comparison htseq-count.xml @ 20:3b3601a2a7c7 draft

planemo upload for repository https://github.com/lparsons/galaxy_tools/tree/master/tools/htseq_count commit 8a40cf16ce0b48cdfda88a505869e77e8826cb23
author lparsons
date Mon, 22 Jun 2015 17:01:05 -0400
parents d5edaf8dc974
children a6dcb86af112
comparison
equal deleted inserted replaced
19:6f920f33c5eb 20:3b3601a2a7c7
1 <tool id="htseq_count" name="htseq-count" version="0.4.1"> 1 <tool id="htseq_count" name="htseq-count" version="0.6.1galaxy1">
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 <version_command>htseq-count -h | grep version | sed 's/^\(.*\)*\(version .*\)\./\2/'</version_command>
4 <requirements> 3 <requirements>
5 <requirement type="package" version="1.7.1">numpy</requirement>
6 <requirement type="package" version="0.6.1">htseq</requirement> 4 <requirement type="package" version="0.6.1">htseq</requirement>
7 <requirement type="package" version="0.1.19">samtools</requirement> 5 <requirement type="package" version="0.1.19">samtools</requirement>
8 <requirement type="package" version="0.7.7">pysam</requirement> 6 <requirement type="package" version="0.7.7">pysam</requirement>
9 </requirements> 7 </requirements>
10 <command> 8
9 <stdio>
10 <exit_code range="1:" level="fatal" description="Unknown error occurred" />
11 <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" />
12 <regex match="samtools: (command ){0,1}not found" source="stderr" level="fatal" description="The samtools package is not properly installed, contact Galaxy administrators" />
13 <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'" />
14 <regex match="Error occured in line (\d+) of file" source="stderr" level="fatal" description="Unknown error parsing the GFF file" />
15 <regex match="Error" source="stderr" level="fatal" description="Unknown error occured" />
16 <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." />
17 </stdio>
18
19 <version_command>htseq-count -h | grep version | sed 's/^\(.*\)*\(version .*\)\./\2/'</version_command>
20
21 <command><![CDATA[
11 ##set up input files 22 ##set up input files
12 #set $reference_fasta_filename = "localref.fa" 23 #set $reference_fasta_filename = "localref.fa"
13 #if $samout_conditional.samout: 24 #if $samout_conditional.samout:
14 #if str( $samout_conditional.reference_source.reference_source_selector ) == "history": 25 #if str( $samout_conditional.reference_source.reference_source_selector ) == "history":
15 ln -s "${samout_conditional.reference_source.ref_file}" "${reference_fasta_filename}" &amp;&amp; 26 ln -s "${samout_conditional.reference_source.ref_file}" "${reference_fasta_filename}" &&
16 samtools faidx "${reference_fasta_filename}" 2&gt;&amp;1 || echo "Error running samtools faidx for htseq-count" &gt;&amp;2 &amp;&amp; 27 samtools faidx "${reference_fasta_filename}" 2>&1 || echo "Error running samtools faidx for htseq-count" >&2 &&
17 #else: 28 #else:
18 #set $reference_fasta_filename = str( $samout_conditional.reference_source.ref_file.fields.path ) 29 #set $reference_fasta_filename = str( $samout_conditional.reference_source.ref_file.fields.path )
19 #end if 30 #end if
20 #end if 31 #end if
21 htseq-count 32 #if $force_sort:
22 --format=$samfile.extension 33 #if $samfile.extension == 'bam':
23 --order=pos 34 samtools sort -n "$samfile" "name_sorted_alignment" &&
24 --mode=$mode 35 #else
25 --stranded=$stranded 36 samtools view -Su -t ${reference_fasta_filename}.fai "$samfile" | samtools sort -n - "name_sorted_alignment" &&
26 --minaqual=$minaqual 37 #end if
27 --type=$featuretype 38 #end if
28 --idattr=$idattr 39 htseq-count
40 --mode=$mode
41 --stranded=$stranded
42 --minaqual=$minaqual
43 --type="$featuretype"
44 --idattr="$idattr"
29 #if $samout_conditional.samout: 45 #if $samout_conditional.samout:
30 --samout=$__new_file_path__/${samoutfile.id}_tmp 46 --samout=$__new_file_path__/${samoutfile.id}_tmp
31 #end if 47 #end if
32 $samfile 48 #if $force_sort:
33 $gfffile 49 --order=name
34 | awk '{if ($1 ~ "no_feature|ambiguous|too_low_aQual|not_aligned|alignment_not_unique") print $0 | "cat 1>&amp;2"; else print $0}' &gt; $counts 2&gt;$othercounts 50 --format=bam
51 name_sorted_alignment.bam
52 #else
53 --order=pos
54 --format=$samfile.extension
55 $samfile
56 #end if
57 "$gfffile"
58 | awk '{if ($1 ~ "no_feature|ambiguous|too_low_aQual|not_aligned|alignment_not_unique") print $0 | "cat 1>&2"; else print $0}' > $counts 2>$othercounts
35 #if $samout_conditional.samout: 59 #if $samout_conditional.samout:
36 &amp;&amp; samtools view -Su -t ${reference_fasta_filename}.fai $__new_file_path__/${samoutfile.id}_tmp | samtools sort -o - sorted > $samoutfile 60 && samtools view -Su -t ${reference_fasta_filename}.fai $__new_file_path__/${samoutfile.id}_tmp | samtools sort -o - sorted > $samoutfile
37 #end if</command> 61 #end if
62 ]]>
63 </command>
64
38 <inputs> 65 <inputs>
39 <param format="sam,bam" name="samfile" type="data" label="Aligned SAM/BAM File"/> 66 <param format="sam,bam" name="samfile" type="data" label="Aligned SAM/BAM File"/>
40 <param format="gff" name="gfffile" type="data" label="GFF File"/> 67 <param format="gff" name="gfffile" type="data" label="GFF File"/>
41 <param name="mode" type="select" label="Mode"> 68 <param name="mode" type="select" label="Mode" help="(--mode)">
42 <help>Mode to handle reads overlapping more than one feature.</help> 69 <help>Mode to handle reads overlapping more than one feature.</help>
43 <option value="union" selected="true">Union</option> 70 <option value="union" selected="true">Union</option>
44 <option value="intersection-strict">Intersection (strict)</option> 71 <option value="intersection-strict">Intersection (strict)</option>
45 <option value="intersection-nonempty">Intersection (nonempty)</option> 72 <option value="intersection-nonempty">Intersection (nonempty)</option>
46 </param> 73 </param>
47 <param name="stranded" type="select" label="Stranded"> 74 <param name="stranded" type="select" label="Stranded" help="(--stranded)">
48 <help>Specify whether the data is from a strand-specific assay. 'Reverse' means yes with reversed strand interpretation.</help> 75 <help>Specify whether the data is from a strand-specific assay. 'Reverse' means yes with reversed strand interpretation.</help>
49 <option value="yes" selected="true">Yes</option> 76 <option value="yes" selected="true">Yes</option>
50 <option value="no">No</option> 77 <option value="no">No</option>
51 <option value="reverse">Reverse</option> 78 <option value="reverse">Reverse</option>
52 </param> 79 </param>
53 <param name="minaqual" type="integer" value="10" label="Minimum alignment quality"> 80 <param name="minaqual" type="integer" value="10" label="Minimum alignment quality">
54 <help>Skip all reads with alignment quality lower than the given minimum value</help> 81 <help>Skip all reads with alignment quality lower than the given minimum value. (-minaqual)</help>
55 </param> 82 </param>
56 <param name="featuretype" type="text" value="exon" label="Feature type"> 83 <param name="featuretype" type="text" value="exon" label="Feature type">
57 <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> 84 <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. (--type)</help>
58 </param> 85 </param>
59 <param name="idattr" type="text" value="gene_id" label="ID Attribute"> 86 <param name="idattr" type="text" value="gene_id" label="ID Attribute">
60 <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> 87 <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>
61 </param> 88 </param>
62 <conditional name="samout_conditional"> 89 <conditional name="samout_conditional">
63 <param name="samout" type="boolean" value="False" truevalue="True" falsevalue="False" label="Additional BAM Output"> 90 <param name="samout" type="boolean" value="False" truevalue="True" falsevalue="False" label="Additional BAM Output">
64 <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> 91 <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>
65 </param> 92 </param>
66 <when value="True"> 93 <when value="True">
67 <conditional name="reference_source"> 94 <conditional name="reference_source">
68 <param name="reference_source_selector" type="select" label="Choose the source for the reference list"> 95 <param name="reference_source_selector" type="select" label="Choose the source for the reference list">
69 <option value="cached">Locally cached</option> 96 <option value="cached">Locally cached</option>
70 <option value="history">History</option> 97 <option value="history">History</option>
71 </param> 98 </param>
81 <param name="ref_file" type="data" format="fasta" label="Using reference file" /> 108 <param name="ref_file" type="data" format="fasta" label="Using reference file" />
82 </when> 109 </when>
83 </conditional> 110 </conditional>
84 </when> 111 </when>
85 </conditional> 112 </conditional>
113 <param name="force_sort" type="boolean" value="False" truevalue="True" falsevalue="False" label="Force sorting of SAM/BAM file by NAME">
114 <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>
115 </param>
86 </inputs> 116 </inputs>
87 117
88 <outputs> 118 <outputs>
89 <data format="tabular" name="counts" metadata_source="samfile" label="${tool.name} on ${on_string}"/> 119 <data format="tabular" name="counts" metadata_source="samfile" label="${tool.name} on ${on_string}"/>
90 <data format="tabular" name="othercounts" metadata_source="samfile" label="${tool.name} on ${on_string} (no feature)"/> 120 <data format="tabular" name="othercounts" metadata_source="samfile" label="${tool.name} on ${on_string} (no feature)"/>
91 <data format="bam" name="samoutfile" metadata_source="samfile" label="${tool.name} on ${on_string} (BAM)"> 121 <data format="bam" name="samoutfile" metadata_source="samfile" label="${tool.name} on ${on_string} (BAM)">
92 <filter>samout_conditional['samout']</filter> 122 <filter>samout_conditional['samout']</filter>
93 </data> 123 </data>
94 </outputs> 124 </outputs>
95 125
96 <stdio>
97 <exit_code range="1:" level="fatal" description="Unknown error occurred" />
98 <regex match="htseq-count: command not found" source="stderr" level="fatal" description="The HTSeq python package is not properly installed, contact Galaxy administrators" />
99 <regex match="samtools: command not found" source="stderr" level="fatal" description="The samtools package is not properly installed, contact Galaxy administrators" />
100 <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'" />
101 <regex match="Error occured in line (\d+) of file" source="stderr" level="fatal" description="Unknown error parsing the GFF file" />
102 <regex match="Error" source="stderr" level="fatal" description="Unknown error occured" />
103 <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 paired-end option. See stderr output of this dataset for more information." />
104 </stdio>
105
106 <tests> 126 <tests>
107 <test> 127 <test>
108 <param name="samfile" value="htseq-test.sam" /> 128 <param name="samfile" value="htseq-test.sam" />
109 <param name="gfffile" value="htseq-test.gff" /> 129 <param name="gfffile" value="htseq-test.gff" />
110 <param name="samout" value="False" /> 130 <param name="samout" value="False" />
111 <output name="counts" file="htseq-test_counts.tsv" /> 131 <output name="counts" file="htseq-test_counts.tsv" />
112 <output name="othercounts" file="htseq-test_othercounts.tsv" /> 132 <output name="othercounts" file="htseq-test_othercounts.tsv" />
113 </test> 133 </test>
114 <test> 134 <test>
115 <param name="samfile" value="htseq-test.bam" /> 135 <param name="samfile" value="htseq-test.sam" />
116 <param name="gfffile" value="htseq-test.gff" /> 136 <param name="gfffile" value="htseq-test.gff" />
117 <param name="samout" value="False" /> 137 <param name="samout" value="False" />
138 <param name="force_sort" value="True" />
118 <output name="counts" file="htseq-test_counts.tsv" /> 139 <output name="counts" file="htseq-test_counts.tsv" />
119 <output name="othercounts" file="htseq-test_othercounts.tsv" /> 140 <output name="othercounts" file="htseq-test_othercounts.tsv" />
120 </test> 141 </test>
121 <test> 142 <test>
143 <param name="samfile" value="htseq-test.bam" />
144 <param name="gfffile" value="htseq-test.gff" />
145 <param name="samout" value="False" />
146 <output name="counts" file="htseq-test_counts.tsv" />
147 <output name="othercounts" file="htseq-test_othercounts.tsv" />
148 </test>
149 <test>
122 <param name="samfile" value="htseq-test-paired.bam" /> 150 <param name="samfile" value="htseq-test-paired.bam" />
123 <param name="singlepaired" value="paired" /> 151 <param name="singlepaired" value="paired" />
124 <param name="gfffile" value="htseq-test.gff" /> 152 <param name="gfffile" value="htseq-test.gff" />
125 <param name="samout" value="False" /> 153 <param name="samout" value="False" />
126 <output name="counts" file="htseq-test-paired_counts.tsv" /> 154 <output name="counts" file="htseq-test-paired_counts.tsv" />
127 <output name="othercounts" file="htseq-test-paired_othercounts.tsv" /> 155 <output name="othercounts" file="htseq-test-paired_othercounts.tsv" />
128 </test> 156 </test>
157 <test>
158 <param name="samfile" value="htseq-test-paired.bam" />
159 <param name="singlepaired" value="paired" />
160 <param name="gfffile" value="htseq-test.gff" />
161 <param name="samout" value="False" />
162 <param name="force_sort" value="True" />
163 <output name="counts" file="htseq-test-paired_counts.tsv" />
164 <output name="othercounts" file="htseq-test-paired_othercounts.tsv" />
165 </test>
166
129 <!-- Seems to be an issue setting the $reference_fasta_filename variable during test 167 <!-- Seems to be an issue setting the $reference_fasta_filename variable during test
130 <test> 168 <test>
131 <param name="samfile" value="htseq-test.sam" /> 169 <param name="samfile" value="htseq-test.sam" />
132 <param name="gfffile" value="htseq-test.gff" /> 170 <param name="gfffile" value="htseq-test.gff" />
133 <param name="samout" value="True" /> 171 <param name="samout" value="True" />
139 </test> 177 </test>
140 --> 178 -->
141 </tests> 179 </tests>
142 180
143 <help> 181 <help>
182 <![CDATA[
144 Overview 183 Overview
145 -------- 184 --------
146 185
147 This tool takes an alignment file in SAM or BAM format and feature file in GFF format 186 This tool takes an alignment file in SAM or BAM format and feature file in GFF format
148 and calculates the number of reads mapping to each feature. It uses the *htseq-count* 187 and calculates the number of reads mapping to each feature. It uses the *htseq-count*
149 script that is part of the HTSeq python module. See 188 script that is part of the HTSeq python module. See
150 http://www-huber.embl.de/users/anders/HTSeq/doc/count.html for details. 189 http://www-huber.embl.de/users/anders/HTSeq/doc/count.html for details.
151 190
152 A feature is an interval (i.e., a range of positions) on a chromosome or a union of 191 A feature is an interval (i.e., a range of positions) on a chromosome or a union of
153 such intervals. In the case of RNA-Seq, the features are typically genes, where 192 such intervals. In the case of RNA-Seq, the features are typically genes, where
154 each gene is considered here as the union of all its exons. One may also consider 193 each gene is considered here as the union of all its exons. One may also consider
155 each exon as a feature, e.g., in order to check for alternative splicing. For 194 each exon as a feature, e.g., in order to check for alternative splicing. For
156 comparative ChIP-Seq, the features might be binding regions from a pre-determined 195 comparative ChIP-Seq, the features might be binding regions from a pre-determined
157 list. 196 list.
158 197
159 198
160 Overlap Modes 199 Overlap Modes
161 ------------- 200 -------------
162 201
163 Special care must be taken to decide how to deal with reads that overlap more than one feature. 202 Special care must be taken to decide how to deal with reads that overlap more than one feature.
164 203
165 The htseq-count script allows to choose between three modes: *union*, *intersection-strict*, and *intersection-nonempty*. 204 The htseq-count script allows to choose between three modes: *union*, *intersection-strict*, and *intersection-nonempty*.
166 205
167 The following figure illustrates the effect of these three modes: 206 The following figure illustrates the effect of these three modes:
168 207
228 -q, --quiet suppress progress report and warnings 267 -q, --quiet suppress progress report and warnings
229 268
230 Written by Simon Anders (sanders@fs.tum.de), European Molecular Biology 269 Written by Simon Anders (sanders@fs.tum.de), European Molecular Biology
231 Laboratory (EMBL). (c) 2010. Released under the terms of the GNU General 270 Laboratory (EMBL). (c) 2010. Released under the terms of the GNU General
232 Public License v3. Part of the 'HTSeq' framework. 271 Public License v3. Part of the 'HTSeq' framework.
272 ]]>
233 </help> 273 </help>
274
275 <citations>
276 <citation type="bibtex">
277 @article{anders_htseqpython_2015,
278 title = {{HTSeq}—a {Python} framework to work with high-throughput sequencing data},
279 volume = {31},
280 issn = {1367-4803, 1460-2059},
281 url = {http://bioinformatics.oxfordjournals.org/content/31/2/166},
282 doi = {10.1093/bioinformatics/btu638},
283 abstract = {Motivation: A large choice of tools exists for many standard tasks in the analysis of high-throughput sequencing (HTS) data. However, once a project deviates from standard workflows, custom scripts are needed.
284 Results: We present HTSeq, a Python library to facilitate the rapid development of such scripts. HTSeq offers parsers for many common data formats in HTS projects, as well as classes to represent data, such as genomic coordinates, sequences, sequencing reads, alignments, gene model information and variant calls, and provides data structures that allow for querying via genomic coordinates. We also present htseq-count, a tool developed with HTSeq that preprocesses RNA-Seq data for differential expression analysis by counting the overlap of reads with genes.
285 Availability and implementation: HTSeq is released as an open-source software under the GNU General Public Licence and available from http://www-huber.embl.de/HTSeq or from the Python Package Index at https://pypi.python.org/pypi/HTSeq.
286 Contact: sanders\{at\}fs.tum.de},
287 language = {en},
288 number = {2},
289 urldate = {2015-04-21},
290 journal = {Bioinformatics},
291 author = {Anders, Simon and Pyl, Paul Theodor and Huber, Wolfgang},
292 month = jan,
293 year = {2015},
294 pmid = {25260700},
295 pages = {166--169},
296 file = {Full Text PDF:/Users/lparsons/Library/Application Support/Firefox/Profiles/thd2t4je.default/zotero/storage/84XQB8V6/Anders et al. - 2015 - HTSeq—a Python framework to work with high-through.pdf:application/pdf;Snapshot:/Users/lparsons/Library/Application Support/Firefox/Profiles/thd2t4je.default/zotero/storage/JKUAUCKB/166.html:text/html}
297 }
298 </citation>
299 </citations>
234 </tool> 300 </tool>