Mercurial > repos > greg > vsnp_sample_names
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 |
rev | line source |
---|---|
3 | 1 <tool id="vsnp_sample_names" name="vSNP: sample names" version="@WRAPPER_VERSION@.1" profile="@PROFILE@"> |
0 | 2 <description></description> |
3 | 3 <macros> |
4 <import>macros.xml</import> | |
5 </macros> | |
0 | 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 | 8 #import re |
3 | 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 | 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 | 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 | 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 | 31 echo '$sample_name' > '$output' |
0 | 32 ]]></command> |
33 <inputs> | |
34 <conditional name="input_type_cond"> | |
35 <param name="input_type" type="select" label="Choose the category of the files to be analyzed"> | |
3 | 36 <option value="single" selected="true">Single dataset</option> |
37 <option value="pair">Dataset pair</option> | |
38 <option value="paired">List of dataset pairs</option> | |
0 | 39 </param> |
40 <when value="single"> | |
3 | 41 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/> |
0 | 42 </when> |
3 | 43 <when value="pair"> |
44 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/> | |
45 <param name="read2" type="data" format="fastqsanger.gz,fastqsanger" label="Read2 fastq file"/> | |
0 | 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 | 50 </conditional> |
51 </inputs> | |
52 <outputs> | |
3 | 53 <data name="output" format="txt"/> |
0 | 54 </outputs> |
55 <tests> | |
3 | 56 <!-- Single files --> |
0 | 57 <test> |
3 | 58 <param name="input_type" value="single"/> |
59 <param name="read1" value="CMC_20E1_R1.fastq.gz" dbkey="89"/> | |
60 <output name="output" file="sample_names.txt" ftype="txt"/> | |
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 | 70 <test> |
71 <param name="input_type" value="paired"/> | |
0 | 72 <param name="reads_collection"> |
3 | 73 <collection type="paired"> |
74 <element name="forward" value="CMC_20E1_R1.fastq.gz"/> | |
75 <element name="reverse" value="CMC_20E1_R2.fastq.gz"/> | |
0 | 76 </collection> |
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 | 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 | 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 | 90 </test> |
91 </tests> | |
92 <help> | |
93 **What it does** | |
94 | |
3 | 95 Accepts fastqsanger sample files, extracts a unique portion of the file name as the sample name, and writes it to |
96 the output. The output text file can be consumed by the **Parse parameter value** expression tool to provide workflow | |
97 parameter values to the **Read group identifier (ID)** and the **Sample name identifier (SM)** parameters in the | |
98 **Map with BWA-MEM** tool. | |
0 | 99 </help> |
3 | 100 <expand macro="citations"/> |
0 | 101 </tool> |
102 |