.TH "HTSEQ-COUNT" "1" "September 05, 2013" "0.5.4p3" "HTSeq" .SH NAME htseq-count \- Count the number of reads in a SAM alignment file that map to GFF features . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .\" Man page generated from reStructuredText. . .sp Given a file with aligned sequencing reads and a list of genomic features, a common task is to count how many reads map to each feature. .sp A feature is here an interval (i.e., a range of positions) on a chromosome or a union of such intervals. .sp In the case of RNA\-Seq, the features are typically genes, where each gene is considered here as the union of all its exons. One may also consider each exon as a feature, e.g., in order to check for alternative splicing. For comparative ChIP\-Seq, the features might be binding region from a pre\-determined list. .sp Special care must be taken to decide how to deal with reads that overlap more than one feature. The \fBhtseq\-count\fP script allows to choose between three modes. Of course, if none of these fits your needs, you can write your own script with HTSeq. See the chapter \fItour\fP for a step\-by\-step guide on how to do so. .sp The three overlap resolution modes of \fBhtseq\-count\fP work as follows. For each position \fIi\fP in the read, a set \fIS(i)\fP is defined as the set of all features overlapping position \fIi\fP. Then, consider the set \fIS\fP, which is (with \fIi\fP running through all position within the read) .INDENT 0.0 .IP \(bu 2 the union of all the sets \fIS(i)\fP for mode \fBunion\fP. .IP \(bu 2 the intersection of all the sets \fIS(i)\fP for mode \fBintersection\-strict\fP. .IP \(bu 2 the intersection of all non\-empty sets \fIS(i)\fP for mode \fBintersection\-nonempty\fP. .UNINDENT .sp If \fIS\fP contains precisely one feature, the read is counted for this feature. If it contains more than one feature, the read is counted as \fBambiguous\fP (and not counted for any features), and if \fBS\fP is empty, the read is counted as \fBno_feature\fP. .sp The following figure illustrates the effect of these three modes: [image] .SH USAGE .sp After you have installed HTSeq (see \fIinstall\fP), you can run \fBhtseq\-count\fP from the command line: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C htseq\-count [options] .ft P .fi .UNINDENT .UNINDENT .sp If the file \fBhtseq\-qa\fP is not in your path, you can, alternatively, call the script with .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C python \-m HTSeq.scripts.count [options] .ft P .fi .UNINDENT .UNINDENT .sp The contains the aligned reads in the SAM format. (Note that the \fI\%SAMtools\fP contain Perl scripts to convert most alignment formats to SAM.) Make sure to use a splicing\-aware aligner such as TopHat. HTSeq\-count makes full use of the information in the CIGAR field. .sp To read from standard input, use \fB\-\fP as \fB\fP. .sp If you have paired\-end data, you have to sort the SAM file by read name first. (If your sorting tool cannot handle big files, try e.g. Ruan Jue\(aqs \fImsort\fP, available from the \fI\%SOAP\fP web site.) .sp The contains the features in the \fI\%GFF format\fP. .sp The script outputs a table with counts for each feature, followed by the special counters, which count reads that were not counted for any feature for various reasons, namely: .INDENT 0.0 .IP \(bu 2 \fBno_feature\fP: reads which could not be assigned to any feature (set \fIS\fP as described above was empty). .IP \(bu 2 \fBambiguous\fP: reads which could have been assigned to more than one feature and hence were not counted for any of these (set \fIS\fP had mroe than one element). .IP \(bu 2 \fBtoo_low_aQual\fP: reads which were not counted due to the \fB\-a\fP option, see below .IP \(bu 2 \fBnot_aligned\fP: reads in the SAM file without alignment .IP \(bu 2 \fBalignment_not_unique\fP: reads with more than one reported alignment. These reads are recognized from the \fBNH\fP optional SAM field tag. (If the aligner does not set this field, multiply aligned reads will be counted multiple times.) .UNINDENT .sp \fIImportant:\fP The default for strandedness is \fIyes\fP. If your RNA\-Seq data has not been made with a strand\-specific protocol, this causes half of the reads to be lost. Hence, make sure to set the option \fB\-\-stranded=no\fP unless you have strand\-specific data! .SS Options .INDENT 0.0 .TP .B \-m , \-\-mode= Mode to handle reads overlapping more than one feature. Possible values for \fI\fP are \fBunion\fP, \fBintersection\-strict\fP and \fBintersection\-nonempty\fP (default: \fBunion\fP) .UNINDENT .INDENT 0.0 .TP .B \-s , \-\-stranded= whether the data is from a strand\-specific assay (default: \fByes\fP) .sp For stranded=no, a read is considered overlapping with a feature regardless of whether it is mapped to the same or the opposite strand as the feature. For stranded=yes and single\-end reads, the read has to be mapped to the same strand as the feature. For paired\-end reads, the first read has to be on the same strand and the second read on the opposite strand. For stranded=reverse, these rules are reversed. .UNINDENT .INDENT 0.0 .TP .B \-a , \-\-a= skip all reads with alignment quality lower than the given minimum value (default: 0) .UNINDENT .INDENT 0.0 .TP .B \-t , \-\-type= feature type (3rd column in GFF file) to be used, all features of other type are ignored (default, suitable for RNA\-Seq and \fI\%Ensembl GTF\fP files: \fBexon\fP) .UNINDENT .INDENT 0.0 .TP .B \-i , \-\-idattr= GFF attribute to be used as feature ID. Several GFF lines with the same feature ID will be considered as parts of the same feature. The feature ID is used to identity the counts in the output table. The default, suitable for RNA\-SEq and Ensembl GTF files, is \fBgene_id\fP. .UNINDENT .INDENT 0.0 .TP .B \-o , \-\-samout= write out all SAM alignment records into an output SAM file called , annotating each line with its assignment to a feature or a special counter (as an optional field with tag \(aqXF\(aq) .UNINDENT .INDENT 0.0 .TP .B \-q, \-\-quiet suppress progress report and warnings .UNINDENT .INDENT 0.0 .TP .B \-h, \-\-help Show a usage summary and exit .UNINDENT .SH AUTHOR Simon Anders .SH COPYRIGHT 2010, Simon Anders .\" Generated by docutils manpage writer. .