comparison epiviz_export.xml @ 0:78367907d256 draft default tip

planemo upload commit d56ec81d6c02ad971116dca44b22e02fb0a0ab30
author jkanche
date Fri, 20 Sep 2019 07:23:50 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:78367907d256
1 <tool id="epiviz_export" name="Interactively visualize genomic data with Epiviz" version="0.1.0" python_template_version="3.5">
2 <requirements>
3 </requirements>
4 <command detect_errors="exit_code"><![CDATA[
5 python $script_file
6 ]]></command>
7 <configfiles>
8 <configfile name="script_file">
9 import os
10 import sys
11 import json
12 file_location = []
13 file_type = []
14 file_annotations = []
15 #for $i, $s in enumerate($files)
16 tloc = '${s.input}'
17 tlocs = tloc.split("/")
18 file_location.append("/data/" + tlocs[len(tlocs)-1])
19 file_type.append('${s.format}')
20 tanno = '${s.fileanno}'
21 print(tanno)
22 tanno = tanno.split(",")
23 print(tanno)
24 ttanno = {}
25 for i in tanno:
26 ti = i.split(":")
27 ttanno[ti[0]] = ti[1]
28
29 file_annotations.append(ttanno)
30 #end for
31 epiviz_json = []
32 for i in range(0,len(file_location)):
33 fdatatype = "bp" if file_type[i] == "BigWig" else "annotation"
34 epiviz_json.append(
35 {
36 "url": file_location[i],
37 "file_type": file_type[i],
38 "datatype": fdatatype,
39 "name": file_location[i],
40 "id": file_location[i],
41 "annotation": file_annotations[i],
42 "metadata": []
43 }
44 )
45 print epiviz_json
46 fout = open('$output', "w")
47 json.dump(epiviz_json, fout)
48 fout.close()
49 </configfile>
50 </configfiles>
51 <inputs>
52 <repeat name="files" title="Add File">
53 <param type="data" name="input" format="bigbed,bigwig"/>
54 <param name="format" type="select" label="Data Format">
55 <option value="BigWig" selected="true">BigWig</option>
56 <option value="BigBed">BigBed</option>
57 <option value="tbx">tbx</option>
58 </param>
59 <param type ="text" name="fileanno" format="json" />
60 </repeat>
61 </inputs>
62 <outputs>
63 <data name="output" format="json" from_work_dir="output.json" />
64 </outputs>
65 <tests>
66 <test>
67 <param name="input" value="/test"/>
68 <param name="format" value="bigbed"/>
69 <param name="fileanno" value="annotation"/>
70 <output name="output">
71 <assert_contents>
72 <has_line line="datatype" />
73 </assert_contents>
74 </output>
75 </test>
76 </tests>
77 <help><![CDATA[
78 Usage: Choose files to interactively visualize with epiviz.
79 ]]></help>
80 <citations>
81 <citation type="bibtex">
82 @misc{epiviz,
83 author = {epiviz},
84 year = {2019},
85 title = {epiviz},
86 publisher = {GitHub},
87 journal = {GitHub repository},
88 url = {https://github.com/epiviz/epivizGalaxyTool},
89 }</citation>
90 </citations>
91 </tool>