VariantAnnotation - subset multi-allele variants
1
0
Entering edit mode
user1986 • 0
@user1986-21337
Last seen 3.2 years ago

Hi,

I'm using the variantAnnotation package to read and subset my vcf file.

I'm using the following code in R on my input vcf to keep where where the AF is >= 3 percent.

inputfilteredaf <- subset(input, (geno(input)$AF) >= 0.03))

However, this leads to an error for variants that have multiple alleles: while a standard variant has just one AF value: chr1:27100179_CCCG/C 0.014

The AF value for a multiple-allele variant is this: chr1:27100181CGCA/C Numeric,3
chr1:43812234
G/A Numeric,2

The error that I get is: Error in eval(expr, as.env(envir, enclos)) : (list) object cannot be coerced to type 'double'

How can this be solved?

variantAnnotation • 378 views
ADD COMMENT
2
Entering edit mode
@michael-lawrence-3846
Last seen 9 months ago
United States

You need one row per ALT, so just expand(input) first.

ADD COMMENT
0
Entering edit mode

Thanks! Saved my day!

ADD REPLY
0
Entering edit mode

Thanks! Saved my day!

ADD REPLY

Login before adding your answer.

Traffic: 491 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6