use of com.github.lindenb.jvarkit.setfile.SetFileReaderFactory in project jvarkit by lindenb.
the class SetFileTools method openSetFileIterator.
private CloseableIterator<SetFileRecord> openSetFileIterator(final List<String> args) throws IOException {
CloseableIterator<SetFileRecord> iter = null;
final String input = oneFileOrNull(args);
final SetFileReaderFactory srf = new SetFileReaderFactory(this.theDict);
if (input == null) {
iter = srf.open(IOUtils.openStdinForBufferedReader());
} else {
iter = srf.open(IOUtils.openURIForBufferedReading(input));
}
if (!StringUtils.isBlank(this.extendStr)) {
final IntervalExtender xtExtender = IntervalExtender.of(this.theDict, this.extendStr);
if (xtExtender.isChanging()) {
iter = new ExtenderIterator(iter, xtExtender);
}
}
if (intersectBedPath != null) {
iter = new IntersectBedIterator(iter, this.intersectBedPath);
}
if (!intersectVcfPath.isEmpty()) {
iter = new IntersectVcfIterator(iter, IOUtils.unrollPaths(this.intersectVcfPath));
}
if (!disable_uniq) {
iter = new UniqNameIterator(iter);
}
return iter;
}
Aggregations