I aligned my fasta files to the reference genome using bwa sampe.
I have paired end reads so first used:
bwa aln -t 2 -l 20 lyrata_genome.fa Trm_MA605_R1.fastq > Trm_MA605_R1.sai
bwa aln -t 2 -l 20 lyrata_genome.fa Trm_MA605_R2.fastq > Trm_MA605_R2.sai
Then I did the sampe alignment using:
bwa sampe -n 1 -N 2 lyrata_genome.fa Trm_MA605_R1.sai Trm_MA605_R2.sai Trm_MA605_R1.fastq Trm_MA605_R2.fastq > SAMPEaligned_MA605readsBWA.sam
I tried to sort the alignment and convert it to bam using picard. But, getting the error message (part of the total error message):
Exception in thread "main" htsjdk.samtools.SAMFormatException: Error parsing text SAM file. MAPQ should be 0 for unmapped read.; File SAMPEaligned_MA605readsBWA.sam; Line 673702
Line: HWI-ST588:81:C080WACXX:7:1102:6980:187157 69 4 23328260 6 84M 6 963719 0 GGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGCATAAA +2AAEEEIIFFIFIEI<CEDCEDDDDDIIIBDDEIDDBDDEIIDCCDIIII=ADDDDD?@DAAAAA>?AAAA>??AAA35(54> RG:Z:MA605_C080WACXX_7 XT:A:U NM:i:3 SM:i:6 AM:i:6 X0:i:1 X1:i:55 XM:i:3 XO:i:0 XG:i:0 MD:Z:28C49A1A3
at htsjdk.samtools.SAMLineParser.reportErrorParsingLine(SAMLineParser.java:439)
at htsjdk.samtools.SAMLineParser.parseLine(SAMLineParser.java:341)
at htsjdk.samtools.SAMTextReader$RecordIterator.parseLine(SAMTextReader.java:248)
I tried to validate the sam file using picard again:
java -jar /home/everestial007/picard-tools-1.139/picard.jar ValidateSamFile I=SAMPEaligned_MA605readsBWA.sam Mode=VERBOSE MAX_OUTPUT=15000 O=validatebamMA605forGATK
But, gettin the following error message in the output file.
ERROR: Record 46, Read name HWI-ST588:81:C080WACXX:7:1101:3935:2321, Mate negative strand flag does not match read negative strand flag of mate
ERROR: Record 155, Read name HWI-ST588:81:C080WACXX:7:1101:9306:2386, Mate negative strand flag does not match read negative strand flag of mate
ERROR: Record 352, Read name HWI-ST588:81:C080WACXX:7:1101:20820:2318, Mate negative strand flag does not match read negative strand flag of mate
ERROR: Record 382, Read name HWI-ST588:81:C080WACXX:7:1101:2880:2595, Mate negative strand flag does not match read negative strand flag of mate
ERROR: Record 562, Read name HWI-ST588:81:C080WACXX:7:1101:10717:2694, Mate negative strand flag does not match read negative strand flag of mate
ERROR: Record 603, Read name HWI-ST588:81:C080WACXX:7:1101:12062:2750, Mate negative strand flag does not match read negative strand flag of mate
I followed the bwa manual to letter but getting this kind of errors. I can not figure why is my alignment not working.
Thanks in advance.