From f0bb2f388077e636554378b4308b5752e5dd545a Mon Sep 17 00:00:00 2001 From: Sam Ireland Date: Sat, 2 Dec 2017 17:29:53 +0000 Subject: [PATCH] Final 0.8 changes --- README.rst | 29 +++++++++++++++++++++++++---- atomium/files/pdbstring2pdbdict.py | 22 ++++++++++++++-------- atomium/structures/molecules.py | 3 +++ 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index fb063870..7df09aa3 100644 --- a/README.rst +++ b/README.rst @@ -1,10 +1,10 @@ -.. |travis| image:: https://api.travis-ci.org/samirelanduk/atomium.svg?branch=0.7 +.. |travis| image:: https://api.travis-ci.org/samirelanduk/atomium.svg?branch=0.8 -.. _travis: https://travis-ci.org/samirelanduk/atomium/ +.. _travis https://travis-ci.org/samirelanduk/atomium/ -.. |coveralls| image:: https://coveralls.io/repos/github/samirelanduk/atomium/badge.svg?branch=0.7 +.. |coveralls| image:: https://coveralls.io/repos/github/samirelanduk/atomium/badge.svg?branch=0.8 -.. _coveralls: https://coveralls.io/github/samirelanduk/atomium/ +.. _coveralls https://coveralls.io/github/samirelanduk/atomium/ .. |pypi| image:: https://img.shields.io/pypi/pyversions/atomium.svg @@ -102,6 +102,12 @@ from the RCSB over the internet using the PDB code: datetime.date(2002, 5, 6) >>> pdb.resolution() 1.9 + >>> pdb.rfactor() + 0.193 + >>> pdb.classification() + 'LYASE' + >>> pdb.technique() + 'X-RAY DIFFRACTION' >>> pdb2.model() @@ -311,6 +317,21 @@ The ``Xyz`` or ``Pdb`` object itself can also be saved: Changelog --------- +Release 0.8.0 +~~~~~~~~~~~~~ + +`2 December 2017` + +* Added option to get water residues in binding sites. +* Added extra PDB meta information parsing, such as: + + * Classification + * Experimental Technique + * Source Organism + * Expression Organism + * R-factor + + Release 0.7.0 ~~~~~~~~~~~~~ diff --git a/atomium/files/pdbstring2pdbdict.py b/atomium/files/pdbstring2pdbdict.py index 835f4f24..26a412dd 100644 --- a/atomium/files/pdbstring2pdbdict.py +++ b/atomium/files/pdbstring2pdbdict.py @@ -123,6 +123,20 @@ def extract_source(pdb_dict, lines): pdb_dict["expression_system"] = matches[0] +def extract_technique(pdb_dict, lines): + """Takes a ``dict`` and adds technique information to it by parsing file + lines. + + :param dict pdb_dict: the ``dict`` to update. + :param list lines: the file lines to read from.""" + + line = get_line("EXPDTA", lines) + if line: + pdb_dict["technique"] = line[6:].strip() + if pdb_dict["technique"]: return + pdb_dict["technique"] = None + + def extract_structure(pdb_dict, lines): """Takes a ``dict`` and adds structure information to it by parsing file lines. @@ -150,14 +164,6 @@ def extract_structure(pdb_dict, lines): extract_connections(pdb_dict, conect_lines) -def extract_technique(pdb_dict, lines): - line = get_line("EXPDTA", lines) - if line: - pdb_dict["technique"] = line[6:].strip() - if pdb_dict["technique"]: return - pdb_dict["technique"] = None - - def lines_to_model(atom_lines, hetatm_lines): """Creates a model ``dict`` from ATOM lines and HETATM lines. diff --git a/atomium/structures/molecules.py b/atomium/structures/molecules.py index a7bbc99d..89e48285 100644 --- a/atomium/structures/molecules.py +++ b/atomium/structures/molecules.py @@ -345,6 +345,9 @@ def site(self, include_water=False): all the residues with a non-hydrogen atom within 4 Angstroms of a non-hydrogen atom in the molecule. + :param bool include_water: If ``True``, water molecules will be\ + obtained as well as residues. + :rtype: :py:class:`.Site`""" from .chains import Site