Simple question ( I hope!)
I'm using this VariantAnnotation package from bioconductor to work with SNPs.
myparam = ScanVcfParam( # this function is a fast positional filter samples="3441_pseudo_gatk", which= GRanges(chr, # This is a chromossome name ranges=IRanges( # these are custom filters start= 10, end=10000))) VCF <- readVcf(TabixFile("my_potato.vcf.gz"), "Potato", param=myparam)
VCF is a "Formal class CollapsedVCF". It's very complex and there are extensive instructions, but I cannot find the answer to the most simple thing of them all:
How do I parse the raw data of VCF in R?
I know that if I write it out with:
writeVcf(obj = VCF, filename = "tmp.vcf")
I get exactly what I want in a file in my working directory. However, I would like parsing all lines in R as a vector to filter, as I already wrote a filter that gives index positions.
All of this because I don't like the filterVcf() function. It doesn't take advantage of the fact that VCF is already filtered by positions and is thus smaller than the original "my_potato.vcf.gz".
EDIT : Actually, I got a detail wrong. FilterVcf() can indeed use the positional filter myparam with param=myparam.
Thank you for the attention!