Skip to main content

PCDTW is a package that implements the conversion of amino acid sequences to physicochemical vectors and subsequently allows for alignment of the sequences based on those vectors, development of consensus vectors that can be used to search databases for similar physicochemical profiles, development of the DTW distance between two physicochemical vectors and a few other functions. The basis for this package can be found in three publications and should be consulted for further background [1–3].

To install PCDTW (Two Options): -Use ‘pip install PCDTW’ in a powershell prompt -Use ‘!pip install PCDTW’ in a jupyter notebook

When upgrading PCDTW in a Jupyter notebook uninstall twice and then install the new version: -Use ‘!pip uninstall PCDTW’ -Use ‘!pip uninstall PCDTW’ -Use ‘!pip install PCDTW’ -'!pip show PCDTW' to verify the upgrade

To use PCDTW: Use ‘import PCDTW’

Citations

1)Dixson, J.D.; Vumma, L.; Azad, R.K. An Analysis of Combined Molecular Weight and Hydrophobicity Similarity between the Amino Acid Sequences of Spike Protein Receptor Binding Domains of Betacoronaviruses and Functionally Similar Sequences from Other Virus Families. Microorganisms 2024, 12.

2)Dixson, J.D.; Azad, R.K. Physicochemical Evaluation of Remote Homology in the Twilight Zone. Proteins Struct. Funct. Bioinforma. 2024, n/a, doi:https://doi.org/10.1002/prot.26742.

3)Dixson, J.D.; Azad, R.K. A Novel Predictor of ACE2-Binding Ability among Betacoronaviruses. Evol. Med. Public Heal. 2021, 9, 360–373, doi:10.1093/EMPH/EOAB032.

Usage:

  1. To convert an amino acid sequence to vector form using two physicochemical properties:

    PCDTW.PCDTWConvert(x, PCProp1='Mass', PCProp2='HydroPho', normalize=True, NormType='AbsMax')
    

    PCProp1/PCProp2 options:

    • 'HydroPho'
    • 'HydroPhIl'
    • 'Hbond'
    • 'SideVol'
    • 'Polarity'
    • 'Polarizability'
    • 'SASA'
    • 'NCI'
    • 'Mass'

    Normalization: If normalize is set to True then the individual physicochemical scalar values for each amino acid are normalized before converting the amino acid sequence to vector form. This results in negation of the order of entry for the PCProps. In other words PCProp1='Mass', PCProp2='HydroPho' would yield the same vector as PCProp1='HydroPho', PCProp2='Mass'. This is true regardless of the type of normalization. The NormType parameter sets the type of normalization used.

    NormType Options:

    • 'AbsMax'
    • 'MinMax'
  2. To align two amino acid sequences using DTW and two physicochemical properties:

    PCDTW.PCDTWAlign(inputseq1str, inputseq2str, PCProp1='Mass', PCProp2='HydroPho', Penalty=0, Window=3, GAP="Gap")
    
    • Window = size of Sakoe-Chiba band
    • Penalty = somewhat equivalent to mismatch penalty in standard dynamic programming based alignment
    • GAP = can be 'Gap' or 'Lower' and determines how gaps are presented

    Returns a dictionary containing the following values:

    • 'Seq1AlignedString'
    • 'Seq2AlignedString'
    • 'FullAlignment'
    • 'Identity'
    • 'ConsensusVector'

    Example to get the full alignment and identity:

    seq1 = "MSDSNQGNNQQNYQQYSQNGNQQQGNNRYQG"
    seq2 = "MMNNNGNQVSNLSNALRQVNIGNRNSNTTT"
    print(PCDTWAlign(seq1, seq2, PCProp1='Mass', PCProp2='HydroPho')['FullAlignment'])
    print(PCDTWAlign(seq1, seq2, PCProp1='Mass', PCProp2='HydroPho')['Identity'])
    
  3. To get the PCDTW distance between two sequences normalized to the number of amino acids in the alignment:

    Dist=PCDTW.PCDTWDist(Seq1, Seq2, PCProp1='Mass', PCProp2='HydroPho')
    print(Dist)
    

    Example to get the distance:

    seq1 = "MSDSNQGNNQQNYQQYSQNGNQQQGNNRYQG"
    seq2 = "MMNNNGNQVSNLSNALRQVNIGNRNSNTTT"
    print(PCDTWDist(seq1, seq2))
    
  4. To get synthetically evolved homologs for an input sequence:

    SynHomologs=PCDTW.PCEvolve(Seq='GALM', PCProp1='Mass', PCProp2='HydroPho', BaseName='ProtX')
    print(SynHomologs)
    

    PCProp1/PCProp2 options:

    • 'HydroPho'
    • 'HydroPhIl'
    • 'Hbond'
    • 'SideVol'
    • 'Polarity'
    • 'Polarizability'
    • 'SASA'
    • 'NCI'
    • 'Mass'
  5. To get a newick format tree using PCDTW that represents the physicochemical similarity of protein sequences:

    Newick=PCDTW.PCDTWTree(FastaFile='Your_File_Location.fasta',PCProp1='Mass', PCProp2='HydroPho')
    print(Newick)
    

    PCProp1/PCProp2 options:

    • 'HydroPho'
    • 'HydroPhIl'
    • 'Hbond'
    • 'SideVol'
    • 'Polarity'
    • 'Polarizability'
    • 'SASA'
    • 'NCI'
    • 'Mass'

    This function is derived from the original algorithm used in Dixson and Azad, 2021. Unlike the original algorithm the two physicochemical properties used can be set to any two from the nine included above. If the PCProps are not specified by the user then they default to mass and hydrophobicity. The hydrophobicity values used in this package vary slightly from those used in the original algorithm.

Dependency Citations:

Bio.Phylo:

Talevich, E., Invergo, B.M., Cock, P.J.A., & Chapman, B.A. (2012). Bio.Phylo: A unified toolkit for processing, analyzing, and visualizing phylogenetic trees in Biopython. BMC Bioinformatics, 13, 209

Biopython:

Biopython: freely available Python tools for computational molecular biology and bioinformatics. Bioinformatics, 25(11), 1422–1423. https://doi.org/10.1093/bioinformatics/btp163

dtaidistance:

Wannes Meert, Kilian Hendrickx, Toon Van Craenendonck, Pieter Robberechts, Hendrik Blockeel, & Jesse Davis. (2022). DTAIDistance (Version v2). Zenodo. http://doi.org/10.5281/zenodo.5901139

Matplotlib:

Hunter, J. D. (2007). Matplotlib: A 2D graphics environment. Computing in Science & Engineering, 9(3), 90–95.

numpy:

Harris, C.R., Millman, K.J., van der Walt, S.J. et al. (2020). Array programming with NumPy. Nature 585, 357–362. DOI: 10.1038/s41586-020-2649-2.

pandas:

McKinney, W. (2010). Data Structures for Statistical Computing in Python. Proceedings of the 9th Python in Science Conference (SciPy 2010).

SciPy:

Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, Stéfan J. van der Walt, Matthew Brett, Joshua Wilson, K. Jarrod Millman, Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones, Robert Kern, Eric Larson, CJ Carey, İlhan Polat, Yu Feng, Eric W. Moore, Jake VanderPlas, Denis Laxalde, Josef Perktold, Robert Cimrman, Ian Henriksen, E.A. Quintero, Charles R Harris, Anne M. Archibald, Antônio H. Ribeiro, Fabian Pedregosa, Paul van Mulbregt, and SciPy 1.0 Contributors. (2020) SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods, 17(3), 261-272.

Download files

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

Source Distribution

pcdtw-0.3.3.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

pcdtw-0.3.3-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file pcdtw-0.3.3.tar.gz.

File metadata

  • Download URL: pcdtw-0.3.3.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for pcdtw-0.3.3.tar.gz
Algorithm Hash digest
SHA256 d7d424316f5b1cc9531c92c7bf1cf2e8828c42f4db2362b9d070991b45ea77c0
MD5 bcbe7be6e8c1bd9abc98363fce876357
BLAKE2b-256 fa16c5448ce01a19e6ac6ddf01f7038254181325fd7ce1db73268e205c21de21

See more details on using hashes here.

File details

Details for the file pcdtw-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: pcdtw-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for pcdtw-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9602d6d91b5793bd337424faa13cd14d149f07af3ed6d5a1616dd19082d98aa2
MD5 2acf164c811955318956d38b6d327e27
BLAKE2b-256 b51fef59134ac7e5c8f6cb7421ba2ebf4b5c0a0cf8d6373ecc30ba3e4c0d118d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

This release

0.3.3 This release

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

1 file

0.2.0

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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