Skip to main content

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. Note that only ORF datasets have an associated broad_id by default.

from broad_babel.query import broad_to_standard

broad_to_standard("ccsbBroad304_99994") 
# 'LacZ'

If you provide multiple strings it will return dictionary.

from broad_babel.query import broad_to_standard

broad_to_standard(("ccsbBroad304_09930", "ccsbBroad304_16164")) 

# {'ccsbBroad304_09930': 'SCIMP', 'ccsbBroad304_16164': 'NAP1L5'}

Wildcard search

You can also use sqlite bindings. For instance, to get all the samples that start as "poscon" you can use:

from broad_babel.query import run_query

run_query(query="poscon%", input_column="pert_type", output_columns="JCP2022,standard_key,plate_type,pert_type", operator="LIKE")

# [(None, 'LRRMQNGSYOUANY-OMCISZLKSA-N', 'compound', 'poscon_cp'),
#  (None, 'DHMTURDWPRKSOA-RUZDIDTESA-N', 'compound', 'poscon_diverse'),
#  ...
#  ('JCP2022_913605', 'CDK2', 'orf', 'poscon_orf'),
#  ('JCP2022_913622', 'CLK1', 'orf', 'poscon_cp')]

Make mappers for quick renaming

This is very useful when you need to map from a long list of perturbation names. The following example shows how to map all the perturbations in the compound plate from JCP id to perturbation type.

from broad_babel.query import get_mapper

mapper = get_mapper(query="compound", input_column="plate_type", output_columns="JCP2022,pert_type")

Export database as csv

from broad_babel.query import export_csv

export_csv("./output.csv")

Custom querying

The available fields are:

  • standard_key: Gene Entrez id for gene-related perturbations, and InChIKey for compound perturbations
  • JCP2022: Identifier from the JUMP dataset
  • plate_type: Dataset of origin for a given entry
  • NCBI_Gene_ID: NCBI identifier, only applicable to ORF and CRISPR
  • 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).

You can fetch any field using another (note that the output is a list of tuples)

from broad_babel.query import run_query

run_query(query="JCP2022_915119", input_column="JCP2022", output_columns="broad_sample")
# [('ccsbBroad304_16164',)]

It is also possible to use fuzzy querying by changing the operator argument and adding "%" to out key. For example, to get the genes in the "orf" dataset whose name start with "RBP"(some of which are retinol-binding proteins) we can do:

from broad_babel.query import run_query

[x[:2] for x in run_query(
    "RBP%",
    input_column="standard_key",
    output_columns="standard_key,JCP2022,plate_type",
    operator="LIKE",
    ) if x[2]=="orf"]

# [('RBP7', 'JCP2022_904406'), ('RBPJ', 'JCP2022_906023'), ('RBP4', 'JCP2022_906415'),
# ('RBPMS', 'JCP2022_902435'), ('RBP2', 'JCP2022_914559'), ('RBP2', 'JCP2022_906413'),
# ('RBP3', 'JCP2022_906414'), ('RBP1', 'JCP2022_910341')]

Note that we also got RBPMS here, which is actually RNA-binding protein with multiple splicing, so use this with caution.

Additional documentation

Metadata sources and additional documentation is available here.

Note that Babel only contains metadata of JUMP compounds and genes, and may not contain sample information from other projects (e.g., LINCS). A more comprehensive table to map "broad ids" to standard chemical ids (e.g., SMILES, InChiKey) can be found here.

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

broad_babel-0.1.31.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

broad_babel-0.1.31-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file broad_babel-0.1.31.tar.gz.

File metadata

  • Download URL: broad_babel-0.1.31.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for broad_babel-0.1.31.tar.gz
Algorithm Hash digest
SHA256 95eebe2cfdf50a64f92b8a9fd6f9b0899f5f3e9440c15521b8f67e9ccfe5935d
MD5 d89f8ff30e8b39a6732e6e8fdab5cf8b
BLAKE2b-256 5d901165527481d512a33e04bac4bd3adc8c36978b09a6b9d808fee5a05a1855

See more details on using hashes here.

File details

Details for the file broad_babel-0.1.31-py3-none-any.whl.

File metadata

  • Download URL: broad_babel-0.1.31-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for broad_babel-0.1.31-py3-none-any.whl
Algorithm Hash digest
SHA256 7a8a4637d38d67a8831bff8d9cf742ed97c6dbb9c1f611edc6657db9b4d89b72
MD5 faa68ef27a02e0265ba8449580c4f92f
BLAKE2b-256 7958d9d58ea3dfdb7a28170f1ebe55b8bcdb7ef5a778205907e77a615fdedfce

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