annotate multi_obgrep.py @ 13:274193d6c443 draft default tip

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 327c29cc43f56d7067ab9fa51323ea31951db98b"
author bgruening
date Tue, 10 Nov 2020 20:32:42 +0000
parents 2912ebf12ef2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
1 #!/usr/bin/env python
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
2 """
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
3 Input: Molecules in SDF, SMILES ...
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
4 Output: Molecule file filtered with obgrep.
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
5 Copyright 2013, Bjoern Gruening and Xavier Lucas
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
6 """
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
7 import argparse
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
8 import multiprocessing
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
9 import os
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
10 import shlex
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
11 import shutil
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
12 import subprocess
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
13 import tempfile
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
14
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
15
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
16 def parse_command_line():
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
17 parser = argparse.ArgumentParser()
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
18 parser.add_argument('-i', '--infile', required=True, help='Molecule file.')
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
19 parser.add_argument('-q', '--query', required=True, help='Query file, containing different SMARTS in each line.')
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
20 parser.add_argument('-o', '--outfile', required=True, help='Path to the output file.')
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
21 parser.add_argument("--iformat", help="Input format, like smi, sdf, inchi")
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
22 parser.add_argument("--n-times", dest="n_times", type=int,
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
23 default=0, help="Print a molecule only if the pattern occurs # times inside the molecule.")
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
24 parser.add_argument('-p', '--processors', type=int, default=multiprocessing.cpu_count())
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
25 parser.add_argument("--invert-matches", dest="invert_matches", action="store_true",
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
26 default=False, help="Invert the matching, print non-matching molecules.")
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
27 parser.add_argument("--only-name", dest="only_name", action="store_true",
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
28 default=False, help="Only print the name of the molecules.")
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
29 parser.add_argument("--full-match", dest="full_match", action="store_true",
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
30 default=False, help="Full match, print matching-molecules only when the number of heavy atoms is also equal to the number of atoms in the SMARTS pattern.")
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
31 parser.add_argument("--number-of-matches", dest="number_of_matches", action="store_true",
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
32 default=False, help="Print the number of matches.")
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
33 return parser.parse_args()
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
34
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
35
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
36 results = list()
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
37
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
38
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
39 def mp_callback(res):
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
40 results.append(res)
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
41
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
42
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
43 def mp_helper(query, args):
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
44 """
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
45 Helper function for multiprocessing.
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
46 That function is a wrapper around obgrep.
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
47 """
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
48
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
49 cmd_list = []
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
50 if args.invert_matches:
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
51 cmd_list.append('-v')
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
52 if args.only_name:
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
53 cmd_list.append('-n')
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
54 if args.full_match:
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
55 cmd_list.append('-f')
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
56 if args.number_of_matches:
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
57 cmd_list.append('-c')
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
58 if args.n_times:
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
59 cmd_list.append('-t %s' % str(args.n_times))
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
60
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
61 tmp = tempfile.NamedTemporaryFile(delete=False)
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
62 cmd = 'obgrep %s "%s" %s' % (' '.join(cmd_list), query, args.infile)
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
63 child = subprocess.Popen(shlex.split(cmd), stdout=open(tmp.name, 'w+'), stderr=subprocess.PIPE)
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
64
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
65 stdout, stderr = child.communicate()
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
66 return (tmp.name, query)
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
67
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
68
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
69 def obgrep(args):
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
70 temp_file = tempfile.NamedTemporaryFile()
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
71 temp_link = "%s.%s" % (temp_file.name, args.iformat)
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
72 temp_file.close()
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
73 os.symlink(args.infile, temp_link)
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
74 args.infile = temp_link
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
75
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
76 pool = multiprocessing.Pool(args.processors)
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
77 for query in open(args.query):
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
78 pool.apply_async(mp_helper, args=(query.strip(), args), callback=mp_callback)
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
79 # mp_callback(mp_helper(query.strip(), args))
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
80 pool.close()
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
81 pool.join()
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
82
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
83 out_handle = open(args.outfile, 'wb')
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
84 for result_file, query in results:
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
85 res_handle = open(result_file, 'rb')
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
86 shutil.copyfileobj(res_handle, out_handle)
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
87 res_handle.close()
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
88 os.remove(result_file)
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
89 out_handle.close()
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
90
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
91 os.remove(temp_link)
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
92
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
93
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
94 def __main__():
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
95 """
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
96 Multiprocessing obgrep search.
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
97 """
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
98 args = parse_command_line()
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
99 obgrep(args)
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
100
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
101
12
2912ebf12ef2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 1fe240ef0064a1a4a66d9be1ccace53824280b75"
bgruening
parents: 11
diff changeset
102 if __name__ == "__main__":
0
b0311f002a5f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 8350bb3a632722c33bc91ec5238d47a536903729
bgruening
parents:
diff changeset
103 __main__()