Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ env:
- SETUP_CMD="${PYTEST_FLAGS}"
- BUILD_CMD="pip install -e package/ && (cd testsuite/ && python setup.py build)"
- CONDA_MIN_DEPENDENCIES="mmtf-python mock six biopython networkx cython matplotlib scipy griddataformats hypothesis gsd codecov"
- CONDA_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 chemfiles"
- CONDA_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 chemfiles mdtraj"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will a user have to install mdtraj in order to use MDAnalysis? I'd like to avoid this situation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it raises an ImportError only when the class is instantiated.

- CONDA_CHANNELS='biobuilds conda-forge'
- CONDA_CHANNEL_PRIORITY=True
- PIP_DEPENDENCIES="duecredit parmed"
- NUMPY_VERSION=stable
- INSTALL_HOLE="true"
- INSTALL_DSSP="true"
- INSTALL_STRIDE="true"
- CYTHON_TRACE_NOGIL=1

matrix:
Expand All @@ -55,6 +57,8 @@ matrix:
BUILD_DOCS=true
BUILD_CMD="cd ${TRAVIS_BUILD_DIR}/package && python setup.py build_ext --inplace"
INSTALL_HOLE="false"
INSTALL_DSSP="false"
INSTALL_STRIDE="false"
PIP_DEPENDENCIES="${PIP_DEPENDENCIES} sphinx==1.8.5 sphinx-sitemap sphinx_rtd_theme"

- env: NAME="Lint"
Expand All @@ -64,6 +68,8 @@ matrix:
BUILD_CMD=""
CONDA_DEPENDENCIES=""
INSTALL_HOLE="false"
INSTALL_DSSP="false"
INSTALL_STRIDE="false"

- env: NAME="python 2.7"
PYTHON_VERSION=2.7
Expand Down Expand Up @@ -97,6 +103,8 @@ matrix:
PIP_DEPENDENCIES=""
CONDA_DEPENDENCIES=${CONDA_MIN_DEPENDENCIES}
INSTALL_HOLE="false"
INSTALL_DSSP="false"
INSTALL_STRIDE="false"
CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis"

allow_failures:
Expand All @@ -120,6 +128,16 @@ install:
HOLE_BINDIR="${HOME}/hole2/exe"; \
export PATH=${PATH}:${HOLE_BINDIR}; \
fi
if [[ $INSTALL_DSSP == 'true' ]]; then \
bash ./maintainer/install_dssp.sh $TRAVIS_OS_NAME "${HOME}"; \
DSSP_BINDIR="${HOME}/dssp-3.1.4"; \
export PATH=${PATH}:${DSSP_BINDIR}; \
fi
if [[ $INSTALL_STRIDE == 'true' ]]; then \
bash ./maintainer/install_stride.sh $TRAVIS_OS_NAME "${HOME}"; \
STRIDE_BINDIR="${HOME}/stride"; \
export PATH=${PATH}:${STRIDE_BINDIR}; \
fi
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
- eval $BUILD_CMD
Expand Down
127 changes: 127 additions & 0 deletions maintainer/install_dssp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#!/usr/bin/env bash
#
# Written by Lily Wang, 2020
#
# This script is placed into the Public Domain using the CC0 1.0 Public Domain
# Dedication https://creativecommons.org/publicdomain/zero/1.0/
#
#
# NOTE: IF YOU RUN THIS SCRIPT YOU MUST BE ABLE TO COMPLY WITH THE DSSP
# LICENSE BELOW.
#
# Boost Software License - Version 1.0 - August 17th, 2003
# Permission is hereby granted, free of charge, to any person or organization
# obtaining a copy of the software and accompanying documentation covered by
# this license (the "Software") to use, reproduce, display, distribute, execute,
# and transmit the Software, and to prepare derivative works of the Software,
# and to permit third-parties to whom the Software is furnished to do so, all
# subject to the following:

# The copyright notices in the Software and this entire statement, including
# the above license grant, this restriction and the following disclaimer,
# must be included in all copies of the Software, in whole or in part, and all
# derivative works of the Software, unless such copies or derivative works are
# solely in the form of machine-executable object code generated by a source
# language processor.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR
# ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
#
# Install DSSP from https://swift.cmbi.umcn.nl/gv/dssp/
#
# arguments
# OSNAME : linux | darwin
# PREFIX : "path/to/installdir"
#
# PREFIX can be relative to CWD or an absolute path; it will be created
# and DSSP unpacked under PREFIX (the tar file contains "dssp-xx.xx.xx/...")
#
#


set -o errexit -o nounset

SCRIPT=$(basename $0)


DOWNLOAD_URL='https://github.com/cmbi/dssp/archive/3.1.4.tar.gz'
TARFILE='3.1.4.tar.gz'


# path to dir with executables in the current HOLE distribution
DSSP_EXE_DIR=dssp-3.1.4

function die () {
local msg="$1" err=$2
echo "[${SCRIPT}] ERROR: $msg [$err]"
exit $err
}

function is_native_executable () {
local filename="$1" OSNAME="$2"
file "${filename}" | grep -qi ${OFORMAT}
return $?
}

OSNAME="$1"
case "$OSNAME" in
Linux|linux)
OSNAME=Linux
OFORMAT=Linux
sudo apt-get -y install libboost-all-dev autoconf automake autotools-dev
;;
OSX|osx|Darwin|darwin)
OSNAME=Darwin
OFORMAT="Mach-O"
;;
*)
die "OS '${OSNAME}' not supported." 10;;
esac


PREFIX="$2"
test -n "$PREFIX" || die "missing argument PREFIX (installation directory)" 10

#------------------------------------------------------------
# start installation
#------------------------------------------------------------

mkdir -p "$PREFIX" && cd "$PREFIX" || die "Failed to create and cd to $PREFIX" 1
if ! test -f ${TARFILE}; then
echo "Downloading ${TARFILE} from ${DOWNLOAD_URL}..."
# fixing curl on travis/anaconda, see http://stackoverflow.com/a/31060428/334357
export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
curl -L ${DOWNLOAD_URL} -o ${TARFILE} || \
die "Failed to download ${TARFILE} from ${DOWNLOAD_URL}" 1
fi

# only install the executables in DSSP_EXE_DIR
tar xvf ${TARFILE} ${DSSP_EXE_DIR} || die "Failed 'tar xvf ${TARFILE} ${DSSP_EXE_DIR}'" 1

MDA_DSSP_BINDIR="${PWD}/${DSSP_EXE_DIR}"
DSSP_EXE="${MDA_DSSP_BINDIR}/mkdssp"

cd $MDA_DSSP_BINDIR

echo "Configuring"
./autogen.sh
./configure
echo "Making"
make

test -f "${DSSP_EXE}" || die "mkdssp executable ${DSSP_EXE} not installed" 2
is_native_executable ${DSSP_EXE} ${OFORMAT} || \
{ file ${DSSP_EXE}; \
die "${DSSP_EXE} will not run on ${OSNAME} (object format ${OFORMAT})" 3; }

echo "mkdssp was installed into ${MDA_DSSP_BINDIR}"
echo ">>> export PATH=\${PATH}:${MDA_DSSP_BINDIR}"

# repeat this line in .travis.yml
export PATH=${PATH}:${MDA_DSSP_BINDIR}
117 changes: 117 additions & 0 deletions maintainer/install_stride.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#!/usr/bin/env bash
#
# Written by Lily Wang, 2020
#
# This script is placed into the Public Domain using the CC0 1.0 Public Domain
# Dedication https://creativecommons.org/publicdomain/zero/1.0/
#
# NOTE: IF YOU RUN THIS SCRIPT YOU MUST BE ABLE TO COMPLY WITH THE DSSP
# LICENSE BELOW.
#
# All rights reserved, whether the whole or part of the program is
# concerned. Permission to use, copy, and modify this software and its
# documentation is granted for academic use, provided that:
#
# i. this copyright notice appears in all copies of the software and
# related documentation;
#
# ii. the reference given below (Frishman and Argos, 1995) must be
# cited in any publication of scientific results based in part or
# completely on the use of the program;
#
# iii. bugs will be reported to the authors.
#
# The use of the software in commercial activities is not allowed
# without a prior written commercial license agreement.
#
# IF YOU USE STRIDE IN PUBLISHED WORK, PLEASE CITE:
#
# Frishman, D and Argos, P. (1995) Knowledge-based secondary structure
# assignment. Proteins: structure, function and genetics, 23,
# 566-579.
#
# The source code is available at http://webclu.bio.wzw.tum.de/stride/
#
# arguments
# OSNAME : linux | darwin
# PREFIX : "path/to/installdir"
#
# PREFIX can be relative to CWD or an absolute path; it will be created
# and STRIDE unpacked under PREFIX/stride.
#
#


set -o errexit -o nounset

SCRIPT=$(basename $0)


DOWNLOAD_URL='http://webclu.bio.wzw.tum.de/stride/stride.tar.gz'
TARFILE='stride.tar.gz'


# path to dir with executables in the current HOLE distribution
STRIDE_EXE_DIR=stride

function die () {
local msg="$1" err=$2
echo "[${SCRIPT}] ERROR: $msg [$err]"
exit $err
}

function is_native_executable () {
local filename="$1" OSNAME="$2"
file "${filename}" | grep -qi ${OFORMAT}
return $?
}

OSNAME="$1"
case "$OSNAME" in
Linux|linux)
OSNAME=Linux
OFORMAT=Linux
;;
OSX|osx|Darwin|darwin)
OSNAME=Darwin
OFORMAT="Mach-O"
;;
*)
die "OS '${OSNAME}' not supported." 10;;
esac


PREFIX="$2"
test -n "$PREFIX" || die "missing argument PREFIX (installation directory)" 10
PREFIX="${PREFIX}/${STRIDE_EXE_DIR}"

#------------------------------------------------------------
# start installation
#------------------------------------------------------------

mkdir -p "$PREFIX" && cd "$PREFIX" || die "Failed to create and cd to $PREFIX" 1
if ! test -f ${TARFILE}; then
echo "Downloading ${TARFILE} from ${DOWNLOAD_URL}..."
# fixing curl on travis/anaconda, see http://stackoverflow.com/a/31060428/334357
export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
curl -L ${DOWNLOAD_URL} -o ${TARFILE} || \
die "Failed to download ${TARFILE} from ${DOWNLOAD_URL}" 1
fi

# only install the executables in STRIDE_EXE_DIR
tar xvf ${TARFILE} || die "Failed 'tar xvf ${TARFILE}'" 1
STRIDE_EXE="${PWD}/stride"

echo "Making"
make

test -f "${STRIDE_EXE}" || die "stride executable ${STRIDE_EXE} not installed" 2
is_native_executable ${STRIDE_EXE} ${OFORMAT} || \
{ file ${STRIDE_EXE}; \
die "${STRIDE_EXE} will not run on ${OSNAME} (object format ${OFORMAT})" 3; }

echo "stride was installed into ${PWD}"
echo ">>> export PATH=\${PATH}:${PWD}"

# repeat this line in .travis.yml
export PATH=${PATH}:${PWD}
27 changes: 27 additions & 0 deletions package/MDAnalysis/analysis/secondary_structure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2020 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under the GNU Public Licence, v2 or any higher version
#
# Please cite your use of MDAnalysis in published work:
#
# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler,
# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein.
# MDAnalysis: A Python package for the rapid analysis of molecular dynamics
# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th
# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy.
# doi: 10.25080/majora-629e541a-00e
#
# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein.
# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations.
# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787
#

from __future__ import absolute_import

from .dssp import DSSP
from .wrapper import DSSPWrapper, STRIDEWrapper
Loading