I encountered an error when trying to process cram files. The error was thrown when it was trying to organize unmapped reads. After some help on Biostars, I found a solution:
Duplicate the HLA-LA.pl file. I renamed it to HLA-LA_CRAM.pl
The gist of what turned out to be the issue was that the header information was being removed by awk. I dealt with this issue by first saving the header information, running the awk command, add the header back onto the piped file, then continue with the pipeline. This should not affect the accuracy of the program.
I encountered an error when trying to process cram files. The error was thrown when it was trying to organize unmapped reads. After some help on Biostars, I found a solution:
my $extraction_command_unmapped = qq($samtools_bin view -H $BAM > $working_dir_thisSample/header.file ; $samtools_bin view -\@ $threads_minus_1 $view_T_switch $BAM '*' | awk '{if (\$3 == "*") print \$0}' > $working_dir_thisSample/filtered.sam ; cat $working_dir_thisSample/header.file $working_dir_thisSample/filtered.sam | $samtools_bin view -bo $target_extraction_unmapped -);
The gist of what turned out to be the issue was that the header information was being removed by awk. I dealt with this issue by first saving the header information, running the awk command, add the header back onto the piped file, then continue with the pipeline. This should not affect the accuracy of the program.