I apologize in advance for the stupid question... but what you mean with "No, you do not need to sort by name, although it needs either position or name sorted sam / bam"? I tried the tool without providing other files and it works, but I would like to be sure that it is the right procedure. Thank you for your kindly help!
Hello!
I am using featuresCount for read summarization, with the following command:
featureCounts -T 5 -t exon -g gene_name -a genomehg38.gtf -o counts.txt file.sam
I am wondering if I had to sort by name my sam file before to use featureCounts. I have read the featuresCount's documentation but I didn't understand it.
Thank you in advance
Best
1 answer
No, you do not need to sort by name, although it needs either position or name sorted sam / bam. From the manual, page 29:
Automatically detect input format (SAM or BAM).
Automatically sort paired-end reads. Users can provide either location-sorted or name- sorted bams files to featureCounts. Read sorting is implemented on the fly and it only incurs minimal time cost.
How did you get your sam file? Did you sort it, or know if the mapper sorts it on the fly? And what do you mean by
I tried the tool without providing other files
What other files? You only need the gtf annotation and the sam / bam mapping file.
It is the result of the alignment by HISAT 2... I didn't re-order it after that and I don't know if the mapper sorts it on the fly...
Log in to answer this question.
It would be helpful for you to understand how featurecounts works if you tried both the options. Try it with and without sorted sam and let us know if it makes any difference.
From here ,
Thank you! I have tried now and the results were the same :) Thank you again!
Thanks @noeD