2
0
Entering edit mode
hwaterma • 0
@hwaterma-22394
Last seen 2.5 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"’


0
Entering edit mode
@james-w-macdonald-5106
Last seen 14 hours 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:

up.flank=1000,down.flank=1000,unique.prom=TRUE)

## S4 method for signature 'character'
up.flank = 1000, down.flank = 1000, unique.prom = TRUE)

Arguments:

location: location of the bed file with 12 or more columns.  The file
http:// or ftp://. If the file is not compressed it can


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

0
Entering edit mode

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

0
Entering edit mode

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

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.

0
Entering edit mode
@altuna-akalin-7813
Last seen 3.3 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