Skip to content
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

py2/3 compatibility #6

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 15 additions & 38 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@
+-----------------------+-+


TADdyn is a Python library that allows to model and explore single or time-series 3C-based data.
These datasets are constituted by interaction matrices that describe distinct stages of naturally
occurring or induced cellular process such as the cell trans-differentiation, or reprogramming.
With TADdyn the user can load at once the raw and normalised interaction binned matrices (Hi-C like matrices)
at each of the experimental stages, build 4D models, and finally, extract structural properties from the models.
The 4D models reproduce the expected interaction patterns at the experimental time-points,
and also describe the structural modifications at intermediate moments (between stages) under the hypothesis
that the changes occurring between consecutive experimental time-points are smooth. To do this,
TADdyn is designed as a combination of restraint-based modelling, and steered Langevin dynamics of Physics-based
chromatin models.
TADphys.

Documentation
*************
Expand All @@ -25,22 +16,11 @@ Documentation
| 1 - Download lammps
| git clone -b stable https://github.com/lammps/lammps.git mylammps

| 2 - Download the colvar modified version
| git clone https://github.com/david-castillo/colvars

| 3 - Update the user-defined colvars library
| ./colvars/update-colvars-code.sh ./mylammps/

| 4 - Compile colvars library
| cd ./mylammps/lib/colvars
| make -f Makefile.g++

| 5 - Install lammps as a shared library
| 2 - Install lammps as a shared library
| cd ../../src/
| include "-DLAMMPS_EXCEPTIONS" in the LMP_INC line in src/MAKE/Makefile.serial
| make yes-user-colvars
| include "-DLAMMPS_EXCEPTIONS" in the LMP_INC line in src/MAKE/Makefile.mpi
| make yes-molecule
| make serial mode=shlib
| make mpi mode=shlib
| make install-python

| cd ../../
Expand All @@ -49,38 +29,35 @@ Documentation
| conda install -y scipy # scientific computing in python
| conda install -y numpy # scientific computing in python
| conda install -y matplotlib # to produce plots
| conda install -y jupyter # this notebook :)
| conda install -y -c https://conda.anaconda.org/bcbio pysam # to deal with SAM/BAM files
| conda install -y -c https://conda.anaconda.org/salilab imp # for 3D modeling
| conda install -y -c bioconda mcl # for clustering

**Install TADdyn**
| 1 - Download TADdyn from the Github repository
| git clone https://github.com/david-castillo/TADbit.git -b TADdyn TADdyn
**Install TADphys**
| 1 - Download TADphys from the Github repository
| git clone https://github.com/MarcoDiS/TADphys.git -b TADphys TADphys

| 2 - Install TADdyn
| cd TADdyn
| 2 - Install TADphys
| cd TADphys
| python setup.py install
| cd ..

**Try TADdyn**
| cd test/Sox2
| python test_TADdyn_on_Sox2.py
| cd test/
| python test_TADphys.py

Citation
********
Please, cite this article if you use TADdyn.
Please, cite this article if you use TADphys.

Marco Di Stefano, Ralph Stadhouders, Irene Farabella, David Castillo, François Serra, Thomas Graf, Marc A. Marti-Renom.
**Dynamic simulations of transcriptional control during cell reprogramming reveal spatial chromatin caging.**
*bioRxiv* 642009; `doi: https://doi.org/10.1101/642009`_

Methods implemented in TADdyn
Methods implemented in TADphys
-----------------------------
In the actual implementation, TADdyn relies on TADbit for the preparation of the 3C-based datasets from mapping to normalization,
In the actual implementation, TADphys relies on TADbit for the models' analysis
and on LAMMPS [Plimpton]_ for the implementation of the simulations.

Bibliography
************

.. [Plimpton] Plimpton, S. Fast Parallel Algorithms for Short-Range Molecular Dynamics. J Comp Phys 117, 1-19 (1995) and Fiorin, G., Klein, M.L. & Hénin, J. Using collective variables to drive molecular dynamics simulations. Molecular Physics 111, 3345-3362 (2013).
.. [Plimpton] Plimpton, S. Fast Parallel Algorithms for Short-Range Molecular Dynamics. J Comp Phys 117, 1-19 (1995) and Fiorin, G., Klein, M.L. & Hénin, J. Using collective variables to drive molecular dynamics simulations. Molecular Physics 111, 3345-3362 (2013).
73 changes: 73 additions & 0 deletions TADphys.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Metadata-Version: 1.0
Name: TADphys
Version: 0.1
Summary: Tadphys is a Python library that allows to model and explore single or time-series 3C-based data.
Home-page: UNKNOWN
Author: Marco Di Stefano
Author-email: marco.di.distefano.1985@gmail.com
License: GPLv3
Description:

+-----------------------+-+
| | |
| Current version: pipeline_v0.2.722 |
| | |
+-----------------------+-+


TADphys.

Documentation
*************

**Install LAMMPS as a shared library**
| 1 - Download lammps
| git clone -b stable https://github.com/lammps/lammps.git mylammps

| 2 - Install lammps as a shared library
| cd ../../src/
| include "-DLAMMPS_EXCEPTIONS" in the LMP_INC line in src/MAKE/Makefile.mpi
| make yes-molecule
| make mpi mode=shlib
| make install-python

| cd ../../

**Install packages**
| conda install -y scipy # scientific computing in python
| conda install -y numpy # scientific computing in python
| conda install -y matplotlib # to produce plots
| conda install -y -c https://conda.anaconda.org/bcbio pysam # to deal with SAM/BAM files

**Install TADphys**
| 1 - Download TADphys from the Github repository
| git clone https://github.com/MarcoDiS/TADphys.git -b TADphys TADphys

| 2 - Install TADphys
| cd TADphys
| python setup.py install
| cd ..

**Try TADdyn**
| cd test/
| python test_TADphys.py

Citation
********
Please, cite this article if you use TADphys.

Marco Di Stefano, Ralph Stadhouders, Irene Farabella, David Castillo, François Serra, Thomas Graf, Marc A. Marti-Renom.
**Dynamic simulations of transcriptional control during cell reprogramming reveal spatial chromatin caging.**
*bioRxiv* 642009; `doi: https://doi.org/10.1101/642009`_

Methods implemented in TADphys
-----------------------------
In the actual implementation, TADphys relies on TADbit for the models' analysis
and on LAMMPS [Plimpton]_ for the implementation of the simulations.

Bibliography
************

.. [Plimpton] Plimpton, S. Fast Parallel Algorithms for Short-Range Molecular Dynamics. J Comp Phys 117, 1-19 (1995) and Fiorin, G., Klein, M.L. & Hénin, J. Using collective variables to drive molecular dynamics simulations. Molecular Physics 111, 3345-3362 (2013).

Platform: OS Independent
29 changes: 29 additions & 0 deletions TADphys.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
README.rst
setup.py
TADphys.egg-info/PKG-INFO
TADphys.egg-info/SOURCES.txt
TADphys.egg-info/dependency_links.txt
TADphys.egg-info/top_level.txt
src/3d-lib/squared_distance_matrix_calculation_py.c
tadphys/Chromosome_region.py
tadphys/__init__.py
tadphys/_version.py
tadphys/chromosome.py
tadphys/experiment.py
tadphys/hic_data.py
tadphys/modelling/HIC_CONFIG.py
tadphys/modelling/LAMMPS_CONFIG.py
tadphys/modelling/__init__.py
tadphys/modelling/impoptimizer.py
tadphys/modelling/lammps_modelling.py
tadphys/modelling/lammpsmodel.py
tadphys/modelling/restraints.py
tadphys/modelling/structuralmodel.py
tadphys/utils/__init__.py
tadphys/utils/extraviews.py
tadphys/utils/hic_filtering.py
tadphys/utils/hic_parser.py
tadphys/utils/maths.py
tadphys/utils/modelAnalysis.py
tadphys/utils/tadmaths.py
test/test_TADdyn_on_Sox2.py
1 change: 1 addition & 0 deletions TADphys.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions TADphys.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tadphys
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from os import environ
from subprocess import Popen, PIPE, check_call, CalledProcessError

from taddyn._version import __version__
from tadphys._version import __version__

# ## Check if we have X display http://stackoverflow.com/questions/8257385/automatic-detection-of-display-availability-with-matplotlib
# if not "DISPLAY" in environ:
Expand All @@ -19,11 +19,11 @@

def get_dependencies_version(dico=False):
"""
Check versions of TADdyn and all dependencies, as well and retrieves system
Check versions of TADphys and all dependencies, as well and retrieves system
info. May be used to ensure reproducibility.
:returns: string with description of versions installed
"""
versions = {' TADdyn': __version__ + '\n\n'}
versions = {' TADphys': __version__ + '\n\n'}

try:
import scipy
Expand Down Expand Up @@ -62,11 +62,11 @@ def get_dependencies_version(dico=False):
sorted(versions.keys())])


from taddyn.chromosome import Chromosome
from taddyn.experiment import Experiment, load_experiment_from_reads
from taddyn.chromosome import load_chromosome
from tadphys.chromosome import Chromosome
from tadphys.experiment import Experiment, load_experiment_from_reads
from tadphys.chromosome import load_chromosome
# from taddyn.modelling.structuralmodels import StructuralModels
# from taddyn.modelling.structuralmodels import load_structuralmodels
# from taddyn.utils.hic_parser import load_hic_data_from_reads
# from taddyn.utils.hic_parser import load_hic_data_from_bam
from taddyn.utils.hic_parser import read_matrix
from tadphys.utils.hic_parser import read_matrix
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

from string import ascii_lowercase as letters
from copy import deepcopy as copy
from cPickle import load, dump
from pickle import load, dump
from random import random
from math import sqrt
from sys import stderr
from os.path import exists
import taddyn
from taddyn.experiment import Experiment
# from taddyn.alignment import Alignment, randomization_test
import tadphys
from tadphys.experiment import Experiment
# from tadphys.alignment import Alignment, randomization_test

try:
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -276,7 +276,7 @@ def get_experiment(self, name):
This can also be done directly with Chromosome.experiments[name].

:param name: name of the experiment to select
:returns: :class:`taddyn.Experiment`
:returns: :class:`tadphys.Experiment`
"""
for exp in self.experiments:
if exp.name == name:
Expand Down Expand Up @@ -379,9 +379,9 @@ def save_chromosome(self, out_f, fast=True, divide=True, force=False):
# simply shuffled
# :param 1000 rnd_num: number of randomizations to do
# :param reciprocal method: if global, Needleman-Wunsch is used to align
# (see :func:`taddyn.boundary_aligner.globally.needleman_wunsch`);
# (see :func:`tadphys.boundary_aligner.globally.needleman_wunsch`);
# if reciprocal, a method based on reciprocal closest boundaries is
# used (see :func:`taddyn.boundary_aligner.reciprocally.reciprocal`)
# used (see :func:`tadphys.boundary_aligner.reciprocally.reciprocal`)

# :returns: an alignment object or, if the randomizattion was invoked,
# an alignment object, and a list of statistics that are, the alignment
Expand Down Expand Up @@ -485,7 +485,7 @@ def add_experiment(self, name, resolution=None, tad_def=None, hic_data=None,
# verbose=True, max_tad_size="max", heuristic=True,
# batch_mode=False, **kwargs):
# """
# Call the :func:`taddyn.tadbit.tadbit` function to calculate the
# Call the :func:`tadphys.tadbit.tadbit` function to calculate the
# position of Topologically Associated Domain boundaries

# :param experiment: A square matrix of interaction counts of Hi-C
Expand Down Expand Up @@ -639,7 +639,7 @@ def __update_size(self, xpr):
# :param True normalized: show the normalized data (weights might have
# been calculated previously). *Note: white rows/columns may appear in
# the matrix displayed; these rows correspond to filtered rows (see*
# :func:`taddyn.utils.hic_filtering.hic_filtering_for_modelling` *)*
# :func:`tadphys.utils.hic_filtering.hic_filtering_for_modelling` *)*
# :param True relative: color scale is relative to the whole matrix of
# data, not only to the region displayed
# :param True decorate: draws color bar, title and axes labels
Expand Down Expand Up @@ -903,14 +903,14 @@ def __update_size(self, xpr):
class ExperimentList(list):
"""
Inherited from python built in :py:func:`list`, modified for TADbit
:class:`taddyn.Experiment`.
:class:`tadphys.Experiment`.

Mainly, `getitem`, `setitem`, and `append` were modified in order to
be able to search for experiments by index or by name, and to add
experiments simply using Chromosome.experiments.append(Experiment).

The whole ExperimentList object is linked to a Chromosome instance
(:class:`taddyn.Chromosome`).
(:class:`tadphys.Chromosome`).

"""
def __init__(self, thing, crm):
Expand Down Expand Up @@ -971,12 +971,12 @@ def append(self, exp):

class AlignmentDict(dict):
"""
:py:func:`dict` of :class:`taddyn.Alignment`
:py:func:`dict` of :class:`tadphys.Alignment`

Modified getitem, setitem, and append in order to be able to search
alignments by index or by name.

linked to a :class:`taddyn.Chromosome`
linked to a :class:`tadphys.Chromosome`
"""

def __getitem__(self, nam):
Expand Down
Loading