I followed the PE recipe to align the reads. At a later stage I need to add ReadGrp to the bam file and PICARD is showing following error:
'''
Exception in thread "main" htsjdk.samtools.SAMFormatException: SAM validation error: ERROR: Record 1, Read name M03309:282:000000000-D4876:1:1102:11182:26444, Mapped mate should have mate reference name
at htsjdk.samtools.SAMUtils.processValidationErrors(SAMUtils.java:441)
at htsjdk.samtools.BAMFileReader$BAMFileIterator.advance(BAMFileReader.java:644)
at htsjdk.samtools.BAMFileReader$BAMFileIterator.<init>(BAMFileReader.java:617)
at htsjdk.samtools.BAMFileReader$BAMFileIterator.<init>(BAMFileReader.java:605)
at htsjdk.samtools.BAMFileReader.getIterator(BAMFileReader.java:313)
at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.iterator(SamReader.java:448)
at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.iterator(SamReader.java:350)
at picard.sam.AddOrReplaceReadGroups.doWork(AddOrReplaceReadGroups.java:124)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:209)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:105)
'''
Commands used:
```
~/Research/Programs/LAST/last-948/scripts/fastq-interleave ../../qc_qa/DeDup/D00172_000001_R1.DeDup.fq.gz ../../qc_qa/DeDup/D00172_000001_R2.DeDup.fq.gz | ~/Research/Pr
ograms/LAST/last-948/src/lastal -Q1 -D1000 -i1 HumanIDX_last48/last_hg19 >temp.maf
~/Research/Programs/LAST/last-948/src/last-pair-probs temp.maf >out.maf
~/Research/Programs/LAST/last-948/scripts/maf-convert sam out.maf >out.sam
samtools view -T HumanIDX_last48/ucsc.hg19.fasta -b -S out.sam >Sample_D00172_000001_ORF15Test_LAST.bam
java -Xmx2G -jar /modules/ogi-mbc/software/picardtools/1.141/picard.jar AddOrReplaceReadGroups I=Sample_D00172_000001_ORF15Test_LAST.bam O=Sample_D00172_000001_ORF15Test_LAST.ReadGrp.bam RGPL=Illumina RGSM=D00172_000001 RGLB=D00172_000001 RGPU=Illumina RGID=D00172_000001
```
Even when I add VALIDATION_STRINGENCY=LENIENT to Picard, many reads are ignored. Perhaps maf-convert is adhering to old standar of SAM/BAMs?
I did updated and used the latest version of LAST: last-948
Thank you,
Sudeep
Hello,
I used the '-r' option in mac-convert to added the read group. Once that was done, I used Picard to validate the sam/bam and its not validating.
```
## HISTOGRAM java.lang.String
Error Type Count
ERROR:HEADER_RECORD_MISSING_REQUIRED_TAG 1
ERROR:INVALID_FLAG_FIRST_OF_PAIR 3271
ERROR:INVALID_FLAG_SECOND_OF_PAIR 2637
ERROR:MISSING_PLATFORM_VALUE 1
ERROR:POORLY_FORMATTED_HEADER_TAG 5
```
I had to do all this as when I get the 'sam' output from LAST, its coverted to 'BAM' sorted and then used GATK to make variant calls. When GATK failed, based on the errors shown I started fixing issues. But now when readgroup is added. GATK still wont run. This is when I tried 'validating' sam file.
Thanks,
Sudeep
Sorry about frequent emails.
To check/fix issues, I tried running samtools fixmate:
```
samtools fixmate -O bam out_ReadGrpAdded.sam out_ReadGrpAdded.fixmate.bam
[E::sam_parse1] missing SAM header
[W::sam_read1] Parse error at line 3
```
So my initial suspicion seems correct:
`Perhaps maf-convert is adhering to old standard of SAM/BAMs` or may be its something else.
Best,
Sudeep
--
You received this message because you are subscribed to the Google Groups "last-align" group.
To unsubscribe from this group and stop receiving emails from it, send an email to last-align+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.