Search in sources :

Example 1 with VCFSimpleHeaderLine

use of htsjdk.variant.vcf.VCFSimpleHeaderLine in project gatk-protected by broadinstitute.

the class CopyNumberTriStateAllele method addHeaderLinesTo.

/**
     * Adds the alternative allele ALT meta-data lines to a vcf-header.
     * @param header the header to add the lines to.
     * @throws IllegalArgumentException if {@code header} is {@code null}.
     */
public static void addHeaderLinesTo(final VCFHeader header) {
    Utils.nonNull(header);
    header.addMetaDataLine(new VCFSimpleHeaderLine(ALT_KEY, DEL.getBaseString(), Utils.nonNull(DEL_VCF_DESCRIPTION)));
    header.addMetaDataLine(new VCFSimpleHeaderLine(ALT_KEY, DUP.getBaseString(), Utils.nonNull(DUP_VCF_DESCRIPTION)));
}
Also used : VCFSimpleHeaderLine(htsjdk.variant.vcf.VCFSimpleHeaderLine)

Example 2 with VCFSimpleHeaderLine

use of htsjdk.variant.vcf.VCFSimpleHeaderLine in project gatk by broadinstitute.

the class ReferenceConfidenceModelUnitTest method testGetHeaderLines.

@Test
public void testGetHeaderLines() throws Exception {
    final Set<VCFHeaderLine> vcfHeaderLines = model.getVCFHeaderLines();
    Assert.assertEquals(vcfHeaderLines.size(), 1);
    Assert.assertEquals(vcfHeaderLines.iterator().next(), new VCFSimpleHeaderLine(GATKVCFConstants.SYMBOLIC_ALLELE_DEFINITION_HEADER_TAG, GATKVCFConstants.NON_REF_SYMBOLIC_ALLELE_NAME, "Represents any possible alternative allele at this location"));
}
Also used : VCFHeaderLine(htsjdk.variant.vcf.VCFHeaderLine) VCFSimpleHeaderLine(htsjdk.variant.vcf.VCFSimpleHeaderLine) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Example 3 with VCFSimpleHeaderLine

use of htsjdk.variant.vcf.VCFSimpleHeaderLine in project gatk-protected by broadinstitute.

the class ReferenceConfidenceModel method getVCFHeaderLines.

/**
     * Get the VCF header lines to include when emitting reference confidence values via {@link #calculateRefConfidence}.
     * @return a non-null set of VCFHeaderLines
     */
public Set<VCFHeaderLine> getVCFHeaderLines() {
    final Set<VCFHeaderLine> headerLines = new LinkedHashSet<>();
    headerLines.add(new VCFSimpleHeaderLine(GATKVCFConstants.SYMBOLIC_ALLELE_DEFINITION_HEADER_TAG, GATKVCFConstants.NON_REF_SYMBOLIC_ALLELE_NAME, "Represents any possible alternative allele at this location"));
    return headerLines;
}
Also used : VCFHeaderLine(htsjdk.variant.vcf.VCFHeaderLine) VCFSimpleHeaderLine(htsjdk.variant.vcf.VCFSimpleHeaderLine)

Example 4 with VCFSimpleHeaderLine

use of htsjdk.variant.vcf.VCFSimpleHeaderLine in project gatk by broadinstitute.

the class CopyNumberTriStateAllele method addHeaderLinesTo.

/**
     * Adds the alternative allele ALT meta-data lines to a vcf-header.
     * @param header the header to add the lines to.
     * @throws IllegalArgumentException if {@code header} is {@code null}.
     */
public static void addHeaderLinesTo(final VCFHeader header) {
    Utils.nonNull(header);
    header.addMetaDataLine(new VCFSimpleHeaderLine(ALT_KEY, DEL.getBaseString(), Utils.nonNull(DEL_VCF_DESCRIPTION)));
    header.addMetaDataLine(new VCFSimpleHeaderLine(ALT_KEY, DUP.getBaseString(), Utils.nonNull(DUP_VCF_DESCRIPTION)));
}
Also used : VCFSimpleHeaderLine(htsjdk.variant.vcf.VCFSimpleHeaderLine)

Example 5 with VCFSimpleHeaderLine

use of htsjdk.variant.vcf.VCFSimpleHeaderLine in project gatk by broadinstitute.

the class GATKTool method getDefaultToolVCFHeaderLines.

/**
     * @return If addOutputVCFCommandLine is true, a set of VCF header lines containing the tool name, version,
     * date and command line, otherwise an empty set.
     */
protected Set<VCFHeaderLine> getDefaultToolVCFHeaderLines() {
    final Set<VCFHeaderLine> gatkToolHeaderLines = new HashSet<>();
    if (addOutputVCFCommandLine) {
        final Map<String, String> simpleHeaderLineMap = new HashMap<>(4);
        simpleHeaderLineMap.put("ID", this.getClass().getSimpleName());
        simpleHeaderLineMap.put("Version", getVersion());
        simpleHeaderLineMap.put("Date", Utils.getDateTimeForDisplay((ZonedDateTime.now())));
        simpleHeaderLineMap.put("CommandLine", getCommandLine());
        gatkToolHeaderLines.add(new VCFHeaderLine("source", this.getClass().getSimpleName()));
        gatkToolHeaderLines.add(new VCFSimpleHeaderLine(String.format("%sCommandLine", getToolkitName()), simpleHeaderLineMap));
    }
    return gatkToolHeaderLines;
}
Also used : VCFHeaderLine(htsjdk.variant.vcf.VCFHeaderLine) HashMap(java.util.HashMap) VCFSimpleHeaderLine(htsjdk.variant.vcf.VCFSimpleHeaderLine) HashSet(java.util.HashSet)

Aggregations

VCFSimpleHeaderLine (htsjdk.variant.vcf.VCFSimpleHeaderLine)7 VCFHeaderLine (htsjdk.variant.vcf.VCFHeaderLine)5 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)2 Test (org.testng.annotations.Test)2 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1