annotate vsnp_sample_names.xml @ 0:f75e2ac7b6cd draft

Uploaded
author greg
date Tue, 21 Apr 2020 10:17:20 -0400
parents
children 895d18fcfebe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
1 <tool id="vsnp_sample_names" name="vSNP: sample names" version="1.0.0">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
2 <description></description>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
3 <command detect_errors="exit_code"><![CDATA[
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
4 #import os
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
5 #import re
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
6 #set output_dir = 'output'
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
7 mkdir -p $output_dir
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
8 #if str($input_type_cond.input_type) == "single":
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
9 ## We may have a single read or a pair, but in
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
10 ## either case we want the same base file name.
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
11 #set sample_name = $os.path.basename($input_type_cond.read.element_identifier)
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
12 #if $sample_name.find(".") > 0:
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
13 #set sample_name = $sample_name.split(".")[0]
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
14 #end if
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
15 #if $sample_name.find("_") > 0:
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
16 #set sample_name = $sample_name.split("_")[0]
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
17 #end if
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
18 echo $sample_name > $output
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
19 #else:
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
20 #for $i in $input_type_cond.reads_collection:
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
21 #set sample_name = $os.path.basename($i.element_identifier)
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
22 #if $sample_name.find(".") > 0:
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
23 #set sample_name = $sample_name.split(".")[0]
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
24 #end if
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
25 #set output_file = $os.path.join($output_dir, $sample_name)
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
26 && echo $sample_name > $output_file
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
27 #end for
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
28 #end if
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
29 ]]></command>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
30 <inputs>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
31 <conditional name="input_type_cond">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
32 <param name="input_type" type="select" label="Choose the category of the files to be analyzed">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
33 <option value="single" selected="true">Single files</option>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
34 <option value="collection">Collections of files</option>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
35 </param>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
36 <when value="single">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
37 <param name="read" type="data" format="fastqsanger.gz,fastqsanger" label="Sample file"/>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
38 </when>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
39 <when value="collection">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
40 <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="list" label="Collection of sample files"/>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
41 </when>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
42 </conditional>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
43 </inputs>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
44 <outputs>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
45 <data name="output" format="txt">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
46 <filter>input_type_cond['input_type'] == 'single'</filter>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
47 </data>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
48 <collection name="output__collection" type="list">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
49 <discover_datasets pattern="__name__" directory="output" format="txt" />
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
50 <filter>input_type_cond['input_type'] == 'collection'</filter>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
51 </collection>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
52 </outputs>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
53 <tests>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
54 <test>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
55 <param name="input_type" value="collection"/>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
56 <param name="reads_collection">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
57 <collection type="list">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
58 <element name="BCG_Danish_Human_UK_SRR9596061.fastq" value="BCG_Danish_Human_UK_SRR9596061.fastq" dbkey="89"/>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
59 <element name="Dassie_Dassie_ZA_SRR3745455.fastq" value="Dassie_Dassie_ZA_SRR3745455.fastq" dbkey="89"/>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
60 <element name="Mbov_Cattle_NI_SRR10993937.fastq" value="Mbov_Cattle_NI_SRR10993937.fastq" dbkey="89"/>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
61 </collection>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
62 </param>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
63 <output_collection name="output__collection" type="list">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
64 <element name="BCG_Danish_Human_UK_SRR9596061" file="BCG_Danish_Human_UK_SRR9596061" ftype="txt"/>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
65 <element name="Dassie_Dassie_ZA_SRR3745455" file="Dassie_Dassie_ZA_SRR3745455" ftype="txt"/>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
66 <element name="Mbov_Cattle_NI_SRR10993937" file="Mbov_Cattle_NI_SRR10993937" ftype="txt"/>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
67 </output_collection>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
68 </test>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
69 </tests>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
70 <help>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
71 **What it does**
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
72
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
73 Accepts one or more sample files and extracts a unique portion of the file name as the content of the output file(s). These
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
74 text files are then used as workflow parameter values for the Read Group Identifier parameter in the bwa-mem tool.
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
75
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
76 **Required Options**
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
77
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
78 * **Choose the category of the files to be analyzed** - select "Single files" or "Collections of files", then select the appropriate history items (single or paired fastqsanger reads or collections of fastqsanger reads) based on the selected option.
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
79 </help>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
80 <citations>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
81 <citation type="bibtex">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
82 @misc{None,
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
83 journal = {None},
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
84 author = {1. Stuber T},
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
85 title = {Manuscript in preparation},
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
86 year = {None},
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
87 url = {https://github.com/USDA-VS/vSNP},}
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
88 </citation>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
89 </citations>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
90 </tool>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
91