Skip to content

Conversation

@joserdf
Copy link
Member

@joserdf joserdf commented Jun 26, 2025

No description provided.

@joserdf joserdf requested review from Copilot and mpds June 26, 2025 00:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces functionality to apply MMFF94S parameters to receptors and generate a corresponding topology file.

  • Adds a new module (receptor_mmff94s.py) to load MMFF94S data and write topology in mmCIF format.
  • Injects MMFF atom types and partial charges into the mmCIF data structure.
  • Calls write_topology in main.py after modeller operations to produce a _topology.cif file.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
docktprep/receptor_mmff94s.py New functions to load MMFF94S parameters and write topology data into mmCIF files.
docktprep/main.py Invokes write_topology after receptor processing.
Comments suppressed due to low confidence (3)

docktprep/receptor_mmff94s.py:22

  • [nitpick] The parameter name file shadows the built-in Python name; consider renaming it to something like output_path for clarity.
def write_topology(receptor: Receptor, file: str):

docktprep/receptor_mmff94s.py:22

  • [nitpick] The file parameter is not described in the docstring; please add an Args: entry to clarify what this argument represents and its expected format.
def write_topology(receptor: Receptor, file: str):

docktprep/main.py:30

  • [nitpick] Topology generation is invoked unconditionally; consider adding a CLI flag (e.g., --write-topology) to let users opt in or out.
    write_topology(receptor, args.output)


mmcif_io = receptor.get_biopython_file_io(output_fmt="cif")
mmcif_io.set_dict(mmcif_dict)
with open(file.split(".")[0] + "_topology.cif", "w") as f:
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using file.split(".")[0] can mis-handle filenames with multiple dots or no extension; consider using os.path.splitext(output_path)[0] to derive the base name.

Suggested change
with open(file.split(".")[0] + "_topology.cif", "w") as f:
with open(os.path.splitext(file)[0] + "_topology.cif", "w") as f:

Copilot uses AI. Check for mistakes.
Returns:
dict: A dictionary containing MMFF94S parameters.
"""
with open("docktprep/mmff94s_dict.pkl", "rb") as f:
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Loading the pickle via a hard-coded relative path may break in deployed packages; consider using importlib.resources or pkg_resources to access bundled data.

Suggested change
with open("docktprep/mmff94s_dict.pkl", "rb") as f:
with importlib.resources.open_binary("docktprep", "mmff94s_dict.pkl") as f:

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants