0
|
1 <tool id="subread_featurecounts" name="FeatureCount from subread" version="1.5.0-p1">
|
|
2 <description>Runs FeatureCount from subread</description>
|
|
3 <requirements>
|
|
4 <requirement type="package" version="1.5.0-p1">subread</requirement>
|
|
5 </requirements>
|
|
6 <stdio>
|
|
7 <exit_code range="1" level="fatal" description="Error code 1 occurred" />
|
|
8 <exit_code range="2:255" level="fatal" description="Unknown error occurred" />
|
|
9 </stdio>
|
|
10 <command>
|
|
11 featureCounts -p -t exon -g gene_id
|
|
12 #if $reference_source.reference_source_selector=='history':
|
|
13 -a $reference_source.ref_file
|
|
14 #end if
|
|
15 #if $reference_source.reference_source_selector=='cached':
|
|
16 -a $reference_source.ref_path.fields.path
|
|
17 #end if
|
|
18 -o counts
|
|
19 #if $names_source.names_source_selector=='manual':
|
|
20 #for $s in $names_source.input_serie
|
|
21 $s.input_file
|
|
22 #end for
|
|
23 #else
|
|
24 #for $input in $names_source.inputs
|
|
25 "${input}"
|
|
26 #end for
|
|
27 #end if
|
|
28 ;
|
|
29 #if $names_source.names_source_selector in ["file","manual"]:
|
|
30 python $__tool_directory__/name_changer.py
|
|
31 --raw_count_file counts --fixed_count_file ${output}
|
|
32 --raw_summary_file counts.summary --fixed_summary_file "${summary}"
|
|
33 #if $names_source.names_source_selector=='file':
|
|
34 --names_file ${names_source.names_file}
|
|
35 #if $names_source.names_prefix:
|
|
36 --names_prefix ${names_source.names_prefix}
|
|
37 #end if
|
|
38 #else:
|
|
39 #for $s in $names_source.input_serie
|
|
40 --new_name $s.new_name
|
|
41 #end for
|
|
42 #end if
|
|
43 #else
|
|
44 cp counts "${output}" ;
|
|
45 cp counts.summary "${summary}"
|
|
46 #end if
|
|
47 </command>
|
|
48 <inputs>
|
|
49 <conditional name="reference_source">
|
|
50 <param name="reference_source_selector" type="select" label="Choose the source for the gene_transfer (gtf) file.">
|
|
51 <option value="cached">Locally cached</option>
|
|
52 <option value="history">History</option>
|
|
53 </param>
|
|
54 <when value="cached">
|
|
55 <param name="ref_path" type="select" label="Using reference gene transfer">
|
|
56 <options from_data_table="gene_transfer"/>
|
|
57 <validator type="no_options" message="A built-in reference gene transfer is not available."/>
|
|
58 </param>
|
|
59 </when>
|
|
60 <when value="history">
|
|
61 <param name="ref_file" type="data" format="gtf" label="Using reference file" />
|
|
62 </when>
|
|
63 </conditional>
|
|
64 <conditional name="names_source">
|
|
65 <param name="names_source_selector" type="select" label="How are the inputs organized?">
|
|
66 <option value="file">Collection of /Multiple bam file plus File with list of names.</option>
|
|
67 <option value="galaxy_path">Collection of /Multiple bam files, but no file with list of names.</option>
|
|
68 <option value="manual">Manually enter each file and a name for that file.</option>
|
|
69 </param>
|
|
70 <when value="file">
|
|
71 <param name="inputs" format="bam" multiple="True" label="Bam file(s) to count Features of" type="data" />
|
|
72 <param name="names_file" format="txt"
|
|
73 label="File which has the names for the columns. Note start and end strings shared by every name will be removed"
|
|
74 type="data" />
|
|
75 <param name="names_prefix" size="30" type="text" value="" label="Prefix to add before every column name"/>
|
|
76 </when>
|
|
77 <when value="manual">
|
|
78 <repeat name="input_serie" title="Files and names to add">
|
|
79 <param name="input_file" format="bam" label="Bam file to count Features of" type="data" />
|
|
80 <param name="new_name" size="30" type="text" value="" label="Name for that column"/>
|
|
81 </repeat>
|
|
82 </when>
|
|
83 <when value="galaxy_path">
|
|
84 <param name="inputs" format="bam" multiple="True" label="Bam file(s) to count Features of" type="data" />
|
|
85 </when>
|
|
86 </conditional>
|
|
87 </inputs>
|
|
88 <outputs>
|
|
89 <data format="tabular" name="output" label="Counted Features" />
|
|
90 <data format="tabular" name="summary" label="Feature Count Summary" />
|
|
91 </outputs>
|
|
92 <tests>
|
|
93 <!-- Test data too large to be included but can be found at
|
|
94 https://github.com/Christian-B/galaxy_shedtools/tree/master/subread_featurecounts -->
|
|
95 <test>
|
|
96 <param ftype="bam" name="inputs" value="C75_sorted.bam" />
|
|
97 <param name="reference_source|reference_source_selector" value="cached"/>
|
|
98 <param ftype="gtf" name="reference_source|ref_path" value="gencode.vM5" />
|
|
99 <param name="names_source|names_source_selector" value="galaxy_path"/>
|
|
100 <output name="output" file="C75_FeatureCounts.tsv" ftype="tabular" compare="sim_size" delta="10000"/>
|
|
101 <output name="summary">
|
|
102 <assert_contents>
|
|
103 <has_text text="Unassigned_Ambiguity" />
|
|
104 </assert_contents>
|
|
105 </output>
|
|
106 </test>
|
|
107 <test>
|
|
108 <param ftype="bam" name="inputs" value="C01_sorted.bam,C02_sorted.bam,C75_sorted.bam" />
|
|
109 <param name="reference_source|reference_source_selector" value="history"/>
|
|
110 <param ftype="gtf" name="reference_source|ref_file" value="/home/christian/Dropbox/Gene_data/gencode.vM5.annotation.gtf" />
|
|
111 <param name="names_source|names_source_selector" value="file"/>
|
|
112 <param ftype="txt" name="names_source|names_file" value="names.dat" />
|
|
113 <param name="names_source|names_prefix" value="prefix_"/>
|
|
114 <output name="output">
|
|
115 <assert_contents>
|
|
116 <has_text text="prefix__1" />
|
|
117 <has_text text="prefix__2" />
|
|
118 <has_text text="prefix_75" />
|
|
119 </assert_contents>
|
|
120 </output>
|
|
121 <output name="summary">
|
|
122 <assert_contents>
|
|
123 <has_text text="Unassigned_Ambiguity" />
|
|
124 </assert_contents>
|
|
125 </output>
|
|
126 </test>
|
|
127 <test>
|
|
128 <param name="reference_source|reference_source_selector" value="history"/>
|
|
129 <param ftype="gtf" name="reference_source|ref_file" value="/home/christian/Dropbox/Gene_data/gencode.vM5.annotation.gtf" />
|
|
130 <param name="names_source|names_source_selector" value="manual"/>
|
|
131 <param ftype="bam" name="names_source|input_serie_0|input_file" value="C01_sorted.bam" />
|
|
132 <param name="names_source|input_serie_0|new_name" value="ForC1"/>
|
|
133 <param ftype="bam" name="names_source|input_serie_1|input_file" value="C02_sorted.bam" />
|
|
134 <param name="names_source|input_serie_1|new_name" value="ForC2"/>
|
|
135 <param ftype="bam" name="names_source|input_serie_2|input_file" value="C75_sorted.bam" />
|
|
136 <param name="names_source|input_serie_2|new_name" value="ForC75"/>
|
|
137 <output name="output">
|
|
138 <assert_contents>
|
|
139 <has_text text="ForC1" />
|
|
140 <has_text text="ForC2" />
|
|
141 <has_text text="ForC75" />
|
|
142 </assert_contents>
|
|
143 </output>
|
|
144 <output name="summary">
|
|
145 <assert_contents>
|
|
146 <has_text text="Unassigned_Ambiguity" />
|
|
147 </assert_contents>
|
|
148 </output>
|
|
149 </test>
|
|
150 </tests>
|
|
151 <help>
|
|
152 <![CDATA[
|
|
153 This tool runs subread's Featurecounts function.
|
|
154
|
|
155 Feature count labels the data columns with the input file names. Which will be the .../000/024.dat style names used by galaxy.
|
|
156
|
|
157 This tool therefor post processes the result changing these column names with either values found in a file or entered manually.
|
|
158 In each case every name can be prefixed with the same value
|
|
159 ]]>
|
|
160 </help>
|
|
161 <citations>
|
|
162 <citation type="bibtex">
|
|
163 @misc{
|
|
164 Subread,
|
|
165 author = {Liao Y, Smyth GK and Shi W},
|
|
166 title = {Subread (incl FeatureCount on SourceForge},
|
|
167 url = {http://subread.sourceforge.net/}
|
|
168 }
|
|
169 </citation>
|
|
170 <citation type="doi">10.1093/bioinformatics/btt656</citation>
|
|
171 <citation type="doi">10.1093/nar/gkt214</citation>
|
|
172 </citations>
|
|
173
|
|
174 </tool>
|