changeset 1:8d9c8ba2ec86 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/transfs commit ec28658e0e9cd92edff6e1f86427c6e80c69d572"
author bgruening
date Wed, 08 Apr 2020 07:28:49 -0400
parents de29b4f35536
children f6f9b47d02b6
files transfs.py transfs.xml
diffstat 2 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/transfs.py	Fri Mar 27 09:18:53 2020 -0400
+++ b/transfs.py	Wed Apr 08 07:28:49 2020 -0400
@@ -210,14 +210,14 @@
     return "{0}{1}{2}".format(work_dir, os.path.sep, predict_file_name)
 
 
-def run_predictions():
+def run_predictions(model):
     global types_file_name
     global predict_file_name
     global work_dir
     # python3 scripts/predict.py -m resources/dense.prototxt -w resources/weights.caffemodel -i work_0/test_set.types >> work_0/caffe_output/predictions.txt
     cmd1 = ['python3', '/train/fragalysis_test_files/scripts/predict.py',
             '-m', '/train/fragalysis_test_files/resources/dense.prototxt',
-            '-w', '/train/fragalysis_test_files/resources/weights.caffemodel',
+            '-w', os.path.sep.join(['/train/fragalysis_test_files/resources', model]),
             '-i', os.path.sep.join([work_dir, types_file_name]),
             '-o', os.path.sep.join([work_dir, predict_file_name])]
     log("CMD:", cmd1)
@@ -286,13 +286,13 @@
     sdf_file.close()
 
 
-def execute(ligands_sdf, protein, outfile, distance, mock=False):
+def execute(ligands_sdf, protein, outfile, distance, model='weights.caffemodel', mock=False):
 
     write_inputs(protein, ligands_sdf, distance)
     if mock:
         mock_predictions()
     else:
-        run_predictions()
+        run_predictions(model)
     scores = read_predictions()
     patch_scores_sdf(outfile, scores)
 
@@ -307,6 +307,7 @@
     parser.add_argument('-d', '--distance', type=float, default=2.0, help="Cuttoff for removing waters")
     parser.add_argument('-o', '--outfile', default='output.sdf', help="File name for results")
     parser.add_argument('-w', '--work-dir', default=".", help="Working directory")
+    parser.add_argument('-m', '--model', default="weights.caffemodel", help="Model to use for predictions")
     parser.add_argument('--mock', action='store_true', help='Generate mock scores rather than run on GPU')
 
     args = parser.parse_args()
@@ -314,7 +315,7 @@
 
     work_dir = args.work_dir
 
-    execute(args.input, args.receptor, args.outfile, args.distance, mock=args.mock)
+    execute(args.input, args.receptor, args.outfile, args.distance, model=args.model, mock=args.mock)
 
 
 if __name__ == "__main__":
--- a/transfs.xml	Fri Mar 27 09:18:53 2020 -0400
+++ b/transfs.xml	Wed Apr 08 07:28:49 2020 -0400
@@ -1,11 +1,11 @@
-<tool id="xchem_transfs_scoring" name="XChem TransFS pose scoring" version="0.2.0">
+<tool id="xchem_transfs_scoring" name="XChem TransFS pose scoring" version="0.3.0">
     <description>using deep learning</description>
 
     <requirements>
         <!--requirement type="package" version="3.0.0">openbabel</requirement-->
         <!--requirement type="package" version="3.7">python</requirement-->
         <!-- many other requirements are needed -->
-        <container type="docker">informaticsmatters/deep-app-ubuntu-1604:0.9</container>
+        <container type="docker">informaticsmatters/deep-app-ubuntu-1604:1.2</container>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
 
@@ -24,7 +24,7 @@
 
     ## mkdir -p ligands &&
     cd ../ &&
-    python '$__tool_directory__/transfs.py' -i ./workdir/ligands.sdf -r ./workdir/receptor.pdb -d $distance -w /train/fragalysis_test_files/workdir &&
+    python '$__tool_directory__/transfs.py' -i ./workdir/ligands.sdf -r ./workdir/receptor.pdb -d $distance -w /train/fragalysis_test_files/workdir --model '$model' &&
     ls -l &&
     ls -l workdir &&
     sudo -u ubuntu cp ./workdir/output.sdf '$output' &&
@@ -44,6 +44,12 @@
         <param type="data" name="receptor" format="pdb" label="Receptor" help="Select a receptor (pdb format)."/>
         <param type="data" name="ligands" format="sdf,mol" label="Ligands" help="Ligands (docked poses) in SDF format)"/>
         <param name="distance" type="float" value="2.0" min="1.0" max="5.0" label="Distance to waters" help="Remove waters closer than this distance to any ligand heavy atom"/>
+        <param name="model" type="select" label="Model for predictions">
+            <option value="weights.caffemodel">No threshold (original model)</option>
+            <option value="10nm.0_iter_50000.caffemodel">10nM threshold</option>
+            <option value="50nm.0_iter_50000.caffemodel">50nM threshold</option>
+            <option value="200nm.0_iter_50000.caffemodel">200nM threshold</option>
+        </param>
         <param type="hidden" name="mock" value="" label="Mock calculations" help="Use random numbers instead of running on GPU"/>
     </inputs>
     <outputs>