Create VRanges object from mutation data (txt extracted from annotated vcf)
1
0
Entering edit mode
@gaiusjaugustus-10041
Last seen 6.2 years ago
University of Arizona

I am working on using the SomaticSignatures package on a list of mutations I've received from a collaborator.  The file has all the variants listed in a tab-delimited text file, with all the fields you would expect from an annotated vcf file (e.g. Chromosome, Start_Position, End_Position, Reference_Allele, Tumor_Seq_allele, etc) named "CCCC_muts"

In order to get this working, I'm trying to create a VRanges object from this text file.  I ran the following command to try to accomplish this:

mutations <- VRanges(
     seqnames = seqnames(as.character(CCCC_muts$Chromosome)),
     ranges = ranges(CCCC_muts, start = CCCC_muts$Start_Position, end = CCCC_muts$End_Position),
     ref = CCCC_muts$Reference_Allele,
     alt = CCCC_muts$Tumor_Seq_Allele2,
     sampleNames = CCCC_muts$Barcode
)

I'm getting an error:

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘ranges’ for signature ‘"X"’

(where X is whatever type of data I try to put into it)

 

Because I'm unsure how to create the proper ranges format from my CCCC_muts file, and perhaps because of some other reason I don't understand.  Any help in resolving this issue would be awesome.

 

iranges variantannotation • 1.3k views
ADD COMMENT
0
Entering edit mode

In order to fix this, I had to convert my original dataframe to a GRanges object.  Then I had to input some fields as GRanges objects and some from the original text file.

 

VRanges(
    seqnames = seqnames(CCCC_GRanges),
    ranges = ranges(CCCC_GRanges),
    ref = CCCC_muts$Reference_Allele,
    alt = CCCC_muts$Tumor_Seq_Allele2,
    sampleNames = CCCC_muts2$Barcode
)

ADD REPLY
0
Entering edit mode
@michael-lawrence-3846
Last seen 3.0 years ago
United States

I think you want something like:

mutations <- with(CCCC_muts, VRanges(
    seqnames = Chromosome,
    ranges = IRanges(Start_Position, End_Position),
    ref = Reference_Allele,
    alt = Tumor_Seq_Allele2,
    sampleNames = Barcode
))

 

 

ADD COMMENT

Login before adding your answer.

Traffic: 642 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