Question: sorting a BAM file
gravatar for Bogdan
7 months ago by
Palo Alto, CA, USA
Bogdan700 wrote:

Dear all,

would you please advise: beside SAMTOOLS, PICARD or SAMBAMBA, is there any tool that you would recommend in order to sort a BAM based on read name ? It is a BAM file from EGA that contains cancer sequencing data, and when I do run PICARD SortSam, I am getting the following error (below), and the file does not get sorted. Thanks !

Exception in thread "main" htsjdk.samtools.SAMFormatException: SAM validation error: ERROR: Record 957453876, Read name HWI-ST7001002R:223:C14GPACXX:3:1305:7471:56486, MAPQ should be 0 for unmapped read

sort bam • 324 views
ADD COMMENTlink modified 7 months ago by Philipp Bayer5.9k • written 7 months ago by Bogdan700
gravatar for Philipp Bayer
7 months ago by
Philipp Bayer5.9k
Philipp Bayer5.9k wrote:

That seems to be a very strange read, how can it have a MAPQ > 0?

Anyway, you can either try samtools sort -n to sort by name, or try setting PICARD's VALIDATION_STRINGENCY to 'lenient', so for example

java -jar picard.jar SortSam I=your_input O=your_sorted_output VALIDATION_STRINGENCY=LENIENT

By default VALIDATION_STRINGENCY is set to STRICT, which is probably the reason why it stops.

ADD COMMENTlink written 7 months ago by Philipp Bayer5.9k

Thank you Philipp for your suggestion !

ADD REPLYlink written 7 months ago by Bogdan700
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1608 users visited in the last hour