changeset 8:6572347b3e1a draft

planemo upload commit 6a252d04f4b2f79606ab6679b6a91f957e33da7b-dirty
author pablocarb
date Thu, 02 May 2019 10:21:32 -0400
parents e328a5f60135
children f9aef3df1fc8
files optbiodes.xml toolOptBioDes.py
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/optbiodes.xml	Thu May 02 09:27:23 2019 -0400
+++ b/optbiodes.xml	Thu May 02 10:21:32 2019 -0400
@@ -7,7 +7,7 @@
         python $__tool_directory__/toolOptBioDes.py $input1 $input2 $output1 $output2 -server $server
     ]]></command>
     <inputs>
-        <param type="data" name="input1" format="txt" />
+        <param type="data" name="input1" format="csv" />
         <param type="integer" name="input2" value="48" label="Library size" help="Library size" />
     	<param name="server" type="text" label="OptBioDes RES server" value="http://doe.synbiochem.co.uk/REST" help="OptBioDes REST server" />
     </inputs>
--- a/toolOptBioDes.py	Thu May 02 09:27:23 2019 -0400
+++ b/toolOptBioDes.py	Thu May 02 10:21:32 2019 -0400
@@ -16,7 +16,7 @@
 def arguments():
     parser = argparse.ArgumentParser(description='toolOptBioDes: Optimal SynBio Design. Pablo Carbonell, SYNBIOCHEM, 2019')
     parser.add_argument('infile', 
-                        help='Input xlsx file (DoE specificiations).')
+                        help='Input csv file (DoE specificiations).')
     parser.add_argument('size', 
                         help='Library size.')
     parser.add_argument('outfile', 
@@ -34,7 +34,7 @@
     
 def sheetUpload(doefile, size, outfile, diagfile, url):
     files = { 'file': open(doefile, 'rb' ) }
-    values = {'size': int(size)}
+    values = {'size': int(size), 'format': 'csv'}
     r = requests.post( os.path.join(url, 'Query' ), files=files, data=values )
     res = json.loads( r.content.decode('utf-8') )
     M = res['data']['M']
@@ -43,6 +43,10 @@
         cw.writerow( res['data']['names'] )
         for row in M:
             cw.writerow( row )
+    with open(diagfile. 'w') as h:
+        cw = csv.writer(h)
+        cw.writerow( ['Size', 'Efficiency'] )
+        cw.writerow( [res['data']['libsize'], res['data']['J']] )
     print( 'Size:', res['data']['libsize'], 'Efficiency:', res['data']['J'] )