Sorting the Input Bam file by Read Id.
0
0
Entering edit mode
12 months ago
jigarnt ▴ 30

Hi All,

I am trying to sort the deduplicated, filtered, sorted BAM file by read id to be used as an Input file for the Samblaster tool which identifies split and discordant read pairs from the bam file.
I used samtools sort command but it is still showing me an error that it is not sorted by read id. Below is the script that I used:

samtools sort -n dedup_RG_Filtered_Sorted_C002-165.bam                                        -o dedup_RG_Filtered_Sorted_C002-165_readid.bam 

**Error: Are you sure the input is sorted by read ids?samblaster: Exiting early, the following stats are for processing preceeding the error
samblaster: Output 0 discordant read pairs to dedup_RG_Filtered_Sorted_C002-165.disc.sam
samblaster: Output 0 split reads to dedup_RG_Filtered_Sorted_C002-165.split.sam
samblaster: Marked  0 of 15 (0.000%) total read ids as duplicates using 1680k memory in 0.000S CPU seconds and 0S wall time.
samblaster: Premature exit (return code 1).**

In that case, what should I do to insert read id in my BAM file. Are there any other tools which can be used for the same ?

Thank you in advance for your assistance.

Samblaster read InputBAM id • 638 views
ADD COMMENT
0
Entering edit mode

what was the samblaster cmd ?

ADD REPLY
0
Entering edit mode

Hi Pierre,

/samtools view -h dedup_RG_Filtered_Sorted_C002-165_readid.bam | /home/jigar89/Software/samblaster-master/samblaster -a -e -d dedup_RG_Filtered_Sorted_C002-165.disc.sam -s dedup_RG_Filtered_Sorted_C002-165.split.sam -o /dev/null
ADD REPLY

Login before adding your answer.

Traffic: 2161 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6