d4-format icon indicating copy to clipboard operation
d4-format copied to clipboard

Mapping quality filter not functioning

Open toddrichmond opened this issue 2 years ago • 2 comments

Using "D4 Utilities Program 0.3.7" installed with conda

I created 3 d4 files using different mapping quality filters:

d4tools create --mapping-qual 0 S01_HyperPlus_Program1_HyperExomev1_Rep1_S1_sorted_dupsrm.bam MQ0.d4 d4tools create --mapping-qual 20 S01_HyperPlus_Program1_HyperExomev1_Rep1_S1_sorted_dupsrm.bam MQ20.d4 d4tools create --mapping-qual 60 S01_HyperPlus_Program1_HyperExomev1_Rep1_S1_sorted_dupsrm.bam MQ60.d4

I then looked at coverage depths for a known problematic gene SMN1 d4tools show -H MQ0.d4 chr5:70924941-70966375 > SMN1.MQ0.txt d4tools show -H MQ20.d4 chr5:70924941-70966375 > SMN1.MQ20.txt d4tools show -H MQ60.d4 chr5:70924941-70966375 > SMN1.MQ60.txt

All three files are identical - using 'diff' shows no difference between the three files. Using the same input BAM, and counting the number of reads using samtools 1.15, shows a very clear difference

samtools view -c -q 0 S01_HyperPlus_Program1_HyperExomev1_Rep1_S1_sorted_dupsrm.bam chr5:70924941-70966375 => 1914 samtools view -c -q 20 S01_HyperPlus_Program1_HyperExomev1_Rep1_S1_sorted_dupsrm.bam chr5:70924941-70966375 => 230 samtools view -c -q 60 S01_HyperPlus_Program1_HyperExomev1_Rep1_S1_sorted_dupsrm.bam chr5:70924941-70966375 => 33

Perhaps I don't understand how the --mapping-qual switch is supposed to work, but it's clearly not working as I expect. SMN1.zip

toddrichmond avatar Aug 04 '22 15:08 toddrichmond

This is a known issue related to https://github.com/38/d4-format/issues/56 Can you try downloading the latest from github and seeing if it fixes the problem? I had the same issue and my test example worked with the latest code

petersudmant avatar Aug 04 '22 20:08 petersudmant

Thanks, this fixes the issue.

toddrichmond avatar Aug 05 '22 00:08 toddrichmond