Comparison_and_update_of_valueslocal00 KIG0001 10.5683662379 NaN 2011-11-18 15:16:40.677 CET The file with a list of three columns: name of the galaxy, value, error 2011-11-18 15:16:08.472 CET remote00 The file with a list of three columns: name of the galaxy, value, error 2011-11-18 15:15:54.100 CET KIG0001 10.5683662379 NaN 2011-11-18 15:16:47.813 CET Table00 The name of the table to create/update 2011-11-18 15:35:27.260 CET LB 2011-11-18 15:17:04.725 CET Field00 Name of the field of the database to create/update 2011-11-18 15:07:06.683 CET LB 2011-11-18 15:07:11.651 CET comparingFile File with a comparison between two other files 2011-11-18 15:09:07.370 CET KIG0001 5.0 NaN 5.0 NaN 0.0 NaN 0 0 2011-11-18 15:09:46.436 CET updatingFile File with the command to update / create the database. 2011-11-18 15:07:29.427 CET CREATE TABLE AG (ID mediumint(8) AUTO_INCREMENT, NAME_CIG varchar(32), AG decimal(6,3), ERROR decimal(6,3), DIF_VAL decimal(6,3), DIF_ERR decimal(6,3), ADDED BOOL, REMOVED BOOL, PRIMARY KEY (ID) ); INSERT INTO AG (NAME_CIG, AG, ERROR, DIF_VAL, DIF_ERR, ADDED, REMOVED) VALUES ('KIG0001', 0.17, NULL, 0.003, NULL, 0, 0); 2011-11-18 15:08:17.620 CET Updatingremote0local0nameTable0nameField0STDOUT00net.sf.taverna.t2.activitiesexternal-tool-activity1.3net.sf.taverna.t2.activities.externaltool.ExternalToolActivity 789663B8-DA91-428A-9F7D-B3F3DA185FD4 default local <?xml version="1.0" encoding="UTF-8"?> <localInvocation><shellPrefix>/bin/sh -c</shellPrefix><linkCommand>/bin/ln -s %%PATH_TO_ORIGINAL%% %%TARGET_NAME%%</linkCommand></localInvocation> 8a153e0c-06dc-41d3-b0e0-7f0bca32fcb9 python updating.py %%nameTable%% %%nameField%% 1200 1800 nameField nameTable updating.py true false false MacRoman false #!/usr/bin/env python import sys import math with open("local.txt", "r") as local_file: localValues=local_file.readlines() with open("remote.txt", "r") as remote_file: remoteValues=remote_file.readlines() nameTable=sys.argv[1] nameField=sys.argv[2] print "CREATE TABLE %s (ID mediumint(8) AUTO_INCREMENT, NAME_CIG varchar(32), %s decimal(6,3), ERROR decimal(6,3), DIF_VAL decimal(6,3), DIF_ERR decimal(6,3), ADDED BOOL, REMOVED BOOL, PRIMARY KEY (ID) );\n"%(nameTable, nameField) num_values=min(len(localValues), len(remoteValues)) for i in range(num_values): try: (lname, lvalue, lerr)=localValues[i].split() (rname, rvalue, rerr)=remoteValues[i].split() lvalue=float(lvalue) lerr=float(lerr) rvalue=float(rvalue) rerr=float(rerr) added=0 removed=0 if math.isnan(lvalue) and not math.isnan(rvalue): added=1 if not math.isnan(lvalue) and math.isnan(rvalue): removed=1 except: print "/*No update for galaxy %s*/\n"%(i+1) else: value_diff=lvalue-rvalue err_diff=lerr-rerr if math.isnan(value_diff): value_diff="NULL" if math.isnan(err_diff): err_diff="NULL" if math.isnan(rvalue): rvalue="NULL" if math.isnan(rerr): rerr="NULL" print "INSERT INTO %s (NAME_CIG, %s, ERROR, DIF_VAL, DIF_ERR, ADDED, REMOVED) VALUES ('%s', %s, %s, %s, %s, %s, %s);"%(nameTable, nameField, rname, rvalue, rerr, value_diff, err_diff, added, removed) nameField nameField false false false MacRoman false false false local local.txt true false false MacRoman false false false remote remote.txt true false false MacRoman false false false nameTable nameTable false false false MacRoman false false false false true true 0 false net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize 1 net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry 1.0 1000 5000 0 net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokeComparinglocal0remote0STDOUT00net.sf.taverna.t2.activitiesexternal-tool-activity1.3net.sf.taverna.t2.activities.externaltool.ExternalToolActivity 789663B8-DA91-428A-9F7D-B3F3DA185FD4 default local <?xml version="1.0" encoding="UTF-8"?> <localInvocation><shellPrefix>/bin/sh -c</shellPrefix><linkCommand>/bin/ln -s %%PATH_TO_ORIGINAL%% %%TARGET_NAME%%</linkCommand></localInvocation> 8a153e0c-06dc-41d3-b0e0-7f0bca32fcb9 python comparing.py 1200 1800 comparing.py true false false MacRoman false #!/usr/bin/env python import sys import math with open("local.txt", "r") as local_file: localValues=local_file.readlines() with open("remote.txt", "r") as remote_file: remoteValues=remote_file.readlines() num_values=min(len(localValues), len(remoteValues)) for i in range(num_values): try: (lname, lvalue, lerr)=localValues[i].split() lvalue=float(lvalue) lerr=float(lerr) (rname, rvalue, rerr)=remoteValues[i].split() rvalue=float(rvalue) rerr=float(rerr) added=0 removed=0 if math.isnan(lvalue) and not math.isnan(rvalue): added=1 if not math.isnan(lvalue) and math.isnan(rvalue): removed=1 except: print "Error in galaxy %s\n"%(i+1) else: value_diff=lvalue-rvalue err_diff=lerr-rerr if math.isnan(value_diff): value_diff="NaN" if math.isnan(err_diff): err_diff="NaN" if math.isnan(lvalue): lvalue="NaN" if math.isnan(lerr): lerr="NaN" if math.isnan(rvalue): rvalue="NaN" if math.isnan(rerr): rerr="NaN" print "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s"%(lname, lvalue, lerr, rvalue, rerr, value_diff, err_diff, added, removed) local local.txt true false false MacRoman false false false remote remote.txt true false false MacRoman false false false false true true 0 false net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize 1 net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry 1.0 1000 5000 0 net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokeUpdatingremoteremoteUpdatinglocallocalUpdatingnameTableTableUpdatingnameFieldFieldComparinglocallocalComparingremoteremotecomparingFileComparingSTDOUTupdatingFileUpdatingSTDOUT d3be606f-525d-41c7-9756-c93725c3060e 2011-11-21 10:36:56.98 CET 128f745c-4501-419f-bec3-fdf320dea384 2011-11-18 15:14:32.970 CET 9d1d0125-2df2-4c17-a0ab-ef766f6d2189 2011-11-16 21:22:40.0 CET 163ba001-6279-4f53-ac8a-b6e9fe8b38c5 2011-11-16 21:23:47.795 CET 5632c4b0-fdff-45da-bc89-65857212bf34 2011-11-08 19:16:00.293 CET a2bf17b2-a8f0-432d-b3e5-15bf029884d6 2011-11-16 21:30:07.360 CET 5073efc6-fbeb-48fc-aced-7526d23c1b1d 2011-11-16 21:27:05.637 CET c8ffe097-d70c-4086-9f42-96f3779389e0 2011-11-16 12:01:36.968 CET 3f1831ab-484d-4027-a169-df7bd9e60f0b 2011-11-16 21:20:43.829 CET f13b192c-c1f9-41fc-831a-94b211c95d32 2011-11-16 12:50:12.780 CET 2a3f752e-44e7-4e10-8b1d-7030e1a72163 2011-11-16 22:02:11.375 CET This workflow receives two files, the name of a table and the name of a field as input. One of the file should be contain a list of old values (name galaxy and value), and the other one should be a list of new values (name galaxy,value) The workflow makes a comparison between the two files. This comparison will be a list of 7 columns: name of the galaxy, old value, old error, new value, new error, difference of value, difference of error. In other hand, this workflow makes a sql script with the command to update/create the table and filed given, with the new values. 2011-11-18 15:14:32.825 CET 3fa32a4c-aeb1-4a2f-a346-acd4e274602b 2011-11-16 21:09:24.319 CET c3300de6-aa1b-4991-b559-d91f1d104065 2011-11-10 10:48:37.670 CET 62bf3cb9-0dcd-4b34-a221-e84525e6f6bd 2011-11-16 21:13:01.956 CET 9f48ec70-e83f-4bed-8fd3-3f300b7798bc 2011-11-16 16:07:45.989 CET Susana Sánchez 2011-11-21 10:36:55.925 CET 06c1e61d-76cf-40ad-9e07-52d5d860cc00 2011-11-16 21:16:10.412 CET bac7afb2-8f90-4964-bd20-06c117d89194 2011-11-18 15:17:06.724 CET 07024249-0be6-4597-a3ea-064472395225 2011-11-16 21:10:57.212 CET 1bebda15-9d6c-4d9a-b2db-02eb17979219 2011-11-16 21:14:04.812 CET 3804b05a-4601-4ecd-bc51-8ef4a058cebc 2011-11-16 21:07:58.625 CET a439fcc9-8ecb-4608-ba40-5e65ab537a03 2011-11-16 21:25:37.767 CET Comparison and update of values 2011-11-21 10:36:31.84 CET 3433e3c2-946a-4890-8ffe-a9d1c84b3348 2011-11-18 15:36:29.745 CET 56e9f220-62d2-44b6-a2e5-9abcc4cc425a 2011-11-16 10:07:41.749 CET f034c53c-587a-41d9-8483-41d936c0c983 2011-11-16 21:18:43.102 CET