Question: sorting a BAM file
gravatar for Bogdan
27 days ago by
Palo Alto, CA, USA
Bogdan550 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 • 155 views
ADD COMMENTlink modified 27 days ago by Philipp Bayer5.6k • written 27 days ago by Bogdan550
gravatar for Philipp Bayer
27 days ago by
Philipp Bayer5.6k
Philipp Bayer5.6k 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 27 days ago by Philipp Bayer5.6k

Thank you Philipp for your suggestion !

ADD REPLYlink written 27 days ago by Bogdan550
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: 660 users visited in the last hour