0
|
1 <?xml version="1.0"?>
|
|
2 <tool id="mosaik_wrapper" name="Map with Mosaik" version="1.1.1">
|
|
3 <description/>
|
|
4 <requirements><requirement type="package">mosaik</requirement></requirements>
|
|
5 <command>
|
|
6 #set $processors = '-p 4'
|
|
7 #set $lm = ''
|
|
8 #if $paired.kind == 'single':
|
|
9 #set $mfl = ''
|
|
10 #set $ls = ''
|
|
11 #else:
|
|
12 #set $ls = '-ls $mfl'
|
|
13 #end if
|
|
14 MosaikBuild -fr
|
|
15 #if $genomeSource.refGenomeSource == 'indexed':
|
|
16 ${ filter( lambda x: str( x[0] ) == str( $genomeSource.indexReference ), $__app__.tool_data_tables[ 'mosaik_indexes' ].get_fields() )[0][-1] }
|
|
17 #else:
|
|
18 $genomeSource.historyReference
|
|
19 #end if
|
|
20 -oa mosaik_ref_file;
|
|
21 MosaikBuild -q $reads $mfl -st $st -out mosaik_reads_file;
|
|
22 MosaikAligner -ia mosaik_ref_file -in mosaik_reads_file -out mosaik_aligned_file $ls -mm $mm -mhp $mhp -act $act -bw $bw $processors $lm -hs 15;
|
|
23 MosaikText -in mosaik_aligned_file -$outFormat sam_bam_file;
|
|
24 #if str($outFormat) == 'bam':
|
|
25 samtools sort sam_bam_file sorted_bam;
|
|
26 mv sorted_bam.bam $output
|
|
27 #else:
|
|
28 gunzip sam_bam_file.gz;
|
|
29 mv sam_bam_file $output
|
|
30 #end if
|
|
31 </command>
|
|
32 <inputs>
|
|
33 <conditional name="genomeSource">
|
|
34 <param name="refGenomeSource" type="select" label="Will you select a reference genome from your history or use a built-in index?">
|
|
35 <option value="indexed">Use a built-in index</option>
|
|
36 <option value="history">Use one from the history</option>
|
|
37 </param>
|
|
38 <when value="indexed">
|
|
39 <param name="indexReference" type="select" label="Select a reference genome">
|
|
40 <options from_data_table="mosaik_indexes">
|
|
41 <filter type="sort_by" column="2"/>
|
|
42 <validator type="no_options" message="No indexes are available" />
|
|
43 </options>
|
|
44 </param>
|
|
45 </when>
|
|
46 <when value="history">
|
|
47 <param format="fasta" name="historyReference" type="data" metadata_name="dbkey" label="Select a reference from history"/>
|
|
48 </when>
|
|
49 </conditional>
|
|
50 <param format="fastq" name="reads" type="data" label="Fastq Reads File"/>
|
|
51 <param name="outFormat" type="select" label="Output Format">
|
|
52 <option value="sam">Sam</option>
|
|
53 <option value="bam">Bam</option>
|
|
54 </param>
|
|
55 <param name="st" type="select" label="Sequencing Technology Used">
|
|
56 <option value="454">454</option>
|
|
57 <option value="illumina">Illumina</option>
|
|
58 <option value="solid">Solid</option>
|
|
59 <option value="sanger">Sanger</option>
|
|
60 <option value="helicos">Helicos</option>
|
|
61 </param>
|
|
62 <conditional name="paired">
|
|
63 <param name="kind" type="select" label="Is this library mate-paired?">
|
|
64 <option value="single">Single-end</option>
|
|
65 <option value="paired">Paired-end</option>
|
|
66 </param>
|
|
67 <when value="single"/>
|
|
68 <when value="paired">
|
|
69 <param name="mfl" type="integer" value="200" label="Insert Size" help="the length between the paired reads"/>
|
|
70 <param name="ls" type="integer" value="50" label="Realignment Window" help="Window size to realign mate pairs that are out of position. Large values slow down performance"/>
|
|
71 </when>
|
|
72 </conditional>
|
|
73 <param name="mm" size="5" type="integer" value="6" label="Mismatches allowed" help="mismatches allowed per sequence"/>
|
|
74 <param name="act" size="5" type="integer" value="35" label="Alignment Candidate Threshold" help="determines which hash regions will be aligned with Smith Waterman"/>
|
|
75 <param name="bw" size="5" type="integer" value="19" label="Smith-Waterman band width"/>
|
|
76 <param name="mhp" size="5" type="integer" value="100" label="Maximum # Of Positions Stored Per Seed" help="number of places in the reference the aligner will try to place a particular hash"/>
|
|
77 </inputs>
|
|
78 <outputs>
|
|
79 <data format="sam" name="output">
|
|
80 <change_format>
|
|
81 <when input="outFormat" value="bam" format="bam" />
|
|
82 </change_format>
|
|
83 <actions>
|
|
84 <conditional name="genomeSource.refGenomeSource">
|
|
85 <when value="indexed">
|
|
86 <action type="metadata" name="dbkey">
|
|
87 <option type="from_data_table" name="mosaik_indexes" column="1">
|
|
88 <filter type="param_value" column="0" value="#" compare="startswith" keep="False" />
|
|
89 <filter type="param_value" ref="genomeSource.indexReference" column="0" />
|
|
90 </option>
|
|
91 </action>
|
|
92 </when>
|
|
93 <when value="history">
|
|
94 <action type="metadata" name="dbkey">
|
|
95 <option type="from_param" name="genomeSource.historyReference" param_attribute="dbkey" />
|
|
96 </action>
|
|
97 </when>
|
|
98 </conditional>
|
|
99 </actions>
|
|
100 </data>
|
|
101 </outputs>
|
|
102 <tests>
|
|
103 <test>
|
|
104 <param name="refGenomeSource" value="history"/>
|
|
105 <param name="historyReference" ftype="fasta" value="mosaik_test_ref.fasta"/>
|
|
106 <param name="reads" ftype="fastq" value="mosaik_test_input.fastq"/>
|
|
107 <param name="outFormat" value="sam"/>
|
|
108 <param name="st" value="454"/>
|
|
109 <param name="kind" value="single"/>
|
|
110 <param name="mm" value="6"/>
|
|
111 <param name="act" value="35"/>
|
|
112 <param name="bw" value="19"/>
|
|
113 <param name="mhp" value="100"/>
|
|
114 <output name="output" file="mosaik_test_out.sam" compare="sim_size" delta="0"/>
|
|
115 </test>
|
|
116 </tests>
|
|
117 <help>
|
|
118 This tool uses Mosaik to align reads to a reference sequence.
|
|
119 </help>
|
|
120 </tool>
|