Skip to main content

Add your description here

Project description

The aim of uniprot-redis is to have a rapid access to uniprot data previously stored in redis instance, and querying them by uniprot protein ids.

Start and query uniprot-redis in a python environment with poetry

1. Install and start redis

Install redis following the website instruction : https://redis.io/docs/getting-started/

Then run a redis instance (it needs to run constantly so we recommand to use screen or equivalent)

screen -S redis
redis-server

then ctrl + A + D to quit the screen. screen -r redis if you want to go back to it.

Be aware that it will created a local "save file" of the instance (dump.rdb) in the directory you launch the command. You will need to launch redis-server in the directory where dump.rdb is stored if you want to retrieve the data later.

2. Install uniprot-redis

uniprot-redis is available as a pip package

pip install uniprot-redis

3. Run uniprot-redis and store informations

You need to store into redis the proteins you want to. uniprot-redis can load xml proteome file downloadable here : https://www.uniprot.org/proteomes?query=*

Choose your organisms of interest. For example if you want to have access to all human proteins you will need to download UP000005640 proteome file (https://www.uniprot.org/proteomes/UP000005640) Download => Download all => Format : XML => Download

  • Load a proteome into uniprot-redis
  1. Through python
from uniprot_redis.store import UniprotStore
store = UniprotStore()
protein_collection = store.load_uniprot_xml(file=<xml file>)
# You can identify this protein collection by keyword in order to retrieve it later
store.save_collection('my_id', protein_collection)
# List all collections
store.list_collection()

4. Interrogate uniprot-redis

You can now have an easy access to all stored protein through python code

# Access a protein through its uniprot id
store.get_protein('<uniprot id>')
# Iterator through a collection
store.get_protein_collection('<collection id>')
# Iterator through all proteins stored in the database
store.proteins

5. Uniprot store gestion

# Wipe all database
store.wipe_all()
# Delete a collection 
store.delete_collection('<collection id>')

See notebooks/uniprot_redis_demo.ipynb for usage examples

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_redis-1.8.3.tar.gz (7.6 MB view details)

Uploaded Source

Built Distribution

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

uniprot_redis-1.8.3-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file uniprot_redis-1.8.3.tar.gz.

File metadata

  • Download URL: uniprot_redis-1.8.3.tar.gz
  • Upload date:
  • Size: 7.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.3

File hashes

Hashes for uniprot_redis-1.8.3.tar.gz
Algorithm Hash digest
SHA256 b1a2e01714fa5485924b97df99a3dd74a0c450fc6f1775d37773b1a9d475be77
MD5 84caa3e17b8cf2985b1dd2b21a7d6f29
BLAKE2b-256 a9bdf2cb00ab7c14643aac1608384519519079cc14ecec7eff66baa27446c181

See more details on using hashes here.

File details

Details for the file uniprot_redis-1.8.3-py3-none-any.whl.

File metadata

File hashes

Hashes for uniprot_redis-1.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5a12e48d180c4cce3aa4f2921e938247d6e8394ebd419f4b6886bfd35965f0a3
MD5 de8c901bbe21a093c2f5c2c17735a866
BLAKE2b-256 2bd2aab693aba4ff1d6ccf75468237dc05388981d7bc2ff5957f61983738bbc1

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