Skip to main content

Package that provides information on proteins

Project description

README

Overview

The module UniprotXplorer contains two Python files: uniprot_collection.py and uniprot.py, which provide tools for analyzing UniProt protein data.


uniprot.py

The uniprot.py file defines the Uniprot class, which represents a protein object with the following features:

  • Attributes:

    • identification: Protein Id
    • ac_number: Accession number
    • org_species: Organism species
    • gene_name: Gene name
    • peptide_seq: Amino acid sequence
    • go_id: List of associated Gene Ontology Ids
  • Methods:

    • fasta_dump(): Exports the protein sequence in FASTA format
    • molecular_weight(): Calculates the molecular weight of the protein
    • average_hydrophobicity(): Computes the average hydrophobicity of the protein

uniprot_collection.py

The uniprot_collection.py file defines the Collection class, which manages multiple Uniprot objects. It includes:

  • Attributes:

    • uniprot_list: A list of Uniprot objects
  • Methods:

    • add_uniprot(contenu_uniprot): Adds proteins to the collection
    • del_uniprot(uniprot_id): Deletes a protein from the collection by Id
    • sort_by_length(): Sorts proteins by sequence length
    • filter_for_hydrophobic(min_hydro): Filters proteins by average hydrophobicity
    • filter(): Filters proteins based on specific criteria
    • go_view(): Counts occurrences of GO Ids across all proteins
    • draw_ABRL(uniprot_id): Generates a histogram of ABRL for a specific protein

Examples of use

This demonstration allows you to test the "fasta_dump" method of the Uniprot class.

import uniprot_xplorer.uniprot
import os 

def open_uniprot_file(file_path):
  with open(file_path, "r") as file:
    return file.read()
  
data = os.path.join(os.curdir,<"data.txt">)

uniprot_data = uniprot_xplorer.uniprot.Uniprot(open_uniprot_file(data))

# you have created an output folder with the fasta file inside
uniprot_data.fasta_dump()

This demonstration allows you to test the "add_uniprot" method of the Collection class.

import uniprot_xplorer.uniprot_collection 
import os

def open_uniprot_file(file_path):
  with open(file_path, "r") as file:
    return file.read()

data = os.path.join(os.curdir,<"data.txt">) # if there is one protein
data2 = os.path.join(os.curdir,<"data2.txt">) # if there is five proteins

uniprot_data = open_uniprot_file(data)
uniprot_data2 = open_uniprot_file(data2)

# creation of the collection object
collection = uniprot_xplorer.uniprot_collection.Collection()

# you added to the collection one protein
collection.add_uniprot(uniprot_data)
# you added to the collection five proteins, you have now 6 proteins
collection.add_uniprot(uniprot_data2)

print(collection)

Authors

  • Salma El AOUDATI
  • Elsa BALIGAND

Date : 2024-11-22

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

uniprot_xplorer-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

uniprot_xplorer-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for uniprot_xplorer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 170701857a724a25ff34f688f4dc3090dde1babdf8fd86b1c31c92763f85c67b
MD5 bac7ff58476ea5cc2cf28bffab91e3f4
BLAKE2b-256 c90be07ce7315277db2227f465f06c246eea41c0802540c3c1c77682f0f0f47b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uniprot_xplorer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0ec90f8ef25db2ada06f01e20a25f537d0da26e36e4e4ecba58dcd2b64e86a2
MD5 8f11f5639d50a238f441e406ead7929e
BLAKE2b-256 dab2aaa89bbf9488822890ecd27de5cbc5de04a910f80a707ab2517da3675931

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