UniProt SNP variation retrieval and processing toolkit
Project description
UniRet
UniRet is a command-line toolkit for retrieving and processing UniProt SNP variation data via the EBI Proteins API.
Installation
git clone https://github.com/sushi-cpu/UniRet.git
cd UniRet
pip install -e .
After install, the uniret command is available globally.
Quick start
Run the full pipeline (fetch → parse → sort) in one command:
uniret run -i proteins.xlsx -o ./results
Output layout:
results/
├── json/ # raw variation JSONs from EBI
├── variations/ # parsed flat CSV/TSV/JSON tables
└── sorted/ # per-protein folders split by variation type
└── P12345_variations/
├── Natural variant.csv
├── Mutagenesis.csv
└── ...
Input formats
UniProt IDs can be supplied in any combination of:
| Method | Example |
|---|---|
| Excel file | -i proteins.xlsx (needs a UniprotID column) |
| CSV / TSV | -i proteins.csv (same column requirement) |
| Plain text | -i ids.txt (one ID per line) |
| Inline args | uniret fetch snp P12345 Q8N158 -o ./out |
Commands
uniret run — full pipeline
uniret run -i proteins.xlsx -o ./results
uniret run P12345 Q8N158 -o ./results -f tsv
uniret run -i ids.txt -o ./results --skip-fetch # re-use existing JSONs
uniret fetch snp — fetch variation data
uniret fetch snp -i proteins.xlsx -o ./data/json
uniret fetch snp P12345 Q8N158 -o ./data/json --delay 0.5
uniret fetch info — fetch general UniProt entries
uniret fetch info -i proteins.xlsx -o ./data/json
uniret fetch info P12345 -o ./data/json
uniret parse snp — parse variation JSONs
uniret parse snp -d ./data/json -o ./data/variations -f csv
uniret parse snp -d ./data/json -o ./data/variations -f tsv
uniret parse snp -d ./data/json -o ./data/variations -f json
uniret parse info — parse UniProt info JSONs
uniret parse info -d ./data/json -o ./data/info -f csv
uniret sort — split variations by type
uniret sort -d ./data/variations -o ./data/sorted -f csv
Options reference
| Option | Commands | Default | Description |
|---|---|---|---|
-i, --input |
fetch, run | — | Input file of UniProt IDs |
-o, --output-dir |
all | required | Output directory |
-f, --format |
parse, sort, run | csv |
Output format: csv, tsv, json |
-d, --json-dir |
parse | required | Directory of JSON files to parse |
-d, --variations-dir |
sort | required | Directory of parsed variation files |
--delay |
fetch, run | 0.3 |
Seconds between API requests |
--skip-fetch |
run | False |
Skip fetch, re-use existing JSONs |
Output columns (variation tables)
| Column | Source |
|---|---|
type, wildType, mutatedType, begin, end |
Core variation fields |
xref_name, xref_id, xref_url |
Flattened from xrefs |
pred_valType, pred_score, pred_algorithmName |
Flattened from predictions |
loc_loc, loc_seqId, loc_source |
Flattened from locations |
clin_type, clin_sources, clin_reviewStatus |
Flattened from clinicalSignificances |
pop_populationName, pop_frequency, pop_source |
Flattened from populationFrequencies |
Requirements
- Python 3.10+
click,requests,pandas,openpyxl,tqdm
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uniret-1.0.0.tar.gz.
File metadata
- Download URL: uniret-1.0.0.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5261aa60cc81afccb9889ec856d47d414c3cac8fb9828f19fa31de8eec47058
|
|
| MD5 |
6ec3eba5832ef92914f0eaa8b483f914
|
|
| BLAKE2b-256 |
97b8f9302410f8aead95287039df79cd0a49cf5a23314973fade0fb4d9e76b8a
|
File details
Details for the file uniret-1.0.0-py3-none-any.whl.
File metadata
- Download URL: uniret-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
670479fcf7ae33966495440626f6d51961e4c51f76125759c6e1401af6f2b7c4
|
|
| MD5 |
8b83aa2634de593fa8c89b4f550fd536
|
|
| BLAKE2b-256 |
7bc9bdf1916f9c0ed9dd87ce911bc14431b70d71d4f4ba2a61bb7d6fd7b6e497
|