Question: sorting a BAM file
0
gravatar for Bogdan
4 months ago by
Bogdan690
Palo Alto, CA, USA
Bogdan690 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 • 263 views
ADD COMMENTlink modified 4 months ago by Philipp Bayer5.8k • written 4 months ago by Bogdan690
3
gravatar for Philipp Bayer
4 months ago by
Philipp Bayer5.8k
Australia/Perth/UWA
Philipp Bayer5.8k 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 4 months ago by Philipp Bayer5.8k

Thank you Philipp for your suggestion !

ADD REPLYlink written 4 months ago by Bogdan690
Please log in to add an answer.

Help
Access

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