Skip to content

Commit 8c0f25d

Browse files
author
Paul Francoeur
committed
Fixed input to types_extender because there will only be 1 file per pocket
1 parent 0915437 commit 8c0f25d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

types_extender.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
55
Assumptions
66
i) The data structure is <ROOT>/<POCKET>/<FILES>
7-
ii) The name of the file containing the types lines to add is <ligname><SUFFIX> for each ligand in the pocket.
7+
ii) The name of the file containing the types lines to add is <NAME> for each pocket in the types file.
88
iii) the input types file has <POCKET>/<receptor file> from which to parse the needed pockets from.
99
1010
INPUT
1111
i) Original types file
1212
ii) New types filename
13-
iii) Suffix of file(s) in Pocket that contains the lines to add
13+
iii) Name of file in Pocket that contains the lines to add
1414
iv) The ROOT of the data directory
1515
1616
OUTPUT
@@ -28,7 +28,7 @@ def check_exists(filename):
2828
parser=argparse.ArgumentParser(description='Add lines to types file and create a new one. Assumes data file structure is ROOT/POCKET/FILES.')
2929
parser.add_argument('-i','--input',type=str,required=True,help='Types file you will be extending.')
3030
parser.add_argument('-o','--output',type=str,required=True,help='Name of the extended types file.')
31-
parser.add_argument('-s','--suffix',type=str,required=True,help='Suffix of the file(s) containing the lines to add for a given pocket. This is the output of generate_counterexample_typeslines.py.')
31+
parser.add_argument('-n','--name',type=str,required=True,help='Name of the file containing the lines to add for a given pocket. This is the output of generate_counterexample_typeslines.py.')
3232
parser.add_argument('-r','--root',default='',help='Root of the data directory. Defaults to current working directory.')
3333
args=parser.parse_args()
3434

@@ -42,8 +42,6 @@ def check_exists(filename):
4242

4343
if pocket not in completed:
4444
completed.add(pocket)
45-
toadd=glob.glob(os.path.join(args.root,pocket,'')+'*'+args.suffix)
46-
for thing in toadd:
47-
with open(thing) as linesfile:
48-
for line2 in linesfile:
49-
outfile.write(line2)
45+
with open(os.path.join(args.root,pocket,args.name)) as linesfile:
46+
for line2 in linesfile:
47+
outfile.write(line2)

0 commit comments

Comments
 (0)