Skip to content

Commit

Permalink
Merge pull request #158 from nostrumbiodiscovery/devel
Browse files Browse the repository at this point in the history
Release of 1.6.0b6
  • Loading branch information
martimunicoy authored May 20, 2021
2 parents 22e03de + 5802b53 commit cd18dc4
Show file tree
Hide file tree
Showing 16 changed files with 374 additions and 141 deletions.
4 changes: 4 additions & 0 deletions docs/build_docs/source/analysis/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ class Analysis
Path to the topology file, if using XTC trajectories.
cpus: int (optional, default = 1)
Number of CPUs to use.
water_ids_to_track : List (optional, default = [])
List of IDs of water molecules to cluster. Each water ID is defined by
a tuple that contains the PDB chain and the residue number, e.g.
``water_ids_to_track = [("A", 234), ("A", 235)]``

.. code-block:: python
Expand Down
107 changes: 84 additions & 23 deletions docs/build_docs/source/environment/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,111 @@ Mandatory variables
-------------------

They must be defined for the pele_platform to work correctly:
- PELE: path to PELE installation
- SCHRODINGER: path to Schrodinger installation

Examples:
- PELE: path to PELE installation
- SCHRODINGER: path to Schrodinger installation

.. code-block:: bash
Examples:

export PELE=/path/to/PELE-1.X/
export SCHRODINGER=/path/to/schoringer/20XX/
.. code-block:: bash
export PELE=/path/to/PELE-1.X/
export SCHRODINGER=/path/to/schoringer/20XX/
Optional variables
------------------
- PELE_LICENSE:

Licenses can be configured in several ways (from highest to lowest precedence):
PELE_EXEC:
++++++++++

The PELE executable can be configured in several ways (from highest to lowest precedence):

1. Can be specified by input.yaml flag:

.. code-block:: yaml
pele_exec: "/home/pele/bin/Pele_mpi"
2. Can be specified by environment variable:

.. code-block:: bash
export PELE_EXEC=/home/pele/bin/Pele_mpi
3. If no path is specified, the PELE executable must be ``/path/to/PELE-1.X/bin/Pele_mpi`` (according to the path specified by the environment variable PELE).

PELE_DATA:
++++++++++

The PELE data folder can be configured in several ways (from highest to lowest precedence):

1. Can be specified by input.yaml flag:

.. code-block:: yaml
pele_data: "/home/pele/Data/"
2. Can be specified by environment variable:

.. code-block:: bash
export PELE_DATA=/home/pele/Data/
3. If no path is specified, the PELE data folder must be ``/path/to/PELE-1.X/Data`` (according to the path specified by the environment variable PELE).

PELE_DOCUMENTS:
+++++++++++++++

The PELE documents folder can be configured in several ways (from highest to lowest precedence):

1. Can be specified by input.yaml flag:

.. code-block:: yaml
pele_documents: "/home/pele/Documents/"
2. Can be specified by environment variable:

.. code-block:: bash
export PELE_DOCUMENTS=/home/pele/Documents/
3. If no path is specified, the PELE documents folder must be ``/path/to/PELE-1.X/Documents`` (according to the path specified by the environment variable PELE).

PELE_LICENSE:
+++++++++++++

Licenses can be configured in several ways (from highest to lowest precedence):

1. Can be specified by input.yaml flag:
1. Can be specified by input.yaml flag:

.. code-block:: yaml
.. code-block:: yaml
license: /path/to/licenses/folder/
license: /path/to/licenses/folder/
2. Can be specified by environment variable:
2. Can be specified by environment variable:

.. code-block:: bash
.. code-block:: bash
export PELE_LICENSE=/path/to/licenses/folder/
export PELE_LICENSE=/path/to/licenses/folder/
3. If no path is specified, licenses must be under /path/to/PELE-1.X/licenses/ (according to the path specified by the environment variable PELE)
3. If no path is specified, licenses must be under ``/path/to/PELE-1.X/licenses/`` (according to the path specified by the environment variable PELE).


- SINGULARITY_EXEC:
SINGULARITY_EXEC:
+++++++++++++++++

Path of the singularity container that contains the PELE executable. It can be configured in two ways:
Path of the singularity container that contains the PELE executable. It can be configured in two ways:

1. Can be specified by input.yaml flag
1. Can be specified by input.yaml flag:

.. code-block:: yaml
.. code-block:: yaml
singularity_exec: /path/to/singularity/container/
singularity_exec: /path/to/singularity/container/
2. Can be specified by environment variable:
2. Can be specified by environment variable:

.. code-block:: bash
.. code-block:: bash
export SINGULARITY_EXEC=/path/to/singularity/container/
export SINGULARITY_EXEC=/path/to/singularity/container/
9 changes: 8 additions & 1 deletion pele_platform/Adaptive/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def run_adaptive(args):
adaptiveSampling.main(parameters.ad_ex_temp)
parameters.logger.info("Simulation run successfully (:\n\n")

elif not parameters.only_analysis:
elif not parameters.only_analysis and not parameters.restart:
parameters.logger.info(
"System: {}; Platform Functionality: {}\n\n".format(
parameters.residue, parameters.software))
Expand Down Expand Up @@ -334,6 +334,13 @@ def run_adaptive(args):
adaptive.run()
parameters.logger.info("Simulation run successfully (:\n\n")

elif parameters.restart:
# Start simulation from scratch (unlike adaptive_restart) but use files created in debug mode
parameters.logger.info(f"Launching simulation from {parameters.pele_dir}")
adaptive = ad.SimulationBuilder(parameters.ad_ex_temp, parameters.pele_exit_temp, parameters.topology)
adaptive.run()
parameters.logger.info("Simulation run successfully (:\n\n")

# Run analysis
if parameters.analyse and not parameters.debug:
from pele_platform.analysis import Analysis
Expand Down
8 changes: 4 additions & 4 deletions pele_platform/Checker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ def check_variables(self, args: yp.YamlParser) -> None:

def _generate_env_variables(self, args: yp.YamlParser) -> list:
self.env_variables = [
en.EnvVariable("pele_data", args.pele_data, os.path.join(cs.PELE, "Data"), "--pele_data /path/to/data/folder/", "export PELE=/path/to/PELE-1.X/"),
en.EnvVariable("pele_documents", args.pele_documents, os.path.join(cs.PELE, "Documents"), "--pele_documents /path/to/documents/folder", "export PELE=/path/to/PELE-1.X/"),
en.EnvVariable("pele_exec", args.pele_exec, os.path.join(cs.PELE, "bin/Pele_mpi"), "--pele_exec /path/to/PELE_exec", "export PELE=/path/to/PELE-1.X/"),
en.EnvVariable("pele_license", args.pele_license, cs.DEFAULT_PELE_LICENSE, "--pele_license /path/to/licenses", "export PELE=/path/to/PELE-1.X/"),
en.EnvVariable("pele_data", args.pele_data, cs.DEFAULT_PELE_DATA, "--pele_data /path/to/data/folder/", "export PELE_DATA=/path/to/PELE-Data/folder"),
en.EnvVariable("pele_documents", args.pele_documents, cs.DEFAULT_PELE_DOCUMENTS, "--pele_documents /path/to/documents/folder", "export PELE_DOCUMENTS=/path/to/PELE-Documents/folder"),
en.EnvVariable("pele_exec", args.pele_exec, cs.DEFAULT_PELE_EXEC, "--pele_exec /path/to/PELE_exec", "export PELE_EXEC=/path/to/PELE-1.X/binary"),
en.EnvVariable("pele_license", args.pele_license, cs.DEFAULT_PELE_LICENSE, "--pele_license /path/to/licenses", "export PELE_LICENSE=/path/to/PELE-License/folder"),
en.EnvVariable("schrodinger", args.schrodinger, cs.SCHRODINGER, "--schrodinger /path/to/schrodinger-20XX/", "export SCHRODINGER=/path/to/schrodinger-20XX/")
]
return self.env_variables
Expand Down
3 changes: 2 additions & 1 deletion pele_platform/PPI/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ def run_ppi(parsed_yaml: dict) -> (pv.ParametersBuilder, pv.ParametersBuilder):

# no waters in the first simulation
parsed_yaml.water_arg = None
parsed_yaml.use_peleffy = parsed_yaml.use_peleffy if parsed_yaml.use_peleffy is not None else False

# remove chains except for "protein" flag
protein_file = prepare_structure(protein_file, ligand_pdb, chain, True)
protein_file = prepare_structure(protein_file, ligand_pdb, chain, True, peleffy=parsed_yaml.use_peleffy)
parsed_yaml.system = protein_file

# start simulation 1 - induced fit
Expand Down
11 changes: 6 additions & 5 deletions pele_platform/PPI/preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pele_platform.constants import constants


def prepare_structure(protein_file, ligand_pdb, chain, remove_water=False):
def prepare_structure(protein_file, ligand_pdb, chain, remove_water=False, peleffy=False):

to_remove = []

Expand Down Expand Up @@ -41,9 +41,10 @@ def prepare_structure(protein_file, ligand_pdb, chain, remove_water=False):
for line in ligand:
file.write(line)

# Run through Schrodinger again to add CONECT lines.
schrodinger_path = os.path.join(constants.SCHRODINGER, "utilities/prepwizard")
command_pdb = f"{schrodinger_path} -nohtreat -noepik -noprotassign -noimpref -noccd -NOJOBID {protein} {new_protein_file}"
subprocess.call(command_pdb.split(), shell=True)
if peleffy:
# Run through Schrodinger again to add CONECT lines.
schrodinger_path = os.path.join(constants.SCHRODINGER, "utilities/prepwizard")
command_pdb = f"{schrodinger_path} -nohtreat -noepik -noprotassign -noimpref -noccd -NOJOBID {protein_file} {new_protein_file}"
subprocess.call(command_pdb.split(), shell=True)

return new_protein_file
2 changes: 1 addition & 1 deletion pele_platform/Utilities/Helpers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def check_remove_folder(*output_folders):
"""
for folder in output_folders:
if os.path.exists(folder):
shutil.rmtree(folder)
shutil.rmtree(folder, ignore_errors=True)


def get_atom_indices(ids, pdb, pdb_atom_name=None):
Expand Down
Loading

0 comments on commit cd18dc4

Please sign in to comment.