A translator of Broad and JUMP ids to more conventional names.
Project description
Broad_Babel
Minimal name translator of JUMP consortium.
Installation
pip install broad-babel
Broad sample to standard
You can fetch a single value
from broad_sample.query import sample_to_standard
broad_to_standard("BRD-K18895904-001-16-1")
# -> 'KVWDHTXUZHCGIO-UHFFFAOYSA-N'
If you provide multiple strings it will return dictionary.
broad_to_standard(("BRD-K36461289-001-05-8", "ccsbBroad304_16164"))
# {'BRD-K36461289-001-05-8': 'SCIMP', 'ccsbBroad304_16164': 'PIMZUZSSNYHVCU-KBLUICEQSA-N'}
Export database as csv
from broad_sample.query import export_csv
export_csv("./output.csv")
Custom querying
The available fields are:
- perturbation: Dataset of origin for a given entry
- JCP2022: Identifier from the JUMP dataset
- standard_key: Gene Entrez id for gene-related perturbations, and InChIKey for compound perturbations
- broad_sample: Internal Broad ID
- pert_type: Type of perturbation, options are trt (treatment), control, negcon (Negative Control), poscon_cp (Positive Control, Compound Probe), poscon_diverse, poscon_orf, and poscon (Positive Control).
- NCBI_Gene_ID: NCBI identifier, only applicable to ORF and CRISPR
You can fetch any field using another (note that the output is a list of tuples)
run_query(query="JCP2022_915119", input_column="JCP2022", output_column="broad_sample")
# [('ccsbBroad304_16164',)]
Note that there are some duplicates that arise from both between orf and crispr perturbations, but also within orf standard_keys.
run_query("ccsbBroad304_00900", input_column = "broad_sample", output_column = "*")
# [('crispr', 'JCP2022_803621', 'KCNN1', 'ccsbBroad304_00900', 'trt', None),
# ('orf', 'JCP2022_900842', 'KCNN1', 'ccsbBroad304_00900', 'trt', None),
# ('Target1_orf', None, 'KCNN1', 'ccsbBroad304_00900', 'trt', None)]
It is also possible to use fuzzy querying by changing the operator argument and adding "%" to out key.
run_query(
"BRD-K21728777%",
input_column="broad_sample",
output_column="*",
operator="LIKE",
)
# [('compound',
# 'JCP2022_037716',
# 'IVUGFMLRJOCGAS-UHFFFAOYSA-N',
# 'BRD-K21728777-001-02-3',
# 'control',
# 'poscon_cp'),
# ('Target2_compound',
# None,
# 'IVUGFMLRJOCGAS-UHFFFAOYSA-N',
# 'BRD-K21728777-001-02-3',
# 'control',
# 'poscon_cp')]
Additional documentation
Metadata sources and additional documentation is available here.
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
broad_babel-0.1.15.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for broad_babel-0.1.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cb0de0f399e71b25b2d35cfec3ede873a4d879f1176537eb30efb4a7624d18b |
|
MD5 | b632ddb6232fbea25ecf33e23db0b082 |
|
BLAKE2b-256 | e72e0557c39bd6f5186356cc00b5552385100aa4f7a4d4f3e3a48c7f3b0b2b60 |