Skip to content

Commit

Permalink
Merge pull request #13 from Electrostatics/nathan/areas
Browse files Browse the repository at this point in the history
Provide surface area output by residue type.
  • Loading branch information
sobolevnrm authored Dec 18, 2020
2 parents b7a109f + e370363 commit ba0aa89
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 10 additions & 3 deletions osmolytes/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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} "
Expand All @@ -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()}")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ba0aa89

Please sign in to comment.