Mercurial > repos > lparsons > htseq_count
comparison htseq-count.xml @ 25:f1368427a79c draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/htseq_count commit 76065f751b678abf87e6c723be680fecaa8cb589
author | iuc |
---|---|
date | Mon, 05 Feb 2018 15:04:47 -0500 |
parents | 620d5603d1a8 |
children | 7f5a8d427b39 |
comparison
equal
deleted
inserted
replaced
24:620d5603d1a8 | 25:f1368427a79c |
---|---|
1 <tool id="htseq_count" name="htseq-count" version="0.6.1galaxy3" profile="16.04"> | 1 <tool id="htseq_count" name="htseq-count" version="0.9.1" profile="16.04"> |
2 <description> - Count aligned reads in a BAM file that overlap features in a GFF file</description> | 2 <description> - Count aligned reads in a BAM file that overlap features in a GFF file</description> |
3 <requirements> | 3 <requirements> |
4 <requirement type="package" version="0.6.1.post1">htseq</requirement> | 4 <requirement type="package" version="0.9.1">htseq</requirement> |
5 <requirement type="package" version="1.3.1">samtools</requirement> | 5 <requirement type="package" version="1.7">samtools</requirement> |
6 </requirements> | 6 </requirements> |
7 | 7 |
8 <stdio> | 8 <stdio> |
9 <exit_code range="1:" level="fatal" description="Unknown error occurred" /> | 9 <exit_code range="1:" level="fatal" description="Unknown error occurred" /> |
10 <regex match="htseq-count: (command ){0,1}not found" source="stderr" level="fatal" description="The HTSeq python package is not properly installed, contact Galaxy administrators" /> | 10 <regex match="htseq-count: (command ){0,1}not found" source="stderr" level="fatal" description="The HTSeq python package is not properly installed, contact Galaxy administrators" /> |
11 <regex match="samtools: (command ){0,1}not found" source="stderr" level="fatal" description="The samtools package is not properly installed, contact Galaxy administrators" /> | 11 <regex match="samtools: (command ){0,1}not found" source="stderr" level="fatal" description="The samtools package is not properly installed, contact Galaxy administrators" /> |
12 <regex match="Error: Feature (.+) does not contain a '(.+)' attribute" source="both" level="fatal" description="Error parsing the GFF file, at least one feature of the specified 'Feature type' does not have a value for the specified 'ID Attribute'" /> | 12 <regex match="Error: Feature (.+) does not contain a '(.+)' attribute" source="both" level="fatal" description="Error parsing the GFF file, at least one feature of the specified 'Feature type' does not have a value for the specified 'ID Attribute'" /> |
13 <regex match="Error occured in line (\d+) of file" source="stderr" level="fatal" description="Unknown error parsing the GFF file" /> | 13 <regex match="Error occured in line (\d+) of file" source="stderr" level="fatal" description="Unknown error parsing the GFF file" /> |
14 <regex match="Error" source="stderr" level="fatal" description="Unknown error occured" /> | 14 <regex match="Error" source="stderr" level="fatal" description="Unknown error occured" /> |
15 <regex match="Warning: Read (.+) claims to have an aligned mate which could not be found. \(Is the SAM file properly sorted\?\)" source="stderr" level="warning" description="PAIRED DATA MISSING OR NOT PROPERLY SORTED. Try reruning and selecting the option to 'Force sorting of SAM/BAM file by NAME'. See stderr output of this dataset for more information." /> | |
16 </stdio> | 15 </stdio> |
17 | 16 |
18 <version_command>htseq-count -h | grep version | sed 's/^\(.*\)*\(version .*\)\./\2/'</version_command> | 17 <version_command>htseq-count -h | grep version | sed 's/^\(.*\)*\(version .*\)\./\2/'</version_command> |
19 | 18 |
20 <command><![CDATA[ | 19 <command><![CDATA[ |
21 ##set up input files | 20 ##set up input files |
22 #set $reference_fasta_filename = "localref.fa" | 21 #set $reference_fasta_filename = "localref.fa" |
23 #if $samout_conditional.samout == "Yes": | 22 #set $name_sorted_alignment_filename = "name_sorted_alignment.sam" |
24 #if str( $samout_conditional.reference_source.reference_source_selector ) == "history": | 23 #if str( $advanced_options.advanced_options_selector ) == "advanced": |
25 ln -s "${samout_conditional.reference_source.ref_file}" "${reference_fasta_filename}" && | 24 #if str( $advanced_options.samout_conditional.samout ) == "Yes": |
26 samtools faidx '${reference_fasta_filename}' 2>&1 || echo "Error running samtools faidx for htseq-count" >&2 && | 25 #if str( $advanced_options.samout_conditional.reference_source.reference_source_selector ) == "history": |
27 #else: | 26 ln -s "${advanced_options.samout_conditional.reference_source.ref_file}" "${reference_fasta_filename}" && |
28 #set $reference_fasta_filename = str( $samout_conditional.reference_source.ref_file.fields.path ) | 27 samtools faidx '${reference_fasta_filename}' 2>&1 || echo "Error running samtools faidx for htseq-count" >&2 && |
28 #else: | |
29 #set $reference_fasta_filename = str( $advanced_options.samout_conditional.reference_source.ref_file.fields.path ) | |
30 #end if | |
29 #end if | 31 #end if |
30 #end if | 32 #end if |
31 | 33 |
32 #if $force_sort == "True": | 34 #if $samfile.extension == 'bam': |
33 #if $samfile.extension == 'bam': | 35 samtools sort -n --output-fmt=SAM -o '$name_sorted_alignment_filename' '$samfile' && |
34 samtools sort -n -o 'name_sorted_alignment.bam' '$samfile' && | 36 #else |
35 #else | 37 samtools view -Su -t '${reference_fasta_filename}.fai' '$samfile' | samtools sort -n --output-fmt=SAM -o '$name_sorted_alignment_filename' - && |
36 samtools view -Su -t '${reference_fasta_filename}.fai' '$samfile' | samtools sort -n -o 'name_sorted_alignment.bam' - && | |
37 #end if | |
38 #end if | 38 #end if |
39 | 39 |
40 htseq-count | 40 htseq-count |
41 --mode=$mode | 41 --mode=$mode |
42 --stranded=$stranded | 42 --stranded=$stranded |
43 --minaqual=$minaqual | 43 --minaqual=$minaqual |
44 --type='$featuretype' | 44 --type='$featuretype' |
45 --idattr='$idattr' | 45 --idattr='$idattr' |
46 #if $samout_conditional.samout == "Yes": | 46 |
47 --samout='$__new_file_path__/${samoutfile.id}_tmp' | 47 #if str( $advanced_options.advanced_options_selector ) == "advanced": |
48 --nonunique=$advanced_options.nonunique | |
49 --secondary-alignments=${advanced_options.secondary_alignments} | |
50 --supplementary-alignments=${advanced_options.supplementary_alignments} | |
51 #if $advanced_options.samout_conditional.samout == "Yes": | |
52 --samout='$__new_file_path__/${samoutfile.id}_tmp.sam' | |
53 #end if | |
48 #end if | 54 #end if |
49 #if $force_sort == "True": | 55 |
50 --order=name | 56 --order=name |
51 --format=bam | 57 --format=sam |
52 name_sorted_alignment.bam | 58 '$name_sorted_alignment_filename' |
53 #else | |
54 --order=pos | |
55 --format=$samfile.extension | |
56 '$samfile' | |
57 #end if | |
58 | 59 |
59 "$gfffile" | awk '{if ($1 ~ "no_feature|ambiguous|too_low_aQual|not_aligned|alignment_not_unique") print $0 | "cat 1>&2"; else print $0}' | 60 "$gfffile" | awk '{if ($1 ~ "no_feature|ambiguous|too_low_aQual|not_aligned|alignment_not_unique") print $0 | "cat 1>&2"; else print $0}' |
60 > '$counts' | 61 > '$counts' |
61 2> '$othercounts' | 62 2> '$othercounts' |
62 | 63 |
63 #if $samout_conditional.samout == "Yes": | 64 #if str( $advanced_options.advanced_options_selector ) == "advanced": |
64 && samtools view -Su | 65 #if $advanced_options.samout_conditional.samout == "Yes": |
65 -t '${reference_fasta_filename}.fai' | 66 && samtools view -Su |
66 '$__new_file_path__/${samoutfile.id}_tmp' | 67 -t '${reference_fasta_filename}.fai' |
67 | samtools sort -o '$samoutfile' - | 68 '$__new_file_path__/${samoutfile.id}_tmp.sam' |
69 | samtools sort -o '$samoutfile' - | |
70 #end if | |
68 #end if | 71 #end if |
69 ]]> | 72 ]]> |
70 </command> | 73 </command> |
71 | 74 |
72 <inputs> | 75 <inputs> |
73 <param format="sam,bam" name="samfile" type="data" label="Aligned SAM/BAM File"/> | 76 <param format="sam,bam" name="samfile" type="data" label="Aligned SAM/BAM File"/> |
74 <param format="gff" name="gfffile" type="data" label="GFF File"/> | 77 <param format="gff" name="gfffile" type="data" label="GFF File"/> |
75 <param name="mode" type="select" label="Mode" argument="(--mode)"> | 78 <param name="mode" type="select" label="Mode" argument="--mode"> |
76 <help>Mode to handle reads overlapping more than one feature.</help> | 79 <help>Mode to handle reads overlapping more than one feature.</help> |
77 <option value="union" selected="True">Union</option> | 80 <option value="union" selected="True">Union</option> |
78 <option value="intersection-strict">Intersection (strict)</option> | 81 <option value="intersection-strict">Intersection (strict)</option> |
79 <option value="intersection-nonempty">Intersection (nonempty)</option> | 82 <option value="intersection-nonempty">Intersection (nonempty)</option> |
80 </param> | 83 </param> |
81 <param name="stranded" type="select" label="Stranded" argument="(--stranded)"> | 84 <param name="stranded" type="select" label="Stranded" argument="--stranded"> |
82 <help>Specify whether the data is from a strand-specific assay. 'Reverse' means yes with reversed strand interpretation.</help> | 85 <help>Specify whether the data is from a strand-specific assay. |
86 **Be sure to choose the correct value** (see help for more | |
87 information).</help> | |
83 <option value="yes" selected="True">Yes</option> | 88 <option value="yes" selected="True">Yes</option> |
84 <option value="no">No</option> | 89 <option value="no">No</option> |
85 <option value="reverse">Reverse</option> | 90 <option value="reverse">Reverse</option> |
86 </param> | 91 </param> |
87 <param name="minaqual" type="integer" value="10" label="Minimum alignment quality" argument="--minaqual"> | 92 <param name="minaqual" type="integer" value="10" label="Minimum alignment quality" argument="--minaqual"> |
91 <help>Feature type (3rd column in GFF file) to be used. All features of other types are ignored. The default, suitable for RNA-Seq and Ensembl GTF files, is exon.</help> | 96 <help>Feature type (3rd column in GFF file) to be used. All features of other types are ignored. The default, suitable for RNA-Seq and Ensembl GTF files, is exon.</help> |
92 </param> | 97 </param> |
93 <param name="idattr" type="text" value="gene_id" label="ID Attribute" argument="--idattr"> | 98 <param name="idattr" type="text" value="gene_id" label="ID Attribute" argument="--idattr"> |
94 <help>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. All features of the specified type MUST have a value for this attribute. The default, suitable for RNA-Seq and Ensembl GTF files, is gene_id.</help> | 99 <help>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. All features of the specified type MUST have a value for this attribute. The default, suitable for RNA-Seq and Ensembl GTF files, is gene_id.</help> |
95 </param> | 100 </param> |
96 <conditional name="samout_conditional"> | 101 |
97 <param name="samout" type="select" label="Additional BAM Output"> | 102 <conditional name="advanced_options"> |
98 <help>Write out all SAM alignment records into an output BAM file, annotating each line with its assignment to a feature or a special counter (as an optional field with tag ‘XF’).</help> | 103 <param name="advanced_options_selector" type="select" label="Set advanced options"> |
99 <option value="No" selected="True">Do not output additional BAM file</option> | 104 <option value="simple" selected="true">Default settings</option> |
100 <option value="Yes">Output additional BAM file</option> | 105 <option value="advanced">Set advanced options</option> |
101 </param> | 106 </param> |
102 <when value="Yes"> | 107 <when value="simple"> |
103 <conditional name="reference_source"> | 108 </when> |
104 <param name="reference_source_selector" type="select" label="Choose the source for the reference list"> | 109 <when value="advanced"> |
105 <option value="cached">Locally cached</option> | 110 <param argument="--nonunique" type="select" label="How to count nonunique or ambiguous mapping reads"> |
106 <option value="history">History</option> | 111 <option value="none" selected="true">None - do not count nonuniquely or ambiguously mapped reads for any features</option> |
112 <option value="all">All - count nonuniquely or ambiguously mapped reads in BOTH in the nonunique or ambiguous category AND for any features they overlap</option> | |
113 </param> | |
114 <param argument="--secondary-alignments" name="secondary_alignments" type="boolean" truevalue="ignore" falsevalue="score" checked="false" label="Ignore seconday alignments (0x100 flag)" /> | |
115 <param argument="--supplementary-alignments" name="supplementary_alignments" type="boolean" truevalue="ignore" falsevalue="score" checked="false" label="Ignore supplementary alignments (0x800 flag)" /> | |
116 <conditional name="samout_conditional"> | |
117 <param name="samout" type="select" label="Additional BAM Output"> | |
118 <help>Write out all SAM alignment records into an output BAM file, annotating each line with its assignment to a feature or a special counter (as an optional field with tag ‘XF’).</help> | |
119 <option value="No" selected="True">Do not output additional BAM file</option> | |
120 <option value="Yes">Output additional BAM file</option> | |
107 </param> | 121 </param> |
108 <when value="cached"> | 122 <when value="Yes"> |
109 <param name="ref_file" type="select" label="Using reference genome"> | 123 <conditional name="reference_source"> |
110 <options from_data_table="sam_fa_indexes"> | 124 <param name="reference_source_selector" type="select" label="Choose the source for the reference list"> |
111 <filter type="data_meta" key="dbkey" ref="samfile" column="1"/> | 125 <option value="cached">Locally cached</option> |
112 </options> | 126 <option value="history">History</option> |
113 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/> | 127 </param> |
114 </param> | 128 <when value="cached"> |
129 <param name="ref_file" type="select" label="Using reference genome"> | |
130 <options from_data_table="sam_fa_indexes"> | |
131 <filter type="data_meta" key="dbkey" ref="samfile" column="1"/> | |
132 </options> | |
133 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/> | |
134 </param> | |
135 </when> | |
136 <when value="history"> | |
137 <param name="ref_file" type="data" format="fasta" label="Using reference file" /> | |
138 </when> | |
139 </conditional> | |
115 </when> | 140 </when> |
116 <when value="history"> | 141 <when value="No"> |
117 <param name="ref_file" type="data" format="fasta" label="Using reference file" /> | 142 <!-- Do nothing --> |
118 </when> | 143 </when> |
119 </conditional> | 144 </conditional> |
120 </when> | 145 </when> |
121 <when value="No"> | |
122 <!-- Do nothing --> | |
123 </when> | |
124 </conditional> | 146 </conditional> |
125 <param name="force_sort" type="boolean" value="False" truevalue="True" falsevalue="False" label="Force sorting of SAM/BAM file by NAME"> | |
126 <help>This option can be used for for paired-end data that has many unmapped mates. Use this if you get the warning about paired end data missing or not being properly sorted.</help> | |
127 </param> | |
128 </inputs> | 147 </inputs> |
129 | 148 |
130 <outputs> | 149 <outputs> |
131 <data format="tabular" name="counts" metadata_source="samfile" label="${tool.name} on ${on_string}"> | 150 <data format="tabular" name="counts" metadata_source="samfile" label="${tool.name} on ${on_string}"> |
132 <actions> | 151 <actions> |
133 <action name="column_names" type="metadata" default="Geneid,${samfile.name}" /> | 152 <action name="column_names" type="metadata" default="Geneid,${samfile.element_identifier}" /> |
134 </actions> | 153 </actions> |
135 </data> | 154 </data> |
136 <data format="tabular" name="othercounts" metadata_source="samfile" label="${tool.name} on ${on_string} (no feature)"/> | 155 <data format="tabular" name="othercounts" metadata_source="samfile" label="${tool.name} on ${on_string} (no feature)"> |
156 <actions> | |
157 <action name="column_names" type="metadata" default="Category,${samfile.element_identifier}" /> | |
158 </actions> | |
159 </data> | |
137 <data format="bam" name="samoutfile" metadata_source="samfile" label="${tool.name} on ${on_string} (BAM)"> | 160 <data format="bam" name="samoutfile" metadata_source="samfile" label="${tool.name} on ${on_string} (BAM)"> |
138 <filter>samout_conditional['samout'] == "Yes"</filter> | 161 <filter>samout_conditional['samout'] == "Yes"</filter> |
139 </data> | 162 </data> |
140 </outputs> | 163 </outputs> |
141 | 164 |
142 <tests> | 165 <tests> |
143 <test> | 166 <test> |
144 <param name="samfile" value="htseq-test.sam" /> | 167 <param name="samfile" value="htseq-test.sam" /> |
145 <param name="gfffile" value="htseq-test.gff" /> | 168 <param name="gfffile" value="htseq-test.gff" /> |
146 <param name="samout" value="No" /> | |
147 <output name="counts" file="htseq-test_counts.tsv" /> | 169 <output name="counts" file="htseq-test_counts.tsv" /> |
148 <output name="othercounts" file="htseq-test_othercounts.tsv" /> | 170 <output name="othercounts" file="htseq-test_othercounts.tsv" /> |
149 </test> | 171 </test> |
150 <test> | 172 <test> |
151 <param name="samfile" value="htseq-test.sam" /> | 173 <param name="samfile" value="htseq-test.sam" /> |
152 <param name="gfffile" value="htseq-test.gff" /> | 174 <param name="gfffile" value="htseq-test.gff" /> |
153 <param name="samout" value="No" /> | |
154 <param name="force_sort" value="True" /> | |
155 <output name="counts" file="htseq-test_counts.tsv" /> | 175 <output name="counts" file="htseq-test_counts.tsv" /> |
156 <output name="othercounts" file="htseq-test_othercounts.tsv" /> | 176 <output name="othercounts" file="htseq-test_othercounts.tsv" /> |
157 </test> | 177 </test> |
158 <test> | 178 <test> |
159 <param name="samfile" value="htseq-test.bam" /> | 179 <param name="samfile" value="htseq-test.bam" /> |
160 <param name="gfffile" value="htseq-test.gff" /> | 180 <param name="gfffile" value="htseq-test.gff" /> |
161 <param name="samout" value="No" /> | |
162 <output name="counts" file="htseq-test_counts.tsv" /> | 181 <output name="counts" file="htseq-test_counts.tsv" /> |
163 <output name="othercounts" file="htseq-test_othercounts.tsv" /> | 182 <output name="othercounts" file="htseq-test_othercounts.tsv" /> |
164 </test> | 183 </test> |
165 <test> | 184 <test> |
166 <param name="samfile" value="htseq-test-paired.bam" /> | 185 <param name="samfile" value="htseq-test-paired.bam" /> |
167 <param name="singlepaired" value="paired" /> | 186 <param name="gfffile" value="htseq-test.gff" /> |
187 <output name="counts" file="htseq-test-paired_counts.tsv" /> | |
188 <output name="othercounts" file="htseq-test-paired_othercounts.tsv" /> | |
189 </test> | |
190 <test> | |
191 <param name="samfile" value="htseq-test-paired.bam" /> | |
168 <param name="gfffile" value="htseq-test.gff" /> | 192 <param name="gfffile" value="htseq-test.gff" /> |
169 <param name="samout" value="No" /> | 193 <param name="samout" value="No" /> |
170 <output name="counts" file="htseq-test-paired_counts.tsv" /> | 194 <output name="counts" file="htseq-test-paired_counts.tsv" /> |
171 <output name="othercounts" file="htseq-test-paired_othercounts.tsv" /> | 195 <output name="othercounts" file="htseq-test-paired_othercounts.tsv" /> |
172 </test> | 196 </test> |
173 <test> | 197 <test> |
174 <param name="samfile" value="htseq-test-paired.bam" /> | |
175 <param name="singlepaired" value="paired" /> | |
176 <param name="gfffile" value="htseq-test.gff" /> | |
177 <param name="samout" value="No" /> | |
178 <param name="force_sort" value="True" /> | |
179 <output name="counts" file="htseq-test-paired_counts.tsv" /> | |
180 <output name="othercounts" file="htseq-test-paired_othercounts.tsv" /> | |
181 </test> | |
182 <test> | |
183 <param name="samfile" value="htseq-test.sam" /> | 198 <param name="samfile" value="htseq-test.sam" /> |
184 <param name="gfffile" value="htseq-test.gff" /> | 199 <param name="gfffile" value="htseq-test.gff" /> |
200 <param name="advanced_options_selector" value="advanced" /> | |
185 <param name="samout" value="Yes" /> | 201 <param name="samout" value="Yes" /> |
186 <param name="reference_source_selector" value="history" /> | 202 <param name="reference_source_selector" value="history" /> |
187 <param name="ref_file" value="htseq-test_reference.fasta" /> | 203 <param name="ref_file" value="htseq-test_reference.fasta" /> |
188 <output name="counts" file="htseq-test_counts.tsv" /> | 204 <output name="counts" file="htseq-test_counts.tsv" /> |
189 <output name="othercounts" file="htseq-test_othercounts.tsv" /> | 205 <output name="othercounts" file="htseq-test_othercounts.tsv" /> |
190 <output name="samoutfile" file="htseq-test_samout.bam" /> | 206 <output name="samoutfile" file="htseq-test_samout.bam" /> |
207 </test> | |
208 <test> | |
209 <param name="samfile" value="htseq-test.sam" /> | |
210 <param name="gfffile" value="htseq-test.gff" /> | |
211 <param name="advanced_options_selector" value="advanced" /> | |
212 <param name="nonunique" value="all" /> | |
213 <param name="secondary_alignments" value="ignore" /> | |
214 <param name="supplementary_alignments" value="ignore" /> | |
215 <output name="counts" file="htseq-test_counts_nonunique.tsv" /> | |
216 <output name="othercounts" file="htseq-test_othercounts.tsv" /> | |
191 </test> | 217 </test> |
192 </tests> | 218 </tests> |
193 | 219 |
194 <help> | 220 <help> |
195 <![CDATA[ | 221 <![CDATA[ |
210 | 236 |
211 | 237 |
212 Overlap Modes | 238 Overlap Modes |
213 ------------- | 239 ------------- |
214 | 240 |
215 Special care must be taken to decide how to deal with reads that overlap more than one feature. | 241 Special care must be taken to decide how to deal with reads that align to or |
216 | 242 overlap with more than one feature. The ``htseq-count`` script allows to choose |
217 The htseq-count script allows to choose between three modes: *union*, *intersection-strict*, and *intersection-nonempty*. | 243 between three modes. See also the FAQ_, if the following explanation seems too |
218 | 244 technical. |
219 The following figure illustrates the effect of these three modes: | 245 |
246 The three overlap resolution modes of `htseq-count` work as follows. For each | |
247 position *i* in the read, a set *S(i)* is defined as the set of all features | |
248 overlapping position *i*. Then, consider the set *S*, which is (with *i* | |
249 running through all position within the read or a read pair) | |
250 | |
251 - the union of all the sets *S(i)* for mode ``union``. This mode is | |
252 recommended for most use cases. | |
253 - the intersection of all the sets *S(i)* for mode ``intersection-strict``. | |
254 - the intersection of all non-empty sets *S(i)* for mode | |
255 ``intersection-nonempty``. | |
256 | |
257 If *S* contains precisely one feature, the read (or read pair) is counted for | |
258 this feature. If *S* is empty, the read (or read pair) is counted as | |
259 ``no_feature``. If *S* contains more than one feature, ``htseq-count`` behaves | |
260 differently based on the ``--nonunique`` option: | |
261 | |
262 - ``--nonunique none`` (default): the read (or read pair) is counted as | |
263 ``ambiguous`` and not counted for any features. Also, if the read (or read | |
264 pair) aligns to more than one location in the reference, it is scored as | |
265 ``alignment_not_unique``. | |
266 - ``--nonunique all``: the read (or read pair) is counted as ``ambiguous`` and | |
267 is also counted in all features to which it was assigned. Also, if the read | |
268 (or read pair) aligns to more than one location in the reference, it is | |
269 scored as ``alignment_not_unique`` and also separately for each location. | |
270 | |
271 Notice that when using ``--nonunique all`` the sum of all counts will not be | |
272 equal to the number of reads (or read pairs), because those with multiple | |
273 alignments or overlaps get scored multiple times. | |
274 | |
275 The following figure illustrates the effect of these three modes and the | |
276 ``--nonunique`` option: | |
220 | 277 |
221 .. image:: count_modes.png | 278 .. image:: count_modes.png |
222 | 279 |
223 | 280 |
224 Strandedness | 281 Strandedness |
225 ------------ | 282 ------------ |
226 | 283 |
227 **Important**: The default for strandedness is yes. 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 Stranded to 'No' unless you have strand-specific data! | 284 **Important: The default for strandedness is yes. Be sure to choose the correct value.** |
228 | 285 |
286 To check which value is correct, select forward and reverse independently. If | |
287 the overall counts drop at one condition then the opposite condition is | |
288 correct, otherwise your data is not stranded. | |
229 | 289 |
230 Output | 290 Output |
231 ------ | 291 ------ |
232 | 292 |
233 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 | 293 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 |
248 | 308 |
249 Usage: htseq-count [options] sam_file gff_file | 309 Usage: htseq-count [options] sam_file gff_file |
250 | 310 |
251 This script takes an alignment file in SAM format and a feature file in GFF | 311 This script takes an alignment file in SAM format and a feature file in GFF |
252 format and calculates for each feature the number of reads mapping to it. See | 312 format and calculates for each feature the number of reads mapping to it. See |
253 http://www-huber.embl.de/users/anders/HTSeq/doc/count.html for details. | 313 https://htseq.readthedocs.io/en/release_0.9.1/count.html for details. |
254 | 314 |
255 Options: | 315 Options: |
256 -h, --help show this help message and exit | 316 -f <format>, --format=<format> |
257 -m MODE, --mode=MODE mode to handle reads overlapping more than one | 317 |
258 feature(choices: union, intersection-strict, | 318 Format of the input data. Possible values are sam (for text SAM files) and bam (for binary BAM files). Default is sam. |
259 intersection-nonempty; default: union) | 319 |
260 -s STRANDED, --stranded=STRANDED | 320 -r <order>, --order=<order> |
261 whether the data is from a strand-specific assay. | 321 |
262 Specify 'yes', 'no', or 'reverse' (default: yes). | 322 For paired-end data, the alignment have to be sorted either by read name or by alignment position. If your data is not sorted, use the samtools sort function of samtools to sort it. Use this option, with name or pos for <order> to indicate how the input data has been sorted. The default is name. |
263 'reverse' means 'yes' with reversed strand | 323 |
264 interpretation | 324 If name is indicated, htseq-count expects all the alignments for the reads of a given read pair to appear in adjacent records in the input data. For pos, this is not expected; rather, read alignments whose mate alignment have not yet been seen are kept in a buffer in memory until the mate is found. While, strictly speaking, the latter will also work with unsorted data, sorting ensures that most alignment mates appear close to each other in the data and hence the buffer is much less likely to overflow. |
265 -a MINAQUAL, --minaqual=MINAQUAL | 325 |
266 skip all reads with alignment quality lower than the | 326 --max-reads-in-buffer=<number> |
267 given minimum value (default: 0) | 327 |
268 -t FEATURETYPE, --type=FEATURETYPE | 328 When <alignment_file> is paired end sorted by position, allow only so many reads to stay in memory until the mates are found (raising this number will use more memory). Has no effect for single end or paired end sorted by name. (default: 30000000) |
269 feature type (3rd column in GFF file) to be used, all | 329 |
270 features of other type are ignored (default, suitable | 330 -s <yes/no/reverse>, --stranded=<yes/no/reverse> |
271 for Ensembl GTF files: exon) | 331 |
272 -i IDATTR, --idattr=IDATTR | 332 whether the data is from a strand-specific assay (default: yes) |
273 GFF attribute to be used as feature ID (default, | 333 |
274 suitable for Ensembl GTF files: gene_id) | 334 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. |
275 -o SAMOUT, --samout=SAMOUT | 335 |
276 write out all SAM alignment records into an output SAM | 336 -a <minaqual>, --a=<minaqual> |
277 file called SAMOUT, annotating each line with its | 337 |
278 feature assignment (as an optional field with tag | 338 skip all reads with alignment quality lower than the given minimum value (default: 10 — Note: the default used to be 0 until version 0.5.4.) |
279 'XF') | 339 |
280 -q, --quiet suppress progress report and warnings | 340 -t <feature type>, --type=<feature type> |
281 | 341 |
282 Written by Simon Anders (sanders@fs.tum.de), European Molecular Biology | 342 feature type (3rd column in GFF file) to be used, all features of other type are ignored (default, suitable for RNA-Seq analysis using an Ensembl GTF file: exon) |
283 Laboratory (EMBL). (c) 2010. Released under the terms of the GNU General | 343 |
284 Public License v3. Part of the 'HTSeq' framework. | 344 -i <id attribute>, --idattr=<id attribute> |
345 | |
346 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 analysis using an Ensembl GTF file, is gene_id. | |
347 | |
348 --additional-attr=<id attributes> | |
349 | |
350 Additional feature attributes, which will be printed as an additional column after the primary attribute column but before the counts column(s). The default is none, a suitable value to get gene names using an Ensembl GTF file is gene_name. | |
351 | |
352 -m <mode>, --mode=<mode> | |
353 | |
354 Mode to handle reads overlapping more than one feature. Possible values for <mode> are union, intersection-strict and intersection-nonempty (default: union) | |
355 | |
356 --nonunique=<nonunique mode> | |
357 | |
358 Mode to handle reads that align to or are assigned to more than one feature in the overlap <mode> of choice (see -m option). <nonunique mode> are none and all (default: none) | |
359 | |
360 --secondary-alignments=<mode> | |
361 | |
362 Mode to handle secondary alignments (SAM flag 0x100). <mode> can be score and ignore (default: score) | |
363 | |
364 --supplementary-alignments=<mode> | |
365 | |
366 Mode to handle supplementary/chimeric alignments (SAM flag 0x800). <mode> can be score and ignore (default: score) | |
367 | |
368 -o <samout>, --samout=<samout> | |
369 | |
370 write out all SAM alignment records into an output SAM file called <samout>, annotating each line with its assignment to a feature or a special counter (as an optional field with tag ‘XF’) | |
371 | |
372 -q, --quiet | |
373 | |
374 suppress progress report and warnings | |
375 | |
376 -h, --help | |
377 | |
378 Show a usage summary and exit | |
379 | |
380 .. _FAQ: https://htseq.readthedocs.io/en/release_0.9.1/count.html#frequenctly-asked-questions | |
381 | |
285 ]]> | 382 ]]> |
286 </help> | 383 </help> |
287 <citations> | 384 <citations> |
288 <citation type="doi">10.1093/bioinformatics/btu638</citation> | 385 <citation type="doi">10.1093/bioinformatics/btu638</citation> |
289 </citations> | 386 </citations> |