Skip to main content

Toolkit for analyses of amino acid sequences, optimized for GlobDB compatibility

Project description

Amino acid sequence toolkit

NOTE: aastk is currently in active development, and not yet ready for broad public use. Please be patient

AASTK synopsis

The amino acid sequence toolkit (AASTK) is a suite of tools that enables construction and analyses of protein sequence datasets from the GlobDB genomes. The GlobDB is the most comprehensive genomic resource of species-representative microbial genomes of Bacteria and Archaea, and contains the largest phylogenetic sequence diversity currently available in a single resource. AASTK is designed to leverage the GlobDB to create and analyze protein sequence datasets for evolutionary and functional studies.

AASTK uses a precomputed SQL database that includes the protein sequences, their genomic context, functional annotations from KEGG, COG, and PFAM, and metadata on the genomes the protein sequences. This SQL database is available for download on the GlobDB website.

AASTK currently consists of four tools:
pasr - Creating and updating comprehensive datasets of proteins of interest.
casm - Clustering datasets of complex functionally diverse protein superfamilies.
cugo - Assessing consensus genomic context of a protein dataset.
meta - Retrieving metadata such as taxonomy, environment, and annotations from the AASTK SQL database

Installation instructions, usage examples, and short descriptions of the tools in AASTK can be found below. A more extended description can be found in the documentation. A full description of all command line tools and arguments is available on command line reference pages for PASR, CASM, CUGO, and Meta, also accessible via the dropdown menu on the AASTK documentation page.

Installation

Using conda (recommended)

git clone https://github.com/dspeth/aastk.git
cd aastk
conda env create -f environment.yml
conda activate aastk
pip install -e .

Using pip

tbd

From source

tbd

Brief descriptions of the tools in AASTK

Protein alignment score ratio (PASR)

PASR is intended for the creation of comprehensive sequence datasets of homologous proteins, using alignment of all sequences in a query dataset to a (small) seed dataset of sequences of interest using DIAMOND. Thus, the query file is the large dataset containing all proteins to be searched, and the seed is the (preliminary) dataset of homologous proteins to be found in the query data. The PASR workflow can be run using aastk pasr, and the helper tool pasr_select can be used to select sequences to include in the final dataset, based on the PASR plot.

More extensive documentation for PASR is available on the documentation page and all command line options for PASR are available on the PASR command line reference page.  

Clustering alignment score matrix (CASM)

CASM is designed to investigate the structure of a dataset of homologous proteins, such as a protein superfamily. Many protein (super)families contain members with distinct biochemical or physiological functions. Understanding the structure of a protein (super)family is an essential first step in understanding the functional landscape of a protein (super)family. CASM clusters sequences by generating an N x n alignment score matrix, by aligning all N sequences in a dataset against a subset of n sequences. T-distributed stochastic neighbourhood embedding (t-SNE) is then used to reduce this matrix to from n to 2 dimensions. Clusters are called using DBSCAN, and the t-SNE results can be annotated with metadata and visualized. The CASM workflow can be run using aastk casm, and the helper tool pasr_select can be used to select sequences to include in the final dataset, based on the PASR plot.

More extensive documentation for CASM is available on the documentation page and all command line options for CASM are available on the CASM command line reference page.  

Colocated unidirectional gene organization (CUGO)

CUGO is intended to retrieve and visualise the consensus genomic context of a dataset of homologous proteins. To do so, it uses information from the AASTK SQL database of the proteins in the GlobDB genomes. Each GlobDB genome is partitioned into CUGO units, that are limited by a strand change of encoded proteins, or when a contig ends. For each sequence in the input file, aastk cugo determines it's CUGO unit, and then extracts all sequences belonging to this CUGO unit, and optionally adjacent CUGOs. These sequences are then used for visualisation. Consensus genomic context is visualised in three plots combined into one overview figure. The first plot shows the three most common annotations per genomic position, the second the density of amino acid sequence length per position, and the third the density of number of transmembrane helices per position (see figure below). This design ensures that there is no upper limit to the size of the query dataset size from a visualisation perspective, although data retrieval time scales with query size. CUGO uses the AASTK SQL database, which as of release 226 is xxx Gb.

Metadata retrieval (Meta)

Meta allows for retrieval of sequence metadata from the AASTK SQL database based on a protein fasta file or a list of protein identifiers. There are two types of metadata in the SQL database, those linked to protein sequences directly, and those linked to the genomes encoding the protein sequences. Available metadata categories are annotation (protein linked), taxonomy, culture collection availability, and two levels of environmental metadata (all genome linked). The selected metadata are written to a tsv file.

Usage examples

PASR

aastk pasr -m BLOSUM45 -q query.fasta -s seed.fasta -o output_dir
Where:
-m specifies the scoring matrix to be used, can be BLOSUM62 or BLOSUM45
-q specifies the query dataset in fasta format
-s specifies the seed database of homologous proteins, in fasta format
-o specifies the output directory
All command line options for PASR are available on the PASR command line reference page.

CASM

aastk casm --fasta input.faa -o output_directory --subset_size 1000 -n 4 -p 1000
Where:
--fasta and -o control the input and output 
--subset_size determines the number of randomly selected proteins in the subset
-n specifies the number of threads to use
-p is the t-SNE perplexiity
All command line options for CASM are available on the CASM command line reference page.

CUGO

aastk cugo -r 0 -l -3 -u 6 -d aastk_sql_database.db -f fasta_file.faa -o cugo_output_dir
Where:
-r is the range of CUGO numbers to be considered
-l specifies the number of positions upstream of the gene of interest
-u specifies the number of positions downstream of the gene of interest
-d is the path to the AASTK SQL database
-f and -o control the input and output
All command line options for CASM are available on the CUGO command line reference page.

Meta

aastk meta --all_metadata -d aastk_sql_database.db -f fasta_file.faa -o output_directory
Where:
--all_metadata controls which metadata is added to the output tsv file
-d is the path to the AASTK SQL database
-f and -o control the input and output
All command line options for CASM are available on the Meta command line reference page.

Example plots

Examples of the graphical output of PASR, CUGO, and CASM. For a full overview of the output files generated by these tools, consult the AASTK documentation page.

Example PASR plot

Example PASR plot, described in the legend below PASR plot of the catalytic, molybdenum containing subunit of an enzyme in the MopB superfamily. Each dot indicates a protein sequence, with the x-axis representing the calculated maximum alignment score, and the y-axis the alignment score against the seed dataset. Color of the dots represents sequence identity of the best hit in the seed dataset. Dots on the 1:1 line represent sequences already present in the seed dataset. Full length sequences (for this dataset) have a calculated maximum score (x-axis) of approx. 4500-5000. Dots with lower values on the x-axis represent partial sequences, either pseudogenes or (more commonly) sequences encoded at the edge of contigs in fragmented genomes. The x-axis is cut off at 150% of the maximum value of the y-axis

Example CUGO plot

Example CUGO plot, described in the legend below The CUGO visualisation consists of three plots. The first plot shows the three most prevalent annotations per position, using a histogram like graph. Colors for each COG are consistent within and across plots. The second plot shows the number of proteins in length bins (default 50 amino acids) position, showing whether proteins at a position are conserved in an annotation independent way. The third plot shows the predicted transmembrane helices at each position.

Example CASM plot after early exaggeration phase.

Example CASM plot after early exaggeration phase, described in the legend below tSNE plot showing 166,445 sequences of the mopB superfamily after early exaggeration, when the clustering with DBSCAN is done. Points are colored by cluster affiliation.

Example of final CASM plot

Example of the final CASM plot, described in the legend below Final tSNE plot showing 166,445 sequences of the mopB superfamily. Points are colored by cluster affiliation, but can also be colored by information from the AASTK SQL database, including taxonomy, environment or culture availability.

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

aastk-0.1.0.tar.gz (67.2 kB view details)

Uploaded Source

Built Distribution

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

aastk-0.1.0-py3-none-any.whl (66.9 kB view details)

Uploaded Python 3

File details

Details for the file aastk-0.1.0.tar.gz.

File metadata

  • Download URL: aastk-0.1.0.tar.gz
  • Upload date:
  • Size: 67.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aastk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 74b0849e79663eb00f11f4d69d4acd4684a94140e70e9f7ab93cd7ec688cffb9
MD5 6d90d6398e65bac4a72b7c21a61ba64c
BLAKE2b-256 f8695df50922364262928af2637e138dd956ab3ca797a3e6fe4a219a0c7fc69c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aastk-0.1.0.tar.gz:

Publisher: release.yml on dspeth/aastk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aastk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aastk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 66.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aastk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab632f089393a75b8ab0dc80237b26157fba75986d6f06167e4b2f4ee90cc779
MD5 bb0e5c999660d33ca4f86780fc2873e7
BLAKE2b-256 e2c0fc81e17fdfbb1fdf7909cfd24a9e06bd34a8cd96d3b39ba1de7d368a9bef

See more details on using hashes here.

Provenance

The following attestation bundles were made for aastk-0.1.0-py3-none-any.whl:

Publisher: release.yml on dspeth/aastk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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