annotate tools/visualization/LAJ_code.py @ 0:9071e359b9a3

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:37:19 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
1 #post processing, add sequence and additional annoation info if available
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2 from urllib import urlencode
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3 from galaxy.datatypes.images import create_applet_tag_peek
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5 def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6 primary_data = out_data.items()[0][1]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8 #default params for LAJ type
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
9 params = {
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
10 "alignfile1": "display?id=%s" % primary_data.id,
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
11 "buttonlabel": "Launch LAJ",
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
12 "title": "LAJ in Galaxy",
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
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 } )
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
14 }
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
15 for name,data in inp_data.items():
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
16 if name == "maf_input":
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
17 params["alignfile1"] = "display?id=%s" % data.id
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
18 elif name == "seq_file1" and data.state == data.states.OK and data.has_data():
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
19 params["file1seq1"] = "display?id=%s" % data.id
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
20 elif name == "seq_file2" and data.state == data.states.OK and data.has_data():
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
21 params["file1seq2"] = "display?id=%s" % data.id
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
22 elif name == "exonfile" and data.state == data.states.OK and data.has_data():
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
23 params["exonfile"] = "display?id=%s" % data.id
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
24 elif name == "repeatfile" and data.state == data.states.OK and data.has_data():
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
25 params["repeatfile"] = "display?id=%s" % data.id
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
26 elif name == "annotationfile" and data.state == data.states.OK and data.has_data():
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
27 params["annotationfile"] = "display?id=%s" % data.id
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
28 elif name == "underlayfile" and data.state == data.states.OK and data.has_data():
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
29 params["underlayfile"] = "display?id=%s" % data.id
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
30 elif name == "highlightfile" and data.state == data.states.OK and data.has_data():
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
31 params["highlightfile"] = "display?id=%s" % data.id
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
32
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
33 if "file1seq1" not in params and "file1seq2" not in params:
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
34 params["noseq"] = "true"
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
35
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
36 class_name = "edu.psu.cse.bio.laj.LajApplet.class"
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
37 archive = "/static/laj/laj.jar"
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
38 primary_data.peek = create_applet_tag_peek( class_name, archive, params )
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
39 app.model.context.add( primary_data )
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
40 app.model.context.flush()