Mercurial > repos > bgruening > openbabel_change_title
diff distance_finder.py @ 14:9db27a4302a2 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
author | bgruening |
---|---|
date | Mon, 19 Oct 2020 14:27:55 +0000 |
parents | 1c79ea18e7b5 |
children | 935042911dae |
line wrap: on
line diff
--- a/distance_finder.py Tue Jul 28 12:01:47 2020 +0000 +++ b/distance_finder.py Mon Oct 19 14:27:55 2020 +0000 @@ -11,7 +11,9 @@ # a property named distance1 where the numeric part is the index (starting from 1) of the points (in that example # there would be properties for distance1, distance2 and distance3. -import argparse, os, sys, math +import argparse +import math +import sys from openbabel import pybel @@ -30,7 +32,6 @@ :return: """ - points = [] # read the points @@ -41,7 +42,7 @@ p = line.split() if len(p) == 3: points.append((float(p[0]), float(p[1]), float(p[2]))) - log("Read points",p) + log("Read points", p) continue log("Failed to read line:", line) log('Found', len(points), 'atom points') @@ -56,7 +57,6 @@ try: # print("Processing mol", mol.title) - clone = pybel.Molecule(mol) clone.removeh() @@ -82,7 +82,7 @@ sdf_writer.write(mol) except Exception as e: - log('Failed to handle molecule: '+ str(e)) + log('Failed to handle molecule: ' + str(e)) continue sdf_writer.close() @@ -93,12 +93,10 @@ global work_dir parser = argparse.ArgumentParser(description='XChem distances - measure distances to particular points') - parser.add_argument('-i', '--input', help="SDF containing the 3D molecules to score)") parser.add_argument('-p', '--points', help="PDB format file with atoms") parser.add_argument('-o', '--outfile', default='output.sdf', help="File name for results") - args = parser.parse_args() log("XChem distances args: ", args)