Question: Create VRanges object from mutation data (txt extracted from annotated vcf)
0
gravatar for gaiusjaugustus
3.0 years ago by
University of Arizona
gaiusjaugustus0 wrote:

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.

 

variantannotation iranges • 531 views
ADD COMMENTlink modified 3.0 years ago by Michael Lawrence11k • written 3.0 years ago by gaiusjaugustus0

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 REPLYlink written 3.0 years ago by gaiusjaugustus0
Answer: Create VRanges object from mutation data (txt extracted from annotated vcf)
0
gravatar for Michael Lawrence
3.0 years ago by
United States
Michael Lawrence11k wrote:

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 COMMENTlink written 3.0 years ago by Michael Lawrence11k
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: 226 users visited in the last hour