Skip to main content

This package has functions for the conversion of amino acid sequences to physicochemical vectors and the subsequent analysis of those vector sequences.

Project description

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

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=False)
    

    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 absolute maximum normalized before converting the amino acid sequence to vector form.

  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)
    
    • window = size of Sakoe-Chiba band
    • penalty = somewhat equivalent to mismatch penalty in standard dynamic programming based alignment

    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)['FullAlignment'])
    print(PCDTWAlign(seq1, seq2)['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)
    print(Dist)
    

    Example to get the distance:

    seq1 = "MSDSNQGNNQQNYQQYSQNGNQQQGNNRYQG"
    seq2 = "MMNNNGNQVSNLSNALRQVNIGNRNSNTTT"
    print(PCDTWDist(seq1, seq2))
    
  4. To get a variable number of 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:

    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 mass and hydrophobicity. The hydrophobicity values used in this package vary slightly from those used in the original algorithm.

Dependency Citations:

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

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).

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

pcdtw-0.2.7.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

pcdtw-0.2.7-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pcdtw-0.2.7.tar.gz
Algorithm Hash digest
SHA256 2f48ab5fa71c4d0707770f191f1682e58b5b125ec27d453aeca6b37c4914defd
MD5 9e550debdb9ba49498aab7252990c86e
BLAKE2b-256 0161b5cf6750df6b1762bd83024b349c90c2a77bd8b8f493bef41b43f45958f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pcdtw-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 72d778a39716f61e135586321e769ab04914e1ea004fed030a2633b803a99ded
MD5 5c0110a77ad35e4db418ed764a7e0d01
BLAKE2b-256 a134289c2b35d0954543381a757ca2e385392a50395aebe933b1793d4d9ecad1

See more details on using hashes here.

Supported by

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