How to sort SAM file
0
0
Entering edit mode
@4fedfa78
Last seen 25 days ago
Japan

Hello Everyone, I want to sort my sam files, I tried these 2 different commands but still not got the result properly. is there anyone who advise me in this case? I would really appreciate your comments.

1. samtools view -u ../SRR00000.sam | samtools sort | samtools view -h > SRR00000.sorted.sam
2. samtools sort -O sam -o SRR00000.sort.sam  SRR00000.sam

sessionInfo( )

samtool • 270 views
0
Entering edit mode

Is this s Bioconductor question?

0
Entering edit mode

Hi, have you checked the Samtools tutorial?

I am not sure why you are sorting .sam files, shouldn't you first convert to .bam?

samtools view -S -b sample.sam > sample.bam

samtools sort sample.bam -o sample.sorted.bam

0
Entering edit mode

Hi many thanks for your comment. I am sorting my SAM files because I want to recreate the data from the original paper. so I tried different way but the number of counts which I get after doing the HTSeqcount is smaller than the original data. That's why I am doing it. but in any case, still, my number of counts is smaller. I tried many parameters but not any changes. I did trimming as well. do you have some suggestion?

0
Entering edit mode

Sorting should not remove reads, though it might make the file smaller. Are you absolutely sure reads are being lost?