Skip to content

Commit

Permalink
Merge pull request #23 from wesbarnett/setup
Browse files Browse the repository at this point in the history
Merging #23 which adds setup script for standard installation.
  • Loading branch information
davidlmobley committed May 29, 2015
2 parents 25e869d + ad21883 commit be23e5a
Show file tree
Hide file tree
Showing 141 changed files with 162 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
*.egg-info
*.pyc
build
dist
9 changes: 9 additions & 0 deletions DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Alchemical Analysis
=======================

Analyze alchemical free energy calculations conducted in GROMACS, AMBER or SIRE
using recommended best practices from Klimovich et al., JCAMD 29:397-411
(2015). This tool handles analysis via a slate of free energy methods, including BAR,
MBAR, TI, and the Zwanzig relationship (exponential averaging) among others,
and provides a good deal of analysis of computed free energies and convergence
in order to help you assess the quality of your results.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include DESCRIPTION.rst
include README.md
recursive-include samples *
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def checkUnitsAndMore(units):

# If using Gromacs we can read in the temperature directly from dhdl.xvg
if P.software.title() == 'Gromacs':
import parsers.parser_gromacs
P.temperature = parsers.parser_gromacs.readTempGromacs(P)
import parser_gromacs
P.temperature = parser_gromacs.readTempGromacs(P)

kB = 1.3806488*6.02214129/1000.0 # Boltzmann's constant (kJ/mol/K).
beta = 1./(kB*P.temperature)
Expand Down Expand Up @@ -1084,7 +1084,32 @@ def stripZeros(a, aa, b, bb):
# MAIN
#===================================================================================================

if __name__ == "__main__":
def main():

global dhdlt
global u_klt
global P
global K
global n_components
global pymbar
global dhdl
global N_k
global lv
global dlam
global ave_dhdl
global std_dhdl
global lchange
global cubspl
global mapl
global u_kln
global Deltaf_ij
global dDeltaf_ij
global df_allk
global ddf_allk
global nsnapshots
global pl
global FP
global matplotlib

# Timing.
stime = ttt_time.time()
Expand All @@ -1105,21 +1130,21 @@ def stripZeros(a, aa, b, bb):
from matplotlib.font_manager import FontProperties as FP

if P.software.title() == 'Gromacs':
import parsers.parser_gromacs
nsnapshots, lv, dhdlt, u_klt = parsers.parser_gromacs.readDataGromacs(P)
import parser_gromacs
nsnapshots, lv, dhdlt, u_klt = parser_gromacs.readDataGromacs(P)
elif P.software.title() == 'Sire':
import parsers.parser_sire
nsnapshots, lv, dhdlt, u_klt = parsers.parser_sire.readDataSire(P)
import parser_sire
nsnapshots, lv, dhdlt, u_klt = parser_sire.readDataSire(P)
elif P.software.title() == 'Amber':
import parsers.parser_amber
lv, ave_dhdl, std_dhdl = parsers.parser_amber.readDataAmber(P)
import parser_amber
lv, ave_dhdl, std_dhdl = parser_amber.readDataAmber(P)
else:
from inspect import currentframe, getframeinfo
lineno = getframeinfo(currentframe()).lineno
print "\n\n%s\n Looks like there is no yet proper parser to process your files. \n Please modify lines %d and %d of this script.\n%s\n\n" % (78*"*", lineno+3, lineno+4, 78*"*")
#### LINES TO BE MODIFIED
import parsers.YOUR_OWN_FILE_PARSER
nsnapshots, lv, dhdlt, u_klt = parsers.YOUR_OWN_FILE_PARSER.yourDataParser(*args, **kwargs)
import YOUR_OWN_FILE_PARSER
nsnapshots, lv, dhdlt, u_klt = YOUR_OWN_FILE_PARSER.yourDataParser(*args, **kwargs)
#### All the four are numpy arrays.
#### lv is the array of lambda vectors.
#### nsnapshots is the number of equilibrated snapshots per each state.
Expand Down Expand Up @@ -1154,6 +1179,10 @@ def stripZeros(a, aa, b, bb):
plotCFM(u_kln, N_k, 50)

print "\nTime spent: %s hours, %s minutes, and %s seconds.\nFinished on %s" % timeStatistics(stime)

if __name__ == "__main__":
main()

#===================================================================================================
# End of the script
#===================================================================================================
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file removed parsers/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
107 changes: 107 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
"""Alchemical Analysis
See:
https://github.com/MobleyLab/alchemical-analysis
"""

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

# Get the long description from the relevant file
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description = f.read()

setup(
name='alchemical_analysis',

# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.1.0',

description='Alchemical Analysis',
long_description=long_description,

# The project's main homepage.
url='https://github.com/MobleyLab/alchemical-analysis',

# Author details
author='Pavel Klimovich, Michael Shirts, and David Mobley',
author_email='[email protected]',

# Choose your license
license='LGPL',

# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 5 - Production/Stable',

# Indicate who your project is intended for
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Physics',

# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)',

# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2.7',
],

# What does your project relate to?
keywords='pymbar',

# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
#packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
packages=find_packages(),
py_modules=['parser_gromacs','parser_amber','parser_sire','unixlike'],

# List run-time dependencies here. These will be installed by pip when
# your project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=["pymbar"],

# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
# for example:
# $ pip install -e .[dev,test]
# extras_require={
# 'dev': ['check-manifest'],
# 'test': ['coverage'],
#},

# If there are data files included in your packages that need to be
# installed, specify them here. If using Python 2.6 or less, then these
# have to be included in MANIFEST.in as well.
#package_data={
# 'sample': ['package_data.dat'],
#},

# Although 'package_data' is the preferred approach, in some case you may
# need to place data files outside of your packages. See:
# http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
# In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
#data_files=[('my_data', ['data/data_file'])],

# To provide executable scripts, use entry points in preference to the
# "scripts" keyword. Entry points provide cross-platform support and allow
# pip to create the appropriate form of executable for the target platform.
scripts={"alchemical_analysis/alchemical_analysis.py","alchemical_analysis/parser_gromacs.py","alchemical_analysis/unixlike.py"},
entry_points={
'console_scripts': [
'alchemical_analysis=alchemical_analysis:main',
],
},
)

0 comments on commit be23e5a

Please sign in to comment.