Skip to content

Commit

Permalink
v0.2.5 (#59)
Browse files Browse the repository at this point in the history
* modernized setup.py

* include insertion codes in amino3to1

* pep8 fixes

* update conda command

* update travis config

* update travis installer scripts

* disable systemwide packages

* old conda style syntax to disable system conda

* use more recent conda installer

* fix conda install

* conda init

* conda init
  • Loading branch information
rasbt committed Jul 9, 2019
1 parent 615a7cf commit 3f78c91
Show file tree
Hide file tree
Showing 10 changed files with 1,986 additions and 57 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
@@ -1,12 +1,12 @@
language: python
virtualenv:
system_site_packages: true
system_site_packages: false
env:
matrix:
- PYTHON_VERSION="2.7" LATEST="true"
- PYTHON_VERSION="3.5" LATEST="true"
- PYTHON_VERSION="3.6" NUMPY_VERSION="1.11.2" SCIPY_VERSION="0.18.1" PANDAS_VERSION="0.19.1"
- PYTHON_VERSION="3.6" COVERAGE="true" LATEST="true"
- PYTHON_VERSION="3.7" LATEST="true"
- PYTHON_VERSION="3.7" COVERAGE="false" NUMPY_VERSION="1.16.2" SCIPY_VERSION="1.2.1" PANDAS_VERSION="0.24.2"
- PYTHON_VERSION="3.7" COVERAGE="true" LATEST="true"
install: source ./ci/.travis_install.sh
script: bash ./ci/.travis_test.sh
after_success:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion biopandas/__init__.py
Expand Up @@ -24,5 +24,5 @@
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
#

__version__ = '0.2.4'
__version__ = '0.2.5'
__author__ = "Sebastian Raschka <mail@sebastianraschka.com>"
7 changes: 5 additions & 2 deletions biopandas/pdb/pandas_pdb.py
Expand Up @@ -406,7 +406,10 @@ def amino3to1(self, record='ATOM',
cmp = 'placeholder'
indices = []

for num, ind in zip(tmp['residue_number'], np.arange(tmp.shape[0])):
residue_number_insertion = (tmp['residue_number'].astype(str)
+ tmp['insertion'])

for num, ind in zip(residue_number_insertion, np.arange(tmp.shape[0])):
if num != cmp:
indices.append(ind)
cmp = num
Expand Down Expand Up @@ -526,7 +529,7 @@ def to_pdb(self, path, records=None, gz=False, append_newline=True):
" Please consider updating your pandas"
" installation to a more recent version.",
DeprecationWarning)
df.sort(columns='line_idx', inplace=True)
dfs.sort(columns='line_idx', inplace=True)

elif pd_version < LooseVersion('0.23.0'):
df = pd.concat(dfs)
Expand Down
1,911 changes: 1,911 additions & 0 deletions biopandas/pdb/tests/data/2d7t.pdb

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions biopandas/pdb/tests/test_amino3to1.py
Expand Up @@ -106,3 +106,12 @@ def test_multichain():
assert expect_res_a == got_res_a
assert expect_res_b == got_res_b


def test_pdb_with_insertion_codes():

PDB_2D7T_PATH = os.path.join(os.path.dirname(__file__),
'data', '2d7t.pdb')

ppdb = PandasPdb().read_pdb(PDB_2D7T_PATH)
sequence = ppdb.amino3to1()
assert "".join(sequence[50:60]['residue_name'].values) == 'INPKSGDTNY'
15 changes: 10 additions & 5 deletions ci/.travis_install.sh
Expand Up @@ -19,11 +19,15 @@ deactivate

# Use the miniconda installer for faster download / install of conda
# itself
wget http://repo.continuum.io/miniconda/Miniconda-3.9.1-Linux-x86_64.sh \
-O miniconda.sh
chmod +x miniconda.sh && ./miniconda.sh -b
export PATH=/home/travis/miniconda/bin:$PATH
conda update --yes conda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh

bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
hash -r
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda update -q pip
conda info -a

# Configure the conda environment and put it in the path using the
# provided versions
Expand All @@ -36,6 +40,7 @@ else
pandas=$PANDAS_VERSION
fi

conda init bash
source activate testenv

if [[ "$COVERAGE" == "true" ]]; then
Expand Down
25 changes: 23 additions & 2 deletions docs/sources/CHANGELOG.md
Expand Up @@ -3,12 +3,33 @@
The CHANGELOG for the current development version is available at
[https://github.com/rasbt/biopandas/blob/master/docs/sources/CHANGELOG.md](https://github.com/rasbt/biopandas/blob/master/docs/sources/CHANGELOG.md).

### 0.2.5 (07-09-2019)

##### Downloads

- [Source code (zip)](https://github.com/rasbt/biopandas/archive/v0.2.5.zip)
- [Source code (tar.gz)](https://github.com/rasbt/biopandas/archive/v0.2.5.tar.gz)

##### New Features

- -

##### Changes

- -

##### Bug Fixes

- The `PandasPdb.amino3to1` method now also considers insertion codes when converting the amino acid codes; before, inserted amino acides were skipped.



### 0.2.4 (02-05-2019)

##### Downloads

- [Source code (zip)]
- [Source code (tar.gz)]
- [Source code (zip)](https://github.com/rasbt/biopandas/archive/v0.2.4.zip)
- [Source code (tar.gz)](https://github.com/rasbt/biopandas/archive/v0.2.4.tar.gz)

##### New Features

Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
@@ -0,0 +1,2 @@
numpy>=1.16.2
pandas>=0.24.2
64 changes: 21 additions & 43 deletions setup.py
@@ -1,65 +1,43 @@
from pkgutil import walk_packages
from fnmatch import fnmatch as wc_match
from itertools import chain
from os.path import realpath, dirname, join
from setuptools import setup, find_packages
import biopandas

VERSION = biopandas.__version__
PROJECT_ROOT = dirname(realpath(__file__))

try:
from setuptools import setup
except ImportError:
from distutils.core import setup
REQUIREMENTS_FILE = join(PROJECT_ROOT, 'requirements.txt')

with open(REQUIREMENTS_FILE) as f:
install_reqs = f.read().splitlines()

def find_packages(where, exclude=None):
if not exclude:
exclude = ()
if isinstance(where, str):
where = (where, )

ret_list = []
for name in chain.from_iterable(map(lambda w: (
n for _, n, ispkg in w if ispkg), (walk_packages(p) for p in where))):
if not any(wc_match(name, p) for p in exclude):
ret_list.append(name)

return tuple(ret_list)


def calculate_version():
initpy = open('biopandas/__init__.py').read().split('\n')
version = list(filter(lambda x: '__version__'
in x, initpy))[0].split('\'')[1]
return version


package_version = calculate_version()
install_reqs.append('setuptools')

setup(name='biopandas',
version=package_version,
description='Molecular Structures in Pandas DataFrames',
version=VERSION,
description='Machine Learning Library Extensions',
author='Sebastian Raschka',
author_email='mail@sebastianraschka.com',
url='https://github.com/rasbt/biopandas',
license='new BSD',
zip_safe=True,
packages=find_packages('.'),
packages=find_packages(),
package_data={'': ['LICENSE.txt',
'README.md',
'requirements.txt']
},
include_package_data=True,
install_requires=install_reqs,
license='BSD 3-Clause',
platforms='any',
install_requires=['numpy', 'pandas'],
keywords=['bioinformatics', 'molecular structures',
'protein databank', 'computational biology',
'protein structures'],
classifiers=[
'License :: OSI Approved :: BSD License',
'Development Status :: 5 - Production/Stable',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering',
],
long_description="""
Expand Down

0 comments on commit 3f78c91

Please sign in to comment.