From e370363d123488e4ee3201f19b630a5858ebb33b Mon Sep 17 00:00:00 2001 From: Nathan Baker Date: Thu, 17 Dec 2020 16:33:51 -0800 Subject: [PATCH] Provide surface area output by residue type. Fixes #3. --- CHANGELOG.md | 6 ++++++ osmolytes/main.py | 13 ++++++++++--- setup.py | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 151ebb6..62df752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # osmolytes +## 1.2.0 (17-Dec-2020) + +## Additions + +* Output surface area per residue type + ## 1.1.1 (17-Dec-2020) ### Fixes diff --git a/osmolytes/main.py b/osmolytes/main.py index e60e566..4f5978b 100644 --- a/osmolytes/main.py +++ b/osmolytes/main.py @@ -6,7 +6,7 @@ import osmolytes from osmolytes.pqr import parse_pqr_file, count_residues from osmolytes.sasa import SolventAccessibleSurface -from osmolytes.energy import transfer_energy +from osmolytes.energy import transfer_energy, get_folded_areas assert version_info > (3, 5) @@ -96,8 +96,6 @@ def main(args=None): _LOGGER.info(f"Reading PQR input from {args.pqr_path}...") with open(args.pqr_path, "rt") as pqr_file: atoms = parse_pqr_file(pqr_file) - count_df = count_residues(atoms) - _LOGGER.info(f"Protein composition:\n{count_df}") _LOGGER.info( f"Constructing protein solvent-accessible surface with " f"solvent radius {args.solvent_radius} and {args.surface_points} " @@ -109,6 +107,15 @@ def main(args=None): num_points=args.surface_points, xyz_path=args.surface_output, ) + counts = count_residues(atoms) + areas = get_folded_areas(atoms, sas).rename( + {"sidechain": "sidechain areas", "backbone": "backbone areas"}, + axis="columns" + ) + areas["residue counts"] = counts + print(areas) + areas = areas[["residue counts", "sidechain areas", "backbone areas"]] + _LOGGER.info(f"Protein composition:\n{areas}") _LOGGER.info("Calculating transfer energies.") energy_df = transfer_energy(atoms, sas) _LOGGER.info(f"Detailed energies (kcal/mol/M):\n{energy_df.to_string()}") diff --git a/setup.py b/setup.py index 2aa2e92..bc56ca0 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name="osmolytes", - version="1.1.1", + version="1.2.0", description=( "This code attempts to predict the influence of osmolytes on protein " "stability"