Rsubread- feature counts
1
0
Entering edit mode
memoly101 • 0
@memoly101-19491
Last seen 5.8 years ago

Hello everyone,

I am trying to get ncRNA from my bam files so I'm using feature counts from Rsubread and I have the following ERRORs after running:

> featureCounts(BAMfiles, annot.ext="//path/to/gff/", isGTFAnnotationFile=TRUE,
   nthreads=16, isPairedend=TRUE, allowMultiOverlap=TRUE, fraction=TRUE)
ERROR: '--fraction' option should be used together with '-M' or '-O'. Please change the parameters to allow multi-mapping reads and/or multi-overlapping features.
Error in file(file, "rt") : cannot open the connection
Calls: featureCounts -> read.delim -> read.table -> file
In addition: Warning message:
In file(file, "rt") :
  cannot open file './.Rsubread_featureCounts_pid11043': No such file or directory

I'd appreciate your help. Memol

annotation Rsubread featureCounts • 3.4k views
ADD COMMENT
0
Entering edit mode

I have edited your post to format the code correctly. The Bioconductor Support text editor now uses markdown, meaning that you now have to add four spaces to the beginning of each code line for it to be recognized as code.

ADD REPLY
2
Entering edit mode
Wei Shi ★ 3.6k
@wei-shi-2183
Last seen 1 day ago
Australia/Melbourne

The version of Rsubread you use seems to be a outdated one. Please update it to the latest version. The first error has been fixed in latest versions.

Also you did not provide a valid annotation file for the 'annot.ext' parameter.

ADD COMMENT
0
Entering edit mode

Dear Wei Shi,

Thanks a lot! I updated to Rsubread 3.8, that one error is solved but I have again the path error :

> bamdir <- ("/path/bam_files")
> bamfiles  <- dir(bamdir, pattern = "bam$")
> fls <- propmapped(file.path(bamdir,bamfiles))
> featureCounts(fls, annot.ext="//path/to/gff/", isGTFAnnotationFile=TRUE,
   nthreads=16, isPairedend=TRUE, allowMultiOverlap=TRUE, fraction=TRUE)
Error in path.expand(path) : invalid 'path' argument
Calls: featureCounts -> normalizePath -> path.expand

could you please advice? Memol

ADD REPLY
0
Entering edit mode

Again, I edited your post to format the code chunk correctly.

ADD REPLY
0
Entering edit mode

Thank you, I'm so sorry about that, which part specifically I need to format correctly. (I'm sorry I'm new to this matter).

ADD REPLY
0
Entering edit mode

As I mentioned in my answer above, the value you provided to the 'annot.ext' parameter is invalid. It does not contain a file name. You need to make sure the file path is correct and a file name is provided.

ADD REPLY
0
Entering edit mode

Oh, I had actually provided the file name when you mentioned it, but it seems I forgot to include it in this post so basically, I have the following:

> bamdir <- ("/path/bam_files/")
> bamfiles  <- dir(bamdir, pattern = "bam$")
> fls <- propmapped(file.path(bamdir,bamfiles))
> featureCounts(fls, annot.ext="//path/to/gtf/x.gtf", isGTFAnnotationFile=TRUE,
    nthreads=16, isPairedend=TRUE, allowMultiOverlap=TRUE, fraction=TRUE)
Error in path.expand(path) : invalid 'path' argument   Calls: featureCounts -> normalizePath -> path.expand

Thank you so much!

ADD REPLY
1
Entering edit mode

Thanks for the details. I noticed that you ran propmapped() on the BAM files, then gave the return value from propmapped() directly to featureCounts(). As you may have noticed, the return value from propmapped() is a data.frame object, and featureCounts cannot take a data.frame as the argument for input BAM files. When featureCounts tried to normalize the file names (eg "~/abc.GTF" => "/home/users/me/abc.GTF"), an error message was reported by an R function for the wrong data type.

You can simply give "file.path(bamdir,bamfiles)" to featureCounts as the first argument.

ADD REPLY
0
Entering edit mode

Thank you so much! I should have checked it.

ADD REPLY
0
Entering edit mode

Again, I've edited your comment to format the code correctly. The part I'm referring to is the code and output in the box.

ADD REPLY
0
Entering edit mode

Thank you so much! I'll have the code and error in the same box for future.

ADD REPLY
0
Entering edit mode

memoly -- it might help to clear your browser cache, to be sure that the most recent editor is being use for the support.bioconductor.org site. New questions and answers (though not comments, yet) should have a preview of the message; there should be a series of 'buttons' across the top of the editor panel that can help with formatting.

ADD REPLY
0
Entering edit mode

Thank you so much Martin Morgan!

ADD REPLY

Login before adding your answer.

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