Search in sources :

Example 1 with SetFileReaderFactory

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;
}
Also used : SetFileRecord(com.github.lindenb.jvarkit.setfile.SetFileRecord) IntervalExtender(com.github.lindenb.jvarkit.samtools.util.IntervalExtender) SetFileReaderFactory(com.github.lindenb.jvarkit.setfile.SetFileReaderFactory)

Aggregations

IntervalExtender (com.github.lindenb.jvarkit.samtools.util.IntervalExtender)1 SetFileReaderFactory (com.github.lindenb.jvarkit.setfile.SetFileReaderFactory)1 SetFileRecord (com.github.lindenb.jvarkit.setfile.SetFileRecord)1