Skip to main content

Calculate allele frequency from a sequence multialignment.

Project description

allfreqs Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Documentation Status

Calculate allele frequencies from a sequence multialignment.


Calculate allele frequencies from a nucleotide multialignment in fasta or csv format.

Allele frequencies will be returned as a table in which each row is a nucleotide position (based on the provided reference sequence) and columns are A, C, G, T frequencies as well as gaps and other non-canonical nucleotides.

For example, given the following multialignment:

ID Sequence

the resulting allele frequencies will be:

position A C G T gap oth
1.0_A 1.0 0.0 0.0 0.0 0.0 0.0
2.0_C 0.0 0.5 0.0 0.0 0.5 0.0
3.0_G 0.0 0.5 0.5 0.0 0.0 0.0
4.0_T 0.5 0.0 0.0 0.5 0.0 0.0
5.0_A 0.5 0.0 0.5 0.0 0.0 0.0
6.0_C 0.0 0.5 0.5 0.0 0.0 0.0
7.0_G 0.0 0.0 1.0 0.0 0.0 0.0
8.0_T 0.0 0.0 0.0 0.5 0.0 0.5

Frequencies of non-canonical (ambiguous) nucleotides are by default squashed into the oth column, but they can also be shown separately using a simple flag.

allfreqs can be used either as a command line tool or through its Python API.

For more information, please refer to the Usage section of the documentation.


PLEASE NOTE: allfreqs only supports Python >= 3.6!

The preferred installation method for allfreqs is using pip:

$ pip install allfreqs

For more information, please refer to the Installation section of the documentation.


This package was created with Cookiecutter and the cc-pypackage project template.


0.1.0 (2019-07-08)

  • First release.

0.1.1 (2019-08-08)

  • Read and process multialignments from fasta and csv files (Python module only).

0.1.2 (2019-10-17)

  • Add tests with and without reference included in multialignments;
  • Add tests with real datasets (coming from haplogroup-specific multialignments).

0.1.3 (2019-10-18)

  • Add more detailed tests for real datasets;
  • Implement more efficient frequency calculation;
  • Add dunder methods and sanity checks;
  • Fix requirements and testing framework;
  • Clean code.

0.2.0 (2020-03-07)

  • Remove numpy and pandas from requirements as they are installed by scikit-bio;
  • Move tests module inside allfreqs;
  • Add ci module for internal management;
  • Clean code.

0.3.0 (2020-04-02)

  • Add option to allow ambiguous nucleotides shown separately.

Project details

Download files

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

Files for allfreqs, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size allfreqs-0.3.0-py2.py3-none-any.whl (8.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size allfreqs-0.3.0.tar.gz (13.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page