DiltheyLab / HLA-LA

Fast HLA type inference from whole-genome data
GNU General Public License v3.0
120 stars 40 forks source link

error when extracting unmapped reads #58

Closed wt2015-github closed 11 months ago

wt2015-github commented 3 years ago

The following code could get an error of bam header when there is no unmapped reads

my $extraction_command_unmapped = qq($samtools_bin view $BAM '' | awk '{if (\$3 == "") print \$0}' | $samtools_bin view -bo $target_extraction_unmapped -);

how about this:

my $extraction_command_unmapped = qq($samtools_bin view -bo $target_extraction_unmapped $BAM '*'); or my $extraction_command_unmapped = qq($samtools_bin view -f4 -bo $target_extraction_unmapped $BAM); but the second one could be a problem when only one of the paired-end reads mapped

AlexanderDilthey commented 11 months ago

Hey @wt2015-github,

Thank you! This is now fixed! (https://github.com/DiltheyLab/HLA-LA/commit/c532e1e4805f6a1b5d0496449329b08dc6611f97)

Best wishes

Alex