Picard SortSam error
AnsweredI got the following error while running picard SortSam command. Below is the details:
REQUIRED for all errors and issues:
a) GATK version used: 4.2.5.0
b) Exact command used: java -jar /home/tbiswas/softwares/gatk-4.2.5.0/picard.jar SortSam INPUT=/home/tbiswas/IITK_P6_N_fixmate.bam OUTPUT=/home/tbiswas/IITK_P6_BD_fixmate_sorted.bam SORT_ORDER=coordinate
c) Entire program log:
[tbiswas@un04 ~]$ java -jar /home/tbiswas/softwares/gatk-4.2.5.0/picard.jar SortSam INPUT=/home/tbiswas/IITK_P6_N_fixmate.bam OUTPUT=/home/tbiswas/IITK_P6_BD_fixmate_sorted.bam SORT_ORDER=coordinate
INFO 2022-10-14 16:43:15 SortSam
********** NOTE: Picard's command line syntax is changing.
**********
********** For more information, please see:
**********
https://github.com/broadinstitute/picard/wiki/Command-Line-Syntax-Transition-For-Users-(Pre-Transition)
**********
********** The command line looks like this in the new syntax:
**********
********** SortSam -INPUT /home/tbiswas/IITK_P6_N_fixmate.bam -OUTPUT /home/tbiswas/IITK_P6_BD_fixmate_sorted.bam -SORT_ORDER coordinate
**********
16:43:15.414 INFO NativeLibraryLoader - Loading libgkl_compression.so from jar:file:/home/tbiswas/softwares/gatk-4.2.5.0/picard.jar!/com/intel/gkl/native/libgkl_compression.so
[Fri Oct 14 16:43:15 IST 2022] SortSam INPUT=/home/tbiswas/IITK_P6_N_fixmate.bam OUTPUT=/home/tbiswas/IITK_P6_BD_fixmate_sorted.bam SORT_ORDER=coordinate VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json USE_JDK_DEFLATER=false USE_JDK_INFLATER=false
[Fri Oct 14 16:43:15 IST 2022] Executing as tbiswas@un04 on Linux 3.10.0-327.el7.x86_64 amd64; OpenJDK 64-Bit Server VM 1.8.0_65-b17; Deflater: Intel; Inflater: Intel; Provider GCS is not available; Picard version: 2.27.5
[Fri Oct 14 16:43:15 IST 2022] picard.sam.SortSam done. Elapsed time: 0.00 minutes.
Runtime.totalMemory()=2022178816
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" htsjdk.samtools.SAMFormatException: SAM validation error: ERROR::INVALID_FLAG_MATE_UNMAPPED:Record 205, Read name A00718:32:HGHCHDSXX:3:1101:9824:1063, Mate unmapped flag should not be set for unpaired read.
at htsjdk.samtools.SAMUtils.processValidationErrors(SAMUtils.java:458)
at htsjdk.samtools.BAMFileReader$BAMFileIterator.advance(BAMFileReader.java:863)
at htsjdk.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:848)
at htsjdk.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:816)
at htsjdk.samtools.SamReader$AssertingIterator.next(SamReader.java:591)
at htsjdk.samtools.SamReader$AssertingIterator.next(SamReader.java:570)
at picard.sam.SortSam.doWork(SortSam.java:162)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:309)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)
[tbiswas@un04 ~]$
Please let me know what can be done.
Thank you.
-
Hi Tanay Biswas,
Thanks again for writing to the GATK forum! Let’s see if we can help you sort this out.
So our developers informed me that your code is raising a flag that your sample is malformed. ValidateSamFile (Picard) would flag the same issue. You can use it to troubleshoot and diagnose to determine which steps you need to take to fix your bam file.
Errors in SAM or BAM files can be diagnosed with ValidateSamFile
I hope this helps! Please let me know what you find out and if this helps lead you to success. If you have any further questions, please do not hesitate to send them my way.
Best,
Anthony -
Hi Anthony,
This problem is sorted. I have again made new SAM and BAM files aligning to hg38 and used the following command:
[tbiswas@un02 ~]$ java -jar picard.jar SortSam I=/scratch/tbiswas/TD_fixmate.bam O=/scratch/tbiswas/TD_fixmate_sorted.bam SORT_ORDER=coordinate TMP_DIR=/scratch/tbiswas/tmp/
This time it worked. But now I'm getting error in the BQSR table generation step which I also wrote to GATK forum.
Thanks.
Regards,
Tanay
-
Hi Tanay Biswas,
I'm happy to hear that we could solve this portion of the issue! I will continue to follow up with you on your other post.
Thank you again for contributing to the GATK forum!
Best,
Anthony
Please sign in to leave a comment.
3 comments