In [2]:
from tavernaplayerclient import *
In [3]:
c = Client('http://dev.at.biovel.eu', 'player', 'player')
In [4]:
workflows = c.workflows
In [5]:
enm = c.get_workflow(2)
In [6]:
print enm.title
Ecological niche modelling workflow
In [7]:
enm_rt = enm.run_template
In [9]:
print enm_rt.inputs.keys
<built-in method keys of dict object at 0x0312DB70>
In [12]:
for k in enm_rt.inputs.keys(): print k
input_points
In [17]:
with open ("C:\\Users\\alanrw\\Downloads\\erynnis_tages_150.csv", "r") as myfile:
    data=myfile.read()
In [18]:
print data
occurrenceID,decimalLatitude,decimalLongitude,nameComplete
1,51.15642,6.05849,Erynnis tages
2,41.81676,2.30539,Erynnis tages
3,44.85917,13.85799,Erynnis tages
4,52.28331,-7.04828,Erynnis tages
5,54.80302,-8.26432,Erynnis tages
6,52.3,21.15,Erynnis tages
7,51.66,22.81,Erynnis tages
8,58.1853,16.8384,Erynnis tages
9,50.37,19.62,Erynnis tages
10,59.106,18.2514,Erynnis tages
11,58.8902,15.6212,Erynnis tages
12,49.54,5.88,Erynnis tages
13,47.99,13.66,Erynnis tages
14,47.19,9.65,Erynnis tages
15,59.71338,10.33761,Erynnis tages
16,56.0839,13.3127,Erynnis tages
17,59.6645,17.6627,Erynnis tages
18,52.24099,1.61101,Erynnis tages
19,50.2279,18.8219,Erynnis tages
20,59.1884,18.0888,Erynnis tages
21,60.0819,12.8285,Erynnis tages
22,57.6282,-3.76601,Erynnis tages
23,50.96907,-0.93532,Erynnis tages
24,48.75,5.33,Erynnis tages
25,58.7318,15.1287,Erynnis tages
26,44.34,23.01,Erynnis tages
27,47.25,15.75,Erynnis tages
28,59.50186,10.98,Erynnis tages
29,59.7146,17.9642,Erynnis tages
30,59.1336,18.0177,Erynnis tages
31,57.57265,-5.33659,Erynnis tages
32,49.701,19.7367,Erynnis tages
33,51.06265,-1.37917,Erynnis tages
34,52.72567,-0.54946,Erynnis tages
35,51.07141,-1.33623,Erynnis tages
36,49.75,6.5,Erynnis tages
37,62.5902,15.7171,Erynnis tages
38,50.94,20.41,Erynnis tages
39,51.0546,-1.59332,Erynnis tages
40,64.4804,19.4184,Erynnis tages
41,50.86667,7.11667,Erynnis tages
42,39.05384,-0.86212,Erynnis tages
43,51.01,22.53,Erynnis tages
44,42.98,-4.47,Erynnis tages
45,59.02598,11.01741,Erynnis tages
46,58.0445,16.0869,Erynnis tages
47,51.7925,15.4123,Erynnis tages
48,49.8838,22.5614,Erynnis tages
49,59.9313,12.5972,Erynnis tages
50,50.92031,-2.1494,Erynnis tages
51,55.70711,10.8302,Erynnis tages
52,60.08928,9.83863,Erynnis tages
53,49.57,6.52,Erynnis tages
54,51.33419,-1.7136,Erynnis tages
55,52.57,21.8,Erynnis tages
56,46.63736,7.24366,Erynnis tages
57,55.87552,12.52241,Erynnis tages
58,60.1164,17.3639,Erynnis tages
59,59.0812,15.7724,Erynnis tages
60,49.73,6.24,Erynnis tages
61,49.82,19.01,Erynnis tages
62,54.18054,-0.2607,Erynnis tages
63,51.0527,20.3983,Erynnis tages
64,47.26679,7.10919,Erynnis tages
65,50.13,19.39,Erynnis tages
66,58.5988,15.553,Erynnis tages
67,57.8542,15.8051,Erynnis tages
68,58.3584,11.9601,Erynnis tages
69,60.3955,15.5679,Erynnis tages
70,47.42115,9.89195,Erynnis tages
71,59.4142,15.2439,Erynnis tages
72,58.2225,13.6093,Erynnis tages
73,51.68422,-2.36889,Erynnis tages
74,56.43887,9.40546,Erynnis tages
75,47.24,9.69,Erynnis tages
76,56.2501,16.4625,Erynnis tages
77,59.5138,14.9727,Erynnis tages
78,51.62604,-0.93807,Erynnis tages
79,59.0465,12.455,Erynnis tages
80,57.8457,18.6464,Erynnis tages
81,59.7827,16.9988,Erynnis tages
82,52.44,22.5,Erynnis tages
83,59.1982,18.3281,Erynnis tages
84,50.95975,-0.85365,Erynnis tages
85,50.4909,18.1204,Erynnis tages
86,59.1221,17.588,Erynnis tages
87,46.54665,7.89597,Erynnis tages
88,46.79444,9.73234,Erynnis tages
89,48.61,13.89,Erynnis tages
90,59.1092,17.6773,Erynnis tages
91,46.27228,6.33677,Erynnis tages
92,49.66,6.25,Erynnis tages
93,46.81,15.97,Erynnis tages
94,56.16997,8.91948,Erynnis tages
95,55.23677,11.90964,Erynnis tages
96,49.97833,19.84111,Erynnis tages
97,59.2985,16.1123,Erynnis tages
98,48.6,16.78,Erynnis tages
99,52.69506,-2.44173,Erynnis tages
100,51.11825,-2.03572,Erynnis tages
101,51.13268,1.35291,Erynnis tages
102,52.83455,-4.13047,Erynnis tages
103,59.89514,10.60354,Erynnis tages
104,60.4835,16.3958,Erynnis tages
105,51.62776,-4.24758,Erynnis tages
106,58.9811,15.1293,Erynnis tages
107,58.2958,16.8437,Erynnis tages
108,52.2865,23.1635,Erynnis tages
109,58.6924,16.0806,Erynnis tages
110,59.1788,18.3646,Erynnis tages
111,59.9754,17.4386,Erynnis tages
112,54.28873,-2.88342,Erynnis tages
113,58.0165,15.6017,Erynnis tages
114,58.2873,16.3247,Erynnis tages
115,58.3091,15.759,Erynnis tages
116,59.34658,10.95441,Erynnis tages
117,57.71157,-3.42425,Erynnis tages
118,57.9045,15.9697,Erynnis tages
119,47.69,14.13,Erynnis tages
120,44.02,28.4,Erynnis tages
121,52.66455,-2.42663,Erynnis tages
122,51.39663,-1.69093,Erynnis tages
123,50.97027,-1.88676,Erynnis tages
124,52.6899,23.8739,Erynnis tages
125,46.89159,9.34264,Erynnis tages
126,51.57999,-0.82367,Erynnis tages
127,50.8369,-2.53332,Erynnis tages
128,52.39678,-2.37848,Erynnis tages
129,47.08,9.65,Erynnis tages
130,59.0954,15.8031,Erynnis tages
131,49.91,5.76,Erynnis tages
132,58.6415,16.9531,Erynnis tages
133,56.6389,15.5624,Erynnis tages
134,54.55811,-1.07984,Erynnis tages
135,40.48,-2.72,Erynnis tages
136,45.90802,8.92173,Erynnis tages
137,58.8009,17.812,Erynnis tages
138,46.27764,7.37471,Erynnis tages
139,52.15475,0.99711,Erynnis tages
140,49.63,5.89,Erynnis tages
141,60.26579,10.49566,Erynnis tages
142,49.064,22.6833,Erynnis tages
143,52.39428,0.56491,Erynnis tages
144,51.66865,-0.44463,Erynnis tages
145,59.45352,8.3218,Erynnis tages
146,59.0766,12.4753,Erynnis tages
147,59.1061,17.4056,Erynnis tages
148,59.61165,10.41388,Erynnis tages
149,46.80166,9.33947,Erynnis tages
150,56.0444,11.97018,Erynnis tages

In [21]:
enm_run = enm.run('Example enm run', {"input_points" : data})
In [22]:
projection_urls = enm_run.outputs["projection_url"]
In [23]:
print projection_urls
['http://modeller.cria.org.br/maps/LtcIMY.tif', 'http://modeller.cria.org.br/maps/lCHWMU.tif']
In [44]:
esw = c.get_workflow(20)
In [45]:
esw_run_template = esw.run_template
In [46]:
for k in esw_run_template.inputs.keys(): print k
namelist
layerlist
png_size
In [47]:
layerlist = projection_urls[0] + "," + projection_urls[1]
In [48]:
namelist = "now,2100"
In [49]:
esw.run("Example esw run", {"namelist" : namelist, "layerlist":layerlist, "png_size" : "800"})
Out[49]:
<tavernaplayerclient.taverna_player_client.Run at 0x313cbd0>
In [52]:
esw_outputs = Out[49].outputs
In [53]:
for k in esw_outputs.keys(): print k
pearson
stackImg
covariance
stackPNG
PNGoverview
rastersummary
overall_statistics
In [57]:
from IPython.core.display import Image 
In [59]:
Image(esw_outputs["stackPNG"])
Out[59]:
In [60]:
esd = c.get_workflow(19)
In [62]:
esd_run_template = esd.run_template
In [63]:
for k in esd_run_template.inputs.keys(): print k
input2
input1
PNG_output_size
label_difference_file
label_species
occurrence_csv
In [64]:
input1 = projection_urls[0]
In [65]:
input2 = projection_urls[1]
In [66]:
esd.run("Example esd run", {"input2" : input2, "input1" : input1, "PNG_output_size" : "800", "label_difference_file" : "erynnis_diff",
                            "label_species" : "erynnis", "occurrence_csv" : data})
Out[66]:
<tavernaplayerclient.taverna_player_client.Run at 0x313c110>
In [67]:
esd_run = Out[66]
In [68]:
for k in esd_run.outputs.keys(): print k
diffImg
matrix_diff
diffLayerPng
summary
matrix_y
predictionLayerPng
matrix_x
BioSTIF_URL
changes
logfile
currentLayerPng
In [75]:
Image(esd_run.outputs["diffLayerPng"])
Out[75]:
In [ ]: