Question: Htseq Count Sam
1
gravatar for Varun Gupta
7.6 years ago by
Varun Gupta1.1k
United States
Varun Gupta1.1k wrote:

Hi everyone

I want to use htseq-count to count the number of reads for the features i have but htseq-count says:

If you have paired-end data, you have to sort the SAM file by read name first.

How can i do that if i don't want to use msort.

Regards V

htseq counts • 4.1k views
ADD COMMENTlink modified 6.0 years ago by Irsan7.0k • written 7.6 years ago by Varun Gupta1.1k
2
gravatar for Linxe
7.6 years ago by
Linxe30
Linxe30 wrote:

Use samtools for sorting: samtools sort -n file.bam filesortedbyreadname

ADD COMMENTlink written 7.6 years ago by Linxe30

Does 'samtools sort -n' properly handle paired end data with multiple alignments per read (e.g. rna-seq reads aligned by TopHat)?

ADD REPLYlink written 6.9 years ago by Malachi Griffith17k

Hi Malachi, i am having exactly the same problem. Did you sort out how to deal with this?

ADD REPLYlink written 5.7 years ago by roll290

For htseq-count it won't actually matter as multimapping reads will be ignored in any case (htseq-count looks at the NH:i: auxiliary tag).

ADD REPLYlink written 5.7 years ago by Devon Ryan92k

You have mentioned that SAM file has to be sorted but in the answer you have mentioned a BAM file. ??? Is that a TYPO ???

ADD REPLYlink written 6.6 years ago by venkateshr89690
1
gravatar for Irsan
6.0 years ago by
Irsan7.0k
Amsterdam
Irsan7.0k wrote:

You can also use SortSam.jar from picardtools

java -jar /path_to_folder_picardtools/SortSam.jar INPUT=yourfile.sam OUTPUT=readSorted.sam SORT_ORDER=queryname VALIDATION_STRINGENCY=lenient
ADD COMMENTlink modified 6.0 years ago • written 6.0 years ago by Irsan7.0k
0
gravatar for sethugunja
6.0 years ago by
sethugunja60
Sweden
sethugunja60 wrote:

I have the same question, I have sorted the .bam file and convert it to .sam file : didnt work for ht seq, then I have sorted the .sam file and given for ht seq, didnt work..!! Do you have any other suggestions for sorting the sam file (paired end data) by read name?

ADD COMMENTlink written 6.0 years ago by sethugunja60
1

Firstly, try starting a new thread rather than just answering an almost year-old question with another question. Secondly, we can't help you if you just says "does not work" without providing any details. We're good, but we don't read minds.

ADD REPLYlink written 6.0 years ago by Devon Ryan92k
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: 1271 users visited in the last hour