Uniprot meta tool
this tool is designed to be useful and simple interface for UniProt.org knowlege base witch can be used to simply get protein metadata by its ID
NOTE: this package is in early stage of development so be careful!
installation
as simple as possible:
pip install uniprot-meta-tool
only dependencies are requests and jmespath
Examples
from uniprot_meta_tool import UniprotData
>>>up_data = UniprotData('P05067')
>>>up_data.name
'Amyloid-beta precursor protein'
>>>up_data.genes[0]
'APP'
>>>up_data.organism.common_name
'Human'
some util functions are also available:
get_molecular_functions(uniprot_data) -> List[str]:
returns list of molecular functions from keywords. accepts uniprot_id as string or UniprotData object
get_biological_processes(uniprot_data) -> List[str]:
returns list of biological processes from keywords.
get_pathways(uniprot_data: UniprotData) -> List[str]:
returns list of pathways (from Reactome DB using UniProt cross-reference)
utility to enrich dataframes (requires Pandas to be installed):
from uniprot_meta_tool.dataframe import enrich_df
df = enrich_df(
df, # pandas DataFrame
'protein_id', # name of column contains UniProt ID
['gene', 'protein_name', 'organism'] # list of parameters that should be added
)
Raw search
You can reach raw metadata from UniprotData(u_id).raw_data property.
You can use JMESPath query language to get something from raw data using
UniprotData(u_id).search() method
Configuration
You can set up basic parameters of how uniprot_meta_tool works with remote API and local storage, but be careful with this
from uniprot_meta_tool.data_parser import set_config
set_config(
meta_cache_dir='/your/local/folder', # default is %tmp%/uniprot_meta
use_cache=True, # if you set it to False, module will not store retrieved info to your disk
# and will perform new HTTP request every time you create UniprotData object
uniprot_rest_url='https://rest.uniprot.org/uniprotkb/{}' # have no idea why you could want to change it, but you can
)
MR and feature requests
Feel free to suggest features using GitHub issues and to implement something you need if you want to!
Metadata
Release files for uniprot-meta-tool 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uniprot_meta_tool-0.2.1.tar.gz | 6.5 kB | Without provenance | Details for uniprot_meta_tool-0.2.1.tar.gz |
Release files / uniprot_meta_tool-0.2.1.tar.gz
| Download URL | uniprot_meta_tool-0.2.1.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e218b08b525d414649fa1e3838cba346aa18a8af284814bafd5101596f25ca74
|
|
BLAKE2b-256 checksum How to use checksums |
c45d80a66b29ff0a5a6d9c5e27139eac1f31d5da77d43ffa1c977dc0bc633eaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.12
|
Security for uniprot-meta-tool 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.