Question: htseq-count problem with --samout option
gravatar for Ian
5.5 years ago by
University of Manchester, UK
Ian5.7k wrote:


This is a question for users of htseq-count; a program for counting reads into gene annotation.

I am using version 0.6.1p1.  There is an option '--samout' that looks like a simple way to identify actually which reads are used in the counting.  The manual definition is:

"write out all SAM alignment records into an output SAM file called SAMOUT, annotating each line with its feature assignment (as an optional field with tag 'XF')"

However, I am only getting a file with the XF tag, e.g.:


Is anyone familiar with this option and able to comment?  Perhaps the idea is to concatenate this to the existing SAM.


I have confirmed that the input SAM file is the same length as the --samout output.  Therefore, is the rest of the SAM line missing intentionally?

EDIT 2 (command line used - file names changed for brevity):
htseq-count --mode=union --stranded=no --type=exon --idattr=gene_id --format=bam --order=name --samout=out.sam in.bam genes.gtf > out.txt

Just found that this has already been covered in seqanswers ''.  It does appear to be a bug when trying to use a BAM file directly.

htseq-count • 3.2k views
ADD COMMENTlink modified 5.4 years ago by Biostar ♦♦ 20 • written 5.5 years ago by Ian5.7k

That's odd. Presumably it's a bug. What's the exact command that you're giving?

ADD REPLYlink written 5.5 years ago by Devon Ryan96k

Please see "EDIT 2" in main.  It has just occurred to me that it might not like input as --format=BAM.

ADD REPLYlink written 5.5 years ago by Ian5.7k

Hmm, possible. I suspect this is just a bug. I haven't used the --samout option with the most recent version, though I could do that real quick just to confirm this bug.

ADD REPLYlink written 5.5 years ago by Devon Ryan96k

I can confirm this bug with one of my datasets using 0.6.1p1 (it also seems to have affected 0.6.1). Have you already notified Simon Anders?

ADD REPLYlink written 5.5 years ago by Devon Ryan96k

I have contacted him, thanks for your help.


ADD REPLYlink written 5.5 years ago by Ian5.7k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 711 users visited in the last hour