Skip to main content

Contact Extractor from PDB/mmCIF coordinate files

Project description

Contact Extractor (ContExt), ver. 1.0 (May 2025).

Installation:

pip instal ContactExtractor

Usage:

ContExt input=pathto/coordfile [OPTIONS]

As a Python function:

see https://github.com/febos/ContExt/blob/main/demo.ipynb

Description:

ContExt outputs pairs of atoms that lie closer to each other than a specified threshold in angstroms ("range" parameter). By default, ContExt searches for atom-atom pairs at a distance < 10 angstroms in a structure file specified in the "input" parameter. If another structure file is specified under the "input2" parameter, ContExt will output only the close atom pairs found between the two structures. Subsets of atoms of interest can be defined with "atoms" and "atoms2" parameters.

Requirements:

SciPy

Output:

The found atom-atom pairs are printed into stdout in the following format:

RANGE ATOM1-DESCRIPTION ATOM2-DESCRIPTION

The atom descriptions are in the following format:

#MODEL/CHAIN:RESIDUE_RESIDUENUMBER.INSERTIONCODE@ATOM_ATOMNUMBER.ALTLOC

Example output:

5.40291412 #1/A:A_12.@C1'_120. #1/A:G_13.@P_134.

6.24810643 #1/B:C_12.A@C1'_583. #2/B:G_130.@O4'_14401.B

Options:

input= - input structure in pdb/mmcif format [REQUIRED]

Path to a coordinate file in PDB or mmCIF format.

input=example.pdb - search atom pairs in example.pdb 

input2= - input structure in pdb/mmcif format [DEFAULT: input2=input]

Path to the second coordinate file in PDB or mmCIF format.

input=example.pdb input2=example2.pdb - search 
atom pairs between example.pdb and example2.pdb 

-help - type -help / --help / -h / -H to see this message [DEFAULT: FALSE]

See the help message, ignore all other options.

range= - threshold in angstroms [DEFAULT: range=10.0]

Atom distance threshold in angstroms.

atoms= - input atoms of interest [DEFAULT: atoms=#]

Specify particular subset of atoms to be used as ATOM1.
See the format description below.

atoms2= - input 2 atoms of interest [DEFAULT: atoms2=atoms]

Specify particular subset of atoms to be used as ATOM2.
See the format description below.

ATOMS SPECIFICATION FORMAT:

[#[INT][_INT]][/[STRING]][:[STRING][_INT[_INT]]][@[STRING][_INT[_INT]]]

ATOMS SPECIFICATION EXAMPLES:

atoms=#1/B:C_-1_10@O2 - O2 atoms of the residues with id from -1 to 10 of chain B from model 1

atoms=# - equivalent to an empty condition

atoms=/ - equivalent to an empty condition

atoms=: - equivalent to an empty condition

atoms=@ - equivalent to an empty condition

atoms="@C1' @C2'" - C1’ and C2' atoms

atoms="/B /C" - chain B and chain C

atoms=#1:A - adenines in model 1

atoms=A - not a keyword, i.e. error

atoms=":C@O4'" - O4' atoms of cytidines

atoms=#2_3@_1_1000 - atoms with id from 1 to 1000 from model 2 or model 3

Usage examples:

ContExt input=examples/1ffk_0_kt7.cif range=2.0 atoms="@O3'" atoms2=@P

Find O3'-P pairs at a distance under 2.0 angstroms in the
examples/1ffk_0_kt7.cif coordinate file. The output
includes pairs of consecutive nucleotides.

ContExt input=examples/1ffk_0_kt7.cif input2=examples/3d2g_A_kj.cif range=5 atoms=@P

Find P-P pairs at a distance under 5.0 angstroms
betweeen the two input coordinate files.

ContExt input=examples/2fmt.pdb atoms=:A atoms2=:ARG

Find atom-atom pairs within 10 angstroms (default range)
between adenines and arginines in the input file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contactextractor-1.0.0.tar.gz (209.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contactextractor-1.0.0-py3-none-any.whl (211.3 kB view details)

Uploaded Python 3

File details

Details for the file contactextractor-1.0.0.tar.gz.

File metadata

  • Download URL: contactextractor-1.0.0.tar.gz
  • Upload date:
  • Size: 209.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for contactextractor-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c7b49a2685e763e9728bb2c59680ba5f75fa2cdc50a2fa20509d7455c02be142
MD5 8b6d772a71e3e880b022f12826f58f95
BLAKE2b-256 4a44ed5901aad82264c0f29795c867c46c455eb061256b412e0239ee29d4bef7

See more details on using hashes here.

File details

Details for the file contactextractor-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for contactextractor-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d042e1f2cb5016e069550cd91683dccf0252e54ce48d9b6e5c77ae8cc82eca35
MD5 8a20ff7073a418829c5a794adeb62252
BLAKE2b-256 665c490d58b6d533680567a04ba2e7571738ef5cc5714f74a582e4a2808e64b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page