Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

A simple client library for UniProt

Project description

Proteo

A simple Python library for working with UniProt, the Universal Protein resource.

Installation

pip install proteo

Usage

from proteo.uniprot import UniprotClient

# Initialize a client
u = UniprotClient()

# Use the get_protein method to retrieve a protein record by accession number
accession_number = "B5ZC00"
response = u.get_protein(accession_number)

# Protein data is returned as a dictionary
print(response['gene'])
#glyQS

print(response['recommended_name'])
#Glycine--tRNA ligase

print(response['sequence'])
#MKNKFKTQEELVNHLKTVGFVFANSEIYNGLANAWDYGPLGVLLKNNLKNLWWKEFVTKQKDVVGLDSAIILNPLVWKASGHLDNFSDPLIDCKNCKARYRADKLIESFDENIHIAENSSNEEFAKVLNDYEISCPTCKQFNWTEIRHFNLMFKTYQGVIEDAKNVVYLRPETAQGIFVNFKNVQRSMRLHLPFGIAQIGKSFRNEITPGNFIFRTREFEQMEIEFFLKEESAYDIFDKYLNQIENWLVSACGLSLNNLRKHEHPKEELSHYSKKTIDFEYNFLHGFSELYGIAYRTNYDLSVHMNLSKKDLTYFDEQTKEKYVPHVIEPSVGVERLLYAILTEATFIEKLENDDERILMDLKYDLAPYKIAVMPLVNKLKDKAEEIYGKILDLNISATFDNSGSIGKRYRRQDAIGTIYCLTIDFDSLDDQQDPSFTIRERNSMAQKRIKLSELPLYLNQKAHEDFQRQCQK

Response Dictionary

The protein response dictionary contains the following items:

Key Meaning
gene The gene coding the protein
name The protein's short name
organism The organism in which the protein is found
primary_accession_number The protein's UniProt accession number
recommended_name The protein's long/recommended name
sequence The amino acid sequence defining the protein

Exceptions

Proteo defines the following exceptions:

Exception Meaning
proteo.exceptions.ProteinNotFoundError Raised when no protein can be found for the accession number that was provided.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for proteo, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size proteo-1.0.1-py3-none-any.whl (5.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size proteo-1.0.1.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page