Skip to content

Commit

Permalink
Merge branch 'v0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeaw committed May 12, 2021
2 parents c15f2e3 + d4b8536 commit ed402dd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
![alt text](./_images/PyBILT_logo.png "PyBILT Logo")
# *Py*thon based lipid *BIL*ayer molecular simulation analysis *T*oolkit
------
![Python version badge](https://img.shields.io/badge/python-2.7%2C3.6%2C3.7-blue.svg)
![Python version badge](https://img.shields.io/badge/python-3.7-blue.svg)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2d6da71328a24ef6930ad8f554074292)](https://www.codacy.com/manual/blakeaw1102/PyBILT?utm_source=github.com&utm_medium=referral&utm_content=LoLab-VU/PyBILT&utm_campaign=Badge_Grade)
![version](https://img.shields.io/badge/version-0.2.0-orange.svg)
[![release](https://img.shields.io/github/release-pre/LoLab-VU/PyBILT.svg)](https://github.com/LoLab-VU/PyBILT/releases/tag/v0.2.0)
![version](https://img.shields.io/badge/version-0.3.0-orange.svg)
[![release](https://img.shields.io/github/release-pre/LoLab-VU/PyBILT.svg)](https://github.com/LoLab-VU/PyBILT/releases/tag/v0.3.0)
[![Anaconda-Server Badge](https://anaconda.org/blakeaw/pybilt/badges/version.svg)](https://anaconda.org/blakeaw/pybilt)
[![Documentation Status](https://readthedocs.org/projects/pybilt/badge/?version=latest)](http://pybilt.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://zenodo.org/badge/85123567.svg)](https://zenodo.org/badge/latestdoi/85123567)
Expand Down Expand Up @@ -33,7 +33,7 @@ The analyses include:

### Core dependencies
**PyBILT** has the following core dependencies:
* [MDAnalysis](https://www.mdanalysis.org/)
* [MDAnalysis](https://www.mdanalysis.org/) > 1.0
* [NumPy](http://www.numpy.org/)
* [SciPy](https://www.scipy.org/)
* [Matplotlib](https://matplotlib.org/)
Expand All @@ -42,16 +42,12 @@ The analyses include:
* [future](http://python-future.org/)

### Python version support
The `pybilt` package has been tested using [Anaconda Python](https://www.anaconda.com/) 2.7, 3.6, and 3.7.

#### Sunsetting of Python 2
Please be aware that Python 2 is scheduled to be sunset on January 1 2020. You can read about it here: [https://www.python.org/doc/sunset-python-2/](https://www.python.org/doc/sunset-python-2/)
Parallel to the sunsetting of Python 2 many open source packages are also dropping support for Python 2 ([https://python3statement.org/](https://python3statement.org/)), including some of **PyBILT**'s core dependencies. As such, after January 1, 2020, **PyBILT** will also likely sunset its support for Python 2.7.
The `pybilt` package has been tested using [Anaconda Python](https://www.anaconda.com/) 3.7 and MDAnalysis=1.1.1.

### pip install
You can install the latest version of the `pybilt` package using `pip` sourced from the GitHub repo:
```
pip install -e git+https://github.com/LoLab-VU/PyBILT@v0.2.0#egg=pybilt
pip install -e git+https://github.com/LoLab-VU/PyBILT@v0.3.0#egg=pybilt
```
However, this will not automatically install the core dependencies. You will have to do that separately:
```
Expand Down
18 changes: 10 additions & 8 deletions pybilt/bilayer_analyzer/analysis_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -3548,12 +3548,14 @@ def run_analysis(self, ba_settings, ba_reps, ba_mda_data):
residues = self.selection.residues
cos_run = RunningStats()
for residue in residues:
atom_1 = eval("residue.{}".format(self.settings['ref_atom_1']))
atom_2 = eval("residue.{}".format(self.settings['ref_atom_2']))
#atom_1 = eval("residue.{}".format(self.settings['ref_atom_1']))
#atom_2 = eval("residue.{}".format(self.settings['ref_atom_2']))
atom_1 = residue.atoms.select_atoms('name {}'.format(self.settings['ref_atom_1']))
atom_2 = residue.atoms.select_atoms('name {}'.format(self.settings['ref_atom_2']))
#atom_1 = ast.literal_eval("residue.{}".format(self.settings['ref_atom_1']))
#atom_2 = ast.literal_eval("residue.{}".format(self.settings['ref_atom_2']))
atom_1_i = atom_1.index
atom_2_i = atom_2.index
atom_1_i = atom_1.indices[0]
atom_2_i = atom_2.indices[0]
atom_1_coord = ba_reps['current_mda_frame'].positions[atom_1_i]
atom_2_coord = ba_reps['current_mda_frame'].positions[atom_2_i]
diff = atom_2_coord - atom_1_coord
Expand Down Expand Up @@ -3687,10 +3689,10 @@ def run_analysis(self, ba_settings, ba_reps, ba_mda_data):
residues = self.selection.residues
cos_run = RunningStats()
for residue in residues:
atom_1 = eval("residue."+self.settings['ref_atom_1'])
atom_2 = eval("residue."+self.settings['ref_atom_2'])
atom_1_i = atom_1.index
atom_2_i = atom_2.index
atom_1 = residue.atoms.select_atoms('name {}'.format(self.settings['ref_atom_1']))
atom_2 = residue.atoms.select_atoms('name {}'.format(self.settings['ref_atom_2']))
atom_1_i = atom_1.indices[0]
atom_2_i = atom_2.indices[0]
atom_1_coord = ba_reps['current_mda_frame'].positions[atom_1_i]
atom_2_coord = ba_reps['current_mda_frame'].positions[atom_2_i]
diff = atom_2_coord - atom_1_coord
Expand Down
7 changes: 5 additions & 2 deletions pybilt/bilayer_analyzer/com_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@ def extract(self, mda_residue, unwrap=False, box=None, name_dict=None, make_whol

self.atom_names = names
n_names = len(names)
atom_group = mda.core.AtomGroup.AtomGroup([eval("mda_residue.atoms."+names[0])])
#print(mda_residue.atoms.select_atoms('name {}'.format(names[0])))
#atom_group = mda.core.groups.AtomGroup([eval("mda_residue.atoms."+names[0])])
atom_group = mda_residue.atoms.select_atoms('name {}'.format(names[0]))
#if (not unwrap) and (n_names > 1):
# mda.lib.mdamath.make_whole(mda_residue.atoms, reference_atom=atom_group)

for i in range(1, n_names):
atom_group+=eval("mda_residue.atoms."+names[i])
#atom_group+=eval("mda_residue.atoms."+names[i])
atom_group += mda_residue.atoms.select_atoms('name {}'.format(names[i]))

#else:
if (not unwrap) and make_whole:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from distutils.core import setup

setup(name='pybilt',
version='0.2.0',
version='0.3.0',
description='Lipid bilayer analysis toolkit.',
author='Blake A. Wilson',
author_email='blake.a.wilson@vanderbilt.edu',
Expand All @@ -11,5 +11,5 @@
'pybilt.lipid_grid', 'pybilt.mda_tools',
'pybilt.plot_generation'],
license='MIT',
keywords=['lipid bilayer', 'molecular dynamics', 'analysis']
keywords=['lipid bilayer', 'molecular dynamics', 'analysis']
)

0 comments on commit ed402dd

Please sign in to comment.