read .gtf in R
1
1
Entering edit mode
6.0 years ago
modarzi ▴ 170

Hi, for my RNA-seq, I download annotation file: gencode.v22.annotation.gtf. for reading this file in R, I install "refGeome" package and use read.gtf function. but as you see in below, I got Error:

Error in read.gtf(gencode.v22.annotation, filename = "E:/gencode.v22.annotation.gtf", ,sep="\t", useBasedir = TRUE,comment.char = "#", progress = 100000L) : 
  object 'gencode.v22.annotation' not found

I can't understand meaning of object. I write the name of my file instead of object in read.gtf function.

I appreciate if anybody share his/her comment with me. Best Regards, Mohammad

gene gene Annotation RNA-seq • 4.1k views
ADD COMMENT
3
Entering edit mode
6.0 years ago
Candah ▴ 80

This is because read.gtf will read your gtf file into a pre-specified object. However you did not make this object. Therefore it cannot find it. So lets make that object with the following line:

gencode.v22.annotation <- ensemblGenome()

Now read your gtf file into that object with your code:

read.gtf(gencode.v22.annotation, filename = "E:/gencode.v22.annotation.gtf", sep="\t", useBasedir = TRUE,comment.char = "#", progress = 100000L)

Hope this helps!

ADD COMMENT
0
Entering edit mode

Thanks. I run your command and run read.gtf function again:

read.gtf(gencode.v22.annotation, filename = "E:/gencode.v22.annotation.gtf", ,sep="\t", useBasedir = TRUE,comment.char = "#", progress = 100000L)

but now, I see below Error:

Error in read.gtf(gencode.v22.annotation, filename = "E:/gencode.v22.annotation.gtf", : File './E:/gencode.v22.annotation.gtf' does not exist!

I set setwd() for my path and I have this file in this path but I don't know why I got this Error.

could you please share your comment? best Regards, Mohammad

ADD REPLY
1
Entering edit mode

try useBaseDir = FALSE like so:

read.gtf(gencode.v22.annotation, filename = "E:/gencode.v22.annotation.gtf", sep="\t", useBasedir = FALSE, comment.char = "#", progress = 100000L)
ADD REPLY
0
Entering edit mode

Thanks, I use this command but when I want to run that, my RStudio send notification:

R Session Aborted R encountered a fatal error The session was terminated.

I don't know why. do you have any comment?

ADD REPLY
1
Entering edit mode

no clue, you should check your R diagnostics file or something. One more thing if you are helped by an answer you should upvote and if it solves your problem you should accept the answer so other people who have the same problem can easily the solution. I see on your profile that you never upvote even on extended answers.

ADD REPLY

Login before adding your answer.

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