Question: Converting VCF to VRanges
0
2.7 years ago by
arsala52110
arsala52110 wrote:

Hello

I want to use SomaticSignatures package in my study. It is mentioned in the documentation of the package that the starting point of analysis is the VRanges object. I have variants in the VCF file format. I am using the code that is used to convert VCF to VRanges but I am facing some problem.

I have four VCF files of four different cancer types. I want to construct a single VRanges object from these four files such that in VRanges object, with every variant, cancer type is present in the study column of VRanges.

Regards

somaticsignatures vranges • 702 views
modified 2.7 years ago by Julian Gehring1.3k • written 2.7 years ago by arsala52110
1
2.7 years ago by
Julian Gehring1.3k
Julian Gehring1.3k wrote:

You can concatenate different VRanges to one, e.g.:

vr = c(vr1, vr2, vr3)

To add new metadata to a VRanges, such as cancer type, use:

mcols(vr)$var = "your value" Please also have a look at the extensive documentation of the VariantAnnotation package. ADD COMMENTlink modified 2.7 years ago • written 2.7 years ago by Julian Gehring1.3k Thank you so much. ADD REPLYlink written 2.7 years ago by arsala52110 I think you mean mcols(vr)$cancer.type = "your value"