File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ import os
2
+ import glob
3
+ from pdbfixer import PDBFixer
4
+ from openmm .app import PDBFile
5
+
6
+ base_dir = 'posebusters_benchmark_set'
7
+ suffix = '_protein.pdb'
8
+ new_suffix = '_protein_fix.pdb'
9
+ for in_file in list (glob .glob (f'posebusters_benchmark_set/*/*{ suffix } ' )):
10
+ prefix = os .path .basename (in_file ).removesuffix (suffix )
11
+ out_file = os .path .join (os .path .dirname (in_file ), prefix + new_suffix )
12
+ print (f'{ in_file } -> { out_file } ' )
13
+
14
+ fixer = PDBFixer (filename = in_file )
15
+ fixer .findMissingResidues ()
16
+ fixer .findNonstandardResidues ()
17
+ fixer .replaceNonstandardResidues ()
18
+ # fixer.removeHeterogens(True)
19
+ fixer .findMissingAtoms ()
20
+ fixer .addMissingAtoms ()
21
+
22
+ with open (out_file , 'w+' ) as out :
23
+ PDBFile .writeFile (fixer .topology , fixer .positions , out )
You can’t perform that action at this time.
0 commit comments