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);
}