use of org.broad.igv.util.ResourceLocator in project ASCIIGenome by dariober.
the class TrackWiggles method getAttributesFromTDF.
private String getAttributesFromTDF(String attr) {
String path = this.getWorkFilename();
try {
ResourceLocator resourceLocator = new ResourceLocator(path);
TDFReader reader = new TDFReader(resourceLocator);
TDFGroup rootGroup = reader.getGroup("/");
return rootGroup.getAttribute(attr);
} catch (Exception e) {
return null;
}
}
use of org.broad.igv.util.ResourceLocator in project ASCIIGenome by dariober.
the class TrackWiggles method getChromosomeNames.
@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;
}
Aggregations