Skip to main content

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

Metadata

Release files for uniprot-redis 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uniprot-redis 2.1.0
File Size Uploaded
uniprot_redis-2.1.0.tar.gz 7.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for uniprot-redis 2.1.0
File Interpreter ABI Platform
uniprot_redis-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 MB

Release files / uniprot_redis-2.1.0.tar.gz

Download URL uniprot_redis-2.1.0.tar.gz
Size 7.7 MB
Tags Source
SHA-256 checksum
How to use checksums
08fb9557474f4be1bf0739c0c3d3890e34deddd42a18771c79592717935b23ac
BLAKE2b-256 checksum
How to use checksums
1114b42ef650f5c3818c360a88ca05b5e447804a88b7e2aa286cb83abe31c4bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.3

Release files / uniprot_redis-2.1.0-py3-none-any.whl

Download URL uniprot_redis-2.1.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c33bda805296fdc31df8aadda7003cdad57adb454092a7f6ac33407ad9e304d
BLAKE2b-256 checksum
How to use checksums
09cf800c67c35d5a6a43009da3e19a9c0cb378fed7d581a34ac448ed6473f94a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.3

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page