Skip to main content

<i>In silico</i> mutagenesis of protein and RNA sequences using coevolution

Project description

About pycofitness

pycofitness is Python implemementation of in silico mutagenesis for multipe sequence alignments (MSA) of protein or RNA sequence families using pseudolikelihood maximization direct couplings analysis (DCA) algorithm. The input file for pycofitness must be an MSA of sequences in fasta format, with the first sequence representing the reference sequence. The software provides command line utilities or it can be used as a Python library.

Prerequisites

pycofitness is implemented mainly in Python with the pseudolikelihood maximization parameter inference part implemented using C++ backend to enable parallelization. It requires:

  • Python 3
  • C++ compiler that supports C++11, e.g., the GNU compiler collection (GCC)
  • Optionally, OpenMP for multithreading support

Installing

To install the current version of pycofitness from PyPI, run on the command line

$ pip install pycofitness

Using pycofitness as a Python Library

After installation, pycofitness can be imported into other Python source codes and used. For example,

from pycofitness.mutation import PointMutation

point_mutation = PointMutation(msa_file, biomelcule)
deltas = point_mutation.delphi_epistatic()
#print the values of delta_dict by iteration over sites and bases/residues

for i in range(len(deltas)):
    for res in deltas[i]:
        print(i + 1, res, deltas[i][res])
#Note we added 1 to i to count sites starting from one as opposed to zero.

We can also pass parameters such as number of iterations, and number of threads for parallel execusion, and so on, as keyword arguments to PointMutation constructor:

point_mutation = PointMutation(msa_file, biomolecule,
    max_iterations = 1000,
    num_threads = 4,
    seqid = 0.9,
    lambda_J = 10.0,
    lambda_h = 5.0,
    verbose = True
)

where max_iterations is the number of maximum iterations for gradient decent, num_threads is the number of threads for parallel execution, seqid is sequence identity cut off value (if sequences have similarity more that this value, they are regarded as the same), lambda_J and lambda_h are penalizing constants for L2 regularization. If verbose is set to be True, logging information is enabled.

Running pycofitness From Command Line

When pycofitness is installed, it provides a command pycofitness that can be executed from the command line. For example:

$ pycofitness <biomolecule> <msa_file> --num_threads=4 --verbose

where <biomolecule> refers values "protein" or "RNA" (case insensitive) and <msa_file> is the MSA file.

Information about command line options can be obtained using:

$ pycofitness --help

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

pycofitness-1.0.tar.gz (40.2 kB view details)

Uploaded Source

File details

Details for the file pycofitness-1.0.tar.gz.

File metadata

  • Download URL: pycofitness-1.0.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.9 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13

File hashes

Hashes for pycofitness-1.0.tar.gz
Algorithm Hash digest
SHA256 7c458f6a62692c5bdadfd29bb0eb23e6cb0383d476be55bf7668844f04c5c988
MD5 e528339cf7d0e369455ed26a2600f1d0
BLAKE2b-256 ed4ba25a68560db720de9a62d0381fba60525cb0cf360a19a3744487e00707db

See more details on using hashes here.

Supported by

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