Code Monkey home page Code Monkey logo

adaptivepele's Introduction

AdaptivePELE

MIT license GitHub release PyPI release Conda release DOI

AdaptivePELE is a Python module to perform enhancing sampling of molecular simulation built around the Protein Energy Landscape Exploration method (PELE) developed in the Electronic and Atomic Protein Modelling grop (EAPM) at the Barcelona Supercomputing Center (BSC).

Usage

AdaptivePELE is called with a control file as input parameter. The control file is a json document that contains 4 sections: general parameters, simulation parameters, clustering parameters and spawning parameters. The first block refers to general parameters of the adaptive run, while the other three blocks configure the three steps of an adaptive sampling run, first run a propagation algorithm (simulation), then cluster the trajectories obtained (clustering) and finally select the best point to start the next iteration (spawning).

An example of usage:

python -m AdaptivePELE.adaptiveSampling controlFile.conf

Installation

There are two methods to install AdaptivePELE, from repositories, either PyPI or Conda (recommended), or directly from source.

To install from PyPI simply run:

pip install AdaptivePELE

To install from Conda simply run:

conda install -c nostrumbiodiscovery -c conda-forge adaptive_pele

To install from source, you need to install and compile cython files in the base folder with:

git clone https://github.com/AdaptivePELE/AdaptivePELE.git
cd AdaptivePELE
python setup.py build_ext --inplace

Also, if AdaptivePELE was not installed in a typical library directory, a common option is to add it to your local PYTHONPATH:

export PYTHONPATH="/location/of/AdaptivePELE:$PYTHONPATH"

Documentation

The documentation for AdaptivePELE can be found here

Contributors

Daniel Lecina, Joan Francesc Gilabert, Oriol Gracia, Daniel Soler

Mantainer

Joan Francesc Gilabert ([email protected])

Citation

AdaptivePELE is research software. If you make use of AdaptivePELE in scientific publications, please cite it. The BibTeX reference is:

@article{Lecina2017,
author = {Lecina, Daniel and Gilabert, Joan Francesc and Guallar, Victor},
doi = {10.1038/s41598-017-08445-5},
issn = {2045-2322},
journal = {Scientific Reports},
number = {1},
pages = {8466},
pmid = {28814780},
title = {{Adaptive simulations, towards interactive protein-ligand modeling}},
url = {http://www.nature.com/articles/s41598-017-08445-5},
volume = {7},
year = {2017}
}

adaptivepele's People

Contributors

albertcs avatar alexismolinamr avatar carlesperez94 avatar cescgina avatar chdominguez avatar danielsoler93 avatar lecina avatar martimunicoy avatar oriolgracar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

adaptivepele's Issues

TypeError: float argument required, not numpy.ndarray

Al acabar la primera epoca e intentar clusteritzar surt aquest error:

TypeError: float argument required, not numpy.ndarray

Traceback (most recent call last):
File "PelePlop/main.py", line 204, in
run(args.input, args.residue, args.chain, args.ligands, args.forc, args.confile, args.native, args.cpus, args.core, args.mtor, args.n, args.mae_charges, args.clean, args.only_plop)
File "PelePlop/main.py", line 117, in run
adaptive_exit.run()
File "/home/dsoler/PelePlop/Adaptive/adaptive.py", line 28, in run
ad.main(self.file)
File "/sNow/easybuild/centos/7.4.1708/Skylake/software/Python/2.7.10-foss-2015a/lib/python2.7/site-packages/AdaptivePELE-1.4-py2.7-linux-x86_64.egg/AdaptivePELE/adaptiveSampling.py", line 647, in main
outputPathConstants.clusteringOutputObject % i, writeAll)
File "/sNow/easybuild/centos/7.4.1708/Skylake/software/Python/2.7.10-foss-2015a/lib/python2.7/site-packages/AdaptivePELE-1.4-py2.7-linux-x86_64.egg/AdaptivePELE/clustering/clustering.py", line 890, in writeOutput
metric)
TypeError: float argument required, not numpy.ndarray

Clustering is done with spawning:independent and breaks if binding energy is not calculated

Error

If I run with 1 PELE iteration with spawning: independent I got one cluster:

Output from debbuger:

(Pdb) self.clusters
<AdaptivePELE.clustering.clustering.Clusters object at 0x2ba351320510>
(Pdb) self.clusters.clusters
[<AdaptivePELE.clustering.clustering.Cluster object at 0x2ba326549f50>]
(Pdb) self.clusters.clusters[0]
<AdaptivePELE.clustering.clustering.Cluster object at 0x2ba326549f50>
(Pdb) self.clusters.clusters[0].dict
{'threshold2': 25, 'elements': 2, 'contactThreshold': 8, 'contacts': 0.12275765036932818, 'contactMap': None, 'density': None, 'altStructure': <AdaptivePELE.clustering.clustering.AltStructures object at 0x2ba326549ed0>, 'metricCol': 5, 'metrics': array([ 1.00000e+00, 0.00000e+00, 0.00000e+00, -1.25923e+04]), 'threshold': 5, 'altSelection': True, 'pdb': <AdaptivePELE.atomset.atomset.PDB object at 0x2ba3512d4598>, 'trajPosition': (0, 1, 0), 'originalMetrics': array([ 1.00000e+00, 0.00000e+00, 0.00000e+00, -1.25923e+04])}

Then when going to the line tries to to pick up the metric 5 because in the report I have "metricColumnInReport" : 6 and dies because I do not calculate this metric.

work/NBD_Utilities/PELE/PELE_Softwares/adaptive_types/v1.6.2/AdaptivePELE/clustering/clustering.py(1065)writeOutput()
-> metric = cluster.getMetric()

def getMetric(self):

            Get the value of the prefered metric if present, otherwise return None

            :returns: float -- Value of the prefered metric

    if len(self.metrics) and self.metricCol is not None:
      return self.metrics[self.metricCol]

IndexError: 'index 5 is out of bounds for axis 0 with size 4'**

Idk if its my mistake to include "metricColumnInReport" : 6 but looks strange that I just did a 1 PELE (spawningtype:independent) iteration that I though it needs no clustering and at the same time the script is outputting 1 cluster and trying to pick up the metric 5 because in the report I have "metricColumnInReport" : 6.

Dani

Control files (I can't send u more)

adaptive.txt
pele.txt

OSERROR: File exists: './0/ligand_trajs'

I get an OSError when I run MSM analysis for second time over the same folder. We may want to handle this exceptions for the program not to crash. If you disagree, close the issue.

Error:

Traceback (most recent call last):
File "PelePlop/msm/analysis.py", line 59, in
analyse_results("/scratch/jobs/dsoler/STR_Pele/output_adaptive_long", "STR")
File "PelePlop/msm/analysis.py", line 15, in analyse_results
extractCoords.main(lig_resname=ligand_resname, non_Repeat=True, atom_Ids=atom_ids)
File "/sNow/easybuild/centos/7.4.1708/Skylake/software/Python/2.7.10-foss-2015a/lib/python2.7/site-packages/AdaptivePELE-1.4-py2.7-linux-x86_64.egg/AdaptivePELE/freeEnergies/extractCoords.py", line 291, in main
os.makedirs(os.path.join(pathFolder, constants.ligandTrajectoryFolder))
File "/sNow/easybuild/centos/7.4.1708/Skylake/software/Python/2.7.10-foss-2015a/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: './0/ligand_trajs'

Templetize report name

If Adaptive & pele control files have different report name the next error arises:

We could avoid that by templetazing pele control file

File "/apps/PYTHON/2.7.13/INTEL/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/apps/PYTHON/2.7.13/INTEL/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/gpfs/home/bsc72/bsc72893/test_mutations/AdaptivePELE/AdaptivePELE/adaptiveSampling.py", line 680, in
main(args.controlFile)
File "/gpfs/home/bsc72/bsc72893/test_mutations/AdaptivePELE/AdaptivePELE/adaptiveSampling.py", line 597, in main
initialStructures = simulationRunner.equilibrate(initialStructures, outputPathConstants, spawningParams.reportFilename, outputPath, resname, topology_file)
File "/home/bsc72/bsc72893/test_mutations/AdaptivePELE/AdaptivePELE/simulation/simulationrunner.py", line 429, in equilibrate
newStructure = self.selectEquilibratedStructure(self.parameters.processors, similarityColumn, resname, trajNames, reportNames, topology=topology)
File "/home/bsc72/bsc72893/test_mutations/AdaptivePELE/AdaptivePELE/simulation/simulationrunner.py", line 576, in selectEquilibratedStructure
report_values = report[:, cols]
IndexError: too many indices for array
~

IndexError: too many indices for array

Passa quan estic al mig de la primera epoca els reports són del tipus:

#Task Step numberOfAcceptedPeleSteps currentEnergy Binding Energy sasaLig
1 0 0 -9438.18 -54.0062 0.00796731
1 1 1 -9433.08 -60.2906 0.00173838
1 2 2 -9436.91 -54.5299 0.00897934
1 3 3 -9438.3 -58.2817 0.00197352

Les conf files són les mateixes d'avanç.

File "/home/dsoler/PelePlop/Adaptive/adaptive.py", line 29, in run
ad.main(self.file)
File "/home/dsoler/repos/AdaptivePELE/AdaptivePELE/adaptiveSampling.py", line 670, in main
if simulationRunner.checkExitCondition(clusteringMethod, outputPathConstants.epochOutputPathTempletized % i):
File "/home/dsoler/repos/AdaptivePELE/AdaptivePELE/simulation/simulationrunner.py", line 62, in checkExitCondition
return self.parameters.exitCondition.checkExitCondition(outputFolder)
File "/home/dsoler/repos/AdaptivePELE/AdaptivePELE/simulation/simulationrunner.py", line 528, in checkExitCondition
if self.condition(report[:, self.metricCol], self.metricValue):
IndexError: too many indices for array

Documentation on values and clustering condition difficult to understand

We have been checking the documentation on condition and cluster values (heavyside) and it is not clear to me what refers to contacts and what to rmsd values. Maybe we could set a explanation of a practical example?? Feel free to close the issue if you do not think is relevant (:

Part of docs:

heaviside (default), where thesholds (values) are assigned according to a set of step functions that vary according to a ratio of protein-ligand contacts and ligand size , r, (conditions, see below). The values and conditions of change are defined with two lists. The condition list is iterated until r > condition[i], and the used threshold is values[i]. If r <= conditions[i] for all i, it returns the last element in values. Thresholds typically vary from 5Å in the bulk to 2Å in protein pockets. This method is preferred, as it optimizes the number of clusters, giving more importance to regions with more contacts and interactions, where metastability occurs. Default values: [2,3,4,5], default conditions: [1, 0.75, 0.5].

When the residue name is incorrectly specified the exception catch is no clear

File "AdaptivePELE/atomset/atomset.pyx", line 663, in AdaptivePELE.atomset.atomset.PDB.initialise
File "AdaptivePELE/atomset/atomset.pyx", line 575, in AdaptivePELE.atomset.atomset.PDB._initialisePDB
ValueError: The input pdb file/string was empty, no atoms loaded!

Could it be possible to discern between not finding the input file and having the resname wrongly spelled?

Equilibration error due to None in similarity column

Error:

"/work/NBD_Utilities/PELE/PELE_Softwares/adaptive_types/v1.6.2_python3.6foss2018/AdaptivePELE/simulation/simulationrunner.py", line 781, in selectEquilibratedStructure
if energyColumn > similarityColumn or similarityColumn is None:
TypeError: '>' not supported between instances of 'int' and 'NoneType'

The clause if in simulation/simulationrunner.py", line 781 looks worng as if similarityColumnis none can't do the comparison (>).

Would that be possible?

Thanks!

Wrong box center in equilibration

Description

We detected that the predefined perturbation box used in the Adaptive's equilibration is wrongly located. It should be placed at the COM of ligand according to the first input PDB structure. However, even though we set a box radius of 6Å, the resulting center of the perturbation box was too far away for PELE to accept any move of the ligand.

Support

A zip file with the simulation data to reproduce this issue.

Variable box radius for equilibration

Description

We have been using the equilibration of Adaptive to obtain different initial structures of a small ligand. The idea is to launch afterwards an unbiased PELE simulation starting from different initial positions to cover as many regions as possible in a specific protein cavity. The problem we found is that the default (and only) option to run this equilibration is with a 2Å radius spherical box. As a result, the structures resulting from the equilibrationCluster clusterization are all located in a very small region and they are not spread around the cavity we are interested in exploring.

Solution

The most straightforward solution would be allowing the users to change the hard-coded 2Å-spherical box with the radius they want.

Requirement from PELE

Hi,

I noticed in the constants /gpfs/projects/bsc72/PELE++/bin/rev12025/Pele_rev12025_mpi is required to run this. Is this a part of PELE? I didn't find any matching file in the PELE repo.

Thanks.

Atom names containing ' cannot be used

In adaptive, the templetized pele control file is read and and saved in a different file after substituting the required fields. The new pele control file is saved using the makeWorkingControlFile() function in line 215 of simulation/simulationrunner.py. By default, makeWorkingControlFile substitutes all ' characters in the string by ", see line 231 of simulation/simulationrunner.py. Perhaps there was a good reason to do this, but it's a problem when trying to use as ANM nodes atoms that contain the ' character in their name. This is the case for example in RNA molecules using the AMBER99sbBSC0 which is implemented in PELE (e.g. H5'', C5', C2').

Thus one cannot include the following configuration:

"algorithm": "CARTESIANS", "nodes": { "atoms": { "names": ["P_", "C2", "_C4'"]}}

Because it's transformed into:

"algorithm": "CARTESIANS", "nodes": { "atoms": { "names": ["P_", "C2", "_C4""]}}

Which is not a properly formed json control file (additional ")

Thanks :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.