readTranscriptFeatures from genomation
2
0
Entering edit mode
hwaterma • 0
@hwaterma-22394
Last seen 5.0 years ago

I have a GFF3 file that I turned into a Bed12 file. It load into R and works fine:

>feature_file <- readBed("gene_annotation.bed")
Parsed with column specification:
cols(
  X1 = col_character(),
  X2 = col_double(),
  X3 = col_double(),
  X4 = col_character(),
  X5 = col_double(),
  X6 = col_character(),
  X7 = col_double(),
  X8 = col_double(),
  X9 = col_double(),
  X10 = col_double(),
  X11 = col_number(),
  X12 = col_character()
)

Then I try to run readTranscriptFeatures and I keep getting this error:

> features <- readTranscriptFeatures(feature_file, up.flank=1001, down.flank=0, unique.prom=FALSE, remove.unusual=FALSE)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘readTranscriptFeatures’ for signature ‘"GRanges"’

I am not sure what this means or how to fix it. Please help!

R Rstudio Error readTranscriptFeatures genomation • 1.9k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

The error might be a bit obscure, so here's a translation: it's saying that the first argument to readTranscriptFeatures is supposed to be something other than a GRanges object. Which you could have known if you read the help file (which is what you should have done first!).

Description:

     Function for reading exon intron and promoter structure from a
     given bed file

Usage:

     readTranscriptFeatures(location,remove.unusual=TRUE,
                                   up.flank=1000,down.flank=1000,unique.prom=TRUE)

     ## S4 method for signature 'character'
     readTranscriptFeatures(location, remove.unusual = TRUE,
       up.flank = 1000, down.flank = 1000, unique.prom = TRUE)

Arguments:

location: location of the bed file with 12 or more columns.  The file
          can end in .gz, .bz2, .xz, or .zip and/or start with
          http:// or ftp://. If the file is not compressed it can
          also start with https:// or ftps://.

Which seems to clearly outline what you are supposed to be doing?

ADD COMMENT
0
Entering edit mode

How do I read in my bed file without it truing into a GRanges file?

ADD REPLY
0
Entering edit mode

How do I read in my bed file without it truing into a GRanges file?

ADD REPLY
0
Entering edit mode

The first argument is for the location of the bed file! You don't read it in, you tell readTranscriptFeatures where it is.

ADD REPLY
0
Entering edit mode
@altuna-akalin-7813
Last seen 5.9 years ago
Germany/Berlin/MDC-BIMSB

GFF to bed12 conversion doesn’t always work. Assuming it worked, you should just use provide the bed12 file path as the first argument to readTranscriptFeatures function

Best

Altuna

Sent from mobile, excuse the brevity

ADD COMMENT

Login before adding your answer.

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