Search in sources :

Example 1 with GVCFWriter

use of org.broadinstitute.hellbender.utils.variant.writers.GVCFWriter in project gatk by broadinstitute.

the class HaplotypeCallerEngine method makeVCFWriter.

/**
     * Create a VCF or GVCF writer as appropriate, given our arguments
     *
     * @param outputVCF location to which the vcf should be written
     * @param readsDictionary sequence dictionary for the reads
     * @return a VCF or GVCF writer as appropriate, ready to use
     */
public VariantContextWriter makeVCFWriter(final String outputVCF, final SAMSequenceDictionary readsDictionary) {
    Utils.nonNull(outputVCF);
    Utils.nonNull(readsDictionary);
    VariantContextWriter writer = GATKVariantContextUtils.createVCFWriter(new File(outputVCF), readsDictionary, false);
    if (hcArgs.emitReferenceConfidence == ReferenceConfidenceMode.GVCF) {
        try {
            writer = new GVCFWriter(writer, hcArgs.GVCFGQBands, hcArgs.genotypeArgs.samplePloidy);
        } catch (IllegalArgumentException e) {
            throw new CommandLineException.BadArgumentValue("GQBands", "are malformed: " + e.getMessage());
        }
    }
    return writer;
}
Also used : GVCFWriter(org.broadinstitute.hellbender.utils.variant.writers.GVCFWriter) VariantContextWriter(htsjdk.variant.variantcontext.writer.VariantContextWriter) ReferenceSequenceFile(htsjdk.samtools.reference.ReferenceSequenceFile) File(java.io.File) CommandLineException(org.broadinstitute.barclay.argparser.CommandLineException)

Example 2 with GVCFWriter

use of org.broadinstitute.hellbender.utils.variant.writers.GVCFWriter in project gatk-protected by broadinstitute.

the class HaplotypeCallerEngine method makeVCFWriter.

/**
     * Create a VCF or GVCF writer as appropriate, given our arguments
     *
     * @param outputVCF location to which the vcf should be written
     * @param readsDictionary sequence dictionary for the reads
     * @return a VCF or GVCF writer as appropriate, ready to use
     */
public VariantContextWriter makeVCFWriter(final String outputVCF, final SAMSequenceDictionary readsDictionary) {
    Utils.nonNull(outputVCF);
    Utils.nonNull(readsDictionary);
    VariantContextWriter writer = GATKVariantContextUtils.createVCFWriter(new File(outputVCF), readsDictionary, false);
    if (hcArgs.emitReferenceConfidence == ReferenceConfidenceMode.GVCF) {
        try {
            writer = new GVCFWriter(writer, hcArgs.GVCFGQBands, hcArgs.genotypeArgs.samplePloidy);
        } catch (IllegalArgumentException e) {
            throw new CommandLineException.BadArgumentValue("GQBands", "are malformed: " + e.getMessage());
        }
    }
    return writer;
}
Also used : GVCFWriter(org.broadinstitute.hellbender.utils.variant.writers.GVCFWriter) VariantContextWriter(htsjdk.variant.variantcontext.writer.VariantContextWriter) ReferenceSequenceFile(htsjdk.samtools.reference.ReferenceSequenceFile) File(java.io.File) CommandLineException(org.broadinstitute.barclay.argparser.CommandLineException)

Aggregations

ReferenceSequenceFile (htsjdk.samtools.reference.ReferenceSequenceFile)2 VariantContextWriter (htsjdk.variant.variantcontext.writer.VariantContextWriter)2 File (java.io.File)2 CommandLineException (org.broadinstitute.barclay.argparser.CommandLineException)2 GVCFWriter (org.broadinstitute.hellbender.utils.variant.writers.GVCFWriter)2