Skip to main content

Amino Scribe is a Python package for generating nanopore squiggles based on protein sequences.

Project description

AminoScribe

AminoScribe is a Python module for generating simulated nanopore squiggle signals from amino acid sequences. It provides tools for sequence-based signal generation, time warping, noise addition, and signal processing such as filtering, normalization, and downsampling.

Features

  • Generate idealized templates for amino acid sequences.
  • Add time-domain warping and amplitude noise to simulate realistic signals.
  • Apply low-pass Bessel filtering to reduce noise.
  • Normalize signals using min-max scaling.
  • Downsample signals for efficient processing.
  • Fetch protein sequences using UniProt accession numbers.

Installation

Install AminoScribe using pip:

pip install aminoscribe

Usage

Generate a Squiggle Signal

You can generate a simulated squiggle signal from an amino acid sequence or a protein ID:

from aminoscribe.aminoscribe import generate_squiggle

# Generate a squiggle signal from a sequence
signal = generate_squiggle(sequence="MKTLLDLGYTMKTLLLTLVVTMKTLLDLGYTMKTLLLTLVVLLTLVVVTIVCLDLGYTLGYT", 
                           normalize=True, 
                           downsample=True, 
                           downsample_factor=5)

# Generate a squiggle signal from a protein ID
signal = generate_squiggle(protein_id="P12345", 
                           filter_noise=True, 
                           bessel_N=8, 
                           bessel_Wn=0.1)

Generate an Idealized Template

If you only need the idealized template without noise or processing:

sequence = "YYYYYSTSSDGDEEDGDDSTSYYYYYSTSSDGEDDEGDDSTSYYYYYSTSSDGEDEDGDDSTSYYYYYSTSSDGD"
template = generate_squiggle(sequence=sequence, template_only=True)

Fetch Protein Sequence

Retrieve a protein sequence using its UniProt accession number:

from aminoscribe.aminoscribe import get_protein_seq

sequence = get_protein_seq("E2RYF6")

Function Reference

generate_squiggle

Generates a simulated squiggle signal from an amino acid sequence or protein ID.

Parameters:

  • sequence (str, optional): Amino acid sequence.
  • protein_id (str, optional): Protein ID to fetch the sequence.
  • base_template (optional): Base template signal.
  • seed (optional): Random seed for reproducibility.
  • template_only (bool, optional): Return idealized template only.
  • cterm (str, optional): Sequence to append to the C-terminal end.
  • nterm (str, optional): Sequence to prepend to the N-terminal end.
  • filter_noise (bool, optional): Apply low-pass Bessel filter.
  • bessel_N (int, optional): Order of the Bessel filter.
  • bessel_Wn (float, optional): Normalized cutoff frequency.
  • normalize (bool, optional): Apply min-max normalization.
  • norm_cutoff (int, optional): Number of elements for normalization.
  • downsample (bool, optional): Apply linear downsampling.
  • downsample_factor (float, optional): Downsampling factor.

Returns:

  • List of float values representing the processed squiggle signal.

get_protein_seq

Fetches a protein sequence using its UniProt accession number.

Parameters:

  • protein_id (str): UniProt accession number.

Returns:

  • Amino acid sequence as a string.

License

This project is licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). See the LICENSE file for details.

Contributing

Source code lives at https://github.com/uwmisl/Amino-Scribe. Please submit a pull request or open an issue for any bugs or feature requests.

Contributors

Contributors

  • Melissa Queen — Lead author and maintainer
  • Daphne Kontogiorgos-Heintz — Computed and incorporated the amino acid value and variance numbers

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

aminoscribe-0.4.0.tar.gz (6.9 MB view details)

Uploaded Source

Built Distribution

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

aminoscribe-0.4.0-py3-none-any.whl (6.9 MB view details)

Uploaded Python 3

File details

Details for the file aminoscribe-0.4.0.tar.gz.

File metadata

  • Download URL: aminoscribe-0.4.0.tar.gz
  • Upload date:
  • Size: 6.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for aminoscribe-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f2eea777006409b0443732fc779ed2dd5f302a4d6853b32501cc0f43cdbe3570
MD5 37820938d6c6cab6b67cf9733884a18b
BLAKE2b-256 0655e9bc592f96737a15505f64152d6ce193321b5a0ee1b6c9541f1027076d5a

See more details on using hashes here.

File details

Details for the file aminoscribe-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: aminoscribe-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for aminoscribe-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa1ee8df88c361113106188ce1bf0661ca09c5b2255038015c1dcb585120b1f4
MD5 01e51b6f432c552bf3c7c061ed38c4f8
BLAKE2b-256 e9818992d8e6f14814baa6cae01b47282caa67df4750379733d845046f824b11

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