Search in sources :

Example 1 with IntervalCoverageAccumulator

use of au.edu.wehi.idsv.IntervalCoverageAccumulator in project gridss by PapenfussLab.

the class ComputeCoverage method initIntervalCoverageAccumulator.

private IntervalCoverageAccumulator initIntervalCoverageAccumulator() {
    SAMSequenceDictionary dictionary = getReference().getSequenceDictionary();
    if (VCF == null) {
        return new IntervalCoverageAccumulator(COVERAGE_METHOD, dictionary, BIN_SIZE, null);
    } else {
        try (VCFFileReader vcfReader = new VCFFileReader(VCF, false)) {
            try (CloseableIterator<VariantContext> it = vcfReader.iterator()) {
                GenomicProcessingContext pc = new GenomicProcessingContext(new FileSystemContext(TMP_DIR.get(0), MAX_RECORDS_IN_RAM), REFERENCE_SEQUENCE, getReference());
                Iterator<IdsvVariantContext> idsvIt = Iterators.transform(it, variant -> IdsvVariantContext.create(pc, null, variant));
                Iterator<VariantContextDirectedEvidence> bpit = Iterators.filter(idsvIt, VariantContextDirectedEvidence.class);
                return new IntervalCoverageAccumulator(COVERAGE_METHOD, dictionary, BIN_SIZE, bpit);
            }
        }
    }
}
Also used : IntervalCoverageAccumulator(au.edu.wehi.idsv.IntervalCoverageAccumulator) VariantContextDirectedEvidence(au.edu.wehi.idsv.VariantContextDirectedEvidence) VCFFileReader(htsjdk.variant.vcf.VCFFileReader) VariantContext(htsjdk.variant.variantcontext.VariantContext) IdsvVariantContext(au.edu.wehi.idsv.IdsvVariantContext) FileSystemContext(au.edu.wehi.idsv.FileSystemContext) IdsvVariantContext(au.edu.wehi.idsv.IdsvVariantContext) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) GenomicProcessingContext(au.edu.wehi.idsv.GenomicProcessingContext)

Aggregations

FileSystemContext (au.edu.wehi.idsv.FileSystemContext)1 GenomicProcessingContext (au.edu.wehi.idsv.GenomicProcessingContext)1 IdsvVariantContext (au.edu.wehi.idsv.IdsvVariantContext)1 IntervalCoverageAccumulator (au.edu.wehi.idsv.IntervalCoverageAccumulator)1 VariantContextDirectedEvidence (au.edu.wehi.idsv.VariantContextDirectedEvidence)1 SAMSequenceDictionary (htsjdk.samtools.SAMSequenceDictionary)1 VariantContext (htsjdk.variant.variantcontext.VariantContext)1 VCFFileReader (htsjdk.variant.vcf.VCFFileReader)1