Skip to main content

A Python package to cook DNA variants (SNPs, deletions, duplications)

Project description

      .----------------.
  _.-'    FASTA FOOD    '-._
.'__________________________'.
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
  |   _  ..  _  ..  _  ..  |
  |  / \/  \/ \/  \/ \/  \ |
  |  \ /\  /\ /\  /\ /\  / |
  |   '  ''  '  ''  '  ''  |
!____________________________!
'----------------------------'

    --- fastafood v0.1.0 ---
     "From PASTA to FASTA."

fastafood est une bibliothèque Python et un outil en ligne de commande (CLI) conçu pour manipuler des séquences ADN, générer des variants (SNPs, délétions, duplications) et effectuer des traductions protéiques en masse.

Installation

Installation locale

git clone https://github.com/lthomes/fastafood.git
cd fastafood
pip install .

Utilisation (CLI)

Une fois installé, l'outil est disponible via la commande fastafood.

1. Entrée des données

Vous pouvez fournir un fichier FASTA ou une séquence brute :

  • Fichier : fastafood --file genome.fasta
  • Séquence brute : fastafood --seq ATGCATGC

2. Transformations de base

  • Reverse Complement : --revcomp
  • Trimming (5' et 3') : --trim 5 10 (enlève 5 bases au début et 10 à la fin)

3. Génération de Variants

Générez automatiquement des mutations basées sur votre séquence d'entrée :

  • SNPs : --snps (génère tous les SNPs possibles)
  • Délétions : --deletions 2 (tailles des délétions)
  • Duplications : --duplications 3
  • Protection : --protect 1 2 10 (empêche la mutation des positions 1, 2 et 10)
  • Pas de délétion : --step 3 (taille du décalage de la fenêtre)

4. Traduction

  • Standard : --translate
  • Scanning (3 cadres) : --scan-translate
  • Gestion du Stop : --stop yes (tronque au premier codon STOP) ou --stop no (défaut)

5. Formatage de sortie

  • One-line (défaut) : Chaque séquence sur une seule ligne.
  • Split : Découpage à 60 caractères (format FASTA standard).
  • Usage : fastafood --file in.fa --format split --out out.fa

Utilisation comme bibliothèque

Vous pouvez importer les classes directement dans vos scripts Python :

from fastafood import DNASequence, VariantGenerator


## Créer une séquence
dna = DNASequence("ATGCGTACGTAG", name="ma_sequence")

## Générer des SNPs
gen = VariantGenerator(dna)
for variant in gen.generate_snps():
    print(variant)

## Traduire
proteine = dna.translate(stop_at_stop=True)

Fonctionnalités techniques

  • Validation : Vérifie la validité des bases ADN (A, T, C, G).
  • Flexibilité : Supporte les indexations incrémentales automatiques (_0, _1, ...) pour éviter les noms de séquences en doublon lors des exports massifs.

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

fastafood-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

fastafood-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastafood-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7c90e6e9ca074b3a59392c0cf8a5442bd1139a452b2bc104e253ac1c67ddcbd2
MD5 6cf1a839d221868c3faef2c808c4d196
BLAKE2b-256 8703f13f4cde40c2ba186521ee861b371c1f52b6ca8fa3e0f500f8e0ab96e59d

See more details on using hashes here.

Provenance

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

Publisher: python-publish.yml on lthomes/fastafood

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

File details

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

File metadata

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

File hashes

Hashes for fastafood-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b06ae4909103859a8245a78984ba454e648b708aea4094a381c2bec591db5922
MD5 9bd0fd225b13028570c9b76fdab17064
BLAKE2b-256 e52d28636b433f5b18ac1d3329fe44bed77f72a09f73e68186d010b5249e55f1

See more details on using hashes here.

Provenance

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

Publisher: python-publish.yml on lthomes/fastafood

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