Skip to content

Commit

Permalink
[bugfix] escape some pyright warnings and fix ad4 option parsing in a…
Browse files Browse the repository at this point in the history
…utogrid runner
  • Loading branch information
Hong-Rui Lin committed Apr 8, 2024
1 parent 183dbd8 commit 089cc4f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 123 deletions.
Empty file.
121 changes: 0 additions & 121 deletions unidock_tools/src/unidock_tools/data/docking/AD4.1_bound.dat

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ def __prepare_protein_pdb_file__(self):
protein_cleaned_ag = protein_cleaned_universe.atoms
residue_group = protein_cleaned_ag.residues

########################################
## to get rid of annoying test warnings
current_segid = 'A'
########################################
for current_residue_idx, current_residue in enumerate(residue_group):
prepared_resid = current_residue.resid
for segment_idx, segment_resid_list in enumerate(segment_resid_nested_list):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def run(self):
num_grid_points=self.num_grid_points,
grid_spacing=self.grid_spacing,
covalent_residue_atom_info_list=covalent_residue_atom_info_list,
generate_ad4_grids=self.generate_ad4_grids,
working_dir_name=current_working_dir_name)

docking_grids_generator.generate_docking_grids()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@ def generate_docking_grids(self):
gpf_generator.write_grid_parameter_file()

autogrid_binary_file_name = os.path.join(os.path.dirname(__file__), 'bin', 'autogrid4')
autogrid_chmod_command = f'chmod +x {autogrid_binary_file_name}'
autogrid_command = f'cd {self.working_dir_name}; {autogrid_binary_file_name} -p {os.path.basename(protein_output_gpf_file_name)} -l {os.path.basename(protein_output_glg_file_name)}; cd -'
os.system(autogrid_chmod_command)
os.system(autogrid_command)
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
from unidock_tools.modules.protein_prep.receptor_topology.smarts_definition import HB_DONOR, HB_ACCEPTOR
from unidock_tools.modules.protein_prep.receptor_topology.amber_atom_types import AMBER_RESIDUE_PARAMETER_DICT


class ProteinPDBQTWriter(object):
def __init__(self,
protein_pdb_file_name,
working_dir_name='.'):

self.residue_parameter_dict = AMBER_RESIDUE_PARAMETER_DICT

self.protein_pdb_file_name = os.path.abspath(protein_pdb_file_name)
self.protein_mol, self.protein_residue_mol_list = prepare_protein_residue_mol_list(self.protein_pdb_file_name)

Expand Down Expand Up @@ -112,6 +110,10 @@ def write_protein_pdbqt_file(self):
self.pdbqt_atom_line_list = []
self.pdbqt_atom_line_format = '{:4s} {:5d} {:^4s} {:3s} {:1s}{:4d} {:8.3f}{:8.3f}{:8.3f}{:6.2f}{:6.2f} {:6.3f} {:<2s}\n'

if self.protein_mol.GetNumAtoms() == 0:
raise ValueError('Empty protein mol!!')

atom_idx = 0
for atom in self.protein_mol.GetAtoms():
atom_idx = atom.GetIntProp('atom_idx')
atom_info_tuple = ('ATOM', # atom record name
Expand Down

0 comments on commit 089cc4f

Please sign in to comment.