Split AME .tsv file into GRanges object or DataFrame
1
0
Entering edit mode
rbronste ▴ 60
@rbronste-12189
Last seen 5.0 years ago

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

 
   

 
   

 

 

meme ame motif dataframe granges • 1.4k views
ADD COMMENT
1
Entering edit mode
@michael-lawrence-3846
Last seen 3.0 years ago
United States
gr <- GRanges(df$seq_ID)
mcols(gr) <- df[setdiff(colnames(df), "seq_ID")]

 

 

 

ADD COMMENT
0
Entering edit mode

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 REPLY

Login before adding your answer.

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