Skip to main content

Utitilies for constructing and manipulating models for non-local structural dependencies in genomic sequences

Project description


quasinet PyPI Downloads

PyPI version


Infer non-local structural dependencies in genomic sequences. Genomic sequences are esentially compressed encodings of phenotypic information. This package provides a novel set of tools to extract long-range structural dependencies in genotypic data that define the phenotypic outcomes. The key capabilities implemented here are as follows:

  1. Compute the Quasinet (Q-net) given a database of nucleic acid sequences. The Q-net is a family of conditional inference trees that capture the predictability of each nucleotide position given the rest of the genome. The constructed Q-net for COVID-19 and Influenza A H1N1 HA 2008-9 is shown below.
  1. Compute a structure-aware evolution-adaptive notion of distance between genomes, which is demonstrably more biologically relevant compared to the standard edit distance.

  2. Draw samples in-silico that have a high probability of being biologically correct. For example, given a database of Influenza sequences, we can generate a new genomic sequence that has a high probability of being a valid influenza sequence.


To install with pip:

pip install quasinet

To fix error with Mac or Windows:

from quasinet.osfix import osfix
# for windows
# for max x86_64 (macbook pro)
# mac arm (macbook air)

NOTE: If trying to reproduce the paper below, please use pip install quasinet==0.0.58


  • scikit-learn
  • scipy
  • numpy
  • numba
  • pandas
  • joblib
  • biopython


from quasinet import qnet

# initialize qnet
myqnet = qnet.Qnet()

# train the qnet

# compute qdistance
qdist = qnet.qdistance(seq1, seq2, myqnet, myqnet) 


Examples are located here.


For more documentation, see here.


For reference, please check out our paper:

Preparing For the Next Pandemic: Learning Wild Mutational Patterns At Scale For Analyzing Sequence Divergence In Novel Pathogens


You can reach the ZED lab at:

Project details

Release history Release notifications | RSS feed

Download files

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

Source Distribution

quasinet-0.1.55.tar.gz (14.5 MB view hashes)

Uploaded source

Built Distribution

quasinet-0.1.55-py3-none-any.whl (15.2 MB view hashes)

Uploaded py3

Supported by

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