public void loadBWFile(ResourceLocator locator, List<Track> newTracks, Genome genome) throws IOException { String trackName = locator.getTrackName(); String trackId = locator.getPath(); String path = locator.getPath(); BBFileReader reader = new BBFileReader(path); BigWigDataSource bigwigSource = new BigWigDataSource(reader, genome); if (reader.isBigWigFile()) { DataSourceTrack track = new DataSourceTrack(locator, trackId, trackName, bigwigSource); newTracks.add(track); } else if (reader.isBigBedFile()) { if (locator.getPath().contains("RRBS_cpgMethylation") || locator.getPath().contains("BiSeq_cpgMethylation") || (reader.getAutoSql() != null && reader.getAutoSql().startsWith("table BisulfiteSeq"))) { loadMethylTrack(locator, reader, newTracks, genome); } else { FeatureTrack track = new FeatureTrack(locator, trackId, trackName, bigwigSource); newTracks.add(track); } } else { throw new RuntimeException("Unknown BIGWIG type: " + locator.getPath()); } }
public MethylTrack(ResourceLocator dataResourceLocator, BBFileReader reader, Genome genome) throws IOException { super(dataResourceLocator); setHeight(60); renderer = new PointsRenderer(); boolean isWGBS; if (reader.getAutoSql() != null && reader.getAutoSql().startsWith("table BisulfiteSeq")) { resolutionThreshold = FIVE_MB / 1000; dataSource = new CachingMethylSource(new BBMethylDataSource(reader, BBMethylDataSource.Type.USC, genome), resolutionThreshold); //dataSource = new BBMethylDataSource(reader, BBMethylDataSource.Type.USC, genome); } else { isWGBS = dataResourceLocator.getPath().contains("BiSeq_cpgMethylation"); resolutionThreshold = (isWGBS ? FIVE_MB : FIFTY_MB) / 1000; dataSource = new CachingMethylSource(new BBMethylDataSource(reader, BBMethylDataSource.Type.ZILLER, genome), resolutionThreshold); //dataSource = new BBMethylDataSource(reader, BBMethylDataSource.Type.USC, genome); } loadedRange = new Range("", -1, -1, Collections.<MethylScore>emptyList()); setDataRange(new DataRange(0, 100)); }