annotate vsnp_sample_names.xml @ 4:67e3fa4bbc53 draft

"planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit ff2ce94ece2147f04cf0f1964ed716012422d50f"
author greg
date Wed, 16 Jun 2021 17:06:16 +0000
parents fb3defef50e5
children e1cb13d6a82c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
1 <tool id="vsnp_sample_names" name="vSNP: sample names" version="@WRAPPER_VERSION@.1" profile="@PROFILE@">
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
2 <description></description>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
3 <macros>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
4 <import>macros.xml</import>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
5 </macros>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
6 <command detect_errors="exit_code"><![CDATA[
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
7 #import os
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
8 #import re
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
9
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
10 #set sample_name_read2 = None
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
11
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
12 #if $input_type_cond.input_type in ['single', 'pair']:
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
13 #set read1 = $input_type_cond.read1
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
14 #set sample_name = re.sub('[^\s\w\-]', '_', str($read1.element_identifier))
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
15 #else:
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
16 #set read1_filename = $input_type_cond.reads_collection['forward'].name
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
17 #set sample_name = re.sub('[^\s\w\-]', '_', str($read1_filename))
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
18 #end if
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
19
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
20 #if $sample_name.find('_R1') >0:
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
21 ## Something like CMC_20E1_R1.fastq.gz
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
22 #set sample_name = $sample_name.split('_R1')[0]
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
23 #else if $sample_name.find(".") > 0:
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
24 #if $read1.is_of_type('fastqsanger.gz'):
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
25 ## Something like my_sample.fastq.gz
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
26 #set sample_name = '.'.join($sample_name.split('.')[0:-2])
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
27 #else:
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
28 ## Something like my_sample.fastq
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
29 #set sample_name = $os.path.splitext($sample_name)[0]
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
30 #end if
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
31 #else if $sample_name.find("_") > 0:
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
32 #if $read1.is_of_type('fastqsanger.gz'):
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
33 ## Something like my_sample_fastq_gz
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
34 #set sample_name = '_'.join($sample_name.split('_')[0:-2])
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
35 #else:
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
36 ## Something like my_sample_fastq
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
37 #set sample_name = "_".join($sample_name.split("_")[0:-1])
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
38 #end if
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
39 #end if
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
40 echo '$sample_name' > '$output'
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
41 ]]></command>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
42 <inputs>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
43 <conditional name="input_type_cond">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
44 <param name="input_type" type="select" label="Choose the category of the files to be analyzed">
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
45 <option value="single" selected="true">Single dataset</option>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
46 <option value="pair">Dataset pair</option>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
47 <option value="paired">List of dataset pairs</option>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
48 </param>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
49 <when value="single">
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
50 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
51 </when>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
52 <when value="paired">
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
53 <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="paired" label="Collection of fastqsanger paired read files"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
54 </when>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
55 <when value="pair">
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
56 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
57 <param name="read2" type="data" format="fastqsanger.gz,fastqsanger" label="Read2 fastq file"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
58 </when>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
59 </conditional>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
60 </inputs>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
61 <outputs>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
62 <data name="output" format="txt"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
63 </outputs>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
64 <tests>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
65 <!-- Single files -->
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
66 <test>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
67 <param name="input_type" value="single"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
68 <param name="read1" value="CMC_20E1_R1.fastq.gz" dbkey="89"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
69 <output name="output" file="sample_names.txt" ftype="txt"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
70 </test>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
71 <!-- Paired reads -->
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
72 <test>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
73 <param name="input_type" value="paired"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
74 <param name="reads_collection">
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
75 <collection type="paired">
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
76 <element name="forward" value="CMC_20E1_R1.fastq.gz"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
77 <element name="reverse" value="CMC_20E1_R2.fastq.gz"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
78 </collection>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
79 </param>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
80 <output name="output" file="sample_names.txt" ftype="txt"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
81 </test>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
82 <!-- Paired reads in separate datasets -->
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
83 <test>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
84 <param name="input_type" value="pair"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
85 <param name="read1" value="CMC_20E1_R1.fastq.gz" dbkey="89"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
86 <param name="read2" value="CMC_20E1_R2.fastq.gz" dbkey="89"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
87 <output name="output" file="sample_names.txt" ftype="txt"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
88 </test>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
89 </tests>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
90 <help>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
91 **What it does**
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
92
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
93 Accepts fastqsanger sample files, extracts a unique portion of the file name as the sample name, and writes it to
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
94 the output. The output text file can be consumed by the **Parse parameter value** expression tool to provide workflow
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
95 parameter values to the **Read group identifier (ID)** and the **Sample name identifier (SM)** parameters in the
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
96 **Map with BWA-MEM** tool.
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
97 </help>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
98 <expand macro="citations"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
99 </tool>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
100