Converting VCF to VRanges
1
0
Entering edit mode
arsala521 ▴ 10
@arsala521-10976
Last seen 8.3 years ago

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 • 2.0k views
ADD COMMENT
1
Entering edit mode
Julian Gehring ★ 1.3k
@julian-gehring-5818
Last seen 5.5 years ago

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 COMMENT
0
Entering edit mode

Thank you so much.

ADD REPLY
0
Entering edit mode

I think you mean

mcols(vr)$cancer.type = "your value"
ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 560 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6