Hi,
is there any way to read genotype information (FORMAT field) GT:AD:AF
using VariantAnnotation? Moreover, as I have used a somatic caller, I have 2 format fields for each variant (one from normal and one from tumour sample); so, how can I preserve sample name as a column name when I transform this vcf to a dataframe?
As an example:
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT Normal_sample Tumour_sample
1 52052 . C T . PASS CONTQ=93;DP=56 GT:AD:AF 0/0:36,0:0.026 0/1:15,4:0.238
I am reading the vcf with this command:
as.data.frame(cbind(vcf@rowRanges@seqnames,vcf@rowRanges@ranges@start, vcf@fixed, info(vcf)))
So I get the following dataframe:
vcf.rowRanges.ranges.start REF ALT QUAL FILTER CONTQ DP
52052 C T pass 93 56
I would like to get something like this:
vcf.rowRanges.ranges.start REF ALT QUAL FILTER CONTQ DP NGT NAD NAF TGT TAD TAF
52052 C T pass 93 56 0/0 36,0 0.026 0/1 15,4:0 0.238
Please use the formatting bar (especially the
code
option) to present your post better. You can use backticks for inline code (`text` becomestext
), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.