Hi all,

I am using htseq-count for getting the read count of my genes from RNASeq data.While I have got the read counts but I am getting the warning below:

```
Warning: 35062120 reads with missing mate encountered.
35138401 SAM alignment pairs processed.
```

I am guessing this could be because of how I sorted my sam file.I did not specify any parameters while sorting.This was the command I used(gnu parallel). {1} is used to specify my input files.

    samtools sort - -m 40G {1/.}.sorted

My question is do I have to sort by any specific parameter such as -n ?For example do I need to rerun sorting and then produce results of htseq-count.

Thanks in advance

Ron
<p>First check how many reads have proper mates. May be using <code>samtools flagstat</code></p>

<p>If you find many reads with missing mates, like shown in htseq warning, there are no issues with htseq. If you find most of the reads have their mates aligned, then</p>

<p>Sort the samfile either by position ( default ) or name ( -n ). Then use latest version of htseq and set the -r option to eithe name ( -r name [default] ) or position ( -r pos ) based on how you have sorted the bam file. Make sure you have used the strandedness (-s) option appropriately.</p>
