Repository files navigation

PARD (Physicochemical Amino acid Replacement Distances)

DOICoverageDownloads

Overview

Amino acid replacements (also referred to as substitutions) are changes from one amino acid to a different one in a protein - and there are different ways to assess the difference between the two amino acids that come into play in an amino acid replacement.

One can look at one or several properties' discrepancy between two amino acids. To list only a few: polarity [1][3][4][8], molecular volume / relative sizes of amino-acid side chains [1][3][4], mean number of lone pair electrons on the side-chain [2], maximum moment of inertia for rotation at the α―β bond [2] or at the β―γ bond [2] or at the γ―δ bond [2], presence of a pyrrolidine ring (proline (P)) [2], experimental protein activity and stability after exchanging one amino acid into another [5], Chou-Fasman alpha helical [8], beta strand [8] and/or reverse turn propensity parameters [8], etc.

pard is a package designed to make those Physicochemical Amino acid Replacement Distances calculations straightforward with Python.

One typical use is to establish a 'distance' between a wild-type protein and its mutated version. Sometimes, rather than a distance, a similarity is outputted (e.g. with the Conformational similarity weight matrix[7] or EMPAR[8]). The higher the distance, the more different the two amino acids are. The higher the similarity, the more similar the two amino acids are. Whenever a distance is not outputted but rather a similarity, a warning (that the user can turn off) will be raised.

Getting started

Install from PyPI (recommended)

To use pard, run pip install pard in your terminal.

Usage

## Importsfrompard.granthamimportgranthamfrompard.sneathimportsneathfrompard.experimental_exchangeabilityimportexperimental_exchangeabilityfrompard.koshi_goldsteinimportkoshi_goldstein, MatrixType## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=experimental_exchangeability(
amino_acid_1, amino_acid_2, False, warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=koshi_goldstein(
"-",
"A",
MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

or equivalently

## Importsimportpard## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=pard.grantham.grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=pard.sneath.sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=pard.experimental_exchangeability.experimental_exchangeability(
amino_acid_1,
amino_acid_2,
False,
warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=pard.koshi_goldstein.koshi_goldstein(
"-",
"A",
pard.koshi_goldstein.MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

will output:

>>> 61
>>> 30
>>> 177
>>> 1.6

which are the correct values [1][2][5][6] .

Exit codes:

- 1: Argument amino_acid_1 or amino_acid_2 is neither of length 1 nor length 3. See error message.

About the source code

  • Follows PEP8 Style Guidelines.
  • All functions are unit-tested with pytest.
  • All variables are correctly type-hinted, reviewed with static type checkermypy.
  • All functions are documented with docstrings.

Unit tests details

Coverage

Name Stmts Miss Cover
----------------------------------------------------------------
pard\__init__.py 3 0 100%
pard\_handling_3_letter_code_decorator.py 18 2 89%
pard\_raw_python_dictionaries.py 71 0 100%
pard\empar.py 8 0 100%
pard\epstein.py 7 0 100%
pard\experimental_exchangeability.py 10 0 100%
pard\grantham.py 5 0 100%
pard\kolaskar.py 8 0 100%
pard\koshi_goldstein.py 55 2 96%
pard\miyata.py 5 0 100%
pard\sneath.py 5 0 100%
tests\__init__.py 0 0 100%
tests\test_empar.py 26 0 100%
tests\test_epstein.py 46 0 100%
tests\test_experimental_exchangeability.py 30 0 100%
tests\test_grantham.py 25 0 100%
tests\test_kolaskar.py 26 0 100%
tests\test_koshi_goldstein.py 108 0 100%
tests\test_miyata.py 25 0 100%
tests\test_pard.py 3 0 100%
tests\test_raw_python_dictionaries.py 24 0 100%
tests\test_sneath.py 21 0 100%
unit_tests_simple.py 5 0 100%
----------------------------------------------------------------
TOTAL 534 4 99%

pytest

platform win32 -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0
plugins: anyio-3.6.2, mypy-0.10.3
collected 16 items
tests\test_empar.py . [ 6%] tests\test_epstein.py . [ 12%] tests\test_experimental_exchangeability.py . [ 18%] tests\test_grantham.py . [ 25%]
tests\test_kolaskar.py . [ 31%] tests\test_koshi_goldstein.py ....... [ 75%]
tests\test_miyata.py . [ 81%] tests\test_pard.py . [ 87%] tests\test_raw_python_dictionaries.py . [ 93%] tests\test_sneath.py . [100%] ====================== 16 passed in 0.11s ====================== 

mypy detail

================================== mypy ==================================
Success: no issues found in 24 source files

Useful links:

Citation

If you use this software, please cite it as below.

  • APA:

Lhotte, R. & Taupin, J. (2022). Physicochemical Amino acid Replacement Distances (PARD) package (Version 0.7.0.1) [Computer software]. https://doi.org/10.5281/zenodo.7013169

  • BibTeX:
@software{lhotte_pard_2022,
author = {Lhotte, Romain and Taupin, Jean-Luc},
doi = {10.5281/zenodo.7013169},
month = {8},
title = {{Physicochemical Amino acid Replacement Distances (PARD) package}},
version = {0.7.0.1},
year = {2022}
}

References

  • [1] Grantham, R., 1974. Amino acid difference formula to help explain protein evolution. science, 185(4154), pp.862-864.
  • [2] Sneath, P.H.A., 1966. Relations between chemical structure and biological activity in peptides. Journal of theoretical biology, 12(2), pp.157-195.
  • [3] Epstein, C.J., 1967. Non-randomness of ammo-acid changes in the evolution of homologous proteins. Nature, 215(5099), pp.355-359.
  • [4] Miyata, T., Miyazawa, S. and Yasunaga, T., 1979. Two types of amino acid substitutions in protein evolution. Journal of molecular evolution, 12(3), pp.219-236.
  • [5] Yampolsky, L.Y. and Stoltzfus, A., 2005. The exchangeability of amino acids in proteins. Genetics, 170(4), pp.1459-1472.
  • [6] Koshi, J.M. and Goldstein, R.A., 1995. Context-dependent optimal substitution matrices. Protein Engineering, Design and Selection, 8(7), pp.641-645.
  • [7] Kolaskar, A.S. and Kulkarni-Kale, U., 1992. Sequence alignment approach to pick up conformationally similar protein fragments. Journal of molecular biology, 223(4), pp.1053-1061.
  • [8] Rao, J.M., 1987. New scoring matrix for amino acid residue exchanges based on residue characteristic physical parameters. International Journal of Peptide and Protein Research, 29(2), pp.276-281.

About

Physicochemical Amino acid Replacement Distances (PARD)

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

PARD (Physicochemical Amino acid Replacement Distances)

DOICoverageDownloads

Overview

Amino acid replacements (also referred to as substitutions) are changes from one amino acid to a different one in a protein - and there are different ways to assess the difference between the two amino acids that come into play in an amino acid replacement.

One can look at one or several properties' discrepancy between two amino acids. To list only a few: polarity [1][3][4][8], molecular volume / relative sizes of amino-acid side chains [1][3][4], mean number of lone pair electrons on the side-chain [2], maximum moment of inertia for rotation at the α―β bond [2] or at the β―γ bond [2] or at the γ―δ bond [2], presence of a pyrrolidine ring (proline (P)) [2], experimental protein activity and stability after exchanging one amino acid into another [5], Chou-Fasman alpha helical [8], beta strand [8] and/or reverse turn propensity parameters [8], etc.

pard is a package designed to make those Physicochemical Amino acid Replacement Distances calculations straightforward with Python.

One typical use is to establish a 'distance' between a wild-type protein and its mutated version. Sometimes, rather than a distance, a similarity is outputted (e.g. with the Conformational similarity weight matrix[7] or EMPAR[8]). The higher the distance, the more different the two amino acids are. The higher the similarity, the more similar the two amino acids are. Whenever a distance is not outputted but rather a similarity, a warning (that the user can turn off) will be raised.

Getting started

Install from PyPI (recommended)

To use pard, run pip install pard in your terminal.

Usage

## Importsfrompard.granthamimportgranthamfrompard.sneathimportsneathfrompard.experimental_exchangeabilityimportexperimental_exchangeabilityfrompard.koshi_goldsteinimportkoshi_goldstein, MatrixType## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=experimental_exchangeability(
amino_acid_1, amino_acid_2, False, warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=koshi_goldstein(
"-",
"A",
MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

or equivalently

## Importsimportpard## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=pard.grantham.grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=pard.sneath.sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=pard.experimental_exchangeability.experimental_exchangeability(
amino_acid_1,
amino_acid_2,
False,
warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=pard.koshi_goldstein.koshi_goldstein(
"-",
"A",
pard.koshi_goldstein.MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

will output:

>>> 61
>>> 30
>>> 177
>>> 1.6

which are the correct values [1][2][5][6] .

Exit codes:

- 1: Argument amino_acid_1 or amino_acid_2 is neither of length 1 nor length 3. See error message.

About the source code

  • Follows PEP8 Style Guidelines.
  • All functions are unit-tested with pytest.
  • All variables are correctly type-hinted, reviewed with static type checkermypy.
  • All functions are documented with docstrings.

Unit tests details

Coverage

Name Stmts Miss Cover
----------------------------------------------------------------
pard\__init__.py 3 0 100%
pard\_handling_3_letter_code_decorator.py 18 2 89%
pard\_raw_python_dictionaries.py 71 0 100%
pard\empar.py 8 0 100%
pard\epstein.py 7 0 100%
pard\experimental_exchangeability.py 10 0 100%
pard\grantham.py 5 0 100%
pard\kolaskar.py 8 0 100%
pard\koshi_goldstein.py 55 2 96%
pard\miyata.py 5 0 100%
pard\sneath.py 5 0 100%
tests\__init__.py 0 0 100%
tests\test_empar.py 26 0 100%
tests\test_epstein.py 46 0 100%
tests\test_experimental_exchangeability.py 30 0 100%
tests\test_grantham.py 25 0 100%
tests\test_kolaskar.py 26 0 100%
tests\test_koshi_goldstein.py 108 0 100%
tests\test_miyata.py 25 0 100%
tests\test_pard.py 3 0 100%
tests\test_raw_python_dictionaries.py 24 0 100%
tests\test_sneath.py 21 0 100%
unit_tests_simple.py 5 0 100%
----------------------------------------------------------------
TOTAL 534 4 99%

pytest

platform win32 -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0
plugins: anyio-3.6.2, mypy-0.10.3
collected 16 items
tests\test_empar.py . [ 6%] tests\test_epstein.py . [ 12%] tests\test_experimental_exchangeability.py . [ 18%] tests\test_grantham.py . [ 25%]
tests\test_kolaskar.py . [ 31%] tests\test_koshi_goldstein.py ....... [ 75%]
tests\test_miyata.py . [ 81%] tests\test_pard.py . [ 87%] tests\test_raw_python_dictionaries.py . [ 93%] tests\test_sneath.py . [100%] ====================== 16 passed in 0.11s ====================== 

mypy detail

================================== mypy ==================================
Success: no issues found in 24 source files

Useful links:

Citation

If you use this software, please cite it as below.

  • APA:

Lhotte, R. & Taupin, J. (2022). Physicochemical Amino acid Replacement Distances (PARD) package (Version 0.7.0.1) [Computer software]. https://doi.org/10.5281/zenodo.7013169

  • BibTeX:
@software{lhotte_pard_2022,
author = {Lhotte, Romain and Taupin, Jean-Luc},
doi = {10.5281/zenodo.7013169},
month = {8},
title = {{Physicochemical Amino acid Replacement Distances (PARD) package}},
version = {0.7.0.1},
year = {2022}
}

References

  • [1] Grantham, R., 1974. Amino acid difference formula to help explain protein evolution. science, 185(4154), pp.862-864.
  • [2] Sneath, P.H.A., 1966. Relations between chemical structure and biological activity in peptides. Journal of theoretical biology, 12(2), pp.157-195.
  • [3] Epstein, C.J., 1967. Non-randomness of ammo-acid changes in the evolution of homologous proteins. Nature, 215(5099), pp.355-359.
  • [4] Miyata, T., Miyazawa, S. and Yasunaga, T., 1979. Two types of amino acid substitutions in protein evolution. Journal of molecular evolution, 12(3), pp.219-236.
  • [5] Yampolsky, L.Y. and Stoltzfus, A., 2005. The exchangeability of amino acids in proteins. Genetics, 170(4), pp.1459-1472.
  • [6] Koshi, J.M. and Goldstein, R.A., 1995. Context-dependent optimal substitution matrices. Protein Engineering, Design and Selection, 8(7), pp.641-645.
  • [7] Kolaskar, A.S. and Kulkarni-Kale, U., 1992. Sequence alignment approach to pick up conformationally similar protein fragments. Journal of molecular biology, 223(4), pp.1053-1061.
  • [8] Rao, J.M., 1987. New scoring matrix for amino acid residue exchanges based on residue characteristic physical parameters. International Journal of Peptide and Protein Research, 29(2), pp.276-281.

About

Physicochemical Amino acid Replacement Distances (PARD)

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

PARD (Physicochemical Amino acid Replacement Distances)

DOICoverageDownloads

Overview

Amino acid replacements (also referred to as substitutions) are changes from one amino acid to a different one in a protein - and there are different ways to assess the difference between the two amino acids that come into play in an amino acid replacement.

One can look at one or several properties' discrepancy between two amino acids. To list only a few: polarity [1][3][4][8], molecular volume / relative sizes of amino-acid side chains [1][3][4], mean number of lone pair electrons on the side-chain [2], maximum moment of inertia for rotation at the α―β bond [2] or at the β―γ bond [2] or at the γ―δ bond [2], presence of a pyrrolidine ring (proline (P)) [2], experimental protein activity and stability after exchanging one amino acid into another [5], Chou-Fasman alpha helical [8], beta strand [8] and/or reverse turn propensity parameters [8], etc.

pard is a package designed to make those Physicochemical Amino acid Replacement Distances calculations straightforward with Python.

One typical use is to establish a 'distance' between a wild-type protein and its mutated version. Sometimes, rather than a distance, a similarity is outputted (e.g. with the Conformational similarity weight matrix[7] or EMPAR[8]). The higher the distance, the more different the two amino acids are. The higher the similarity, the more similar the two amino acids are. Whenever a distance is not outputted but rather a similarity, a warning (that the user can turn off) will be raised.

Getting started

Install from PyPI (recommended)

To use pard, run pip install pard in your terminal.

Usage

## Importsfrompard.granthamimportgranthamfrompard.sneathimportsneathfrompard.experimental_exchangeabilityimportexperimental_exchangeabilityfrompard.koshi_goldsteinimportkoshi_goldstein, MatrixType## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=experimental_exchangeability(
amino_acid_1, amino_acid_2, False, warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=koshi_goldstein(
"-",
"A",
MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

or equivalently

## Importsimportpard## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=pard.grantham.grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=pard.sneath.sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=pard.experimental_exchangeability.experimental_exchangeability(
amino_acid_1,
amino_acid_2,
False,
warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=pard.koshi_goldstein.koshi_goldstein(
"-",
"A",
pard.koshi_goldstein.MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

will output:

>>> 61
>>> 30
>>> 177
>>> 1.6

which are the correct values [1][2][5][6] .

Exit codes:

- 1: Argument amino_acid_1 or amino_acid_2 is neither of length 1 nor length 3. See error message.

About the source code

  • Follows PEP8 Style Guidelines.
  • All functions are unit-tested with pytest.
  • All variables are correctly type-hinted, reviewed with static type checkermypy.
  • All functions are documented with docstrings.

Unit tests details

Coverage

Name Stmts Miss Cover
----------------------------------------------------------------
pard\__init__.py 3 0 100%
pard\_handling_3_letter_code_decorator.py 18 2 89%
pard\_raw_python_dictionaries.py 71 0 100%
pard\empar.py 8 0 100%
pard\epstein.py 7 0 100%
pard\experimental_exchangeability.py 10 0 100%
pard\grantham.py 5 0 100%
pard\kolaskar.py 8 0 100%
pard\koshi_goldstein.py 55 2 96%
pard\miyata.py 5 0 100%
pard\sneath.py 5 0 100%
tests\__init__.py 0 0 100%
tests\test_empar.py 26 0 100%
tests\test_epstein.py 46 0 100%
tests\test_experimental_exchangeability.py 30 0 100%
tests\test_grantham.py 25 0 100%
tests\test_kolaskar.py 26 0 100%
tests\test_koshi_goldstein.py 108 0 100%
tests\test_miyata.py 25 0 100%
tests\test_pard.py 3 0 100%
tests\test_raw_python_dictionaries.py 24 0 100%
tests\test_sneath.py 21 0 100%
unit_tests_simple.py 5 0 100%
----------------------------------------------------------------
TOTAL 534 4 99%

pytest

platform win32 -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0
plugins: anyio-3.6.2, mypy-0.10.3
collected 16 items
tests\test_empar.py . [ 6%] tests\test_epstein.py . [ 12%] tests\test_experimental_exchangeability.py . [ 18%] tests\test_grantham.py . [ 25%]
tests\test_kolaskar.py . [ 31%] tests\test_koshi_goldstein.py ....... [ 75%]
tests\test_miyata.py . [ 81%] tests\test_pard.py . [ 87%] tests\test_raw_python_dictionaries.py . [ 93%] tests\test_sneath.py . [100%] ====================== 16 passed in 0.11s ====================== 

mypy detail

================================== mypy ==================================
Success: no issues found in 24 source files

Useful links:

Citation

If you use this software, please cite it as below.

  • APA:

Lhotte, R. & Taupin, J. (2022). Physicochemical Amino acid Replacement Distances (PARD) package (Version 0.7.0.1) [Computer software]. https://doi.org/10.5281/zenodo.7013169

  • BibTeX:
@software{lhotte_pard_2022,
author = {Lhotte, Romain and Taupin, Jean-Luc},
doi = {10.5281/zenodo.7013169},
month = {8},
title = {{Physicochemical Amino acid Replacement Distances (PARD) package}},
version = {0.7.0.1},
year = {2022}
}

References

  • [1] Grantham, R., 1974. Amino acid difference formula to help explain protein evolution. science, 185(4154), pp.862-864.
  • [2] Sneath, P.H.A., 1966. Relations between chemical structure and biological activity in peptides. Journal of theoretical biology, 12(2), pp.157-195.
  • [3] Epstein, C.J., 1967. Non-randomness of ammo-acid changes in the evolution of homologous proteins. Nature, 215(5099), pp.355-359.
  • [4] Miyata, T., Miyazawa, S. and Yasunaga, T., 1979. Two types of amino acid substitutions in protein evolution. Journal of molecular evolution, 12(3), pp.219-236.
  • [5] Yampolsky, L.Y. and Stoltzfus, A., 2005. The exchangeability of amino acids in proteins. Genetics, 170(4), pp.1459-1472.
  • [6] Koshi, J.M. and Goldstein, R.A., 1995. Context-dependent optimal substitution matrices. Protein Engineering, Design and Selection, 8(7), pp.641-645.
  • [7] Kolaskar, A.S. and Kulkarni-Kale, U., 1992. Sequence alignment approach to pick up conformationally similar protein fragments. Journal of molecular biology, 223(4), pp.1053-1061.
  • [8] Rao, J.M., 1987. New scoring matrix for amino acid residue exchanges based on residue characteristic physical parameters. International Journal of Peptide and Protein Research, 29(2), pp.276-281.

About

Physicochemical Amino acid Replacement Distances (PARD)

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

PARD (Physicochemical Amino acid Replacement Distances)

DOICoverageDownloads

Overview

Amino acid replacements (also referred to as substitutions) are changes from one amino acid to a different one in a protein - and there are different ways to assess the difference between the two amino acids that come into play in an amino acid replacement.

One can look at one or several properties' discrepancy between two amino acids. To list only a few: polarity [1][3][4][8], molecular volume / relative sizes of amino-acid side chains [1][3][4], mean number of lone pair electrons on the side-chain [2], maximum moment of inertia for rotation at the α―β bond [2] or at the β―γ bond [2] or at the γ―δ bond [2], presence of a pyrrolidine ring (proline (P)) [2], experimental protein activity and stability after exchanging one amino acid into another [5], Chou-Fasman alpha helical [8], beta strand [8] and/or reverse turn propensity parameters [8], etc.

pard is a package designed to make those Physicochemical Amino acid Replacement Distances calculations straightforward with Python.

One typical use is to establish a 'distance' between a wild-type protein and its mutated version. Sometimes, rather than a distance, a similarity is outputted (e.g. with the Conformational similarity weight matrix[7] or EMPAR[8]). The higher the distance, the more different the two amino acids are. The higher the similarity, the more similar the two amino acids are. Whenever a distance is not outputted but rather a similarity, a warning (that the user can turn off) will be raised.

Getting started

Install from PyPI (recommended)

To use pard, run pip install pard in your terminal.

Usage

## Importsfrompard.granthamimportgranthamfrompard.sneathimportsneathfrompard.experimental_exchangeabilityimportexperimental_exchangeabilityfrompard.koshi_goldsteinimportkoshi_goldstein, MatrixType## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=experimental_exchangeability(
amino_acid_1, amino_acid_2, False, warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=koshi_goldstein(
"-",
"A",
MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

or equivalently

## Importsimportpard## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=pard.grantham.grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=pard.sneath.sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=pard.experimental_exchangeability.experimental_exchangeability(
amino_acid_1,
amino_acid_2,
False,
warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=pard.koshi_goldstein.koshi_goldstein(
"-",
"A",
pard.koshi_goldstein.MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

will output:

>>> 61
>>> 30
>>> 177
>>> 1.6

which are the correct values [1][2][5][6] .

Exit codes:

- 1: Argument amino_acid_1 or amino_acid_2 is neither of length 1 nor length 3. See error message.

About the source code

  • Follows PEP8 Style Guidelines.
  • All functions are unit-tested with pytest.
  • All variables are correctly type-hinted, reviewed with static type checkermypy.
  • All functions are documented with docstrings.

Unit tests details

Coverage

Name Stmts Miss Cover
----------------------------------------------------------------
pard\__init__.py 3 0 100%
pard\_handling_3_letter_code_decorator.py 18 2 89%
pard\_raw_python_dictionaries.py 71 0 100%
pard\empar.py 8 0 100%
pard\epstein.py 7 0 100%
pard\experimental_exchangeability.py 10 0 100%
pard\grantham.py 5 0 100%
pard\kolaskar.py 8 0 100%
pard\koshi_goldstein.py 55 2 96%
pard\miyata.py 5 0 100%
pard\sneath.py 5 0 100%
tests\__init__.py 0 0 100%
tests\test_empar.py 26 0 100%
tests\test_epstein.py 46 0 100%
tests\test_experimental_exchangeability.py 30 0 100%
tests\test_grantham.py 25 0 100%
tests\test_kolaskar.py 26 0 100%
tests\test_koshi_goldstein.py 108 0 100%
tests\test_miyata.py 25 0 100%
tests\test_pard.py 3 0 100%
tests\test_raw_python_dictionaries.py 24 0 100%
tests\test_sneath.py 21 0 100%
unit_tests_simple.py 5 0 100%
----------------------------------------------------------------
TOTAL 534 4 99%

pytest

platform win32 -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0
plugins: anyio-3.6.2, mypy-0.10.3
collected 16 items
tests\test_empar.py . [ 6%] tests\test_epstein.py . [ 12%] tests\test_experimental_exchangeability.py . [ 18%] tests\test_grantham.py . [ 25%]
tests\test_kolaskar.py . [ 31%] tests\test_koshi_goldstein.py ....... [ 75%]
tests\test_miyata.py . [ 81%] tests\test_pard.py . [ 87%] tests\test_raw_python_dictionaries.py . [ 93%] tests\test_sneath.py . [100%] ====================== 16 passed in 0.11s ====================== 

mypy detail

================================== mypy ==================================
Success: no issues found in 24 source files

Useful links:

Citation

If you use this software, please cite it as below.

  • APA:

Lhotte, R. & Taupin, J. (2022). Physicochemical Amino acid Replacement Distances (PARD) package (Version 0.7.0.1) [Computer software]. https://doi.org/10.5281/zenodo.7013169

  • BibTeX:
@software{lhotte_pard_2022,
author = {Lhotte, Romain and Taupin, Jean-Luc},
doi = {10.5281/zenodo.7013169},
month = {8},
title = {{Physicochemical Amino acid Replacement Distances (PARD) package}},
version = {0.7.0.1},
year = {2022}
}

References

  • [1] Grantham, R., 1974. Amino acid difference formula to help explain protein evolution. science, 185(4154), pp.862-864.
  • [2] Sneath, P.H.A., 1966. Relations between chemical structure and biological activity in peptides. Journal of theoretical biology, 12(2), pp.157-195.
  • [3] Epstein, C.J., 1967. Non-randomness of ammo-acid changes in the evolution of homologous proteins. Nature, 215(5099), pp.355-359.
  • [4] Miyata, T., Miyazawa, S. and Yasunaga, T., 1979. Two types of amino acid substitutions in protein evolution. Journal of molecular evolution, 12(3), pp.219-236.
  • [5] Yampolsky, L.Y. and Stoltzfus, A., 2005. The exchangeability of amino acids in proteins. Genetics, 170(4), pp.1459-1472.
  • [6] Koshi, J.M. and Goldstein, R.A., 1995. Context-dependent optimal substitution matrices. Protein Engineering, Design and Selection, 8(7), pp.641-645.
  • [7] Kolaskar, A.S. and Kulkarni-Kale, U., 1992. Sequence alignment approach to pick up conformationally similar protein fragments. Journal of molecular biology, 223(4), pp.1053-1061.
  • [8] Rao, J.M., 1987. New scoring matrix for amino acid residue exchanges based on residue characteristic physical parameters. International Journal of Peptide and Protein Research, 29(2), pp.276-281.

About

Physicochemical Amino acid Replacement Distances (PARD)

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

PARD (Physicochemical Amino acid Replacement Distances)

DOICoverageDownloads

Overview

Amino acid replacements (also referred to as substitutions) are changes from one amino acid to a different one in a protein - and there are different ways to assess the difference between the two amino acids that come into play in an amino acid replacement.

One can look at one or several properties' discrepancy between two amino acids. To list only a few: polarity [1][3][4][8], molecular volume / relative sizes of amino-acid side chains [1][3][4], mean number of lone pair electrons on the side-chain [2], maximum moment of inertia for rotation at the α―β bond [2] or at the β―γ bond [2] or at the γ―δ bond [2], presence of a pyrrolidine ring (proline (P)) [2], experimental protein activity and stability after exchanging one amino acid into another [5], Chou-Fasman alpha helical [8], beta strand [8] and/or reverse turn propensity parameters [8], etc.

pard is a package designed to make those Physicochemical Amino acid Replacement Distances calculations straightforward with Python.

One typical use is to establish a 'distance' between a wild-type protein and its mutated version. Sometimes, rather than a distance, a similarity is outputted (e.g. with the Conformational similarity weight matrix[7] or EMPAR[8]). The higher the distance, the more different the two amino acids are. The higher the similarity, the more similar the two amino acids are. Whenever a distance is not outputted but rather a similarity, a warning (that the user can turn off) will be raised.

Getting started

Install from PyPI (recommended)

To use pard, run pip install pard in your terminal.

Usage

## Importsfrompard.granthamimportgranthamfrompard.sneathimportsneathfrompard.experimental_exchangeabilityimportexperimental_exchangeabilityfrompard.koshi_goldsteinimportkoshi_goldstein, MatrixType## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=experimental_exchangeability(
amino_acid_1, amino_acid_2, False, warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=koshi_goldstein(
"-",
"A",
MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

or equivalently

## Importsimportpard## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=pard.grantham.grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=pard.sneath.sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=pard.experimental_exchangeability.experimental_exchangeability(
amino_acid_1,
amino_acid_2,
False,
warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=pard.koshi_goldstein.koshi_goldstein(
"-",
"A",
pard.koshi_goldstein.MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

will output:

>>> 61
>>> 30
>>> 177
>>> 1.6

which are the correct values [1][2][5][6] .

Exit codes:

- 1: Argument amino_acid_1 or amino_acid_2 is neither of length 1 nor length 3. See error message.

About the source code

  • Follows PEP8 Style Guidelines.
  • All functions are unit-tested with pytest.
  • All variables are correctly type-hinted, reviewed with static type checkermypy.
  • All functions are documented with docstrings.

Unit tests details

Coverage

Name Stmts Miss Cover
----------------------------------------------------------------
pard\__init__.py 3 0 100%
pard\_handling_3_letter_code_decorator.py 18 2 89%
pard\_raw_python_dictionaries.py 71 0 100%
pard\empar.py 8 0 100%
pard\epstein.py 7 0 100%
pard\experimental_exchangeability.py 10 0 100%
pard\grantham.py 5 0 100%
pard\kolaskar.py 8 0 100%
pard\koshi_goldstein.py 55 2 96%
pard\miyata.py 5 0 100%
pard\sneath.py 5 0 100%
tests\__init__.py 0 0 100%
tests\test_empar.py 26 0 100%
tests\test_epstein.py 46 0 100%
tests\test_experimental_exchangeability.py 30 0 100%
tests\test_grantham.py 25 0 100%
tests\test_kolaskar.py 26 0 100%
tests\test_koshi_goldstein.py 108 0 100%
tests\test_miyata.py 25 0 100%
tests\test_pard.py 3 0 100%
tests\test_raw_python_dictionaries.py 24 0 100%
tests\test_sneath.py 21 0 100%
unit_tests_simple.py 5 0 100%
----------------------------------------------------------------
TOTAL 534 4 99%

pytest

platform win32 -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0
plugins: anyio-3.6.2, mypy-0.10.3
collected 16 items
tests\test_empar.py . [ 6%] tests\test_epstein.py . [ 12%] tests\test_experimental_exchangeability.py . [ 18%] tests\test_grantham.py . [ 25%]
tests\test_kolaskar.py . [ 31%] tests\test_koshi_goldstein.py ....... [ 75%]
tests\test_miyata.py . [ 81%] tests\test_pard.py . [ 87%] tests\test_raw_python_dictionaries.py . [ 93%] tests\test_sneath.py . [100%] ====================== 16 passed in 0.11s ====================== 

mypy detail

================================== mypy ==================================
Success: no issues found in 24 source files

Useful links:

Citation

If you use this software, please cite it as below.

  • APA:

Lhotte, R. & Taupin, J. (2022). Physicochemical Amino acid Replacement Distances (PARD) package (Version 0.7.0.1) [Computer software]. https://doi.org/10.5281/zenodo.7013169

  • BibTeX:
@software{lhotte_pard_2022,
author = {Lhotte, Romain and Taupin, Jean-Luc},
doi = {10.5281/zenodo.7013169},
month = {8},
title = {{Physicochemical Amino acid Replacement Distances (PARD) package}},
version = {0.7.0.1},
year = {2022}
}

References

  • [1] Grantham, R., 1974. Amino acid difference formula to help explain protein evolution. science, 185(4154), pp.862-864.
  • [2] Sneath, P.H.A., 1966. Relations between chemical structure and biological activity in peptides. Journal of theoretical biology, 12(2), pp.157-195.
  • [3] Epstein, C.J., 1967. Non-randomness of ammo-acid changes in the evolution of homologous proteins. Nature, 215(5099), pp.355-359.
  • [4] Miyata, T., Miyazawa, S. and Yasunaga, T., 1979. Two types of amino acid substitutions in protein evolution. Journal of molecular evolution, 12(3), pp.219-236.
  • [5] Yampolsky, L.Y. and Stoltzfus, A., 2005. The exchangeability of amino acids in proteins. Genetics, 170(4), pp.1459-1472.
  • [6] Koshi, J.M. and Goldstein, R.A., 1995. Context-dependent optimal substitution matrices. Protein Engineering, Design and Selection, 8(7), pp.641-645.
  • [7] Kolaskar, A.S. and Kulkarni-Kale, U., 1992. Sequence alignment approach to pick up conformationally similar protein fragments. Journal of molecular biology, 223(4), pp.1053-1061.
  • [8] Rao, J.M., 1987. New scoring matrix for amino acid residue exchanges based on residue characteristic physical parameters. International Journal of Peptide and Protein Research, 29(2), pp.276-281.

About

Physicochemical Amino acid Replacement Distances (PARD)

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

PARD (Physicochemical Amino acid Replacement Distances)

DOICoverageDownloads

Overview

Amino acid replacements (also referred to as substitutions) are changes from one amino acid to a different one in a protein - and there are different ways to assess the difference between the two amino acids that come into play in an amino acid replacement.

One can look at one or several properties' discrepancy between two amino acids. To list only a few: polarity [1][3][4][8], molecular volume / relative sizes of amino-acid side chains [1][3][4], mean number of lone pair electrons on the side-chain [2], maximum moment of inertia for rotation at the α―β bond [2] or at the β―γ bond [2] or at the γ―δ bond [2], presence of a pyrrolidine ring (proline (P)) [2], experimental protein activity and stability after exchanging one amino acid into another [5], Chou-Fasman alpha helical [8], beta strand [8] and/or reverse turn propensity parameters [8], etc.

pard is a package designed to make those Physicochemical Amino acid Replacement Distances calculations straightforward with Python.

One typical use is to establish a 'distance' between a wild-type protein and its mutated version. Sometimes, rather than a distance, a similarity is outputted (e.g. with the Conformational similarity weight matrix[7] or EMPAR[8]). The higher the distance, the more different the two amino acids are. The higher the similarity, the more similar the two amino acids are. Whenever a distance is not outputted but rather a similarity, a warning (that the user can turn off) will be raised.

Getting started

Install from PyPI (recommended)

To use pard, run pip install pard in your terminal.

Usage

## Importsfrompard.granthamimportgranthamfrompard.sneathimportsneathfrompard.experimental_exchangeabilityimportexperimental_exchangeabilityfrompard.koshi_goldsteinimportkoshi_goldstein, MatrixType## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=experimental_exchangeability(
amino_acid_1, amino_acid_2, False, warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=koshi_goldstein(
"-",
"A",
MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

or equivalently

## Importsimportpard## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=pard.grantham.grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=pard.sneath.sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=pard.experimental_exchangeability.experimental_exchangeability(
amino_acid_1,
amino_acid_2,
False,
warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=pard.koshi_goldstein.koshi_goldstein(
"-",
"A",
pard.koshi_goldstein.MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

will output:

>>> 61
>>> 30
>>> 177
>>> 1.6

which are the correct values [1][2][5][6] .

Exit codes:

- 1: Argument amino_acid_1 or amino_acid_2 is neither of length 1 nor length 3. See error message.

About the source code

  • Follows PEP8 Style Guidelines.
  • All functions are unit-tested with pytest.
  • All variables are correctly type-hinted, reviewed with static type checkermypy.
  • All functions are documented with docstrings.

Unit tests details

Coverage

Name Stmts Miss Cover
----------------------------------------------------------------
pard\__init__.py 3 0 100%
pard\_handling_3_letter_code_decorator.py 18 2 89%
pard\_raw_python_dictionaries.py 71 0 100%
pard\empar.py 8 0 100%
pard\epstein.py 7 0 100%
pard\experimental_exchangeability.py 10 0 100%
pard\grantham.py 5 0 100%
pard\kolaskar.py 8 0 100%
pard\koshi_goldstein.py 55 2 96%
pard\miyata.py 5 0 100%
pard\sneath.py 5 0 100%
tests\__init__.py 0 0 100%
tests\test_empar.py 26 0 100%
tests\test_epstein.py 46 0 100%
tests\test_experimental_exchangeability.py 30 0 100%
tests\test_grantham.py 25 0 100%
tests\test_kolaskar.py 26 0 100%
tests\test_koshi_goldstein.py 108 0 100%
tests\test_miyata.py 25 0 100%
tests\test_pard.py 3 0 100%
tests\test_raw_python_dictionaries.py 24 0 100%
tests\test_sneath.py 21 0 100%
unit_tests_simple.py 5 0 100%
----------------------------------------------------------------
TOTAL 534 4 99%

pytest

platform win32 -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0
plugins: anyio-3.6.2, mypy-0.10.3
collected 16 items
tests\test_empar.py . [ 6%] tests\test_epstein.py . [ 12%] tests\test_experimental_exchangeability.py . [ 18%] tests\test_grantham.py . [ 25%]
tests\test_kolaskar.py . [ 31%] tests\test_koshi_goldstein.py ....... [ 75%]
tests\test_miyata.py . [ 81%] tests\test_pard.py . [ 87%] tests\test_raw_python_dictionaries.py . [ 93%] tests\test_sneath.py . [100%] ====================== 16 passed in 0.11s ====================== 

mypy detail

================================== mypy ==================================
Success: no issues found in 24 source files

Useful links:

Citation

If you use this software, please cite it as below.

  • APA:

Lhotte, R. & Taupin, J. (2022). Physicochemical Amino acid Replacement Distances (PARD) package (Version 0.7.0.1) [Computer software]. https://doi.org/10.5281/zenodo.7013169

  • BibTeX:
@software{lhotte_pard_2022,
author = {Lhotte, Romain and Taupin, Jean-Luc},
doi = {10.5281/zenodo.7013169},
month = {8},
title = {{Physicochemical Amino acid Replacement Distances (PARD) package}},
version = {0.7.0.1},
year = {2022}
}

References

  • [1] Grantham, R., 1974. Amino acid difference formula to help explain protein evolution. science, 185(4154), pp.862-864.
  • [2] Sneath, P.H.A., 1966. Relations between chemical structure and biological activity in peptides. Journal of theoretical biology, 12(2), pp.157-195.
  • [3] Epstein, C.J., 1967. Non-randomness of ammo-acid changes in the evolution of homologous proteins. Nature, 215(5099), pp.355-359.
  • [4] Miyata, T., Miyazawa, S. and Yasunaga, T., 1979. Two types of amino acid substitutions in protein evolution. Journal of molecular evolution, 12(3), pp.219-236.
  • [5] Yampolsky, L.Y. and Stoltzfus, A., 2005. The exchangeability of amino acids in proteins. Genetics, 170(4), pp.1459-1472.
  • [6] Koshi, J.M. and Goldstein, R.A., 1995. Context-dependent optimal substitution matrices. Protein Engineering, Design and Selection, 8(7), pp.641-645.
  • [7] Kolaskar, A.S. and Kulkarni-Kale, U., 1992. Sequence alignment approach to pick up conformationally similar protein fragments. Journal of molecular biology, 223(4), pp.1053-1061.
  • [8] Rao, J.M., 1987. New scoring matrix for amino acid residue exchanges based on residue characteristic physical parameters. International Journal of Peptide and Protein Research, 29(2), pp.276-281.

About

Physicochemical Amino acid Replacement Distances (PARD)

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

PARD (Physicochemical Amino acid Replacement Distances)

DOICoverageDownloads

Overview

Amino acid replacements (also referred to as substitutions) are changes from one amino acid to a different one in a protein - and there are different ways to assess the difference between the two amino acids that come into play in an amino acid replacement.

One can look at one or several properties' discrepancy between two amino acids. To list only a few: polarity [1][3][4][8], molecular volume / relative sizes of amino-acid side chains [1][3][4], mean number of lone pair electrons on the side-chain [2], maximum moment of inertia for rotation at the α―β bond [2] or at the β―γ bond [2] or at the γ―δ bond [2], presence of a pyrrolidine ring (proline (P)) [2], experimental protein activity and stability after exchanging one amino acid into another [5], Chou-Fasman alpha helical [8], beta strand [8] and/or reverse turn propensity parameters [8], etc.

pard is a package designed to make those Physicochemical Amino acid Replacement Distances calculations straightforward with Python.

One typical use is to establish a 'distance' between a wild-type protein and its mutated version. Sometimes, rather than a distance, a similarity is outputted (e.g. with the Conformational similarity weight matrix[7] or EMPAR[8]). The higher the distance, the more different the two amino acids are. The higher the similarity, the more similar the two amino acids are. Whenever a distance is not outputted but rather a similarity, a warning (that the user can turn off) will be raised.

Getting started

Install from PyPI (recommended)

To use pard, run pip install pard in your terminal.

Usage

## Importsfrompard.granthamimportgranthamfrompard.sneathimportsneathfrompard.experimental_exchangeabilityimportexperimental_exchangeabilityfrompard.koshi_goldsteinimportkoshi_goldstein, MatrixType## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=experimental_exchangeability(
amino_acid_1, amino_acid_2, False, warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=koshi_goldstein(
"-",
"A",
MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

or equivalently

## Importsimportpard## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=pard.grantham.grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=pard.sneath.sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=pard.experimental_exchangeability.experimental_exchangeability(
amino_acid_1,
amino_acid_2,
False,
warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=pard.koshi_goldstein.koshi_goldstein(
"-",
"A",
pard.koshi_goldstein.MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

will output:

>>> 61
>>> 30
>>> 177
>>> 1.6

which are the correct values [1][2][5][6] .

Exit codes:

- 1: Argument amino_acid_1 or amino_acid_2 is neither of length 1 nor length 3. See error message.

About the source code

  • Follows PEP8 Style Guidelines.
  • All functions are unit-tested with pytest.
  • All variables are correctly type-hinted, reviewed with static type checkermypy.
  • All functions are documented with docstrings.

Unit tests details

Coverage

Name Stmts Miss Cover
----------------------------------------------------------------
pard\__init__.py 3 0 100%
pard\_handling_3_letter_code_decorator.py 18 2 89%
pard\_raw_python_dictionaries.py 71 0 100%
pard\empar.py 8 0 100%
pard\epstein.py 7 0 100%
pard\experimental_exchangeability.py 10 0 100%
pard\grantham.py 5 0 100%
pard\kolaskar.py 8 0 100%
pard\koshi_goldstein.py 55 2 96%
pard\miyata.py 5 0 100%
pard\sneath.py 5 0 100%
tests\__init__.py 0 0 100%
tests\test_empar.py 26 0 100%
tests\test_epstein.py 46 0 100%
tests\test_experimental_exchangeability.py 30 0 100%
tests\test_grantham.py 25 0 100%
tests\test_kolaskar.py 26 0 100%
tests\test_koshi_goldstein.py 108 0 100%
tests\test_miyata.py 25 0 100%
tests\test_pard.py 3 0 100%
tests\test_raw_python_dictionaries.py 24 0 100%
tests\test_sneath.py 21 0 100%
unit_tests_simple.py 5 0 100%
----------------------------------------------------------------
TOTAL 534 4 99%

pytest

platform win32 -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0
plugins: anyio-3.6.2, mypy-0.10.3
collected 16 items
tests\test_empar.py . [ 6%] tests\test_epstein.py . [ 12%] tests\test_experimental_exchangeability.py . [ 18%] tests\test_grantham.py . [ 25%]
tests\test_kolaskar.py . [ 31%] tests\test_koshi_goldstein.py ....... [ 75%]
tests\test_miyata.py . [ 81%] tests\test_pard.py . [ 87%] tests\test_raw_python_dictionaries.py . [ 93%] tests\test_sneath.py . [100%] ====================== 16 passed in 0.11s ====================== 

mypy detail

================================== mypy ==================================
Success: no issues found in 24 source files

Useful links:

Citation

If you use this software, please cite it as below.

  • APA:

Lhotte, R. & Taupin, J. (2022). Physicochemical Amino acid Replacement Distances (PARD) package (Version 0.7.0.1) [Computer software]. https://doi.org/10.5281/zenodo.7013169

  • BibTeX:
@software{lhotte_pard_2022,
author = {Lhotte, Romain and Taupin, Jean-Luc},
doi = {10.5281/zenodo.7013169},
month = {8},
title = {{Physicochemical Amino acid Replacement Distances (PARD) package}},
version = {0.7.0.1},
year = {2022}
}

References

  • [1] Grantham, R., 1974. Amino acid difference formula to help explain protein evolution. science, 185(4154), pp.862-864.
  • [2] Sneath, P.H.A., 1966. Relations between chemical structure and biological activity in peptides. Journal of theoretical biology, 12(2), pp.157-195.
  • [3] Epstein, C.J., 1967. Non-randomness of ammo-acid changes in the evolution of homologous proteins. Nature, 215(5099), pp.355-359.
  • [4] Miyata, T., Miyazawa, S. and Yasunaga, T., 1979. Two types of amino acid substitutions in protein evolution. Journal of molecular evolution, 12(3), pp.219-236.
  • [5] Yampolsky, L.Y. and Stoltzfus, A., 2005. The exchangeability of amino acids in proteins. Genetics, 170(4), pp.1459-1472.
  • [6] Koshi, J.M. and Goldstein, R.A., 1995. Context-dependent optimal substitution matrices. Protein Engineering, Design and Selection, 8(7), pp.641-645.
  • [7] Kolaskar, A.S. and Kulkarni-Kale, U., 1992. Sequence alignment approach to pick up conformationally similar protein fragments. Journal of molecular biology, 223(4), pp.1053-1061.
  • [8] Rao, J.M., 1987. New scoring matrix for amino acid residue exchanges based on residue characteristic physical parameters. International Journal of Peptide and Protein Research, 29(2), pp.276-281.

About

Physicochemical Amino acid Replacement Distances (PARD)

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

PARD (Physicochemical Amino acid Replacement Distances)

DOICoverageDownloads

Overview

Amino acid replacements (also referred to as substitutions) are changes from one amino acid to a different one in a protein - and there are different ways to assess the difference between the two amino acids that come into play in an amino acid replacement.

One can look at one or several properties' discrepancy between two amino acids. To list only a few: polarity [1][3][4][8], molecular volume / relative sizes of amino-acid side chains [1][3][4], mean number of lone pair electrons on the side-chain [2], maximum moment of inertia for rotation at the α―β bond [2] or at the β―γ bond [2] or at the γ―δ bond [2], presence of a pyrrolidine ring (proline (P)) [2], experimental protein activity and stability after exchanging one amino acid into another [5], Chou-Fasman alpha helical [8], beta strand [8] and/or reverse turn propensity parameters [8], etc.

pard is a package designed to make those Physicochemical Amino acid Replacement Distances calculations straightforward with Python.

One typical use is to establish a 'distance' between a wild-type protein and its mutated version. Sometimes, rather than a distance, a similarity is outputted (e.g. with the Conformational similarity weight matrix[7] or EMPAR[8]). The higher the distance, the more different the two amino acids are. The higher the similarity, the more similar the two amino acids are. Whenever a distance is not outputted but rather a similarity, a warning (that the user can turn off) will be raised.

Getting started

Install from PyPI (recommended)

To use pard, run pip install pard in your terminal.

Usage

## Importsfrompard.granthamimportgranthamfrompard.sneathimportsneathfrompard.experimental_exchangeabilityimportexperimental_exchangeabilityfrompard.koshi_goldsteinimportkoshi_goldstein, MatrixType## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=experimental_exchangeability(
amino_acid_1, amino_acid_2, False, warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=koshi_goldstein(
"-",
"A",
MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

or equivalently

## Importsimportpard## Basic examplesamino_acid_1: str="W"# Tryptophanamino_acid_2: str="L"# Leucinedistance_grantham: int=pard.grantham.grantham(amino_acid_1, amino_acid_2)
print(distance_grantham)
distance_sneath: int=pard.sneath.sneath(amino_acid_1, amino_acid_2)
print(distance_sneath)
distance_ee: float=pard.experimental_exchangeability.experimental_exchangeability(
amino_acid_1,
amino_acid_2,
False,
warning=True
)
print(distance_ee)
## More subtle examples# Koshi-Goldstein has several scores and can estimate the likelihood of InDelsdistance_koshi_goldstein_all: float=pard.koshi_goldstein.koshi_goldstein(
"-",
"A",
pard.koshi_goldstein.MatrixType.ALL_RESIDUES,
False,
warning=True
)
print(distance_koshi_goldstein_all)

will output:

>>> 61
>>> 30
>>> 177
>>> 1.6

which are the correct values [1][2][5][6] .

Exit codes:

- 1: Argument amino_acid_1 or amino_acid_2 is neither of length 1 nor length 3. See error message.

About the source code

  • Follows PEP8 Style Guidelines.
  • All functions are unit-tested with pytest.
  • All variables are correctly type-hinted, reviewed with static type checkermypy.
  • All functions are documented with docstrings.

Unit tests details

Coverage

Name Stmts Miss Cover
----------------------------------------------------------------
pard\__init__.py 3 0 100%
pard\_handling_3_letter_code_decorator.py 18 2 89%
pard\_raw_python_dictionaries.py 71 0 100%
pard\empar.py 8 0 100%
pard\epstein.py 7 0 100%
pard\experimental_exchangeability.py 10 0 100%
pard\grantham.py 5 0 100%
pard\kolaskar.py 8 0 100%
pard\koshi_goldstein.py 55 2 96%
pard\miyata.py 5 0 100%
pard\sneath.py 5 0 100%
tests\__init__.py 0 0 100%
tests\test_empar.py 26 0 100%
tests\test_epstein.py 46 0 100%
tests\test_experimental_exchangeability.py 30 0 100%
tests\test_grantham.py 25 0 100%
tests\test_kolaskar.py 26 0 100%
tests\test_koshi_goldstein.py 108 0 100%
tests\test_miyata.py 25 0 100%
tests\test_pard.py 3 0 100%
tests\test_raw_python_dictionaries.py 24 0 100%
tests\test_sneath.py 21 0 100%
unit_tests_simple.py 5 0 100%
----------------------------------------------------------------
TOTAL 534 4 99%

pytest

platform win32 -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0
plugins: anyio-3.6.2, mypy-0.10.3
collected 16 items
tests\test_empar.py . [ 6%] tests\test_epstein.py . [ 12%] tests\test_experimental_exchangeability.py . [ 18%] tests\test_grantham.py . [ 25%]
tests\test_kolaskar.py . [ 31%] tests\test_koshi_goldstein.py ....... [ 75%]
tests\test_miyata.py . [ 81%] tests\test_pard.py . [ 87%] tests\test_raw_python_dictionaries.py . [ 93%] tests\test_sneath.py . [100%] ====================== 16 passed in 0.11s ====================== 

mypy detail

================================== mypy ==================================
Success: no issues found in 24 source files

Useful links:

Citation

If you use this software, please cite it as below.

  • APA:

Lhotte, R. & Taupin, J. (2022). Physicochemical Amino acid Replacement Distances (PARD) package (Version 0.7.0.1) [Computer software]. https://doi.org/10.5281/zenodo.7013169

  • BibTeX:
@software{lhotte_pard_2022,
author = {Lhotte, Romain and Taupin, Jean-Luc},
doi = {10.5281/zenodo.7013169},
month = {8},
title = {{Physicochemical Amino acid Replacement Distances (PARD) package}},
version = {0.7.0.1},
year = {2022}
}

References

  • [1] Grantham, R., 1974. Amino acid difference formula to help explain protein evolution. science, 185(4154), pp.862-864.
  • [2] Sneath, P.H.A., 1966. Relations between chemical structure and biological activity in peptides. Journal of theoretical biology, 12(2), pp.157-195.
  • [3] Epstein, C.J., 1967. Non-randomness of ammo-acid changes in the evolution of homologous proteins. Nature, 215(5099), pp.355-359.
  • [4] Miyata, T., Miyazawa, S. and Yasunaga, T., 1979. Two types of amino acid substitutions in protein evolution. Journal of molecular evolution, 12(3), pp.219-236.
  • [5] Yampolsky, L.Y. and Stoltzfus, A., 2005. The exchangeability of amino acids in proteins. Genetics, 170(4), pp.1459-1472.
  • [6] Koshi, J.M. and Goldstein, R.A., 1995. Context-dependent optimal substitution matrices. Protein Engineering, Design and Selection, 8(7), pp.641-645.
  • [7] Kolaskar, A.S. and Kulkarni-Kale, U., 1992. Sequence alignment approach to pick up conformationally similar protein fragments. Journal of molecular biology, 223(4), pp.1053-1061.
  • [8] Rao, J.M., 1987. New scoring matrix for amino acid residue exchanges based on residue characteristic physical parameters. International Journal of Peptide and Protein Research, 29(2), pp.276-281.

About

Physicochemical Amino acid Replacement Distances (PARD)

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages