Question: Split AME .tsv file into GRanges object or DataFrame
0
gravatar for rbronste
13 months ago by
rbronste60
rbronste60 wrote:

I have an AME motif calling output as follows (in a .tsv file) and can import this into R using read.table, however I would like to take the motif_ID, seq_ID, and class fields and split it off into a GRanges object or DataFrame, how can I go about doing this? Thanks!

motif_DB
motif_ID
seq_ID
FASTA_score
PWM_score
class
JASPAR2018_CORE_vertebrates
MA0004.1
chr8:3235975-3236325
146
11.6737
tp

 
   

 
   

 

 

granges motif meme dataframe ame • 288 views
ADD COMMENTlink modified 13 months ago by Michael Lawrence11k • written 13 months ago by rbronste60
Answer: Split AME .tsv file into GRanges object or DataFrame
1
gravatar for Michael Lawrence
13 months ago by
United States
Michael Lawrence11k wrote:
gr <- GRanges(df$seq_ID)
mcols(gr) <- df[setdiff(colnames(df), "seq_ID")]

 

 

 

ADD COMMENTlink written 13 months ago by Michael Lawrence11k

So after read.table, if I do as you suggest I get the following error:

> gr<- GRanges(t$seq_ID)
Error in .from_character_to_GRanges(from) : 
The character vector to convert to a GRanges object must contain strings of the form "chr:start-end" or "chr:start-end:strand", with end >=start - 1, or "chr:pos" or "chr:pos:strand". For example: "chr1:2501-2900", "chr1:2501-2900:+", or "chr1:740". Note that ".." is a valid alternate start/end separator. Strand can be "+", "-", "*", or missing.

Which is odd since my seq_ID column does match the format it specifies. 

ADD REPLYlink modified 13 months ago • written 13 months ago by rbronste60
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: 145 users visited in the last hour