featureCounts 1.5.0 no longer automatically resort paired-end BAM files

103 views
Skip to first unread message

rspreafico

unread,
Dec 4, 2015, 4:49:29 PM12/4/15
to Subread
Hello,

congratulations on a great piece of software! 

I have just downloaded the latest featureCounts 1.5.0 and tried it on paired-end data. Previous versions of featureCounts detected that the BAM file was sorted by coordinates and automatically re-sorted it before counting. The new featureCounts does not resort the BAM files, and as a result it can assign 0.1% of the reads only. However, if I first use the new "repair" utility, and then run featureCounts on the output of such utility, everything works fine. The manual still mentions that featureCounts can automatically resort BAM files if needed, so I guess that manually calling "repair" is just a temporary workaround..?

Thank you for your feedback.

Best,

Roberto

Wei Shi

unread,
Dec 6, 2015, 6:19:29 PM12/6/15
to Subread
Dear Roberto,

featureCounts 1.5.0 still automatically re-sorts the reads if it detects any read pair that is not adjacent to each other in the input. Could you please provide more details about your data such as how your bam file was generated and also your command? This will help figure out what may cause the issue you encountered.

The 'repair' program is a new program included in 1.5.0 release. It is particularly useful for those users who want to perform an one-off conversion of location-sorted read pairs to name-sorted reads pairs and then run featureCounts on the converted data.

Best wishes,

Wei

rspreafico

unread,
Dec 6, 2015, 8:48:00 PM12/6/15
to Subread

Hi Wei, 


thank you for your response.  


I use STAR to generate BAM files sorted by coordinates: 


STAR --genomeDir /opt/ngs_indexes/star/mm10.primary_assembly.gencode.vM6_refchrom.50bp --runThreadN 4 --genomeLoad LoadAndKeep --readFilesIn R1.fastq R2.fastq --outSAMunmapped Within --outSAMtype BAM SortedByCoordinate --limitBAMsortRAM 17179869184 --outFilterType BySJout --outFilterMultimapNmax 20 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1 --outFilterMismatchNmax 999 --outFilterMismatchNoverLmax 0.04 --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000 --seedSearchStartLmax 30 


which are then filtered: 


samtools view -F 2828 -f 2 -q 30 -@ 4 -b mappings.bam >filtered_mappings.bam 


Typically, filter_mappings.bam is then fed to featureCounts: 


featureCounts -T 12 -s 2 -p -B -C -P -d 40 -D 4000 -t exon -g gene_id -a /opt/ngs_indexes/models/mm/mm10/gencode.vM6.refchrom.annotation.gtf -o counts.txt *.bam 


This pipeline resulted in re-sorting from previous versions of featureCounts with 80-95% of features assigned, whereas now there is no automatic re-sorting and only 0.1% of features gets assigned.  


Thank you, 


Roberto 

Wei Shi

unread,
Dec 8, 2015, 6:30:20 PM12/8/15
to Subread
Hi Roberto,

Thanks for providing further information. We found that there is a bug in featureCounts introduced in 1.5.0 which resulted in incorrect read counting when '-P' option is turned on. We will release a patched version with this bug fixed in the next few days. For now, you should run repair program before running featureCounts. When the new version is available, you can directly run featureCounts on your data.

Sorry for the inconvenience caused.

Wei

rspreafico

unread,
Dec 8, 2015, 7:59:42 PM12/8/15
to Subread
Hi Wei,

thanks for the prompt debugging! I look forward to the patch!

Cheers

Roberto
Reply all
Reply to author
Forward
0 new messages