Skip to content

Box size flag#1

Open
nottonofclay wants to merge 3 commits intomainfrom
box-size-flag
Open

Box size flag#1
nottonofclay wants to merge 3 commits intomainfrom
box-size-flag

Conversation

@nottonofclay
Copy link
Collaborator

@nottonofclay nottonofclay commented Apr 30, 2025

added a flag for box size :D

@nottonofclay nottonofclay requested a review from Copilot April 30, 2025 21:57
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 pull request introduces a new flag that controls the box size for solvent addition during protein preprocessing and updates the related function signatures and command line arguments.

  • Modified the prepare_protein function to accept a new box_size parameter and adjusted solvent addition logic accordingly.
  • Updated prepare_one and simulate_one signatures and the argparse configuration in batch_generate.py to pass the new box_size parameter.

Reviewed Changes

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

File Description
scripts/module/preprocess.py Added box_size parameter to prepare_protein and adjusted solvent logic.
scripts/batch_generate.py Updated function signatures and argparse options to pass box_size.

# Add the water molecules if we're using explicit solvent
if not implicit_solvent:
modeller.addSolvent(forcefield, padding=1.0 * unit.nanometers, ionicStrength=0.15 * unit.molar)
# Attmpt to match box size
Copy link

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

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

Correct the spelling error in the comment ('Attmpt' should be 'Attempt').

Suggested change
# Attmpt to match box size
# Attempt to match box size

Copilot uses AI. Check for mistakes.
Comment on lines +20 to 21
box_size(float): If 0.0 adds water solvent with padding = 1 Angstroms. If negative, attempts to match box size, defaulting back to padding = 1 Angstroms. If > 0, uses that value as a box size.

Copy link

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

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

[nitpick] Clarify the expected units and behavior of the box_size parameter in the docstring. For example, specify that a positive value is expected in Angstroms (which is converted to nanometers inside the function) and that negative values fall back to using a padding of 1 nm.

Suggested change
box_size(float): If 0.0 adds water solvent with padding = 1 Angstroms. If negative, attempts to match box size, defaulting back to padding = 1 Angstroms. If > 0, uses that value as a box size.
box_size (float, optional): The size of the simulation box. Positive values are interpreted as the box size in Angstroms
and are converted to nanometers internally. A value of 0.0 adds water solvent with a padding of 1 nm. Negative values
fall back to using a default padding of 1 nm. Defaults to None.

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.

1 participant