Skip to content

Commit

Permalink
Merge pull request #71 from drorlab/70-update-to-python-312-and-mdana…
Browse files Browse the repository at this point in the history
…lysis-28

Update to MDAnalysis 2.8 and Python 3.10
  • Loading branch information
martinvoegele authored Jan 27, 2025
2 parents 7c67c45 + e0c43a7 commit 1e5100d
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 102 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'
- name: Lint with flake8
run: |
pip install flake8
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.9"
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2022 Martin Vögele, Neil Thomson, Sang Truong, Jasper McAvity
Copyright (c) 2020-2025 Martin Vögele, Neil Thomson, Sang Truong, Jasper McAvity

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ All functionality is available as a python package.
Citation
********

If you publish about work for which PENSA was useful, please cite our preprint:
If you publish about work for which PENSA was useful, please cite our publication:

M. Vögele, N. J. Thomson, S. T. Truong, J. McAvity, U. Zachariae, R. O. Dror:
*Systematic Analysis of Biomolecular Conformational Ensembles with PENSA*.
`arXiv:2212.02714 [q-bio.BM] 2022 <https://arxiv.org/abs/2212.02714>`_.
M. Vögele, N. J. Thomson, S. T. Truong, J. McAvity, U. Zachariae, R. O. Dror:
*Systematic analysis of biomolecular conformational ensembles with PENSA*.
`J. Chem. Phys. 162, 014101 (2025) <https://doi.org/10.1063/5.0235544>`_.

The reference for the software implementation itself is the following:

Martin Vögele, Neil Thomson, Sang Truong, Jasper McAvity: *PENSA*. Zenodo, 2024. http://doi.org/10.5281/zenodo.4362136
Martin Vögele, Neil Thomson, Sang Truong, Jasper McAvity: *PENSA*. Zenodo, 2025. http://doi.org/10.5281/zenodo.4362136

To get the citation and DOI for a particular version, see `Zenodo <https://zenodo.org/record/4362136>`_.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# -- Project information -----------------------------------------------------

project = 'PENSA'
copyright = '2020-2024, Martin Vögele, Neil Thomson, Sang Truong, Jasper McAvity'
copyright = '2020-2025, Martin Vögele, Neil Thomson, Sang Truong, Jasper McAvity'
author = 'Martin Vögele, Neil Thomson, Sang Truong, Jasper McAvity'


Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Create and activate a conda environment:

.. code:: bash
conda create --name pensa python=3.9 numpy==1.22 scipy==1.9 pandas==1.4 matplotlib==3.5 MDAnalysis==2.2 cython biotite -c conda-forge -c conda-forge
conda create --name pensa python==3.10 scipy numpy pandas matplotlib MDAnalysis==2.8 deeptime biotite pip -c conda-forge
conda activate pensa
If you want to use PENSA with Jupyter notebooks:
Expand Down
12 changes: 6 additions & 6 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ sphinxcontrib-htmlhelp
sphinxcontrib-jsmath
sphinxcontrib-qthelp
sphinxcontrib-serializinghtml
numpy==1.22
scipy==1.9
pandas==1.4
matplotlib==3.5
numpy
scipy
pandas
matplotlib
deeptime
MDAnalysis==2.2
MDAnalysis==2.8
cython
biotite
pensa==0.3.0
pensa
44 changes: 27 additions & 17 deletions docs/tut-2-preprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ Preprocessing
extract_aligned_coordinates, extract_combined_grid
Coordinates
***********
To work with the biomolecule's coordinates, it is often easier to first extract
them from the simulation, i.e., remove the solvent, lipids etc. If you would like
to calculate water or ion features, you need to calculate the corresponding density.
This kind of preprocessing steps can be cumbersome but you usually only do it
once and can then play with your data.

To work with the biomolecule's coordinates, we first need to extract them from
the simulation, i.e., remove the solvent, lipids etc. This is the hardest part
but you usually only have to do it once and can then play with your data.
Preprocessing can handle many common trajectory formats as it is based on
MDAnalysis. You can start by using the scripts provided in the PENSA repository.
Once you know how PENSA works, you can write your own scripts.
Based on MDAnalysis, PENSA's preprocessing functions can handle many common formats
of molecular simulation trajectories. You can start by using the scripts provided
in the PENSA repository. Once you know how PENSA works, you can write your own scripts.


Files and Directories
---------------------
**********************

In the following, we define the necessary files. For each simulation, we
need a reference file (.psf for AMBER), a PDB file, and the trajetory.
Expand Down Expand Up @@ -71,8 +71,8 @@ will generate.
os.makedirs(subdir)
Extracting Coordinates
----------------------
Coordinates
***********

We have to ensure that from both simulations, we use the exact same
parts of the receptor for the analysis. Often, this will be easy and you
Expand All @@ -91,14 +91,24 @@ In the first case, we will extract all protein residues, assuming
extract_coordinates(ref_file_a, pdb_file_a, trj_file_a, out_name_a+"_receptor", sel_base_a)
extract_coordinates(ref_file_b, pdb_file_b, trj_file_b, out_name_b+"_receptor", sel_base_b)
In many cases, you probably have several runs of the same simulation
that you want to combine to one structural ensemble. This is why the
trajectory argument takes a list as arguments, e.g.
In some cases, you may have only one trajectory while in others,
you may have several runs of the same simulation that you want
to combine to one structural ensemble.
This is why the trajectory argument can be either a single string

.. code:: python
extract_coordinates(
'system.psf', 'system.pdb', 'run1.nc',
'receptor', 'protein', start_frame=1000
)
... or a list of strings.

.. code:: python
extract_coordinates(
'system.psf', 'system.pdb', ['run1.nc','run2.nc','run3.nc'],
'system.psf', 'system.pdb', ['run1.nc','run2.nc','run3.nc'],
'receptor', 'protein', start_frame=1000
)
Expand Down Expand Up @@ -129,8 +139,8 @@ Here, we use selections based on the definitions of transmembrane helices in the
sel_string_b = "protein and resnum "+resnums
print('Selection B:\n', sel_string_b, '\n')
# Extract the coordinates of the transmembrane region from the trajectory
extract_coordinates(ref_file_a, pdb_file_a, [trj_file_a], out_name_a+"_tm", sel_string_a)
extract_coordinates(ref_file_b, pdb_file_b, [trj_file_b], out_name_b+"_tm", sel_string_b)
extract_coordinates(ref_file_a, pdb_file_a, trj_file_a, out_name_a+"_tm", sel_string_a)
extract_coordinates(ref_file_b, pdb_file_b, trj_file_b, out_name_b+"_tm", sel_string_b)
Loading from Multiple Simulations
Expand Down
13 changes: 7 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ channels:
- conda-forge
- defaults
dependencies:
- python==3.9
- scipy==1.9
- numpy==1.22
- pandas==1.4
- matplotlib==3.5
- MDAnalysis==2.2
- python==3.10
- scipy
- numpy
- pandas
- matplotlib
- MDAnalysis==2.8
- deeptime
- biotite
- pip
63 changes: 63 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "pensa"
version = "0.6.0"
description = "exploratory analysis and comparison of biomolecular conformational ensembles."
authors = [
{name = "Martin Voegele, Neil Thomson, Sang Truong, Jasper McAvity", email = "martinvoegele1989@gmail.com"}
]
license = {text = "MIT"}
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
"Topic :: Scientific/Engineering :: Molecular Dynamics",
"Topic :: Scientific/Engineering :: Computational Biology",
]
dependencies = [
"numpy>=1.23",
"scipy",
"pandas",
"matplotlib",
"deeptime",
"MDAnalysis==2.8",
"biotite",
"gpcrmining",
]
requires-python = "==3.10.*"

[project.urls]
Documentation = "https://pensa.readthedocs.io/en/latest/"
Source = "http://github.com/drorlab/pensa"

[metadata]
# Include the license file in the wheel.
license_files = ["LICENSE"]

[tool.setuptools.packages.find]
include = [
"pensa",
"pensa.preprocessing",
"pensa.features",
"pensa.comparison",
"pensa.dimensionality",
"pensa.clusters",
"pensa.statesinfo"
]




14 changes: 0 additions & 14 deletions run-test.sb

This file was deleted.

3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

0 comments on commit 1e5100d

Please sign in to comment.