-
Notifications
You must be signed in to change notification settings - Fork 17
pi-thon 3.14 fixes #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mimakaev
wants to merge
14
commits into
master
Choose a base branch
from
mi/3.14_fixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b7f3c69
contactmaps 3.14 compatible; black/isort
mimakaev a164043
contactmaps multiprocessing friendly
mimakaev 8735dc3
legacy code README
mimakaev c941c06
test and type hints
mimakaev 5f34fc8
black isort
mimakaev 4547dd0
change compression ops to be faster
mimakaev a441dba
Merge branch 'master' into mi/3.14_fixes
mimakaev dff3fa5
deprecate old code
mimakaev 3831b64
address vscode warnings
mimakaev 2d8ac8e
docstrings to raw strings
mimakaev 7740357
last updates
mimakaev 48404d8
Update tests/test_starting_conformations.py
mimakaev 6acac51
Update tests/test_hdf5_format.py
mimakaev 06af7ca
fix in list_URIs
mimakaev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,4 @@ polychrom/_polymer_math.cpp | |
| .idea | ||
| dist | ||
| polychrom/*.so | ||
| .vscode | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| Polychrom is an Open2C polymer simulation library designed to build mechanistic models of chromosomes. It simulates biological processes subject to forces or constraints, which are then compared to Hi-C maps, microscopy, and other data sources. | ||
|
|
||
| ## Development Commands | ||
|
|
||
| ### Installation | ||
| ```bash | ||
| pip install cython # Required dependency | ||
| pip install -r requirements.txt | ||
| pip install -e . # Install in development mode | ||
| ``` | ||
|
|
||
| ### Testing | ||
| ```bash | ||
| pytest # Run all tests | ||
| ``` | ||
|
|
||
| ### Building Cython Extensions | ||
| ```bash | ||
| python setup.py build_ext --inplace | ||
| ``` | ||
|
|
||
| ## Architecture | ||
|
|
||
| ### Core Components | ||
|
|
||
| **Simulation Module** (`polychrom/simulation.py`) | ||
| - Central `Simulation` class manages the entire simulation lifecycle | ||
| - Handles platform setup (CUDA/OpenCL/CPU), integrators, and parameters | ||
| - Methods: `set_data()` for loading conformations, `add_force()` for adding forces, `doBlock()` for running simulation steps | ||
|
|
||
| **Forces System** (`polychrom/forces.py`, `polychrom/forcekits.py`) | ||
| - Forces define polymer behavior: connectivity, confinement, crosslinks, tethering | ||
| - Individual forces in `forces.py` are functions that create OpenMM force objects | ||
| - Complex force combinations are packaged as "forcekits" (e.g., `polymer_chains`) | ||
| - Legacy forces available in `polychrom/legacy/forces.py` | ||
|
|
||
| **Data Storage** (`polychrom/hdf5_format.py`) | ||
| - HDF5Reporter handles simulation output in HDF5 format | ||
| - Backwards compatibility with legacy format via legacy reporter | ||
| - `polymerutils.load()` function reads both new and old formats | ||
|
|
||
| **Starting Conformations** (`polychrom/starting_conformations.py`) | ||
| - Functions to generate initial polymer configurations | ||
| - Example: `grow_cubic()` creates a cubic lattice conformation | ||
|
|
||
| ### Key Design Patterns | ||
|
|
||
| 1. **Force Architecture**: Forces are simple functions that wrap OpenMM force objects, returning the force with a `.name` attribute | ||
| 2. **Simulation Flow**: Initialize Simulation → Load data → Add forces → Run blocks in loop → Save via reporter | ||
| 3. **Extensibility**: Users can define custom forces in their scripts following the pattern in `forces.py` | ||
|
|
||
| ## Important Notes | ||
|
|
||
| - OpenMM is the underlying engine (required dependency not in requirements.txt) | ||
| - Cython extensions in `_polymer_math.pyx` require compilation | ||
| - Main use case is loop extrusion simulations (see `examples/loopExtrusion/`) | ||
| - Testing uses pytest with configuration in `pytest.ini` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| >>> python corr_noise.py [gpuid] | ||
| """ | ||
|
|
||
| import os | ||
| import sys | ||
| import time | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ | |
| In this simulation, a simple polymer chain of 10,000 monomers is simulated. | ||
| """ | ||
|
|
||
|
|
||
| import os | ||
| import sys | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| This folder contains legacy code for the 2016 loop extrusion paper. Not for use in production. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.