Skip to content

Commit 0732e72

Browse files
Update conformer_demo.py
1 parent f1a31f5 commit 0732e72

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

scripts/conformer_demo/conformer_demo.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def analyse(conformers: conformer.ConformerHitList) -> molecule:
6666
print(f'Most probable conformer RMSD wrt input: {round(most_probable_conformer.rmsd(), 3)}; '
6767
f'wrt minimised: {round(most_probable_conformer.rmsd(wrt="minimised"), 3)}.')
6868

69-
print(f'Scores of top 10 conformers: ', end='')
69+
print('Scores of top 10 conformers: ', end='')
7070

7171
top_ten = conformers[:10]
7272
for i in range(len(top_ten)):
@@ -85,7 +85,7 @@ def overlay(conformers, query: str, output_filename: str) -> None:
8585
:param query: SMARTS pattern which the conformers will overlay on top of.
8686
Should be consistent across all conformers, e.g. benzene ring.
8787
"""
88-
print(f'Overlaying conformers ... ', end='')
88+
print('Overlaying conformers ... ', end='')
8989
conformers_mols = [c.molecule for c in conformers]
9090
ss_search = SubstructureSearch()
9191
substructure = SMARTSSubstructure(query)
@@ -113,8 +113,8 @@ def write_conformers_to_file(conformers: conformer.ConformerHitList, filename: s
113113
"""
114114

115115
with io.MoleculeWriter(filename) as writer:
116-
for conformer in conformers:
117-
writer.write(conformer.molecule)
116+
for conf in conformers:
117+
writer.write(conf.molecule)
118118

119119

120120
if __name__ == '__main__':
@@ -124,12 +124,12 @@ def write_conformers_to_file(conformers: conformer.ConformerHitList, filename: s
124124
mol = read(input_filename)
125125

126126
# Generate conformers
127-
conformers = generate_conformers(mol, 20)
127+
confs = generate_conformers(mol, 20)
128128

129129
# Provide summary of analysis
130-
analyse(conformers)
130+
analyse(confs)
131131

132132
# Overlay structures based on common substructure
133133
query = 'c1cncnc1'
134134
output_filename = f'superimposed_{input_filename}'
135-
overlay(conformers, query, output_filename)
135+
overlay(confs, query, output_filename)

0 commit comments

Comments
 (0)