Question: Rsubread- feature counts
0
gravatar for memoly101
3 months ago by
memoly1010
memoly1010 wrote:

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

ADD COMMENTlink written 3 months ago by memoly1010

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 REPLYlink modified 3 months ago • written 3 months ago by Gordon Smyth37k
Answer: C: Rsubread- feature counts
2
gravatar for Wei Shi
3 months ago by
Wei Shi3.0k
Australia
Wei Shi3.0k wrote:

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 COMMENTlink modified 3 months ago • written 3 months ago by Wei Shi3.0k

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 REPLYlink written 12 weeks ago by memoly1010

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

ADD REPLYlink modified 12 weeks ago • written 12 weeks ago by Gordon Smyth37k

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 REPLYlink written 12 weeks ago by memoly1010

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 REPLYlink written 12 weeks ago by Wei Shi3.0k

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 REPLYlink modified 12 weeks ago by Gordon Smyth37k • written 12 weeks ago by memoly1010
1

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 REPLYlink written 12 weeks ago by Yang Liao100

Thank you so much! I should have checked it.

ADD REPLYlink written 12 weeks ago by memoly1010

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 REPLYlink written 12 weeks ago by Gordon Smyth37k

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

ADD REPLYlink written 12 weeks ago by memoly1010

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 REPLYlink written 12 weeks ago by Martin Morgan ♦♦ 23k

Thank you so much Martin Morgan!

ADD REPLYlink written 12 weeks ago by memoly1010
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 219 users visited in the last hour