Repository 'synbiodesign'
hg clone https://toolshed.g2.bx.psu.edu/repos/pablocarb/synbiodesign

Changeset 8:6572347b3e1a (2019-05-02)
Previous changeset 7:e328a5f60135 (2019-05-02) Next changeset 9:f9aef3df1fc8 (2019-05-02)
Commit message:
planemo upload commit 6a252d04f4b2f79606ab6679b6a91f957e33da7b-dirty
modified:
optbiodes.xml
toolOptBioDes.py
b
diff -r e328a5f60135 -r 6572347b3e1a optbiodes.xml
--- a/optbiodes.xml Thu May 02 09:27:23 2019 -0400
+++ b/optbiodes.xml Thu May 02 10:21:32 2019 -0400
b
@@ -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>
b
diff -r e328a5f60135 -r 6572347b3e1a toolOptBioDes.py
--- 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'] )