Skip to content

Commit

Permalink
Merge pull request #4 from bneron/master
Browse files Browse the repository at this point in the history
renaming package
  • Loading branch information
tekpinar authored Oct 7, 2020
2 parents 88d543d + e775695 commit 015c9d6
Show file tree
Hide file tree
Showing 15 changed files with 183 additions and 134 deletions.
15 changes: 8 additions & 7 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM python:3.8.5

LABEL org.label-schema.vcs-url="https://github.com/tekpinar/correlationPlus"
LABEL org.label-schema.version="1.0.3"
LABEL org.label-schema.version="1.0.4"
LABEL org.label-schema.description="A Python API to plot and analyze dynamical correlations of proteins."
LABEL org.label-schema.docker.cmd="docker run -v ~:/home/correlationPlus correlation_plus <sub cmd> <args>"
LABEL org.label-schema.docker.cmd="docker run -v ~:/home/correlationplus correlationplus <sub cmd> <args>"

USER root

RUN pip3 install numpy==1.19.1 matplotlib==3.3.0 scipy==1.5.2 networkx==2.4 biopython==1.77 prody==1.10.11
RUN pip3 correlationPlus==0.1.3
RUN useradd -m correlationPlus
RUN pip3 install correlationplus==0.1.4
RUN pip3 install ipython

USER correlationPlus
WORKDIR /home/correlationPlus
RUN useradd -m correlationplus
USER correlationplus
WORKDIR /home/correlationplus

ENTRYPOINT ["/bin/sh", "-c" , "correlationPlus $0 $@"]
ENTRYPOINT ["/bin/sh", "-c" , "correlationplus $0 $@"]
111 changes: 78 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# CorrelationPlus
# correlationplus

A Python package to calculate, visualize and analyze dynamical correlations of proteins.

CorrelationPlus contains four scripts that you can use to calculate, visualize
correlationplus contains four scripts that you can use to calculate, visualize
and analyze dynamical correlations of proteins.
These correlations can be dynamical cross-correlations, linear mutual
information or generalized correlations.
Expand All @@ -13,57 +13,102 @@ information or generalized correlations.

We recommend to use pip
```bash
pip install correlationPlus
pip install correlationplus
```

or if you do not have administration rights
```bash
pip install --user correlationPlus
pip install --user correlationplus
```

If you prefer to use a virtualenv
```bash
python3 -m venv correlationPlus
cd correlationPlus
python3 -m venv correlationplus
cd correlationplus
source bin/activate
pip install correlationPlus
pip install correlationplus
```

### for developers

We recommend to use pip and a virtualenv
```bash
python3 -m venv correlationPlus
cd correlationPlus
python3 -m venv correlationplus
cd correlationplus
source bin/activate
mkdir src
cd src
git clone https://github.com/tekpinar/correlationPlus.git # or [email protected]:tekpinar/correlationPlus.git
cd correlationPlus
git clone https://github.com/tekpinar/correlationplus.git # or [email protected]:tekpinar/correlationplus.git
cd correlationplus
pip install -e .
```

## A Quick Start with correlationPlus Scripts
### from Docker image

Docker images are also available from [Docker Hub](https://hub.docker.com/r/structuraldynamicslab/correlationplus)
The computation inside the container will performed under *correlationplus* id in */home/correlationplus* directory.
So before to run a *correlationplus* container,
do not forget to create and mount a shared directory in the container.
This directory must be writable.

```bash
mkdir shared_dir
cp 6fl9_just_prot_anm_100_modes_rc_15_cross-correlations.txt 6fl9_centeredOrientedAligned2Z.pdb shared_dir
chmod 777 shared_dir
cd shared_dir
docker run -v $PWD:/home/correlationplus structuraldynamicslab/correlation_plus diffMap -i 6fl9_rc15_scalCoeff1_100_modes_lmi_v2.dat -j zacharias_rc15_scalCoeff15_100_modes_lmi.dat -p 6fl9_centeredOrientedAligned2Z.pdb -t lmi
```
It is also possible to run an ipython interactive session
```bash
docker run -v $PWD:/home/correlationplus --entrypoint /bin/bash -it structuraldynamicslab/correlationplus:0.1.4rc2
```
then once in the container
```bash
ipython
```
### from Singularity image

As the docker image is registered in dockerhub you can also use it directly with [Singularity](https://sylabs.io/docs/)

```bash
singularity run docker://structuraldynamicslab/correlationplus diffMap -i 6fl9_rc15_scalCoeff1_100_modes_lmi_v2.dat -j zacharias_rc15_scalCoeff15_100_modes_lmi.dat -p 6fl9_centeredOrientedAligned2Z.pdb -t lmi
```
or in 2 steps

```bash
singularity pull correlationplus.simg docker://structuraldynamicslab/correlation_plus
./correlationplus.simg -i 6fl9_rc15_scalCoeff1_100_modes_lmi_v2.dat -j zacharias_rc15_scalCoeff15_100_modes_lmi.dat -p 6fl9_centeredOrientedAligned2Z.pdb -t lmi
```

Unlike docker you have not to worry about shared directory, your *home* and */tmp* are automatically shared.
You can also run an *ipython* interactive session.
```bash
singularity shell correlationplus.simg
```


## A Quick Start with correlationplus Scripts

### Calculating dynamical cross-correlations
Download examples folder and go there.

To calculate dynamical cross-correlations with Gaussian network model:
To calculate **dynamical cross-correlations** with **Gaussian** network model:

```bash
correlationPlus calculate -p 6fl9_centeredOrientedAligned2Z.pdb -m GNM -o gnm-ndcc.dat
correlationplus calculate -p 6fl9_centeredOrientedAligned2Z.pdb -m GNM -o gnm-ndcc.dat
```

To calculate dynamical cross-correlations with Anisotropic network model:
To calculate **dynamical cross-correlations** with **Anisotropic** network model:

```bash
correlationPlus calculate -p 6fl9_centeredOrientedAligned2Z.pdb -m ANM -o anm-ndcc.dat
correlationplus calculate -p 6fl9_centeredOrientedAligned2Z.pdb -m ANM -o anm-ndcc.dat
```

### Visualization of correlation maps
To run a simple example of visualization, you can use data and pdb files in the examples folder:

```bash
correlationPlus visualizemap -i 6fl9_just_prot_anm_100_modes_rc_15_cross-correlations.txt -p 6fl9_centeredOrientedAligned2Z.pdb -t absndcc
correlationplus visualizemap -i 6fl9_just_prot_anm_100_modes_rc_15_cross-correlations.txt -p 6fl9_centeredOrientedAligned2Z.pdb -t absndcc
```
This will produce plots of absolute values of dynamical cross correlations.

Expand All @@ -74,8 +119,8 @@ The correlation data has to be in matrix format, where only A(i,j) values are
listed in a square matrix format. LMI matrices produced by g_correlation
program of Lange and Grubmuller can also be parsed.

You can analyze the correlations with VMD just by loading the tcl files produced by
visualizemap script. You can call VMD and go to Extensions->Tk Console menu.
You can analyze the correlations with [VMD](https://www.ks.uiuc.edu/Research/vmd/) just by loading the tcl files produced by
visualizemap script. You can call *VMD* and go to *Extensions->Tk Console menu*.
Write the following command to see the correlations:
```bash
source correlation-interchain-chainsA-B.tcl
Expand All @@ -98,26 +143,26 @@ of ligated vs unligated simulations are some common examples.
The difference maps can be produced with diffMap app as follows:

```bash
correlationPlus diffMap -i 6fl9_rc15_scalCoeff1_100_modes_lmi_v2.dat -j zacharias_rc15_scalCoeff15_100_modes_lmi.dat -p 6fl9_centeredOrientedAligned2Z.pdb -t lmi
correlationplus diffMap -i 6fl9_rc15_scalCoeff1_100_modes_lmi_v2.dat -j zacharias_rc15_scalCoeff15_100_modes_lmi.dat -p 6fl9_centeredOrientedAligned2Z.pdb -t lmi
```

### Centraliy analysis of the correlation maps
### Centrality analysis of the correlation maps
Centrality analysis can be used to deduce active sites, binding sites,
key mutation sites and allosteric residues.
correlationPlus can do centrality analysis for your protein
via its centralityAnalysis app.
**correlationplus** can do centrality analysis for your protein
via its **centralityAnalysis** app.

It can compute degree, closeness, betweenness, current flow closeness,
current flow betweenness and eigenvector centrality. The following command
will do all of the above analysis:

```bash
correlationPlus centralityAnalysis -i 6fl9_just_prot_anm_100_modes_rc_15_cross-correlations.txt -p 6fl9_centeredOrientedAligned2Z.pdb -t absndcc
correlationplus centralityAnalysis -i 6fl9_just_prot_anm_100_modes_rc_15_cross-correlations.txt -p 6fl9_centeredOrientedAligned2Z.pdb -t absndcc
```
After the calculation, the centrality values will be inserted into Bfactor
After the calculation, the centrality values will be inserted into *Bfactor*
column of a pdb file. You can load the pdb files with your favorite visualization
software and color according to Bfactors. If you prefer VMD - as we do-,
the app will produces tcl files so that you can visualize the key residues with VMD.
software and color according to *Bfactors*. If you prefer *VMD* - as we do-,
the app will produces tcl files so that you can visualize the key residues with *VMD*.
The tcl script highlights the residues with the highest 10% of the selected centrality
in VDW representation.

Expand All @@ -130,22 +175,22 @@ For a detailed analysis, script interfaces provided by visualizemap, diffMap and
centralityAnalysis apps may not be sufficient. Therefore, you can use IPython
to load the functions and do a detailed analysis as follows.

```
from correlationPlus.visualize import *
```python
from correlationplus.visualize import *
```


You can get help for individual functions with

```
```python
help(intraChainCorrelationMaps)

```
You can check different valueFilters, distanceFilters for your analysis.
Even you can scan a range of values by calling the functions in a
loop.


## Licensing

correplationPlus is developed and released under GNU Lesser GPL Licence.
Please read to the COPYING and COPYING.LESSER files to know more.
*correlationplus* is developed and released under [GNU Lesser GPL Licence](https://www.gnu.org/licenses/lgpl-3.0.en.html).
Please read to the **COPYING** and **COPYING.LESSER** files to know more.
14 changes: 7 additions & 7 deletions correlationPlus/__init__.py → correlationplus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
###############################################################################
# correlationPlus - A Python package to calculate, visualize and analyze #
# correlationplus - A Python package to calculate, visualize and analyze #
# dynamical correlations maps of proteins. #
# Authors: Mustafa Tekpinar #
# Copyright Mustafa Tekpinar 2017-2018 #
# Copyright CNRS-UMR3528, 2019 #
# Copyright Institut Pasteur Paris, 2020 #
# #
# This file is part of correlationPlus. #
# This file is part of correlationplus. #
# #
# correlationPlus is free software: you can redistribute it and/or modify #
# correlationplus is free software: you can redistribute it and/or modify #
# it under the terms of the GNU Lesser General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# correlationPlus is distributed in the hope that it will be useful, #
# correlationplus is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU LESSER General Public License for more details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with correlationPlus. If not, see <https://www.gnu.org/licenses/>. #
# along with correlationplus. If not, see <https://www.gnu.org/licenses/>. #
###############################################################################

"""
Program Name: correlationPlus
Program Name: correlationplus
Author : Mustafa TEKPINAR
Email : [email protected]
Expand All @@ -34,5 +34,5 @@

__all__ = ['calculate', 'visualize', 'centralityAnalysis']

__version__ = '0.1.3'
__version__ = '0.1.4rc1'

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
##############################################################################
# correlationPlus - Python module to plot dynamical correlations maps #
# correlationplus - Python module to plot dynamical correlations maps #
# for proteins. #
# Authors: Mustafa Tekpinar #
# Copyright Mustafa Tekpinar 2017-2018 #
# Copyright CNRS-UMR3528, 2019 #
# Copyright Institut Pasteur Paris, 2020 #
# #
# This file is part of correlationPlus. #
# This file is part of correlationplus. #
# #
# correlationPlus is free software: you can redistribute it and/or modify #
# correlationplus is free software: you can redistribute it and/or modify #
# it under the terms of the GNU Lesser General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# correlationPlus is distributed in the hope that it will be useful, #
# correlationplus is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU LESSER General Public License for more details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with correlationPlus. If not, see <https://www.gnu.org/licenses/>. #
# along with correlationplus. If not, see <https://www.gnu.org/licenses/>. #
###############################################################################

import sys
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
###############################################################################
# correlationPlus - A Python package to calculate, visualize and analyze #
# correlationplus - A Python package to calculate, visualize and analyze #
# dynamical correlations maps of proteins. #
# Authors: Mustafa Tekpinar #
# Copyright Mustafa Tekpinar 2017-2018 #
# Copyright CNRS-UMR3528, 2019 #
# Copyright Institut Pasteur Paris, 2020 #
# #
# This file is part of correlationPlus. #
# This file is part of correlationplus. #
# #
# correlationPlus is free software: you can redistribute it and/or modify #
# correlationplus is free software: you can redistribute it and/or modify #
# it under the terms of the GNU Lesser General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# correlationPlus is distributed in the hope that it will be useful, #
# correlationplus is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU LESSER General Public License for more details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with correlationPlus. If not, see <https://www.gnu.org/licenses/>. #
# along with correlationplus. If not, see <https://www.gnu.org/licenses/>. #
###############################################################################
Loading

0 comments on commit 015c9d6

Please sign in to comment.