filtering a VCF file based on genotype
Entering edit mode
Bogdan ▴ 670
Last seen 4 months ago
Palo Alto, CA, USA

Dear all, I would appreciate having a piece of advice :

shall we use the VariantAnnotation package, how shall I filter a VCF file in order to exclude the GERMLINE and TUMOR samples that have a GENOTYPE of "./".

for example, if we aim to see the GENOTYPES in the vcf file, we receive the following messages :

> geno(vcf)$GT[,"TUMOR"]
Error in geno(vcf)$GT[, "TUMOR"] : subscript out of bounds
> geno(vcf)$GT[,"NORMAL"]
Error in geno(vcf)$GT[, "NORMAL"] : subscript out of bounds


thank you !



variantannotation • 1.4k views
Entering edit mode
Last seen 2.1 years ago
United States

You can use filterVcf to remove rows from a vcf file that meet certain criteria. (The function does not filter by sample/column.)

From the ?filterVcf man page:

There are up to two passes. In the first pass, unparsed lines are passed to \code{prefilters} for filtering, e.g., searching for a fixed character string. In the second pass lines successfully passing \code{prefilters} are parsed into \code{VCF} instances and made available for further filtering. One or both of \code{prefilter} and \code{filter} can be present.

So the 'prefilter' would use grep on each line of the vcf file (similar to "lowCoverageExomeSNP" on the man page) and the 'filter' would use VCF class extractors to get at the data persome some sort of matching (similar to "VTisSNP" on the man page).

Entering edit mode

Thank you very much Valerie ! great to hear from you ...


Login before adding your answer.

Traffic: 900 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6