Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Oct 4, 2023
1 parent 63b2ea7 commit 5bc968b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main/java/org/broad/igv/bbfile/BBDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ protected synchronized DataTile getRawData(String chr, int start, int end) {
IntArrayList endsList = new IntArrayList(100000);
FloatArrayList valuesList = new FloatArrayList(100000);

String chrAlias = chrNameMap.containsKey(chr) ? chrNameMap.get(chr) : chr;
final String chrAlias = getChrAlias(chr);
//Iterator<WigItem> iter = reader.getBigWigIterator(chrAlias, start, chrAlias, end, false);
int chromId = reader.chromTree.nameToIdMap.get(chrAlias);
try {
Expand All @@ -280,6 +280,10 @@ protected synchronized DataTile getRawData(String chr, int start, int end) {

}

private String getChrAlias(String chr) {
return chrNameMap.containsKey(chr) ? chrNameMap.get(chr) : chr;
}


private List<LocusScore> getWholeGenomeScores() {

Expand All @@ -301,9 +305,12 @@ private List<LocusScore> getWholeGenomeScores() {
BBZoomHeader lowestResHeader = this.getZoomLevelForScale(scale);
if (lowestResHeader == null) return null;

Set<String> wgChrNames = new HashSet<>(genome.getLongChromosomeNames());
Set<String> wgChrNames = new HashSet<>(genome.getLongChromosomeNames().stream().map(nm -> getChrAlias(nm)).toList());

List<Integer> chromIDs = new ArrayList<>(wgChrNames.stream().map(nm -> reader.chromTree.nameToIdMap.get(nm)).toList());
List<Integer> chromIDs = new ArrayList<>(
wgChrNames.stream().map(nm -> reader.chromTree.nameToIdMap.get(nm))
.filter(o -> o != null)
.toList());
chromIDs.sort(Comparator.comparingInt(o -> o));
int firstChromId = chromIDs.get(0);
int lastChromId = chromIDs.get(chromIDs.size() - 1);
Expand Down

0 comments on commit 5bc968b

Please sign in to comment.