Python bindings around the TM-align code for structural alignment of proteins
Project description
TM-Tools
Python bindings for the TM-align algorithm and code developed by Zhang et al for protein structure comparison.
Installation
From the console, simply run
pip install git+https://github.com/jvkersch/tmtools.git#egg=tmtools
The package supports Python 3.6 and up. You will need a fairly recent version of pip, as well as a C++ compiler that supports C++ 14.
This package supports Linux, macOS, and Windows.
Usage
The function tmtools.tm_align
takes two NumPy arrays with coordinates for the
residues (with shape (N, 3)
) and two sequences of peptide codes, performs the
alignment, and returns the optimal rotation matrix and translation, along with
the TM score:
>>> import numpy as np
>>> from tmtools import tm_align
>>>
>>> coords1 = np.array(
... [[1.2, 3.4, 1.5],
... [4.0, 2.8, 3.7],
... [1.2, 4.2, 4.3],
... [0.0, 1.0, 2.0]])
>>> coords2 = np.array(
... [[2.3, 7.4, 1.5],
... [4.0, 2.9, -1.7],
... [1.2, 4.2, 4.3]])
>>>
>>> seq1 = "AYLP"
>>> seq2 = "ARN"
>>>
>>> res = tm_align(coords1, coords2, seq1, seq2)
>>> res.t
array([ 2.94676159, 5.55265245, -1.75151383])
>>> res.u
array([[ 0.40393231, 0.04161396, -0.91384187],
[-0.59535733, 0.77040999, -0.22807475],
[ 0.69454181, 0.63618922, 0.33596866]])
>>> res.tm_norm_chain1
0.3105833326322145
>>> res.tm_norm_chain2
0.414111110176286
If you already have some PDB files, you can use the functions from tmalign.io
to retrieve the coordinate and sequence data:
>>> from tmtools.io import get_structure, get_residue_data
>>> from tmtools.testing import get_pdb_path
>>> s = get_structure(get_pdb_path("2gtl"))
>>> s
<Structure id=2gtl>
>>> chain = next(s.get_chains())
>>> coords, seq = get_residue_data(chain)
>>> seq
'DCCSYEDRREIRHIWDDVWSSSFTDRRVAIVRAVFDDLFKHYPTSKALFERVKIDEPESGEFKSHLVRVANGLKLLINLLDDTLVLQSHLGHLADQHIQRKGVTKEYFRGIGEAFARVLPQVLSCFNVDAWNRCFHRLVARIAKDLP'
>>> coords.shape
(147, 3)
These functions are light-weight wrappers around BioPython.
Credits
This package arose out of a personal desire to better understand both the TM-score algorithm and the pybind11 library to interface with C++ code. At this point in time it contains no original research code.
If you use the package for research, you should cite the original TM-score papers:
- Y. Zhang, J. Skolnick, Scoring function for automated assessment of protein structure template quality, Proteins, 57: 702-710 (2004).
- J. Xu, Y. Zhang, How significant is a protein structure similarity with TM-score=0.5? Bioinformatics, 26, 889-895 (2010).
License
The original TM-align software (version 20210224, released under the MIT
license) is bundled with this repository (src/extern/TMalign.cpp
). Some small
tweaks had to be made to compile the code on macOS and to embed it as a
library. This modifications are also released under the MIT license.
The rest of the codebase is released under the GPL v3 license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for tmtools-0.0.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b61150e03d472feb4f6ed6c30532d454db48468edb09b86787b56180043ec11b |
|
MD5 | bbbb4e8ce63a00f61a37235e62b414b5 |
|
BLAKE2b-256 | 8b27c40cb2e963ac5e611a89014e20018d6e1b2b754275015112eabbba4d4026 |
Hashes for tmtools-0.0.2-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd2160a60e93ab1de8c40ca0608cf92b02624bbdceeb29e87b631a46dad31fd9 |
|
MD5 | 178a9a5ab9853d784738ae7efcaace09 |
|
BLAKE2b-256 | 8c9b7cd734beeba95075744e566d7f2ef0ccbb15cf8325fba9a84afb38a423b9 |
Hashes for tmtools-0.0.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 713d975b67d37cd5deff1c4d9f0bbd5a1884ca7b0d60f98e1b74e8252071af3a |
|
MD5 | ab2573c44e18eb69038c238f6ab7ab7f |
|
BLAKE2b-256 | 6c415e6458bfde1318723d9106d17e6dda7c135b59ea7ff8cf7fa4a5c4a598e1 |
Hashes for tmtools-0.0.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81fdbeb86a856dd5c644a1db261b30e2a413b08c52d593393d1ddf38ca7b1d18 |
|
MD5 | c36369ad7a68e0e9a2994ae68b509980 |
|
BLAKE2b-256 | c89e7b7a22e19fe30daedb632605739f76f6cf2fd8ade768aa94b764635c0af9 |
Hashes for tmtools-0.0.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e313d9971addbb62d77bac0b0fa3c75433cf8f7b998e70510f06dae28c08e56 |
|
MD5 | bb737c2bff57936548d5a6bb647e0cd5 |
|
BLAKE2b-256 | 90336b0a3d4befe126530ad659935c0560eccb02f00dace8fadd47e0967f9fe7 |
Hashes for tmtools-0.0.2-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b95119e434c85484c75d77dabddb557f8a6f7b5c02e4b2da97f9634ea87326d |
|
MD5 | cdce521c8c9b49c51318f762b0ae5f15 |
|
BLAKE2b-256 | 4e4ef25b0a3a19ef3b795ee8edfd2337b387fcd07b531b522ad75e7e92b703b1 |
Hashes for tmtools-0.0.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d689bc90a3ad2c0e7b2902401ba0f91775457b8767294590920b2b1e8166e4e |
|
MD5 | 67d7c9ad6ff67434d4ec50b5f14d19ca |
|
BLAKE2b-256 | cb6b7b43dcceac4f628f9982d60f9768679d4de5f8ef7ecb5bcc9dfdd0b9059c |
Hashes for tmtools-0.0.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 015e3a0cf63915d93b2f1ab7a785da712b8f3ff2a17d49798a3bf93e64d6cd0d |
|
MD5 | 572af17e6df6dbd01db52e26df834a02 |
|
BLAKE2b-256 | de0dc06e8e6b3d278366563b726665fb6b6866d0d2c1814d42b438148c899bb0 |
Hashes for tmtools-0.0.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f797edb854e3c1366124c89942df82452c5a73c988fbc516a563fbfd1bd696e7 |
|
MD5 | 1828d23918b37fab19b804db8027b6f7 |
|
BLAKE2b-256 | bfce4ee21d4514a705cb29731d0baea1c73392ffe5176c465b0ae06176f06a68 |
Hashes for tmtools-0.0.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ae51bebaf155749abfa992d031124d8c835b4eef143d1c706676038a02fed9e |
|
MD5 | f2166ddea37665fce298f2cf5f530927 |
|
BLAKE2b-256 | e85c2cbfa9f8dcba7fcf5bb4d58cd37fde43b6b008139f51e02dcc42074c9a31 |
Hashes for tmtools-0.0.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b7ba3ac284e0d0079be291ee5b3ca72c09b689135b9c7282b135e5850d59d76 |
|
MD5 | 0485c1bbf40dd14cbbd726522e9997df |
|
BLAKE2b-256 | fcfd3457baf9a960447805f731c6474a350f0962c57358eb67e681afc43d6405 |
Hashes for tmtools-0.0.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc4b371a681b0083918949a648f97871e9cc658deda4dda5040dc5ade9acf0ed |
|
MD5 | 197a8e4ee564ca904e369ac3a23d05a7 |
|
BLAKE2b-256 | 83d7a25afd5c760882f22c830fbe370d2cadb2a78613a21edccb351f309f5308 |
Hashes for tmtools-0.0.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 053a5b744278bc0ad14cefd6b88f30f50b6e5b6c933239b61d2ac38691322291 |
|
MD5 | e114166eccb6861d295e3876639c2312 |
|
BLAKE2b-256 | 7e4f54ef0487636f348bad51d3f1fc56a44df283c47710da1d3139b35fa614f8 |
Hashes for tmtools-0.0.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 801d801a3860f416d71ee17da8c856798c255de9c9710a585a6bb51458ee5980 |
|
MD5 | 128b239e860c610768ebfc420d58a80d |
|
BLAKE2b-256 | fc850df54f094e19aac335db9c2f6891f3077fba1acab501eee8e7c9925f6288 |
Hashes for tmtools-0.0.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7430964b28d718b2d72d31b14fdfa800b23183be05a920fc96604a5bad75842 |
|
MD5 | 1ccefc11fcd6a4f31e6a0264eb1f8936 |
|
BLAKE2b-256 | 63a3505dcf3cf51fb62c37318174e5cc8129f57c9f0ef51e5bf4a9dd0cf53c94 |
Hashes for tmtools-0.0.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8de97f4b444f4e23be2810f0e46453fd8a39bc3a34606c97400b55f4fa5db71a |
|
MD5 | 3874eb59ce2db12719d7bb10358e91d6 |
|
BLAKE2b-256 | 69328fe0e8ce2ca41e07a63de45d3cde0863dc5c6452df4b6241466fd1f45458 |
Hashes for tmtools-0.0.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d4dd54bc04d6faf725df4dcb6acb9def5a56c0e781b7f8799154131f4b3815c |
|
MD5 | 74db25d638c23a7dbe72afcef7a9bb3c |
|
BLAKE2b-256 | 50aa2a9ba90551e1bcd53e80bd56f01a12b53affd4f2e69851a94729695e2c40 |
Hashes for tmtools-0.0.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b615babdeb6b96495c5e42e34bf2bacdc34aba45d56f1b8a740c84843d5755f3 |
|
MD5 | f0eab9b9377bdbb503d4c4d6c0f8b3c3 |
|
BLAKE2b-256 | 8eb7eb765674ec64f17633dd7e15c4a15bd9f87877eb1f444c4d95012d3350f2 |
Hashes for tmtools-0.0.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e420900c6786b4e76cef9861f3e62fc5bc1966f610d4b9f9fe0ff7d1e8bce5cb |
|
MD5 | bf8b002825b5518ad17666f9ffbea00b |
|
BLAKE2b-256 | 393f7745c319c3bdb000273a52a79397fdf8fa99a297a533fb9d9e50dbf32165 |
Hashes for tmtools-0.0.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bff3aaeb51d7e7b3618c87df2b84db9dce39e4cbaa359ef6ec00ecc0eadf34c2 |
|
MD5 | a71d7586321a5ebc3529a432a8aa5aa2 |
|
BLAKE2b-256 | 24130724f1f27a6a2c8b0b6129eb9cb6df2c3151d07ffe1f519696dfff2d6411 |
Hashes for tmtools-0.0.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b05648946aceb667f64ded01ac0b604712fd238969eceb8aa353373ce36635f1 |
|
MD5 | c4de5fe61b52422402d0e7ad4e993d01 |
|
BLAKE2b-256 | 0a4b894cb10fc539daf7916e4001d4aa5b8c6612db06e9a913e509915b7bc646 |
Hashes for tmtools-0.0.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a236f485447248f31a7869ae322936cf0477bb96063c899ce30b0f822845641c |
|
MD5 | b926b7bb63d778f6729ca0d1d06756a1 |
|
BLAKE2b-256 | a2ac0c26a6b6af9acf8c2e43564f970b54b2d3a075185fb4574b8ec7a6b507de |
Hashes for tmtools-0.0.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb255a8f32f6dea5376838d606418d5562579836b3443d1827039f1d6d137eaf |
|
MD5 | 155425e47461fd3afe921ec80149f249 |
|
BLAKE2b-256 | 591e9dfe97291ee288b72d39952129e6091738b2a7a4e0d1599102571eaeb1ae |
Hashes for tmtools-0.0.2-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07b9e16fe21107c3c17bef302f7b2894ac5f28e0103f4da5dba0bd0d796f1851 |
|
MD5 | 169811d872f101cc7c9e058f71e329c4 |
|
BLAKE2b-256 | 9385b6b1b5df0d5362dc7c20bbae9e9837ea15cab67bed7d5135909c05917cc3 |
Hashes for tmtools-0.0.2-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d7aa8ba54a45a7f97416ce037c9fb16e91f1d22579a8ac0939990c5e30a156b |
|
MD5 | b785a7e43497cda79dba0a14528eac60 |
|
BLAKE2b-256 | f707e2b8637f96125bd5c1e25a20d0e1bb8af12b67bd407b20d178f13c97cd25 |
Hashes for tmtools-0.0.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32877b135269be5769a1ac68f1a20997251c0134acf1bf43b0ae70493b99960d |
|
MD5 | bcb34a1049430ed7e53feb116cde161b |
|
BLAKE2b-256 | 2d4b65ecfd40dc7ae532792c6952af9b967a5255f838cf440d68fbe2ffa9c734 |