Skip to content

Commit

Permalink
Finish fluctmatch-3.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Click committed Jul 9, 2018
2 parents 188f280 + 7d8ce4a commit da8599c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.3.4
current_version = 3.3.5
commit = True
tag = True

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Overview
:alt: PyPI Package latest release
:target: https://pypi.python.org/pypi/fluctmatch

.. |commits-since| image:: https://img.shields.io/github/commits-since/tclick/python-fluctmatch/v3.3.4.svg
.. |commits-since| image:: https://img.shields.io/github/commits-since/tclick/python-fluctmatch/v3.3.5.svg
:alt: Commits since latest release
:target: https://github.com/tclick/python-fluctmatch/compare/v3.3.4...master
:target: https://github.com/tclick/python-fluctmatch/compare/v3.3.5...master

.. |wheel| image:: https://img.shields.io/pypi/wheel/fluctmatch.svg
:alt: PyPI Wheel
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
year = u'2014-2017'
author = u'Timothy Click'
copyright = '{0}, {1}'.format(year, author)
version = release = u'3.3.4'
version = release = u'3.3.5'

pygments_style = 'trac'
templates_path = ['.']
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def read(*names, **kwargs):

setup(
name="fluctmatch",
version="3.3.4",
version="3.3.5",
license="BSD license",
description="Elastic network model using fluctuation matching.",
long_description="%s\n%s" % (
Expand Down
2 changes: 1 addition & 1 deletion src/fluctmatch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import logging

__version__ = "3.3.4"
__version__ = "3.3.5"

_MODELS = dict()
_DESCRIBE = dict()
Expand Down
4 changes: 2 additions & 2 deletions src/fluctmatch/commands/cmd_splittraj.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
metavar="LOG",
show_default=True,
default="splittraj.log",
type=click.Path(exists=False, file_okay=True, resolve_path=True),
type=click.Path(exists=False, file_okay=True, resolve_path=False),
help="Log file",
)
@click.option(
Expand Down Expand Up @@ -177,7 +177,7 @@ def cli(program, toppar, topology, trajectory, data, index, outfile, logfile,
},
"file": {
"class": "logging.FileHandler",
"filename": logfile,
"filename": path.join(os.getcwd(), logfile),
"level": "INFO",
"mode": "w",
"formatter": "detailed",
Expand Down
19 changes: 13 additions & 6 deletions src/fluctmatch/commands/cmd_table_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def cli(logfile, top1, top2, coord, table, outfile):
},
"file": {
"class": "logging.FileHandler",
"filename": logfile,
"filename": path.join(os.getcwd(), logfile),
"level": "INFO",
"mode": "w",
"formatter": "detailed",
Expand All @@ -130,7 +130,10 @@ def cli(logfile, top1, top2, coord, table, outfile):
cg = mda.Universe(top1, coord)
fluctmatch = mda.Universe(top2, coord)
convert = dict(zip(fluctmatch.atoms.names, cg.atoms.names))
resnames = dict(zip(cg.residues.resnums, cg.residues.resnames))
resnames = pd.DataFrame.from_records(
zip(cg.residues.segids, cg.residues.resnums, cg.residues.resnames),
columns=["segid", "res", "resn"]
).set_index(["segid", "res"])

with open(table, "rb") as tbl:
logger.info("Loading {}.".format(table))
Expand All @@ -147,10 +150,14 @@ def cli(logfile, top1, top2, coord, table, outfile):
constants["J"] = constants["J"].apply(lambda x: convert[x])

# Create lists of corresponding residues
constants["resnI"] = constants["resI"].apply(
lambda x: resnames[x]).to_frame()
constants["resnJ"] = constants["resJ"].apply(
lambda x: resnames[x]).to_frame()
columns = ["segidI", "resI", "segidJ", "resJ"]
resnI = []
resnJ = []
for segidI, resI, segidJ, resJ in constants[columns].values:
resnI.append(resnames.loc[(segidI, resI),])
resnJ.append(resnames.loc[(segidJ, resJ),])
constants["resnI"] = pd.concat(resnI).values
constants["resnJ"] = pd.concat(resnJ).values

# Concatenate the columns
cols = ["segidI", "resI", "resnI", "I", "segidJ", "resJ", "resnJ", "J"]
Expand Down

0 comments on commit da8599c

Please sign in to comment.