Error when trying to import GTF files using rtracklayer's import function
0
0
Entering edit mode
5 months ago
Marcel • 0

I'm trying to use rtracklayer's import function to import a GTF file. I downloaded the current comprehensive genome annotation for human from GENCODE, gunzipped the .gz file and tried the following:

library(rtracklayer)
granges <-import("gencode.v36.annotation.gtf")


I am getting the following error:

Error in h(simpleError(msg, call)) :
error in evaluating the argument 'con' in selecting a method for function 'import': invalid class “GFF2File” object: undefined class for slot "resource" ("characterORconnection")


Also, adding the parameter format="gtf" does not make a difference.

When searching for this on the web, I'm only getting results regarding a tool called IsoformSwitchAnalyzeR where the authors recommended updating their software. But I'm neither using their tool, nor is it even installed on my PC.

For now, I am importing the GTF files manually, but I would like to use rtracklayer's import function. I hope, someone can help.

annotation rtracklayer software error • 648 views
0
Entering edit mode

What happens with rtracklayer::import("gencode.v36.annotation.gtf")?

0
Entering edit mode

I'm getting exactly the same error as before.

0
Entering edit mode

What version of rtracklayer are you using? sessionInfo().

Also, annotation files such as GTFs are generally stored as TxDb objects in R, so depending on your downstream analysis you could use GenomicFeatures::makeTxDbFromGFF.

0
Entering edit mode

It says rtracklayer_1.48.0

Thanks for your suggestion. As I said, I am able to load these files manually, so I'm not really in need of another workaround, I'd just like rtracklayer to be working.

0
Entering edit mode

Having the same problem, have you managed to use "import"?

1
Entering edit mode

Adding this here in case it helps somebody - in my case the GTF itself was not formatted correctly. The problem disappeared when fixed the format.

0
Entering edit mode

Please do not add answers unless you're answering the top-level question. Use Add Comment or Add Reply instead. Your post has been moved to a comment this time.