0
3 months ago by
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,
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
In file(file, "rt") :
cannot open file './.Rsubread_featureCounts_pid11043': No such file or directory


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.

2
3 months ago by
Wei Shi3.0k
Australia
Wei Shi3.0k wrote:

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

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,
Error in path.expand(path) : invalid 'path' argument   Calls: featureCounts -> normalizePath -> path.expand


Thank you so much!

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.

Thank you so much! I should have checked it.

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.

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

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.