diff --git a/README.md b/README.md index 65632ba..8385ffa 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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/) @@ -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: ``` diff --git a/pybilt/bilayer_analyzer/analysis_protocols.py b/pybilt/bilayer_analyzer/analysis_protocols.py index 6059951..8b24ab2 100644 --- a/pybilt/bilayer_analyzer/analysis_protocols.py +++ b/pybilt/bilayer_analyzer/analysis_protocols.py @@ -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 @@ -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 diff --git a/pybilt/bilayer_analyzer/com_frame.py b/pybilt/bilayer_analyzer/com_frame.py index 82de207..b1cf04f 100644 --- a/pybilt/bilayer_analyzer/com_frame.py +++ b/pybilt/bilayer_analyzer/com_frame.py @@ -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: diff --git a/setup.py b/setup.py index e84011c..71f88d3 100644 --- a/setup.py +++ b/setup.py @@ -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', @@ -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'] )