MonashBioinformaticsPlatform / RNAsik-pipe

RNAsik - more than just a pipeline
https://monashbioinformaticsplatform.github.io/RNAsik-pipe/
Apache License 2.0
13 stars 5 forks source link

include -Q flag to filtering multi-mapping reads from featureCounts #41

Closed serine closed 5 years ago

serine commented 5 years ago

note for myself; think about -Q field in featureCounts Is it right to remove multi-mapping reads from counts table?

It feels reasonable to remove them, otherwise you exaggerate you counts?

Bear in mind that at least for STAR MAPQ is a discrete numbers more information here

Any comments on this issue will be much appreciated guys !

Cheers

serine commented 5 years ago

this has been implemented as per commit about, but turns out that this wasn't necessary as featureCounts filters multi-mappers via NH field in the bam files. I think I new that but have forgotten. So this wasn't a bug after all, but I'm going to leave -Q 10 filtering in. For STAR and tophat2/hisat2 aligners this shouldn't do anything.

relevant bit of code from featureCounts source

   if( NH_value > 1 ) {
                        if(global_context -> is_multi_mapping_allowed == 0) {
                                // now it is a NH>1 read!
                                // not allow multimapping -> discard!
                                if(RG_ptr){
                                        void ** tab4s = get_RG_tables(global_context, thread_context, RG_ptr);
                                        fc_read_counters * sumtab = tab4s[1];
                                        sumtab -> unassigned_multimapping++;
                                }else thread_context->read_counters.unassigned_multimapping ++;

                                if(global_context -> read_details_out_FP)
                                        write_read_details_FP(global_context, thread_context, "Unassigned_MultiMapping", -1, NULL, bin1, bin2);

                                return;
                        }
                }