Hi everyone,
I am running an alignment and quality control pipeline. After running bwa (aln or mem), I get an error in Picard SortSam:
"Exception in thread "main" htsjdk.samtools.SAMFormatException: SAM validation error: ERROR::INVALID_MAPPING_QUALITY:Record 18995527, Read name HWI-ST590:214:C1UJ3ACXX:6:1108:8659:37443, MAPQ should be 0 for unmapped read."
I set the validation stringency to "STRICT", I know that I can set it to "LENIENT" to proceed and ignore the error.
My question is, if it is possible that my bwa settings are causing this error. Or does it depend on my data?
This is my code for the bwa alignment:
bwa aln -t 16 ${REF} ${FASTQ1} > ${RG_ID}_1.sai && \ bwa aln -t 16 ${REF} ${FASTQ2} > ${RG_ID}_2.sai && \ bwa sampe -r ${READGROUP} ${REF} ${RG_ID}_1.sai ${RG_ID}_2.sai ${FASTQ1} ${FASTQ2} | \ samtools view -Shb -o <output_file> || \ { echo "BWA-ALN failed"; exit 1; }
I also ran bwa mem on the data to see if it changes anything, but I get the same error. I'd like to run bwa aln in this case because the average read length is < 70 bp.
This is my code for Picard SortSam:
java -jar <picard_path> SortSam \ -CREATE_INDEX true \ -INPUT <input_file> \ -SORT_ORDER coordinate \ -OUTPUT <output_file> \ -VALIDATION_STRINGENCY STRICT || \ { echo "Sorting failed"; exit 1; }
Thank you!
Lynn
Update: I got around this error by using Picard CleanSam after BWA alignment. I don't get the error after cleaning and set back the Validation Stringency to "STRICT".