Skip to main content

Add your description here

Project description

Import du package unipack et guide utilisation basique

import unipack

# Pour travailler avec un fichier contenant une seule entrée UniProt
uniprot_objet = unipack.from_file_to_uniprot('chemin_fichier.txt')

# Pour travailler avec un fichier contenant plusieurs entrées UniProt
collection_objet = unipack.from_file_to_collection('chemin_fichier.txt')

Description

Le package unipack fournit des outils pour manipuler des données UniProt au format texte. Il inclut deux classes principales :

  • Uniprot : Représente une entrée individuelle.
  • Collection : Représente une collection d'entrées UniProt.

Fonctionnalités principales

Création d'objets

À partir d'un fichier contenant une seule entrée UniProt

Utilisez la fonction from_file_to_uniprot pour créer un objet Uniprot :

uniprot_objet = unipack.from_file_to_uniprot("chemin_fichier.txt")

À partir d'un fichier contenant plusieurs entrées UniProt

Utilisez la fonction from_file_to_collection pour créer un objet Collection :

collection_objet = unipack.from_file_to_collection("chemin_fichier_collection.txt")

Détails des classes, méthodes, et exemples d'utilisation

Classe Uniprot

Représente une entrée UniProt individuelle.

Méthode Entrée Description Exemple d'utilisation et sortie
fasta_dump() Aucun Génère un fichier FASTA contenant l'ID, l'organisme, le nom du gène et la séquence. Entrée : uniprot_obj.fasta_dump()
Sortie : Fichier AC12345.fasta créé avec les données de l'objet.
molecular_weight() Aucun Retourne la masse moléculaire de la protéine en fonction de sa séquence. Entrée : uniprot_obj.molecular_weight()
Sortie : 50289.0 (masse moléculaire calculée).
average_hydrophobicity() Aucun Retourne l'hydrophobicité moyenne de la protéine. Entrée : uniprot_obj.average_hydrophobicity()
Sortie : 0.23 (hydrophobicité moyenne).
print_attributes() Aucun Affiche les attributs (ID, séquence, etc.) de l'objet. Entrée : uniprot_obj.print_attributes()
Sortie : Affiche dans la console :
ID: P12345
AC Number: AC12345
Organisme: Homo sapiens...

Classe Collection

Représente une collection d'objets UniProt.

Méthode Entrée Description Exemple d'utilisation et sortie
add(arg) str (chemin vers un fichier) ou Uniprot Ajoute un nouvel objet Uniprot à la collection. Entrée : collection.add(uniprot_obj)
Sortie : L'objet uniprot_obj est ajouté à la collection.
delet(uniprot_id) str (ID d'un objet Uniprot) Supprime un objet Uniprot de la collection à partir de son ID. Entrée : collection.delet("P12345")
Sortie : L'objet avec l'ID "P12345" est supprimé de la collection.
sort_by_lenght() Aucun Trie les objets Uniprot par longueur de séquence. Entrée : collection.sort_by_lenght()
Sortie : La collection est triée, du plus court au plus long.
filter_for_hydrophobic(min_hydro) int (seuil d'hydrophobicité) Retourne les objets dont l'hydrophobicité moyenne dépasse un seuil donné. Entrée : collection.filter_for_hydrophobic(0.5)
Sortie : Une liste des objets respectant le critère d'hydrophobicité moyenne.
__add__(collection_2) Collection Combine deux collections, en éliminant les doublons, pour en créer une nouvelle. Entrée : new_collection = collection1 + collection2
Sortie : Une nouvelle collection contenant les objets uniques des deux collections.
go_view() Aucun Retourne une liste unique des termes GO (Gene Ontology) présents dans la collection. Entrée : collection.go_view()
Sortie : { "GO:0008150": 3, "GO:0003674": 5 } (termes GO avec leur fréquence).
draw_ABRL(uniprot_id) str (ID d'un objet Uniprot) Génère un histogramme de l'abondance relative des acides aminés pour un objet donné. Entrée : collection.draw_ABRL("P12345")
Sortie : Histogramme enregistré sous le nom "P12345.png".
print_attributes() Aucun Affiche les attributs de chaque objet Uniprot dans la collection. Entrée : collection.print_attributes()
Sortie : Affiche dans la console les attributs de chaque objet Uniprot de la collection.

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

unipack-0.1.4.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

unipack-0.1.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file unipack-0.1.4.tar.gz.

File metadata

  • Download URL: unipack-0.1.4.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.4

File hashes

Hashes for unipack-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9e8605ef6451eedc2c16b9b66ef561665fdc3afc8fb7a7c555fa496b56acc63e
MD5 72eb4818f7b580ebd823dd3cb7f443b5
BLAKE2b-256 0664345fa735e4802fb6a15b356517ae6593af9f84daa172bf38b92d6b8ce73b

See more details on using hashes here.

File details

Details for the file unipack-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: unipack-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.4

File hashes

Hashes for unipack-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3f66f0d00351c75ae48e20b3006ce6d1824a190590be95c7089cfa36d2516481
MD5 f873c3e81b1a8209085ebe3490d87591
BLAKE2b-256 6a35a87cd1246de16666240f9065fe3e0e465d5b4b6e7aeac486602934211901

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