1 | #post processing, add sequence and additional annoation info if available
|
---|
2 | from urllib import urlencode
|
---|
3 | from galaxy.datatypes.images import create_applet_tag_peek
|
---|
4 |
|
---|
5 | def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
|
---|
6 | primary_data = out_data.items()[0][1]
|
---|
7 |
|
---|
8 | #default params for LAJ type
|
---|
9 | params = {
|
---|
10 | "alignfile1": "display?id=%s" % primary_data.id,
|
---|
11 | "buttonlabel": "Launch LAJ",
|
---|
12 | "title": "LAJ in Galaxy",
|
---|
13 | "posturl": "history_add_to?%s" % urlencode( { 'history_id': primary_data.history_id, 'ext': 'lav', 'name': 'LAJ Output', 'info': 'Added by LAJ', 'dbkey': primary_data.dbkey } )
|
---|
14 | }
|
---|
15 | for name,data in inp_data.items():
|
---|
16 | if name == "maf_input":
|
---|
17 | params["alignfile1"] = "display?id=%s" % data.id
|
---|
18 | elif name == "seq_file1" and data.state == data.states.OK and data.has_data():
|
---|
19 | params["file1seq1"] = "display?id=%s" % data.id
|
---|
20 | elif name == "seq_file2" and data.state == data.states.OK and data.has_data():
|
---|
21 | params["file1seq2"] = "display?id=%s" % data.id
|
---|
22 | elif name == "exonfile" and data.state == data.states.OK and data.has_data():
|
---|
23 | params["exonfile"] = "display?id=%s" % data.id
|
---|
24 | elif name == "repeatfile" and data.state == data.states.OK and data.has_data():
|
---|
25 | params["repeatfile"] = "display?id=%s" % data.id
|
---|
26 | elif name == "annotationfile" and data.state == data.states.OK and data.has_data():
|
---|
27 | params["annotationfile"] = "display?id=%s" % data.id
|
---|
28 | elif name == "underlayfile" and data.state == data.states.OK and data.has_data():
|
---|
29 | params["underlayfile"] = "display?id=%s" % data.id
|
---|
30 | elif name == "highlightfile" and data.state == data.states.OK and data.has_data():
|
---|
31 | params["highlightfile"] = "display?id=%s" % data.id
|
---|
32 |
|
---|
33 | if "file1seq1" not in params and "file1seq2" not in params:
|
---|
34 | params["noseq"] = "true"
|
---|
35 |
|
---|
36 | class_name = "edu.psu.cse.bio.laj.LajApplet.class"
|
---|
37 | archive = "/static/laj/laj.jar"
|
---|
38 | primary_data.peek = create_applet_tag_peek( class_name, archive, params )
|
---|
39 | app.model.context.add( primary_data )
|
---|
40 | app.model.context.flush()
|
---|