Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into HEAD
  • Loading branch information
mtiberti committed Jan 26, 2016
2 parents f39d3e9 + 9a80de0 commit 5d914cc
Show file tree
Hide file tree
Showing 690 changed files with 86,681 additions and 141,751 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ examples/output.txt
.adk_oplsaa.trr_offsets.pkl
.adk_oplsaa.xtc_offsets.pkl
.gram_A_identical_frames.xtc_offsets.pkl
# Ignore html build
doc/html/
34 changes: 20 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
env:
global:
- secure: "HIj3p+p2PV8DBVg/KGUx6n83KwB0ASE5FwOn0SMB9zxnzAqe8sapwdBQdMdq0sXB7xT1spJqRxuxOMVEVn35BNLu7bxMLfa4287C8YXcomnvmv9xruxAsjsIewnNQ80vtPVbQddBPxa4jKbqgPby5QhhAP8KANAqYe44pIV70fY="
- GH_DOC_BRANCH: develop
- GH_REPOSITORY: github.com/MDAnalysis/mdanalysis.git
- GIT_CI_USER: TravisCI
- GIT_CI_EMAIL: [email protected]
- MDA_DOCDIR: package/doc/html
matrix:
- SETUP=full CYTHONIZE=true
- SETUP=minimal CYTHONIZE=false
language: python
python:
- "2.7"
Expand All @@ -6,27 +17,31 @@ addons:
apt:
packages:
- gfortran
- libgfortran3
- libhdf5-serial-dev
- libnetcdf-dev
- liblapack-dev
- libatlas-dev
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- ./miniconda.sh -b -p /home/travis/miniconda
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda
install:
- conda create --yes -q -n pyenv mkl python=2.7 numpy=1.9.1 scipy=0.14.0 nose=1.3.7 sphinx=1.3
- if [[ $SETUP == 'full' ]]; then conda create --yes -q -n pyenv python=2.7 numpy=1.9.2 scipy=0.16.0 nose=1.3.7 sphinx=1.3; fi
- if [[ $SETUP == 'minimal' ]]; then conda create --yes -q -n pyenv python=2.7 numpy=1.9.2 nose=1.3.7 sphinx=1.3; fi
- source activate pyenv
- conda install --yes python=$TRAVIS_PYTHON_VERSION cython biopython matplotlib networkx netcdf4
- pip install package/
- if [[ $SETUP == 'full' ]]; then conda install --yes python=$TRAVIS_PYTHON_VERSION cython biopython matplotlib networkx netcdf4; fi
- if [[ $SETUP == 'minimal' ]]; then conda install --yes python=$TRAVIS_PYTHON_VERSION biopython networkx; fi
- if [[ $CYTHONIZE == 'true' ]]; then find . -name '*.pyx' -exec touch '{}' \; ;fi
- pip install -v package/
- pip install testsuite/
- pip install coveralls tempdir
- chmod +x testsuite/MDAnalysisTests/mda_nosetests
# command to run tests
script:
- ./testsuite/MDAnalysisTests/mda_nosetests -v --with-coverage --cover-package MDAnalysis --processes=2 --process-timeout=120 --with-memleak
- ./testsuite/MDAnalysisTests/mda_nosetests --with-coverage --cover-package MDAnalysis --processes=2 --process-timeout=300 --with-memleak
- |
test ${TRAVIS_PULL_REQUEST} == "false" && \
test ${TRAVIS_BRANCH} == ${GH_DOC_BRANCH} && \
Expand All @@ -41,12 +56,3 @@ after_success:
test ${TRAVIS_BRANCH} == ${GH_DOC_BRANCH} && \
test "${TRAVIS_BUILD_NUMBER}.1" == "${TRAVIS_JOB_NUMBER}" && \
bash ./maintainer/deploy_docs.sh
env:
global:
- secure: "HIj3p+p2PV8DBVg/KGUx6n83KwB0ASE5FwOn0SMB9zxnzAqe8sapwdBQdMdq0sXB7xT1spJqRxuxOMVEVn35BNLu7bxMLfa4287C8YXcomnvmv9xruxAsjsIewnNQ80vtPVbQddBPxa4jKbqgPby5QhhAP8KANAqYe44pIV70fY="
- GH_DOC_BRANCH: develop
- GH_REPOSITORY: github.com/MDAnalysis/mdanalysis.git
- GIT_CI_USER: TravisCI
- GIT_CI_EMAIL: [email protected]
- MDA_DOCDIR: package/doc/html
3 changes: 3 additions & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ Chronological list of authors
- Max Linke
- Gorman Stock
- Jonathan Barnoud
- Hai Nguyen
2016
- Balasubramanian

External code
-------------
Expand Down
88 changes: 88 additions & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,94 @@ The rules for this file:
* release numbers follow "Semantic Versioning" http://semver.org

------------------------------------------------------------------------------
01/16/16 tyler.je.reddy, kain88-de, richardjgowers, manuel.nuno.melo,
orbeckst, Balasubra

* 0.13.0

API Changes

* ChainReader `delta` keyword deprecated in favor of `dt`. (Issue #522)
* XYZWriter can now be used as a container format for different protein models
as well as a normal trajectory. If `n_atoms` is None (default) MDAnalysis
assumes that it is used as a container and won't give a warning if the
number of atoms differs between frames.
* GROWriter.fmt strings updated to use format style (Issue #494)
* removed MDAnalysis.lib.parallel.distances; use the new backend="OpenMP"
keyword for the functions in MDAnalysis.lib.distances (Issue #530)

Enhancement

* ChainReader now reports times properly summed over sub-readers (Issue #522)
* GRO file reading approximately 50% faster for large files (Issue #212)
* GRO file writing now will write velocities where possible (Issue #494)
* Added bonded selection (Issue #362)
* Spherical layer and spherical zone selections now much faster (Issue #362)
* new keyword "backend" for accelerated functions in MDAnalysis.lib.distances
to select "serial" or "OpenMP"-enabled versions of the code; the default
is "serial" so old code will behave as before (see Issue #530)
* Lammps data file parsing improved greatly. Should now support all files,
and triclinic geometry. (Issue #139)
* Added analysis.polymer, currently with PersistenceLength tool (Issue #460)
* Added analysis.rdf, with InterRDF tool. (Issue #460)
* Made Reader.check_slice_indices a public method (Issue #604)
* analysis.helanal.helanal_main() now returns results as dict
* Added keyword to update selection every frame in density calculation (Issue #584)
* New keywords start, stop, step for density.density_from_Universe()
to slice a trajectory.
* MOL2Reader now reads molecule and substructure into ts.data
* All subclasses of ProtoReader, Writer and TopologyReader are automatically
added to the MDAnalysis directory of I/O (Issue #431)

Changes

* built html doc files are no longer version controlled (Issue #491)
* The lib._distances and lib_distances_openmp libraries now have a
OPENMP_ENABLED boolean flag which indicates if openmp was used in
compilation. (Issue #530)
* analysis.helanal.helanal_trajectory() and helanal_main() now use a
logger at level INFO to output all their computed values instead
of printing to stdout
* default offset for ProgressMeter was changed from 0 to 1 (to match
the change from 1- to 0-based ts.frame counting)
* removed superfluous analysis.density.density_from_trajectory();
use density_from_Universe(TOPOL, TRAJ) instead.
* MOL2Writer.write now only writes a single frame (Issue #521)

Fixes

* Fixed select_atoms requiring a trajectory be loaded (Issue #270)
* AtomGroup timesteps no longer cached (Issue #606)
* GROWriter now truncates atom numbers over 99999 (Issue #550)
* AMBER netcdf writer now correctly uses float32 precision (Issue #518)
* Fixed a numpy incompatibility in `analysis.leaflet.LeafletFinder`.
(Issue #533)
* Cleaned up `MDAnalysis.Writer` docs regarding `dt` usage. (Issue #522)
* Fixed setup-time dependency on numpy that broke pip installs. (Issue #479)
* Fixed unpickling errors due to lingering dead universes. (Issue #487)
* Fixed analysis.density modules requiring the defunct `skip` attribute
on trajectories. (Issue #489)
* ten2eleven camelcase fixer now deals with centerOfMass (Issue #470)
* ten2eleven will now convert numatoms to n_atoms argument
for writer() functions (Issue #470)
* Fixed non-compliant Amber NCDFWriter (Issue #488)
* Fixed many Timestep methods failing when positions weren't present
(Issue #512)
* Fixed PointSelection using KDTree (Issue #362)
* Fixed GROParser getting tripped up by some file (Issue #548)
* Fixed writing dx files from analysis.density.density_from_Universe()
(Issue #544 and #410)
* Fixed base.Reader._check_slice_indices not liking numpy ints
(Issue #604)
* Fixed broken analysis.helanal.helanal_trajectory() and
helanal_main()
* Fixed lib.util.greedy_splitext() (now returns full path)
* Fixed MOL2Reader not reading molecule and substructure on init
(Issue #521)
* Fixed MOL2Writer rereading frames when writing them (Issue #521)
* Fixed PDBWriter not writing occupancies from atoms (Issue #620)


10/08/15

* 0.12.1 kain88-de, orbeckst, richardjgowers
Expand Down
2 changes: 1 addition & 1 deletion package/MDAnalysis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- http://www.MDAnalysis.org
# Copyright (c) 2006-2015 Naveen Michaud-Agrawal, Elizabeth J. Denning, Oliver Beckstein
Expand Down
24 changes: 20 additions & 4 deletions package/MDAnalysis/analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- http://www.MDAnalysis.org
# Copyright (c) 2006-2015 Naveen Michaud-Agrawal, Elizabeth J. Denning, Oliver Beckstein
Expand Down Expand Up @@ -75,6 +75,9 @@
their mutual similarities, including the ability to perform hierarchical
clustering and generate heat map-dendrogram plots.
:mod:`~MDAnalysis.analysis.rdf`
Calculation of pair distribution functions
:mod:`~MDAnalysis.analysis.rms`
Calculation of RMSD and RMSF.
Expand All @@ -95,9 +98,22 @@
"""

__all__ = [
'align', 'contacts', 'density', 'distances',
'gnm', 'hbonds', 'helanal', 'hole', 'leaflet',
'nuclinfo', 'psa', 'rms', 'waterdynamics',
'align',
'base',
'contacts',
'density',
'distances',
'gnm',
'hbonds',
'helanal',
'hole',
'leaflet',
'nuclinfo',
'polymer',
'psa',
'rdf',
'rms',
'waterdynamics',
'x3dna',
]

13 changes: 6 additions & 7 deletions package/MDAnalysis/analysis/align.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- http://www.MDAnalysis.org
# Copyright (c) 2006-2015 Naveen Michaud-Agrawal, Elizabeth J. Denning, Oliver Beckstein
Expand Down Expand Up @@ -461,7 +461,7 @@ def rms_fit_trj(traj, reference, select='all', filename=None, rmsdfile=None, pre
ref_atoms, traj_atoms = get_matching_atoms(ref_atoms, traj_atoms,
tol_mass=tol_mass, strict=strict)

logger.info("RMS-fitting on %d atoms." % len(ref_atoms))
logger.info("RMS-fitting on {0:d} atoms.".format(len(ref_atoms)))
if mass_weighted:
# if performing a mass-weighted alignment/rmsd calculation
weight = ref_atoms.masses / ref_atoms.masses.mean()
Expand Down Expand Up @@ -667,8 +667,8 @@ def fasta2select(fastafilename, is_aligned=False,
raise
with open(alnfilename) as aln:
alignment = Bio.AlignIO.read(aln, "clustal", alphabet=protein_gapped)
logger.info("Using clustalw sequence alignment %r" % alnfilename)
logger.info("ClustalW Newick guide tree was also produced: %r" % treefilename)
logger.info("Using clustalw sequence alignment {0!r}".format(alnfilename))
logger.info("ClustalW Newick guide tree was also produced: {0!r}".format(treefilename))

nseq = len(alignment)
if nseq != 2:
Expand Down Expand Up @@ -922,9 +922,8 @@ def get_atoms_byres(g, match_mask=np.logical_not(mismatch_mask)):

logger.error("Atoms: reference | trajectory")
for ar, at in itertools.izip(ag1[mismatch_atomindex], ag2[mismatch_atomindex]):
logger.error("%4s %3d %3s %3s %6.3f | %4s %3d %3s %3s %6.3f" %
(ar.segid, ar.resid, ar.resname, ar.name, ar.mass,
at.segid, at.resid, at.resname, at.name, at.mass,))
logger.error("{0!s:>4} {1:3d} {2!s:>3} {3!s:>3} {4:6.3f} | {5!s:>4} {6:3d} {7!s:>3} {8!s:>3} {9:6.3f}".format(ar.segid, ar.resid, ar.resname, ar.name, ar.mass,
at.segid, at.resid, at.resname, at.name, at.mass))
errmsg = ("Inconsistent selections, masses differ by more than {0}; " + \
"mis-matching atoms are shown above.").format(tol_mass)
logger.error(errmsg)
Expand Down
105 changes: 105 additions & 0 deletions package/MDAnalysis/analysis/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- http://www.MDAnalysis.org
# Copyright (c) 2006-2015 Naveen Michaud-Agrawal, Elizabeth J. Denning, Oliver Beckstein
# and contributors (see AUTHORS for the full list)
#
# Released under the GNU Public Licence, v2 or any higher version
#
# Please cite your use of MDAnalysis in published work:
#
# 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
#

"""
Analysis building blocks --- :mod:`MDAnalysis.analysis.base`
============================================================
A collection of useful building blocks for creating Analysis
classes.
"""
import numpy as np
import logging


logger = logging.getLogger(__name__)


class AnalysisBase(object):
"""Base class for defining multi frame analysis
The analysis base class is designed as a template for creating
multiframe analysis.
The class implements the following methods:
_setup_frames(trajectory, start=None, stop=None, step=None)
Pass a Reader object and define the desired iteration pattern
through the trajectory
run
The user facing run method. Calls the analysis methods
defined below
Your analysis can implement the following methods, which are
called from run:
_prepare
Called before iteration on the trajectory has begun.
Data structures can be set up at this time, however most
error checking should be done in the __init__
_single_frame
Called after the trajectory is moved onto each new frame.
_conclude
Called once iteration on the trajectory is finished.
Apply normalisation and averaging to results here.
"""
def _setup_frames(self, trajectory, start=None,
stop=None, step=None):
self._trajectory = trajectory
start, stop, step = trajectory.check_slice_indices(
start, stop, step)
self.start = start
self.stop = stop
self.step = step
self.nframes = len(xrange(start, stop, step))

def _single_frame(self):
"""Calculate data from a single frame of trajectory
Don't worry about normalising, just deal with a single frame.
"""
pass

def _prepare(self):
"""Set things up before the analysis loop begins"""
pass

def _conclude(self):
"""Finalise the results you've gathered.
Called at the end of the run() method to finish everything up.
"""
pass

def run(self):
"""Perform the calculation"""
logger.info("Starting preparation")
self._prepare()
for i, ts in enumerate(
self._trajectory[self.start:self.stop:self.step]):
self._ts = ts
#logger.info("--> Doing frame {} of {}".format(i+1, self.nframes))
self._single_frame()
logger.info("Finishing up")
self._conclude()


Loading

0 comments on commit 5d914cc

Please sign in to comment.