annotate vsnp_sample_names.xml @ 9:8b8a3aa96833 draft default tip

"planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 7f5ebaad2e650c53a8980e8567fe9943f9ccabb6"
author greg
date Mon, 15 Nov 2021 23:14:54 +0000
parents 4f43f163c408
children
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[
7
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
7 #import difflib
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
8 #import re
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
9
7
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
10 #if $input_type_cond.input_type == 'single':
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
11 #set read1 = $input_type_cond.read1
8
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
12 #set sample_name = re.sub('[^\s\w\-]', '_', str($read1.element_identifier))
7
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
13 #else if $input_type_cond.input_type == 'pair':
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
14 #set read1 = $input_type_cond.read1
7
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
15 #set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1.element_identifier))
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
16 #set read2 = $input_type_cond.read2
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
17 #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.element_identifier))
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
18 #set matches = difflib.SequenceMatcher(None, read1_identifier, read2_identifier).get_matching_blocks()
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
19 #set match = $matches[0]
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
20 #set sample_name = re.sub('[^\s\w\-]', '_', str($read1_identifier[match.a:match.a + match.size]))
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
21 #else:
8
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
22 #set read1_name = $input_type_cond.reads_collection['forward'].name
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
23 #set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1_name))
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
24 #set read2_name = $input_type_cond.reads_collection['reverse'].name
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
25 #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2_name))
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
26 #set matches = difflib.SequenceMatcher(None, read1_identifier, read2_identifier).get_matching_blocks()
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
27 #set match = $matches[0]
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
28 #set sample_name = re.sub('[^\s\w\-]', '_', str($read1_identifier[match.a:match.a + match.size]))
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
29 #end if
7
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
30
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
31 echo '$sample_name' > '$output'
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
32 ]]></command>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
33 <inputs>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
34 <conditional name="input_type_cond">
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
35 <param name="input_type" type="select" label="Choose the category of the files to be analyzed">
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
36 <option value="single" selected="true">Single dataset</option>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
37 <option value="pair">Dataset pair</option>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
38 <option value="paired">List of dataset pairs</option>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
39 </param>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
40 <when value="single">
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
41 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
42 </when>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
43 <when value="pair">
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
44 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
45 <param name="read2" type="data" format="fastqsanger.gz,fastqsanger" label="Read2 fastq file"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
46 </when>
7
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
47 <when value="paired">
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
48 <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="paired" label="Collection of fastqsanger paired read files"/>
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
49 </when>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
50 </conditional>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
51 </inputs>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
52 <outputs>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
53 <data name="output" format="txt"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
54 </outputs>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
55 <tests>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
56 <!-- Single files -->
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
57 <test>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
58 <param name="input_type" value="single"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
59 <param name="read1" value="CMC_20E1_R1.fastq.gz" dbkey="89"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
60 <output name="output" file="sample_names.txt" ftype="txt"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
61 </test>
7
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
62 <!-- Paired reads in separate datasets -->
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
63 <test>
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
64 <param name="input_type" value="pair"/>
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
65 <param name="read1" value="CMC_20E1_R1.fastq.gz" dbkey="89"/>
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
66 <param name="read2" value="CMC_20E1_R2.fastq.gz" dbkey="89"/>
8
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
67 <output name="output" file="sample_names2.txt" ftype="txt"/>
7
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
68 </test>
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
69 <!-- Collection of Paired reads -->
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
70 <test>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
71 <param name="input_type" value="paired"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
72 <param name="reads_collection">
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
73 <collection type="paired">
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
74 <element name="forward" value="CMC_20E1_R1.fastq.gz"/>
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
75 <element name="reverse" value="CMC_20E1_R2.fastq.gz"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
76 </collection>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
77 </param>
8
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
78 <output name="output" file="sample_names3.txt" ftype="txt"/>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
79 </test>
7
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
80 <!-- Collection of Paired reads -->
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
81 <test>
7
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
82 <param name="input_type" value="paired"/>
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
83 <param name="reads_collection">
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
84 <collection type="paired">
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
85 <element name="forward" value="SRR14085881_forward"/>
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
86 <element name="reverse" value="SRR14085881_reverse"/>
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
87 </collection>
e1cb13d6a82c "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit f85ae0f073297ca7f5dfa22ae3a24f5fc2e6bad6"
greg
parents: 3
diff changeset
88 </param>
8
4f43f163c408 "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697"
greg
parents: 7
diff changeset
89 <output name="output" file="sample_names4.txt" ftype="txt"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
90 </test>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
91 </tests>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
92 <help>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
93 **What it does**
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
94
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
95 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
96 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
97 parameter values to the **Read group identifier (ID)** and the **Sample name identifier (SM)** parameters in the
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
98 **Map with BWA-MEM** tool.
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
99 </help>
3
fb3defef50e5 Uploaded
greg
parents: 2
diff changeset
100 <expand macro="citations"/>
0
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
101 </tool>
f75e2ac7b6cd Uploaded
greg
parents:
diff changeset
102