Java Code Examples for htsjdk.variant.variantcontext.VariantContext#getAttributeAsStringList()

The following examples show how to use htsjdk.variant.variantcontext.VariantContext#getAttributeAsStringList() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SnpEffAnnotationFactory.java    From hmftools with GNU General Public License v3.0 5 votes vote down vote up
@NotNull
// TODO: Doesn't really belong here..
public static List<String> rawAnnotations(@NotNull final VariantContext context) {
    if (context.hasAttribute(SNPEFF_IDENTIFIER)) {
        return context.getAttributeAsStringList(SNPEFF_IDENTIFIER, "");
    }

    return Collections.emptyList();
}
 
Example 2
Source File: SVContextUnitTest.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Tests {@link SVContext#getSupportingContigIds()}.
 * @param vc input variant context.
 */
@Test(dataProvider="validVariantContexts", dependsOnMethods = {"testCreate"}, groups = "sv")
public void testContigNames(final VariantContext vc, @SuppressWarnings("unused") final ReferenceMultiSparkSource reference) {
    final SVContext svc = SVContext.of(vc);
    final List<String> actual = svc.getSupportingContigIds();
    final List<String> expected = vc.getAttributeAsStringList(GATKSVVCFConstants.CONTIG_NAMES, null);
    Assert.assertEquals(actual, expected);
}
 
Example 3
Source File: SnpEffSummaryFactory.java    From hmftools with GNU General Public License v3.0 4 votes vote down vote up
@NotNull
public static SnpEffSummary fromSage(@NotNull final VariantContext context) {
    final List<String> worst = context.getAttributeAsStringList(SagePostProcessVCF.SNPEFF_WORST, Strings.EMPTY);
    final List<String> canonical = context.getAttributeAsStringList(SagePostProcessVCF.SNPEFF_CANONICAL, Strings.EMPTY);
    return SnpEffSummarySerialiser.fromDetails(worst, canonical);
}