Given mapped reads in a BAM file, this tool calculates how many reads map to each gene using Ensembl annotations.
Note that the chromosome names in your BAM file need to the chr prefix (e.g. chr1). You can use splicing-aware aligner such as TopHat when making the BAM file for RNA-seq data, because HTSeq makes full use of the information in the CIGAR field of BAM.
By default the GFF attribute gene-id is used as a feature ID. Several GFF lines (e.g. exons) with the same feature ID will be considered as parts of the same feature, and the feature ID is used to identify the counts in the output table. In other words, a gene is considered as a union of all its exons. There are three different modes to handle reads which overlap with more than one gene. These are illustrated in the HTSeq manual.
By default all aligned reads are mapped to genes, but users can choose to filter them by mapping (alignment) quality (note that unlike BWA, Bowtie doesn't calculate mapping quality, it just inserts 255 to the field 5 of BAM file if the read aligns, and 0 if it doesn't align).
Output is a table with counts for each gene. In order to use the output in edgeR, you need to select all samples and run the tool "Utilities - Define NGS experiment".
The tool also generates a separate text file (htseq-count-info.txt) listing how many reads could not be assigned to any gene (no_feature), mapped to several genes and were hence not counted (ambiguous), had too low alignment quality (too_low_aQual), were not aligned (not_aligned), or had more than one alignment (alignment_not_unique).
This tool is based on the HTSeq package by Simon Anders.