private void intChrMap() { // If we have a genome, build a reverse-lookup table for queries if (genome != null) { Set<String> chrNames = reader.getChromosomeNames(); for (String chr : chrNames) { String igvChr = genome.getCanonicalChrName(chr); if (igvChr != null && !igvChr.equals(chr)) { chrNameMap.put(igvChr, chr); } } } }
Set<String> chrNames = reader.getChromosomeNames(); for (String chr : chrNames) { String igvChr = genome.getChromosomeAlias(chr);
@Override public List<String> getChromosomeNames(){ if(this.getTrackFormat().equals(TrackFormat.TDF)){ ResourceLocator resourceLocator= new ResourceLocator(this.getWorkFilename()); TDFReader reader= new TDFReader(resourceLocator); List<String> chroms= new ArrayList<String>(reader.getChromosomeNames()); if(chroms.get(0).equals("All")){ chroms.remove(0); } return chroms; // chroms.addAll(); } if(this.getTrackFormat().equals(TrackFormat.BEDGRAPH)){ TabixIndex tbi= (TabixIndex) IndexFactory.loadIndex(this.getWorkFilename() + TabixUtils.STANDARD_INDEX_EXTENSION); return tbi.getSequenceNames(); } if(this.getTrackFormat().equals(TrackFormat.BIGWIG)){ return this.bigWigReader.getChromosomeNames(); } return null; }
Iterator<String> iter = TDFReader.getReader(x).getChromosomeNames().iterator(); while(iter.hasNext()){ region= iter.next();
@Test public void testReader() throws Exception { String url = "http://data.broadinstitute.org/igvdata/encode/hg18/broadHistone/SignalK562H3k4me3.tdf"; TDFReader reader = new TDFReader(new ResourceLocator(url)); int version = reader.getVersion(); assertEquals(3, version); assertTrue(reader.compressed); String [] trackNames = reader.getTrackNames(); int nTracks = trackNames.length; assertEquals(1, nTracks); String trackName = trackNames[0]; assertEquals(trackName, "SignalK562H3k4me3.wig.gz"); Set<String> chrNames = reader.getChromosomeNames(); int nChromosomes = chrNames.size(); assertEquals(24, nChromosomes); String datasetName = "/chr1/z0/mean"; TDFDataset dataset = reader.getDataset(datasetName); assertEquals(datasetName, dataset.getName()); TDFTile tile = reader.readTile(dataset, 0); assertNotNull(tile); } }