Skip to main content

Description from GitHub readme.md:

Python3 client API for ConsurfDB

Consurf-DB is a web server developed by the group of Prof. Nir Ben-Tal which provides PDB structures with the b-factors remapped to residue conservation scores as determined by their rate4site.

This unofficial Python3 module queries this server and performs several operations.

This was formerly a part of the Venus backend (:octocat: michelanglo-protein), but I (MF) moved it out as it may be useful for others.

PS. Like all APIs, especially the unofficial ones, do not abuse the server...

Usage

Get and parse consurfDB data.

from consurfDB import ConsurfDB
cp = ConsurfDB.from_web('1UBQ', 'A')

The grades file data is in cp.data and can be made into a pandas dataframe: It takes ~1.7 seconds to fetch a grades file off the web. Do simply ignore the unsafe SSL warning (changing ConsurfDB.REQUEST_VERIFY_SETTING to True, will result in failure).

One can also run it from a grades file:

from consurfDB import ConsurfDB
cp = ConsurfDB.from_filename('grades.txt')

Data is in self.data, which is a dict of MET1:A to dict of values. See the type dictionary ResidueDataType for details.

from consurfDB import ResidueDataType
help(ResidueDataType)

One can make a pandas dataframe from it.

grades : pd.DataFrame = cp.to_pandas()

If a residue appears in SEQPOS but no ATOM records are present, they will be like cp.data['___1:A']. The key is the 3LATOM field, this is ATOM numbering, while POS is the SEQPOS numbering. apply_offset_from_swissmodel uses the latter and makes both Uniprot numbering.

Also can add a consurf conservation to a PyRosetta pose in place.

pose : pyrosetta.Pose = ... # noqa
cp.add_bfactor_to_pose(pose)

Or a pymol object

also, if chain number differs, e.g. V in consurf grades file and A in pose:

cp.remap_chains({'B': 'A'})

Likewise with offset.

If the Uniprot id is known, the offset can be taken from Swissmodel

cp.apply_offset_from_swissmodel(uniprot, code, chain)

Potentially support multi-chain operations, but not tested.

cp = ConsurfDB.merge([cp1, cp2, cp3]) # noqa

Dump of attributes and methods:

  • Consurf.REQUEST_VERIFY_SETTING
  • Consurf.ResidueDataType
  • Consurf.add_bfactor_to_pose
  • Consurf.add_bfactor_to_pymol
  • Consurf.add_bfactor_via_pymol
  • Consurf.align
  • Consurf.apply_offset_by_alignment
  • Consurf.apply_offset_from_swissmodel
  • Consurf.assert_reply
  • Consurf.fetch
  • Consurf.from_filename
  • Consurf.from_web
  • Consurf.get_color
  • Consurf.get_conscore
  • Consurf.get_consurf_chain
  • Consurf.get_key
  • Consurf.get_offset_by_alignment
  • Consurf.get_offset_from_swissmodel
  • Consurf.get_offset_vector_by_alignment
  • Consurf.get_residue_chain
  • Consurf.get_residue_index
  • Consurf.get_residue_name
  • Consurf.get_variety
  • Consurf.keys
  • Consurf.log
  • Consurf.merge
  • Consurf.offset_atom
  • Consurf.offset_seqpos
  • Consurf.parse
  • Consurf.read
  • Consurf.remap_chains
  • Consurf.sequence
  • Consurf.to_pandas

Metadata

Release files for ConsurfDB-client-API 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ConsurfDB-client-API 1.0
File Size Uploaded
ConsurfDB-client-API-1.0.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ConsurfDB-client-API 1.0
File Interpreter ABI Platform
ConsurfDB_client_API-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.0 kB

Release files / ConsurfDB-client-API-1.0.tar.gz

Download URL ConsurfDB-client-API-1.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c1caaf288ccea898977fa3bd3ed74e50f0a1be508b2bbb248dc12da9bbe63bc7
BLAKE2b-256 checksum
How to use checksums
df5900528eb991fd5b573c606228b264aa7f9502e87d3dbd55cc680f57723384
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.27.1 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.6

Release files / ConsurfDB_client_API-1.0-py3-none-any.whl

Download URL ConsurfDB_client_API-1.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de5f5b0003a8328355320cd8fa04a93472dae3680116b05717c59a323f37bc00
BLAKE2b-256 checksum
How to use checksums
95d82460deede201b90872bd29d644b0e85ea1aeeacaf762529355246cb4f87e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.27.1 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.6

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page