Which FC function is handling the automatic PE name sorting?

26 views
Skip to first unread message

martina

unread,
Oct 30, 2020, 1:42:35 PM10/30/20
to Subread
Hi Yang,
as far as I understood, FC sorts automatically paired-end input reads by read-name.
Is the second level sorting based on the strand of read and mate (5th and 6th bit in SAM Flag field)?
Could you please point me to the function which does the job?
Thank you in advance!
Cheers,
Martina

Yang LIAO

unread,
Oct 30, 2020, 3:23:09 PM10/30/20
to Subread
Hi Martina,

FeatureCounts matches read pairs by read names, then the "mate mapping locations" that are in the 7th and 8th columns in the SAM or BAM files, then the "HI" tag in each alignment.

The read pairing module is the essential part for making featureCounts very efficient, and the module is named "SAM_pairer" in src/input-files.c. There are many functions in this module, and the function for extracting information from reads for read pairing is "SAM_pairer_get_read_full_name". The read name generated by this function contains the raw read name in SAM/BAM files, with extra information about the mate mapping location and the HI tag value. This read name is used for finding the other read in the pair, which should have exactly the same read name.

Cheers,
Yang
Reply all
Reply to author
Forward
0 new messages