How to sort SAM file
0
0
Entering edit mode
@4fedfa78
Last seen 2.1 years 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 • 2.5k views
ADD COMMENT
0
Entering edit mode

Is this s Bioconductor question?

ADD REPLY
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

ADD REPLY
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?

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 536 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