Add production run python scripts
Add production run python scripts as well as other ancillary example scripts
Summary by Sourcery
Add new Python scripts for production runs and protein-DNA analysis, enhancing the simulation capabilities and force calculations in the DNA analysis scripts.
New Features:
- Introduce new Python scripts for running production simulations and analyzing protein-DNA interactions.
Enhancements:
- Enhance DNA analysis scripts by adding new force calculations and simulation setup.
Reviewer's Guide by Sourcery
This PR adds production run Python scripts and analysis tools for DNA-protein simulations. The main changes include adding a new production run script with comprehensive simulation setup, modifying the DNA analysis script to remove protein-related code, and adding new analysis tools for computing DNA twist angles.
Sequence diagram for DNA-Protein Simulation Setup
sequenceDiagram
participant User
participant Script
participant OpenMM
participant DNA
participant Protein
participant ForceField
participant Simulation
User->>Script: Run simulation script
Script->>OpenMM: Initialize platform
Script->>DNA: Create DNA object
Script->>Protein: Create Protein object
Script->>ForceField: Create force field
ForceField->>Simulation: Create system
Script->>Simulation: Initialize simulation
Simulation->>Simulation: Add forces
Simulation->>Simulation: Run simulation steps
Simulation->>User: Output results
Sequence diagram for DNA Twist Angle Computation
sequenceDiagram
participant User
participant Script
participant DNA
participant ComputeTwist
User->>Script: Run twist computation script
Script->>DNA: Load DNA structure
Script->>ComputeTwist: Compute twist angles
ComputeTwist->>Script: Return twist angles
Script->>User: Output twist angles
Class diagram for DNA and Protein Simulation
classDiagram
class DNA {
+fromCoarsePDB(file: str)
+periodic: bool
}
class Protein {
+fromCoarsePDB(file: str, sequence: str)
+setup_virtual_sites(system)
+periodic: bool
}
class ForceField {
+createSystem(topology)
}
class Simulation {
+context: Context
+reporters: list
+step(steps: int)
+minimizeEnergy()
+loadCheckpoint(file: str)
}
class Context {
+setPositions(positions)
+setVelocitiesToTemperature(temperature)
+getState(getEnergy: bool, groups: int)
}
class Integrator {
+setTemperature(temperature)
}
class Platform {
+getPlatformByName(name: str)
+setPropertyDefaultValue(property: str, value: str)
}
DNA --> ForceField
Protein --> ForceField
ForceField --> Simulation
Simulation --> Context
Simulation --> Integrator
Simulation --> Platform
Context --> Integrator
Context --> Platform
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Added a new production run script for DNA-protein simulations |
|
open3SPN2/scripts/protein_DNA_run.py |
| Modified DNA analysis script to focus on DNA-specific calculations |
|
examples/DNA_analysis.py |
| Added DNA twist computation utilities |
|
open3SPN2/compute_twist.py |
| Added analysis scripts for protein-DNA simulations |
|
open3SPN2/scripts/protein_DNA_analysis.pyexamples/protein_DNA_analysis.pyexamples/DNA_analysis_PU1_AMHGo.py |
Tips and commands
Interacting with Sourcery
-
Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it.
-
Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. -
Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted.
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Newest commits have segregated relatively duplicate amongst forces terms code into separate forces_setup.py so you don't need to change the forces terms code multiple times across multiple scripts. This removes potential future errors down the road where one script (say run script) had modified inclusion of forces terms and another script forgot to modify (say analysis script).
And also updated and cleaned the info.dat generation file in the analysis script. Ensure to modify or at least check the analysis script, the info.dat generation parts, if you edit or customize the forces_setup.py file from the original. The info.dat file is verified to have Total Energies be the same as the intended terms (not Q or Rg) as of latest revisions.