Question: Converting VCF to VRanges
0
gravatar for arsala521
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.

Would someone please help me with this?

Regards

somaticsignatures vranges • 702 views
ADD COMMENTlink modified 2.7 years ago by Julian Gehring1.3k • written 2.7 years ago by arsala52110
Answer: Converting VCF to VRanges
1
gravatar for Julian Gehring
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"
ADD REPLYlink written 2.7 years ago by Michael Lawrence10k

Thank you, Michael! I have corrected this in my answer.

ADD REPLYlink written 2.7 years ago by Julian Gehring1.3k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 312 users visited in the last hour