Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sets up Travis/Codecov + basic regression tests #21

Merged
merged 15 commits into from
Jul 6, 2020
14 changes: 14 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ignore:
- "propkatraj/tests"

coverage:
precision: 2
round: down
range: "70...100"
status:
patch:
default:
threshold: 50%
project:
default:
threshold: 10%
67 changes: 67 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
language: python
group: travist_latest

env:
global:
- CYTHON_TRACE_NOGIL=1


matrix:
include:
# only test latest python for OSX
- os: osx
language: generic
env: PYTHON_VERSION=3.8

# Test for full range
- os: linux
language: generic
env: PYTHON_VERSION=2.7
- os: linux
language: generic
env: PYTHON_VERSION=3.5
- os: linux
language: generic
env: PYTHON_VERSION=3.6
- os: linux
language: generic
env: PYTHON_VERSION=3.7
- os: linux
language: generic
env: PYTHON_VERSION=3.8


before_install:
- uname -a
# get the right anaconda version
- |
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
fi
- mkdir $HOME/.conda
- bash miniconda.sh -b -p $HOME/miniconda
- $HOME/miniconda/bin/conda init bash
- source ~/.bash_profile
- conda activate base
- conda update --yes conda
- uname -a


install:
- conda env create python=$PYTHON_VERSION -f devtools/environment.yml --quiet
- source activate propkatraj
- python -V
# Build and install package
- pip install -e .


script:
- pytest -v --disable-pytest-warnings --cov=propkatraj propkatraj/tests/

notifications:
email: false

after_success:
- codecov
5 changes: 4 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ Chronological list of authors
- Rick Sexton

2019
- Shujie Fan
- Shujie Fan

2020
- Irfan Alibay
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# README: propkatraj
[![DOI](https://zenodo.org/badge/88095629.svg)](https://zenodo.org/badge/latestdoi/88095629)
[![Travis Build Status](https://travis-ci.com/Becksteinlab/propkatraj.svg?branch=master)](https://travis-ci.com/Becksteinlab/propkatraj)
[![codecov](https://codecov.io/gh/Becksteinlab/propkatraj/branch/master/graph/badge.svg)](https://codecov.io/gh/Becksteinlab/propkatraj/branch/master)

`propkatraj.py` can be used to computationally estimate pKa values for
protein residues. We use an ensemble approach where many different
Expand Down
15 changes: 15 additions & 0 deletions devtools/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: propkatraj
channels:
- conda-forge
- defaults
dependencies:
- MDAnalysis<2.0.0
- MDAnalysisTests<2.0.0
- six
- pandas
- pytest
- pytest-cov
- codecov
- pip
- pip:
- propka==3.1
2 changes: 1 addition & 1 deletion propkatraj/propkatraj.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_propka(universe, sel='protein', start=None, stop=None, step=None, skip_f
# need AtomGroup to write out for propka
if isinstance(sel, string_types):
atomsel = universe.select_atoms(sel)
elif isinstance(sel, (list, np.array)):
elif isinstance(sel, (list, np.ndarray)):
atomsel = universe.atoms[sel]

# "filename" for our stream
Expand Down
Empty file added propkatraj/tests/__init__.py
Empty file.
15 changes: 15 additions & 0 deletions propkatraj/tests/datafiles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Input datafiles for tests
"""

__all__ = [
"PSF_FRAME_ZERO_PKA",
"PSF_FRAME_NINETY_PKA",
]

from pkg_resources import resource_filename

PSF_FRAME_ZERO_PKA = resource_filename(__name__,
'./datafiles/psf_ref_frame0.pka')
PSF_FRAME_NINETY_PKA = resource_filename(__name__,
'./datafiles/psf_ref_frame90.pka')
76 changes: 76 additions & 0 deletions propkatraj/tests/datafiles/psf_ref_frame0.pka
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Group pKa model-pKa ligand atom-type
ASP 33 E 2.36 3.80
ASP 51 E 2.82 3.80
ASP 54 E 2.34 3.80
ASP 61 E 2.73 3.80
ASP 76 E 2.09 3.80
ASP 84 E 4.57 3.80
ASP 94 E 3.16 3.80
ASP 104 E 3.53 3.80
ASP 110 E 3.14 3.80
ASP 113 E 4.48 3.80
ASP 118 E 3.01 3.80
ASP 146 E 1.13 3.80
ASP 147 E 2.46 3.80
ASP 158 E 1.39 3.80
ASP 159 E 3.33 3.80
ASP 197 E 2.18 3.80
ASP 208 E 1.74 3.80
GLU 22 E 4.09 4.50
GLU 44 E 3.51 4.50
GLU 62 E 4.70 4.50
GLU 70 E 4.70 4.50
GLU 75 E 3.98 4.50
GLU 98 E 3.74 4.50
GLU 108 E 4.02 4.50
GLU 114 E 4.24 4.50
GLU 143 E 4.59 4.50
GLU 151 E 4.03 4.50
GLU 152 E 3.62 4.50
GLU 161 E 3.83 4.50
GLU 162 E 2.53 4.50
GLU 170 E 3.42 4.50
GLU 185 E 4.27 4.50
GLU 187 E 3.66 4.50
GLU 204 E 3.82 4.50
GLU 210 E 2.08 4.50
CYS 77 E 10.58 9.00
TYR 24 E 11.01 10.00
TYR 105 E 9.47 10.00
TYR 133 E 11.51 10.00
TYR 171 E 11.98 10.00
TYR 181 E 11.38 10.00
TYR 182 E 13.27 10.00
TYR 193 E 13.95 10.00
LYS 13 E 8.34 10.50
LYS 23 E 11.54 10.50
LYS 40 E 10.09 10.50
LYS 47 E 11.28 10.50
LYS 50 E 12.52 10.50
LYS 57 E 11.29 10.50
LYS 69 E 11.08 10.50
LYS 97 E 12.54 10.50
LYS 136 E 11.31 10.50
LYS 141 E 11.27 10.50
LYS 145 E 11.36 10.50
LYS 157 E 10.92 10.50
LYS 166 E 11.22 10.50
LYS 184 E 11.35 10.50
LYS 192 E 11.18 10.50
LYS 195 E 12.39 10.50
LYS 200 E 12.58 10.50
LYS 211 E 11.37 10.50
ARG 2 E 12.39 12.50
ARG 36 E 14.06 12.50
ARG 71 E 14.32 12.50
ARG 78 E 13.23 12.50
ARG 88 E 10.85 12.50
ARG 119 E 11.44 12.50
ARG 123 E 10.27 12.50
ARG 124 E 12.04 12.50
ARG 131 E 14.28 12.50
ARG 156 E 12.67 12.50
ARG 165 E 14.26 12.50
ARG 167 E 12.04 12.50
ARG 206 E 14.74 12.50
N+ 1 E 7.46 8.00
76 changes: 76 additions & 0 deletions propkatraj/tests/datafiles/psf_ref_frame90.pka
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Group pKa model-pKa ligand atom-type
ASP 33 E 2.57 3.80
ASP 51 E 2.99 3.80
ASP 54 E 2.52 3.80
ASP 61 E 3.54 3.80
ASP 76 E 0.80 3.80
ASP 84 E 4.03 3.80
ASP 94 E 2.41 3.80
ASP 104 E 1.79 3.80
ASP 110 E 3.62 3.80
ASP 113 E 3.94 3.80
ASP 118 E 3.05 3.80
ASP 146 E 0.29 3.80
ASP 147 E 2.48 3.80
ASP 158 E 1.66 3.80
ASP 159 E 1.17 3.80
ASP 197 E 2.23 3.80
ASP 208 E 1.86 3.80
GLU 22 E 3.83 4.50
GLU 44 E 3.14 4.50
GLU 62 E 2.27 4.50
GLU 70 E 3.77 4.50
GLU 75 E 3.60 4.50
GLU 98 E 2.92 4.50
GLU 108 E 4.72 4.50
GLU 114 E 4.14 4.50
GLU 143 E 2.75 4.50
GLU 151 E 3.10 4.50
GLU 152 E 3.54 4.50
GLU 161 E 2.95 4.50
GLU 162 E 3.34 4.50
GLU 170 E 4.79 4.50
GLU 185 E 3.34 4.50
GLU 187 E 3.65 4.50
GLU 204 E 2.85 4.50
GLU 210 E 2.74 4.50
CYS 77 E 11.26 9.00
TYR 24 E 12.61 10.00
TYR 105 E 9.78 10.00
TYR 133 E 11.17 10.00
TYR 171 E 12.16 10.00
TYR 181 E 12.10 10.00
TYR 182 E 12.54 10.00
TYR 193 E 14.15 10.00
LYS 13 E 9.52 10.50
LYS 23 E 11.14 10.50
LYS 40 E 10.41 10.50
LYS 47 E 11.03 10.50
LYS 50 E 12.45 10.50
LYS 57 E 10.27 10.50
LYS 69 E 12.19 10.50
LYS 97 E 13.45 10.50
LYS 136 E 11.31 10.50
LYS 141 E 11.40 10.50
LYS 145 E 11.25 10.50
LYS 157 E 11.35 10.50
LYS 166 E 10.99 10.50
LYS 184 E 11.36 10.50
LYS 192 E 10.09 10.50
LYS 195 E 11.78 10.50
LYS 200 E 12.60 10.50
LYS 211 E 12.16 10.50
ARG 2 E 13.07 12.50
ARG 36 E 13.24 12.50
ARG 71 E 14.34 12.50
ARG 78 E 13.46 12.50
ARG 88 E 12.79 12.50
ARG 119 E 12.00 12.50
ARG 123 E 12.92 12.50
ARG 124 E 14.02 12.50
ARG 131 E 14.87 12.50
ARG 156 E 14.79 12.50
ARG 165 E 14.50 12.50
ARG 167 E 12.61 12.50
ARG 206 E 14.30 12.50
N+ 1 E 8.23 8.00
11 changes: 11 additions & 0 deletions propkatraj/tests/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""
Tests that propkatraj can be imported.
"""

import sys
import pytest
import propkatraj


def test_import_basic():
assert "propkatraj" in sys.modules
Loading