I have 9 files of paired RNA-seq reads from mice. I have aligned them with Rsubread (there is one output .BAM file for each paired-end reads). I am counting with featureCounts. The results show 0% assigned reads for all the files. I have no idea what I am doing wrong, any help will be appreciated. I am using bash as a wrapper to run R in a cluster, so I am not running R directly in the command line. I have searched for previous questions that addressed this and have not had any resolution. This is the code
all.bam <- list.files(path=".", pattern = ".BAM$" )
counts <- featureCounts(all.bam,annot.inbuilt="mm10",isPairedEnd=TRUE,strandSpecific=1,nthreads=16)
Here is the output.
========== _____ _ _ ____ _____ ______ _____
===== / ____| | | | _ \| __ \| ____| /\ | __ \
===== | (___ | | | | |_) | |__) | |__ / \ | | | |
==== \___ \| | | | _ <| _ /| __| / /\ \ | | | |
==== ____) | |__| | |_) | | \ \| |____ / ____ \| |__| |
========== |_____/ \____/|____/|_| \_\______/_/ \_\_____/
Rsubread 1.28.1
//========================== featureCounts setting ===========================\\
|| ||
|| Input files : 9 BAM files ||
|| P Control-1.BAM ||
|| P Control-2.BAM ||
|| P Control-3.BAM ||
|| P IFNg-1.BAM ||
|| P IFNg-2.BAM ||
|| P IFNg-3.BAM ||
|| P M10.BAM ||
|| P M6.BAM ||
|| P M7.BAM ||
|| ||
|| Dir for temp files : . ||
|| Threads : 16 ||
|| Level : meta-feature level ||
|| Paired-end : yes ||
|| Strand specific : stranded ||
|| Multimapping reads : not counted ||
|| Multi-overlapping reads : not counted ||
|| Min overlapping bases : 1 ||
|| ||
|| Chimeric reads : counted ||
|| Both ends mapped : not required ||
|| ||
\\===================== http://subread.sourceforge.net/ ======================//
//================================= Running ==================================\\
|| ||
|| Load annotation file /c1/apps/R/3.4.2/lib64/R/library/Rsubread/annot/m ... ||
|| Features : 222996 ||
|| Meta-features : 27179 ||
|| Chromosomes/contigs : 43 ||
|| ||
|| Process BAM file Control-1.BAM... ||
|| Paired-end reads are included. ||
|| Assign fragments (read pairs) to features... ||
|| Total fragments : 169195669 ||
|| Successfully assigned fragments : 45937 (0.0%) ||
|| Running time : 0.75 minutes ||
|| ||
|| Process BAM file Control-2.BAM... ||
|| Paired-end reads are included. ||
|| Assign fragments (read pairs) to features... ||
|| Total fragments : 165739901 ||
|| Successfully assigned fragments : 45111 (0.0%) ||
|| Running time : 0.75 minutes ||
|| ||
|| Process BAM file Control-3.BAM... ||
|| Paired-end reads are included. ||
|| Assign fragments (read pairs) to features... ||
|| Total fragments : 131195114 ||
|| Successfully assigned fragments : 34758 (0.0%) ||
|| Running time : 0.64 minutes ||
|| ||
|| Process BAM file IFNg-1.BAM... ||
|| Paired-end reads are included. ||
|| Assign fragments (read pairs) to features... ||
|| Total fragments : 155071610 ||
|| Successfully assigned fragments : 40433 (0.0%) ||
|| Running time : 0.78 minutes ||
|| ||
|| Process BAM file IFNg-2.BAM... ||
|| Paired-end reads are included. ||
|| Assign fragments (read pairs) to features... ||
|| Total fragments : 157528629 ||
|| Successfully assigned fragments : 41355 (0.0%) ||
|| Running time : 0.76 minutes ||
|| ||
|| Process BAM file IFNg-3.BAM... ||
|| Paired-end reads are included. ||
|| Assign fragments (read pairs) to features... ||
|| Total fragments : 156642027 ||
|| Successfully assigned fragments : 41787 (0.0%) ||
|| Running time : 0.74 minutes ||
|| ||
|| Process BAM file M10.BAM... ||
|| Paired-end reads are included. ||
|| Assign fragments (read pairs) to features... ||
|| Total fragments : 167695503 ||
|| Successfully assigned fragments : 67108 (0.0%) ||
|| Running time : 0.81 minutes ||
|| ||
|| Process BAM file M6.BAM... ||
|| Paired-end reads are included. ||
|| Assign fragments (read pairs) to features... ||
|| Total fragments : 160942341 ||
|| Successfully assigned fragments : 69735 (0.0%) ||
|| Running time : 0.78 minutes ||
|| ||
|| Process BAM file M7.BAM... ||
|| Paired-end reads are included. ||
|| Assign fragments (read pairs) to features... ||
In this type of situations most likely culprit is that the chromosome names in your BAM files are not matching the annotation being used. I see that you are using the built-in annotation for
featureCounts
. I am not sure if that is from UCSC or NCBI/Ensembl genome builds. What doessamtools view -H one_of_your.bam
files show?You may find it easier to use
featureCounts
outsideR
so you can use an annotation file from the same source where you obtained your genome sequence from.Hi genomax, That was my first thought. Also, like you pointed out, the annotation file I used is built into featureCounts (mm10), so per the manual it is from NCBI annotations. Unfortunately I have Windows and Subread is not Windows-enabled. I have looked into how to work around it and found that you can by installing Cygwin........ I'll try your samtools suggestion. Many thanks.
Edited to add:
You probably want the "reverse" strand-specific setting. That's correct for most libraries these days.
Hi Devon, Thanks for your input, but I already tried 2 standSpecific options (1 and 2). Here's the output for 2/reverse stranded:
It is the same 0% assigned fragments. I have a suspicion of what the problem might be. I think I might have to update my RSubread version (1.28.1) to the current release (1.31.7). I'll effect that change and see what happens.
@Devon Ryan, I have updated R and I still have the same issue.
Post one of the BAM files somewhere and give us a link to the GTF file you're using. Then one of us can have a look at why this is happening.
Hi Devon,
Apologies for the delayed response. Could you please give some details about where you want me to post one of the BAM files? The GTF file I can give the link to, it is the NCBI mm10 which is built into featurecounts so all I had to do was jsut write it out per the manual.
ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq/vertebrate_mammalian/Mus_musculus/latest_assembly_versions/GCF_000001635.26_GRCm38.p6 And thank you so much for your help.
You can post the BAM file where ever you want (drop box, google drive, etc.). You'll need to post a link then (or email one to me).
Great, thanks. I am uploading it to google drive right now. Could I please have your email?
dpryan79@gmail.com is the easiest given that it's google drive.
Thank you Devon, I have sent it.
GenoMax featureCounts: 0% successfully assigned fragments on multiple PE .BAM files
I am facing same problem, I am working on microbial RNA seq data and performed every suggestion on Biostars. if changing header can solve the problem please guide me how to do that.