Search in sources :

Example 6 with CloseableIterator

use of htsjdk.samtools.util.CloseableIterator in project jvarkit by lindenb.

the class VCFComparePredictions method doWork.

@Override
public int doWork(List<String> args) {
    PrintWriter out = null;
    SortingCollection<LineAndFile> variants = null;
    try {
        if (args.isEmpty()) {
            LOG.error("Illegal number of arguments");
            return -1;
        }
        out = super.openFileOrStdoutAsPrintWriter(super.outputFile);
        variants = SortingCollection.newInstance(LineAndFile.class, new AbstractVCFCompareBase.LineAndFileCodec(), new AbstractVCFCompareBase.LineAndFileComparator(), super.sortingCollectionArgs.getMaxRecordsInRam(), super.sortingCollectionArgs.getTmpPaths());
        variants.setDestructiveIteration(true);
        for (final String filename : args) {
            LOG.info("Reading from " + filename);
            Input input = super.put(variants, filename);
            LOG.info("end reading " + input.filename);
        }
        List<PredictionTuple> predictionTuples = new ArrayList<PredictionTuple>(super.inputs.size());
        for (AbstractVCFCompareBase.Input input : this.inputs) {
            PredictionTuple predictionTuple = new PredictionTuple();
            predictionTuple.snpEffPredictionParser = new SnpEffPredictionParserFactory(input.codecAndHeader.header).get();
            predictionTuple.vepPredictionParser = new VepPredictionParserFactory(input.codecAndHeader.header).get();
            predictionTuples.add(predictionTuple);
        }
        List<AbstractVCFCompareBase.LineAndFile> row = new ArrayList<LineAndFile>(super.inputs.size());
        CloseableIterator<LineAndFile> iter = variants.iterator();
        final Comparator<LineAndFile> posCompare = (A, B) -> A.getContigPosRef().compareTo(B.getContigPosRef());
        for (; ; ) {
            LineAndFile rec = null;
            if (iter.hasNext()) {
                rec = iter.next();
            }
            if (rec == null || (!row.isEmpty() && posCompare.compare(row.get(0), rec) != 0)) {
                if (!row.isEmpty()) {
                    boolean printed = false;
                    VariantContext ctx = row.get(0).getContext();
                    if (row.size() != this.inputs.size()) {
                        startLine(out, ctx);
                        out.println("\tDiscordant number of variants");
                        printed = true;
                    }
                    for (int i = 0; i + 1 < row.size(); ++i) {
                        Input input1 = this.inputs.get(row.get(i).fileIdx);
                        VariantContext ctx1 = row.get(i).getContext();
                        PredictionTuple predtuple1 = predictionTuples.get(row.get(i).fileIdx);
                        List<VepPrediction> vepPredictions1 = predtuple1.vepPredictionParser.getPredictions(ctx1);
                        List<SnpEffPrediction> snpEffPredictions1 = predtuple1.snpEffPredictionParser.getPredictions(ctx1);
                        Set<SequenceOntologyTree.Term> so_vep_1 = getVepSoTerms(predtuple1.vepPredictionParser, ctx1);
                        Set<SequenceOntologyTree.Term> so_snpeff_1 = getSnpEffSoTerms(predtuple1.snpEffPredictionParser, ctx1);
                        for (int j = i + 1; j < row.size(); ++j) {
                            Input input2 = this.inputs.get(row.get(j).fileIdx);
                            VariantContext ctx2 = row.get(j).getContext();
                            PredictionTuple predtuple2 = predictionTuples.get(row.get(j).fileIdx);
                            List<VepPrediction> vepPredictions2 = predtuple2.vepPredictionParser.getPredictions(ctx2);
                            List<SnpEffPrediction> snpEffPredictions2 = predtuple2.snpEffPredictionParser.getPredictions(ctx2);
                            Set<SequenceOntologyTree.Term> so_vep_2 = getVepSoTerms(predtuple2.vepPredictionParser, ctx2);
                            Set<SequenceOntologyTree.Term> so_snpeff_2 = getSnpEffSoTerms(predtuple2.snpEffPredictionParser, ctx2);
                            if (vepPredictions1.size() != vepPredictions2.size()) {
                                startLine(out, ctx);
                                out.print("\tVEP discordant transcripts count");
                                out.print("\t" + input1.filename + ":" + vepPredictions1.size());
                                out.print("\t" + input2.filename + ":" + vepPredictions2.size());
                                out.println();
                                printed = true;
                            }
                            if (snpEffPredictions1.size() != snpEffPredictions2.size()) {
                                startLine(out, ctx);
                                out.print("\tSNPEFF discordant transcripts count");
                                out.print("\t" + input1.filename + ":" + snpEffPredictions1.size());
                                out.print("\t" + input2.filename + ":" + snpEffPredictions2.size());
                                out.println();
                                printed = true;
                            }
                            if (!unshared(so_vep_1, so_vep_2).isEmpty()) {
                                startLine(out, ctx);
                                out.print("\tVEP discordant SO:terms");
                                printDiscordantSO(out, input1, so_vep_1, input2, so_vep_2);
                                printed = true;
                            }
                            if (!unshared(so_snpeff_1, so_snpeff_2).isEmpty()) {
                                startLine(out, ctx);
                                out.print("\tSNPEFF discordant SO:terms");
                                printDiscordantSO(out, input1, so_snpeff_1, input2, so_snpeff_2);
                                printed = true;
                            }
                        }
                    }
                    if (!printed) {
                        startLine(out, ctx);
                        out.println("\tPASS");
                    }
                    row.clear();
                }
                if (rec == null)
                    break;
            }
            row.add(rec);
        }
        iter.close();
        out.flush();
        out.close();
        out = null;
        return 0;
    } catch (Exception err) {
        LOG.error(err);
        return -1;
    } finally {
        CloserUtil.close(out);
        try {
            if (variants != null)
                variants.cleanup();
        } catch (Exception err) {
        }
    }
}
Also used : PrintWriter(java.io.PrintWriter) CloseableIterator(htsjdk.samtools.util.CloseableIterator) SortingCollection(htsjdk.samtools.util.SortingCollection) Program(com.github.lindenb.jvarkit.util.jcommander.Program) Logger(com.github.lindenb.jvarkit.util.log.Logger) Set(java.util.Set) SnpEffPrediction(com.github.lindenb.jvarkit.util.vcf.predictions.SnpEffPredictionParser.SnpEffPrediction) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) SnpEffPredictionParserFactory(com.github.lindenb.jvarkit.util.vcf.predictions.SnpEffPredictionParserFactory) List(java.util.List) SequenceOntologyTree(com.github.lindenb.jvarkit.util.so.SequenceOntologyTree) VepPrediction(com.github.lindenb.jvarkit.util.vcf.predictions.VepPredictionParser.VepPrediction) VariantContext(htsjdk.variant.variantcontext.VariantContext) VepPredictionParser(com.github.lindenb.jvarkit.util.vcf.predictions.VepPredictionParser) Comparator(java.util.Comparator) VepPredictionParserFactory(com.github.lindenb.jvarkit.util.vcf.predictions.VepPredictionParserFactory) SnpEffPredictionParser(com.github.lindenb.jvarkit.util.vcf.predictions.SnpEffPredictionParser) CloserUtil(htsjdk.samtools.util.CloserUtil) VepPrediction(com.github.lindenb.jvarkit.util.vcf.predictions.VepPredictionParser.VepPrediction) ArrayList(java.util.ArrayList) VariantContext(htsjdk.variant.variantcontext.VariantContext) PrintWriter(java.io.PrintWriter) SnpEffPrediction(com.github.lindenb.jvarkit.util.vcf.predictions.SnpEffPredictionParser.SnpEffPrediction) SnpEffPredictionParserFactory(com.github.lindenb.jvarkit.util.vcf.predictions.SnpEffPredictionParserFactory) VepPredictionParserFactory(com.github.lindenb.jvarkit.util.vcf.predictions.VepPredictionParserFactory)

Example 7 with CloseableIterator

use of htsjdk.samtools.util.CloseableIterator in project jvarkit by lindenb.

the class VcfBurdenFisherHTest method test01.

@Test(dataProvider = "src1", enabled = false)
public void test01(final String inputFile) throws IOException {
    try {
        final VCFReader r0 = VCFReaderFactory.makeDefault().open(new File(inputFile), false);
        final VCFHeader vcfheader = r0.getHeader();
        if (vcfheader.getNGenotypeSamples() < 2) {
            r0.close();
            return;
        }
        final CloseableIterator<VariantContext> iter = r0.iterator();
        final Path inputVcf = support.createTmpPath(".vcf");
        final VariantContextWriter w = VCFUtils.createVariantContextWriter(inputVcf.toFile());
        w.writeHeader(vcfheader);
        iter.stream().filter(V -> V.getAlleles().size() == 2).forEach(V -> w.add(V));
        iter.close();
        w.close();
        r0.close();
        final Path ped = support.createRandomPedigreeFromFile(inputFile);
        if (ped == null) {
            Reporter.getCurrentTestResult().setAttribute("warn", "No Pedigree for " + inputFile);
            return;
        }
        final Path output = support.createTmpPath(".vcf");
        Assert.assertEquals(new VcfBurdenFisherH().instanceMain(new String[] { "-o", output.toString(), "--pedigree", ped.toString() }), 0);
        support.assertIsVcf(output);
    } finally {
        support.removeTmpFiles();
    }
}
Also used : Path(java.nio.file.Path) VCFUtils(com.github.lindenb.jvarkit.util.vcf.VCFUtils) CloseableIterator(htsjdk.samtools.util.CloseableIterator) DataProvider(org.testng.annotations.DataProvider) VCFHeader(htsjdk.variant.vcf.VCFHeader) VCFReader(htsjdk.variant.vcf.VCFReader) IOException(java.io.IOException) Reporter(org.testng.Reporter) Test(org.testng.annotations.Test) LauncherTest(com.github.lindenb.jvarkit.util.jcommander.LauncherTest) File(java.io.File) Assert(org.testng.Assert) AlsoTest(com.github.lindenb.jvarkit.tests.AlsoTest) VariantContextWriter(htsjdk.variant.variantcontext.writer.VariantContextWriter) TestSupport(com.github.lindenb.jvarkit.tools.tests.TestSupport) VCFReaderFactory(com.github.lindenb.jvarkit.variant.vcf.VCFReaderFactory) VariantContext(htsjdk.variant.variantcontext.VariantContext) Path(java.nio.file.Path) VCFReader(htsjdk.variant.vcf.VCFReader) VariantContext(htsjdk.variant.variantcontext.VariantContext) VariantContextWriter(htsjdk.variant.variantcontext.writer.VariantContextWriter) VCFHeader(htsjdk.variant.vcf.VCFHeader) File(java.io.File) Test(org.testng.annotations.Test) LauncherTest(com.github.lindenb.jvarkit.util.jcommander.LauncherTest) AlsoTest(com.github.lindenb.jvarkit.tests.AlsoTest)

Example 8 with CloseableIterator

use of htsjdk.samtools.util.CloseableIterator in project jvarkit by lindenb.

the class VcfInTest method makeVcfIn.

private Path makeVcfIn(final String vcfpath, String other_args) throws Exception {
    Path vcfDbIn = Paths.get(vcfpath);
    Path tmpIn = support.createTmpPath(".vcf");
    Path outVcf = support.createTmpPath(".vcf");
    final VariantContextWriter w = VCFUtils.createVariantContextWriterToPath(tmpIn);
    final VCFReader r = VCFReaderFactory.makeDefault().open(vcfDbIn, true);
    w.writeHeader(r.getHeader());
    int n = 0;
    final CloseableIterator<VariantContext> iter = r.iterator();
    while (iter.hasNext()) {
        VariantContext ctx = iter.next();
        // ignore some variants
        if (n++ % 2 == 0)
            continue;
        w.add(ctx);
        // add it twice
        w.add(ctx);
        VariantContextBuilder vcb = new VariantContextBuilder(vcfpath, ctx.getContig(), ctx.getStart(), ctx.getEnd(), Arrays.asList(ctx.getReference(), ZORG_ALLELE));
        vcb.genotypes(ctx.getGenotypes().stream().map(G -> new GenotypeBuilder(G.getSampleName(), Arrays.asList(ZORG_ALLELE, ZORG_ALLELE)).make()).collect(Collectors.toList()));
        w.add(vcb.make());
    }
    w.close();
    iter.close();
    r.close();
    final List<String> args = new ArrayList<>();
    args.add("-o");
    args.add(outVcf.toString());
    args.add("--database");
    args.add(vcfDbIn.toString());
    Arrays.stream(other_args.split("[ ]")).filter(S -> !S.isEmpty()).forEach(S -> args.add(S));
    args.add(vcfpath.toString());
    Assert.assertEquals(new VcfIn().instanceMain(args), 0);
    support.assertIsVcf(outVcf);
    return outVcf;
}
Also used : Path(java.nio.file.Path) PrintWriter(java.io.PrintWriter) VCFUtils(com.github.lindenb.jvarkit.util.vcf.VCFUtils) CloseableIterator(htsjdk.samtools.util.CloseableIterator) Allele(htsjdk.variant.variantcontext.Allele) Arrays(java.util.Arrays) DataProvider(org.testng.annotations.DataProvider) Files(java.nio.file.Files) GenotypeBuilder(htsjdk.variant.variantcontext.GenotypeBuilder) VCFReader(htsjdk.variant.vcf.VCFReader) Test(org.testng.annotations.Test) LauncherTest(com.github.lindenb.jvarkit.util.jcommander.LauncherTest) Collectors(java.util.stream.Collectors) ArrayList(java.util.ArrayList) List(java.util.List) Assert(org.testng.Assert) Paths(java.nio.file.Paths) AlsoTest(com.github.lindenb.jvarkit.tests.AlsoTest) VariantContextWriter(htsjdk.variant.variantcontext.writer.VariantContextWriter) TestSupport(com.github.lindenb.jvarkit.tools.tests.TestSupport) VCFReaderFactory(com.github.lindenb.jvarkit.variant.vcf.VCFReaderFactory) VariantContext(htsjdk.variant.variantcontext.VariantContext) Path(java.nio.file.Path) VariantContextBuilder(htsjdk.variant.variantcontext.VariantContextBuilder) ArrayList(java.util.ArrayList) VariantContext(htsjdk.variant.variantcontext.VariantContext) GenotypeBuilder(htsjdk.variant.variantcontext.GenotypeBuilder) VariantContextBuilder(htsjdk.variant.variantcontext.VariantContextBuilder) VCFReader(htsjdk.variant.vcf.VCFReader) VariantContextWriter(htsjdk.variant.variantcontext.writer.VariantContextWriter)

Example 9 with CloseableIterator

use of htsjdk.samtools.util.CloseableIterator in project jvarkit by lindenb.

the class MultiBamLauncher method doWork.

@Override
public int doWork(final List<String> args0) {
    final Map<SamReader, CloseableIterator<SAMRecord>> sam2iterator = new HashMap<>();
    final CloseableIterator<SAMRecord> mainIterator;
    final SAMFileHeader mainHeader;
    final List<String> inputs = new ArrayList<>(args0.size());
    /* parse input */
    try {
        // unroll list
        if (args0.size() == 1 && args0.get(0).endsWith(".list")) {
            final Path p1 = Paths.get(args0.get(0));
            IOUtil.assertFileIsReadable(p1);
            inputs.addAll(Files.lines(p1).filter(S -> !S.startsWith("#")).filter(S -> !StringUtils.isBlank(S)).collect(Collectors.toList()));
            if (inputs.isEmpty()) {
                LOG.error("List is empty " + p1);
                return -1;
            }
        } else {
            inputs.addAll(args0);
        }
    } catch (final IOException err) {
        LOG.error(err);
        return -1;
    }
    /* check input is not output */
    if (validateInputsPath(inputs) != 0) {
        LOG.info("input validation failed");
        return -1;
    }
    /* before SAM */
    try {
        if (beforeSam() != 0) {
            LOG.error("initialization failed");
            return -1;
        }
    } catch (final Throwable err) {
        LOG.error(err);
        return -1;
    }
    try {
        final SamReaderFactory srf = createSamReaderFactory();
        if (inputs.isEmpty() || inputs.size() == 1) {
            final SamReader in;
            if (inputs.isEmpty()) {
                in = srf.open(SamInputResource.of(stdin()));
            } else if (IOUtil.isUrl(inputs.get(0))) {
                in = srf.open(SamInputResource.of(new URL(inputs.get(0))));
            } else {
                in = srf.open(Paths.get(inputs.get(0)));
            }
            final CloseableIterator<SAMRecord> iter = openSamIterator(in);
            sam2iterator.put(in, iter);
            mainHeader = in.getFileHeader();
            mainIterator = iter;
        } else {
            for (final String bamPath : inputs) {
                final SamReader in = srf.open(Paths.get(bamPath));
                final CloseableIterator<SAMRecord> iter = openSamIterator(in);
                sam2iterator.put(in, iter);
            }
            final Set<SAMFileHeader.SortOrder> all_sort_orders = sam2iterator.keySet().stream().map(SR -> SR.getFileHeader()).map(H -> H.getSortOrder()).collect(Collectors.toSet());
            if (all_sort_orders.size() != 1) {
                LOG.error("Heterogenous sort order in input bams : " + all_sort_orders);
                return -1;
            }
            final SAMFileHeader.SortOrder sortOrder = all_sort_orders.iterator().next();
            final SamFileHeaderMerger headerMerger = new SamFileHeaderMerger(sortOrder, sam2iterator.keySet().stream().map(SR -> SR.getFileHeader()).collect(Collectors.toList()), false);
            mainHeader = headerMerger.getMergedHeader();
            @SuppressWarnings("resource") final MergingSamRecordIterator iter = new MergingSamRecordIterator(headerMerger, sam2iterator, false);
            mainIterator = iter;
        }
        if (this.faidxPath != null) {
            final SAMSequenceDictionary dict = SequenceDictionaryUtils.extractRequired(this.faidxPath);
            SequenceUtil.assertSequenceDictionariesEqual(dict, SequenceDictionaryUtils.extractRequired(mainHeader));
        }
        final int err = processInput(mainHeader, mainIterator);
        mainIterator.close();
        for (final SamReader sr : sam2iterator.keySet()) {
            sam2iterator.get(sr).close();
            sr.close();
        }
        sam2iterator.clear();
        if (err != 0)
            deleteOutputOnError();
        return err;
    } catch (final Throwable err) {
        LOG.error(err);
        deleteOutputOnError();
        return -1;
    } finally {
        try {
            afterSam();
        } catch (final Throwable err) {
            LOG.error(err);
        }
        for (final SamReader sr : sam2iterator.keySet()) {
            CloserUtil.close(sam2iterator.get(sr));
            CloserUtil.close(sr);
        }
    }
}
Also used : Path(java.nio.file.Path) CloseableIterator(htsjdk.samtools.util.CloseableIterator) SequenceUtil(htsjdk.samtools.util.SequenceUtil) MergingSamRecordIterator(htsjdk.samtools.MergingSamRecordIterator) Parameter(com.beust.jcommander.Parameter) IOUtil(htsjdk.samtools.util.IOUtil) URL(java.net.URL) IntervalFilter(htsjdk.samtools.filter.IntervalFilter) HashMap(java.util.HashMap) IntervalListProvider(com.github.lindenb.jvarkit.samtools.util.IntervalListProvider) SAMFileHeader(htsjdk.samtools.SAMFileHeader) ValidationStringency(htsjdk.samtools.ValidationStringency) ArrayList(java.util.ArrayList) Interval(htsjdk.samtools.util.Interval) NoSplitter(com.github.lindenb.jvarkit.util.jcommander.NoSplitter) Map(java.util.Map) Launcher(com.github.lindenb.jvarkit.util.jcommander.Launcher) Path(java.nio.file.Path) CloserUtil(htsjdk.samtools.util.CloserUtil) SequenceDictionaryUtils(com.github.lindenb.jvarkit.util.bio.SequenceDictionaryUtils) FilteringSamIterator(htsjdk.samtools.filter.FilteringSamIterator) Files(java.nio.file.Files) SAMRecordIterator(htsjdk.samtools.SAMRecordIterator) Logger(com.github.lindenb.jvarkit.util.log.Logger) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) Set(java.util.Set) IOException(java.io.IOException) SamReader(htsjdk.samtools.SamReader) Collectors(java.util.stream.Collectors) SAMRecord(htsjdk.samtools.SAMRecord) SamFileHeaderMerger(htsjdk.samtools.SamFileHeaderMerger) List(java.util.List) SamInputResource(htsjdk.samtools.SamInputResource) Paths(java.nio.file.Paths) StringUtils(com.github.lindenb.jvarkit.lang.StringUtils) QueryInterval(htsjdk.samtools.QueryInterval) SamReaderFactory(htsjdk.samtools.SamReaderFactory) SamFileHeaderMerger(htsjdk.samtools.SamFileHeaderMerger) CloseableIterator(htsjdk.samtools.util.CloseableIterator) SamReaderFactory(htsjdk.samtools.SamReaderFactory) MergingSamRecordIterator(htsjdk.samtools.MergingSamRecordIterator) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) URL(java.net.URL) SamReader(htsjdk.samtools.SamReader) SAMRecord(htsjdk.samtools.SAMRecord) SAMFileHeader(htsjdk.samtools.SAMFileHeader)

Example 10 with CloseableIterator

use of htsjdk.samtools.util.CloseableIterator in project jvarkit by lindenb.

the class MultiBamLauncher method openSamIterator.

/**
 * create input SAMRecord iterator for one sample
 */
protected CloseableIterator<SAMRecord> openSamIterator(final SamReader sr) {
    if (this.regionFiles != null) {
        this.regionFiles.dictionary(SequenceDictionaryUtils.extractRequired(sr.getFileHeader()));
        if (!sr.hasIndex()) {
            final List<Interval> L = this.regionFiles.stream().map(x -> new Interval(x)).collect(Collectors.toList());
            final SAMRecordIterator st0 = sr.iterator();
            return new FilteringSamIterator(st0, new IntervalFilter(L, sr.getFileHeader()));
        } else {
            final QueryInterval[] optimized = this.regionFiles.optimizedQueryIntervals();
            return sr.query(optimized, false);
        }
    }
    return sr.iterator();
}
Also used : CloseableIterator(htsjdk.samtools.util.CloseableIterator) SequenceUtil(htsjdk.samtools.util.SequenceUtil) MergingSamRecordIterator(htsjdk.samtools.MergingSamRecordIterator) Parameter(com.beust.jcommander.Parameter) IOUtil(htsjdk.samtools.util.IOUtil) URL(java.net.URL) IntervalFilter(htsjdk.samtools.filter.IntervalFilter) HashMap(java.util.HashMap) IntervalListProvider(com.github.lindenb.jvarkit.samtools.util.IntervalListProvider) SAMFileHeader(htsjdk.samtools.SAMFileHeader) ValidationStringency(htsjdk.samtools.ValidationStringency) ArrayList(java.util.ArrayList) Interval(htsjdk.samtools.util.Interval) NoSplitter(com.github.lindenb.jvarkit.util.jcommander.NoSplitter) Map(java.util.Map) Launcher(com.github.lindenb.jvarkit.util.jcommander.Launcher) Path(java.nio.file.Path) CloserUtil(htsjdk.samtools.util.CloserUtil) SequenceDictionaryUtils(com.github.lindenb.jvarkit.util.bio.SequenceDictionaryUtils) FilteringSamIterator(htsjdk.samtools.filter.FilteringSamIterator) Files(java.nio.file.Files) SAMRecordIterator(htsjdk.samtools.SAMRecordIterator) Logger(com.github.lindenb.jvarkit.util.log.Logger) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) Set(java.util.Set) IOException(java.io.IOException) SamReader(htsjdk.samtools.SamReader) Collectors(java.util.stream.Collectors) SAMRecord(htsjdk.samtools.SAMRecord) SamFileHeaderMerger(htsjdk.samtools.SamFileHeaderMerger) List(java.util.List) SamInputResource(htsjdk.samtools.SamInputResource) Paths(java.nio.file.Paths) StringUtils(com.github.lindenb.jvarkit.lang.StringUtils) QueryInterval(htsjdk.samtools.QueryInterval) SamReaderFactory(htsjdk.samtools.SamReaderFactory) SAMRecordIterator(htsjdk.samtools.SAMRecordIterator) IntervalFilter(htsjdk.samtools.filter.IntervalFilter) FilteringSamIterator(htsjdk.samtools.filter.FilteringSamIterator) QueryInterval(htsjdk.samtools.QueryInterval) Interval(htsjdk.samtools.util.Interval) QueryInterval(htsjdk.samtools.QueryInterval)

Aggregations

CloseableIterator (htsjdk.samtools.util.CloseableIterator)103 List (java.util.List)86 Logger (com.github.lindenb.jvarkit.util.log.Logger)85 Parameter (com.beust.jcommander.Parameter)82 Program (com.github.lindenb.jvarkit.util.jcommander.Program)78 ArrayList (java.util.ArrayList)73 Collectors (java.util.stream.Collectors)71 SAMSequenceDictionary (htsjdk.samtools.SAMSequenceDictionary)69 Path (java.nio.file.Path)69 Launcher (com.github.lindenb.jvarkit.util.jcommander.Launcher)66 CloserUtil (htsjdk.samtools.util.CloserUtil)64 Set (java.util.Set)64 VCFHeader (htsjdk.variant.vcf.VCFHeader)59 VariantContext (htsjdk.variant.variantcontext.VariantContext)54 IOException (java.io.IOException)53 SequenceDictionaryUtils (com.github.lindenb.jvarkit.util.bio.SequenceDictionaryUtils)51 SAMRecord (htsjdk.samtools.SAMRecord)51 VariantContextWriter (htsjdk.variant.variantcontext.writer.VariantContextWriter)51 IOUtils (com.github.lindenb.jvarkit.io.IOUtils)50 StringUtils (com.github.lindenb.jvarkit.lang.StringUtils)49