Skip to content

Commit

Permalink
include .bed file in classical Michrom tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
junioreif committed Oct 14, 2024
1 parent ca0dd51 commit 80be52a
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 15 deletions.
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ The following code snippet shows how to generate a single chromosome polymer mod
::

from OpenMiChroM.ChromDynamics import MiChroM
sim = MiChroM(name='GM12878_chr10', temperature=1.0, timeStep=0.01)
sim.setup(platform="Cuda")
sim.saveFolder('GM12878_chr10_simulation')
sim.buildClassicMichrom(ChromSeq='inputs/chr10_beads.txt')
sim = MiChroM(name='stomach_GRCh38', temperature=1.0, timeStep=0.01)
sim.setup(platform="cuda")
sim.saveFolder('stomach_GRCh38_chr10_simulation')
sim.buildClassicMichrom(ChromSeq='inputs/stomach_GRCh38.bed', chromosome='chr10')

sim.createReporters(statistics=True, traj=True, trajFormat="swb", energyComponents=True, interval=1000)
sim.run(nsteps=10**6, report=True, interval=10**4)
sim.createReporters(statistics=True, traj=True, trajFormat="cndb", energyComponents=True, interval=10**3)
sim.run(nsteps=10**5, report=True, interval=10**4)


Resources
Expand Down
103 changes: 94 additions & 9 deletions Tutorials/Chromosomes_simulations/Tutorial_MiChroM_Simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,55 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" *************************************************************************************** \n",
" **** **** *** *** *** *** *** *** OpenMiChroM-1.1.01 *** *** *** *** *** *** **** **** \n",
"\n",
" OpenMiChroM is a Python library for performing chromatin dynamics simulations. \n",
" OpenMiChroM uses the OpenMM Python API, \n",
" employing the MiChroM (Minimal Chromatin Model) energy function. \n",
" The chromatin dynamics simulations generate an ensemble of 3D chromosomal structures \n",
" that are consistent with experimental Hi-C maps, also allows simulations of a single \n",
" or multiple chromosome chain using High-Performance Computing \n",
" in different platforms (GPUs and CPUs). \n",
"\n",
" OpenMiChroM documentation is available at https://open-michrom.readthedocs.io \n",
"\n",
" OpenMiChroM is described in: Oliveira Junior, A. B & Contessoto, V, G et. al. \n",
" A Scalable Computational Approach for Simulating Complexes of Multiple Chromosomes. \n",
" Journal of Molecular Biology. doi:10.1016/j.jmb.2020.10.034. \n",
" We also thank the polychrom <https://github.com/open2c/polychrom> \n",
" where part of this code was inspired - 10.5281/zenodo.3579472. \n",
"\n",
" Copyright (c) 2024, The OpenMiChroM development team at \n",
" Rice University \n",
" *************************************************************************************** \n"
]
}
],
"source": [
"sim = MiChroM(name='GM12878_chr10', temperature=1.0, timeStep=0.01)"
"sim = MiChroM(name='stomach_GRCh38', temperature=1.0, timeStep=0.01)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using platform: CUDA\n"
]
}
],
"source": [
"sim.setup(platform=\"Cuda\")"
]
Expand All @@ -38,9 +75,39 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"FENEBond was added\n",
"AngleForce was added\n",
"RepulsiveSoftCore was added\n",
"TypetoType was added\n",
"IdealChromosome was added\n",
"FlatBottomHarmonic was added\n",
"Setting positions... loaded!\n",
"Setting velocities... loaded!\n",
"Context created!\n",
"\n",
"Simulation name: stomach_GRCh38\n",
"Number of beads: 2702, Number of chains: 1\n",
"Potential energy: 63.93571, Kinetic Energy: 1.51567 at temperature: 1.0\n",
"\n",
"Potential energy per forceGroup:\n",
" Values\n",
"FENEBond 55114.613361\n",
"AngleForce 0.993050\n",
"RepulsiveSoftCore 0.000000\n",
"TypetoType -216.843586\n",
"IdealChromosome -1.082162\n",
"FlatBottomHarmonic 117856.612623\n",
"Potential Energy (total) 172754.293286\n"
]
}
],
"source": [
"sim.buildClassicMichrom(ChromSeq='inputs/stomach_GRCh38.bed', chromosome='chr11')\n"
]
Expand All @@ -56,9 +123,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"#\"Progress (%)\"\t\"Step\"\t\"Speed (ns/day)\"\t\"Time Remaining\"\n",
"10.0%\t10000\t0\t--\n",
"20.0%\t20000\t1.46e+04\t0:04\n",
"30.0%\t30000\t1.44e+04\t0:04\n",
"40.0%\t40000\t1.38e+04\t0:03\n",
"50.0%\t50000\t1.34e+04\t0:03\n",
"60.0%\t60000\t1.3e+04\t0:02\n",
"70.0%\t70000\t1.28e+04\t0:02\n",
"80.0%\t80000\t1.26e+04\t0:01\n",
"90.0%\t90000\t1.25e+04\t0:00\n",
"100.0%\t100000\t1.24e+04\t0:00\n"
]
}
],
"source": [
"sim.run(nsteps=10**5, report=True, interval=10**4) #inbetween"
]
Expand Down

0 comments on commit 80be52a

Please sign in to comment.