A step-by-step guide for scientists · Version 0.9.4 · Attention Labs
This tutorial assumes you have a terminal (also called "command line") open on your computer. If you have never used a terminal before, here is how to open one:
Cmd + Space and type "Terminal".Win + R and type powershell.Ctrl + Alt + T.Once your terminal is open, you will see a blinking cursor. This is where you type commands. Press Enter after each command to run it.
Copy and paste the following command into your terminal and press Enter:
pip install bbnuke
If you also want visualization features (heatmaps and report cards), install with:
pip install "bbnuke[viz]"
To verify the installation worked:
bbnuke --help
You should see something like:
BBB-Nuke: Blood-brain barrier penetration screening pipeline
usage: bbnuke [-h] {run,screen,heatmap,report,tutorial,score-single} ...
If you see an error like command not found, make sure Python (version 3.9 or later) and pip are installed on your system.
This is the simplest way to use BBB-Nuke. You provide one molecule as a SMILES string and get a full report back.
SMILES is a way to represent chemical structures as text. For example:
| Compound | SMILES |
|---|---|
| Aspirin | CC(=O)Oc1ccccc1C(=O)O |
| Caffeine | Cn1c(=O)c2c(ncn2C)n(C)c1=O |
| Serotonin | C1=CC2=C(C=C1O)C(=CN2)CCN |
| Dopamine | NCCc1ccc(O)c(O)c1 |
| Risperidone | CC1=C(C(=O)N2CCCCC2)ON=C1C3=CC=C(F)C=C3 |
You can find SMILES strings for your compounds on PubChem — search for any drug name and look for the "Canonical SMILES" field.
bbnuke score-single --smiles "CC(=O)Oc1ccccc1C(=O)O" --name aspirin
Breaking this down:
| Part | What it means |
|---|---|
bbnuke | The program name |
score-single | The command — score one molecule |
--smiles "..." | The SMILES string for your molecule (in quotes) |
--name aspirin | A label for your compound (can be anything) |
The command prints a JSON block to your screen. Here are the key fields:
"p_bbb": 0.914 ← Final BBB penetration probability (0 to 1)
"cns_mpo score": 6.0 ← CNS-MPO desirability score (0 to 6)
"clogd": 1.31 ← Calculated LogD at pH 7.4
"veto": false ← Whether an efflux transporter blocked this compound
Interpreting P_BBB:
| P_BBB Value | Meaning |
|---|---|
| Above 0.8 | High likelihood of crossing the BBB |
| 0.4 to 0.8 | Moderate — may cross under favorable conditions |
| Below 0.4 | Low likelihood of BBB penetration |
| Near 0 | Vetoed — efflux transporter pumps it back out |
By default, the result is printed to your screen. To save it to a file instead:
bbnuke score-single --smiles "CC(=O)Oc1ccccc1C(=O)O" --name aspirin > aspirin_result.json
The > symbol tells the terminal to write the output to a file called aspirin_result.json instead of displaying it.
When you have more than one compound to test, use the batch run command. This is the most common workflow.
Create a CSV file (you can use Excel, Google Sheets, or any text editor) with two columns: compound_id and smiles.
Save it as compounds.csv:
compound_id,smiles
serotonin,C1=CC2=C(C=C1O)C(=CN2)CCN
dopamine,NCCc1ccc(O)c(O)c1
caffeine,Cn1c(=O)c2c(ncn2C)n(C)c1=O
aspirin,CC(=O)Oc1ccccc1C(=O)O
risperidone,CC1=C(C(=O)N2CCCCC2)ON=C1C3=CC=C(F)C=C3
Tips for the CSV file:
compound_id,smilesNavigate to the folder where your CSV is located. For example, if it is on your Desktop:
cd ~/Desktop
Then run:
bbnuke run --input compounds.csv --output results.json
| Part | What it means |
|---|---|
run | The batch screening command |
--input compounds.csv | Your input file |
--output results.json | Where to save the results |
BBB-Nuke will process each compound and print a summary:
[OK] Processed 5 compounds, 4 passed MPO filter
[OK] Results written to results.json
Open results.json in a text editor to see the detailed output for each compound.
If you prefer to work with results in Excel or Google Sheets:
bbnuke run --input compounds.csv --output results.csv --format csv
The only change is --format csv at the end.
| Column | Description |
|---|---|
compound_id | The name you gave the compound |
smiles_input | The SMILES you provided |
smiles_standardized | Cleaned-up SMILES after standardization |
mw | Molecular weight (Daltons) |
logp | Octanol-water partition coefficient |
tpsa | Topological polar surface area (Ų) |
hbd | Hydrogen bond donors |
hba | Hydrogen bond acceptors |
clogd | Calculated LogD at pH 7.4 |
cns_mpo | CNS-MPO score (0 to 6) |
passed_mpo_filter | True/False — scored ≥ 3.0 on CNS-MPO? |
p_bbb | Final BBB penetration probability (0 to 1) |
affinity_MDR1_HUMAN ... | Binding probability per efflux transporter (9 columns) |
The heatmap gives you a bird's-eye view of your entire screening. Each compound is a row, each property is a column, and cells are color-coded.
# From JSON results
bbnuke heatmap --input results.json
# From CSV results
bbnuke heatmap --input results.csv
# Custom output path, don't auto-open browser
bbnuke heatmap --input results.json --output my_heatmap.html --no-open
The heatmap is divided into four sections:
Properties | CNS-MPO | Efflux Transporters (9) | P_BBB
MW LogP TPSA | MPO | MDR1 ABCG2 MRP1 MRP2 ... | P_BBB
HBD HBA cLogD | | |
Interacting with the heatmap:
Report cards give you a detailed visual summary for each compound — including a 2D structure drawing, a radar chart of CNS-MPO subscores, and a bar chart of efflux transporter binding.
# All compounds
bbnuke report --input results.json
# From CSV (re-runs pipeline for full data)
bbnuke report --input results.csv
# Single compound only
bbnuke report --input results.json --compound-id caffeine
# Custom output, don't open browser
bbnuke report --input results.json --output my_report.html --no-open
1. Header — compound name, SMILES, and a color-coded P_BBB badge:
2. Molecule structure — a 2D drawing generated from the SMILES string.
3. CNS-MPO radar chart — a spider plot with 6 axes (MW, LogP, TPSA, HBD, pKa, cLogD). Bigger coverage = better drug-likeness for the brain.
4. Efflux bar chart — horizontal bars for 9 efflux transporters. A dashed red line at 0.7 marks the veto threshold.
5. Properties table — all physicochemical data in one place.
For large screens, the toolbar at the top of the report lets you:
Click the moon/sun icon in the top-right corner to toggle themes. Chart labels update automatically.
↑ Back to topSay you have 20 candidate compounds and want to screen them for BBB penetration.
compound_id,smiles
compound_01,CCO
compound_02,c1ccccc1
compound_03,CC(=O)Oc1ccccc1C(=O)O
...
Save as my_compounds.csv.
bbnuke run --input my_compounds.csv --output my_results.json
bbnuke run --input my_compounds.csv --output my_results.csv --format csv
bbnuke heatmap --input my_results.json --output screening_heatmap.html
Open the HTML file in your browser. Hover over cells to see values. Look for compounds that are green in the P_BBB column.
bbnuke report --input my_results.json --output screening_report.html
Use the sort buttons to rank compounds by P_BBB. Click a compound in the sidebar to jump to its card.
bbnuke report --input my_results.json --compound-id compound_03 --output compound_03_report.html
If your CSV uses name instead of compound_id, and SMILES instead of smiles:
bbnuke run --input my_data.csv --output results.json --id-col name --smiles-col SMILES
bbnuke score-single --smiles "Cn1c(=O)c2c(ncn2C)n(C)c1=O" --name caffeine
The CNS-MPO score ranges from 0 to 6. Compounds scoring below 3.0 are flagged as unlikely to penetrate the BBB. They still get a P_BBB score, but skip efflux transporter screening.
If any of the 9 efflux transporter proteins has a binding probability above 0.7, the compound is vetoed — efflux pumps would actively transport it back out of the brain. A vetoed compound gets a P_BBB near 0.
| Short Name | Full Name | Role |
|---|---|---|
| MDR1 | P-glycoprotein | Major drug efflux pump at the BBB |
| ABCG2 | Breast cancer resistance protein | Pumps out many small molecules |
| MRP1 | Multidrug resistance protein 1 | Organic anion transporter |
| MRP2 | Multidrug resistance protein 2 | Similar to MRP1, expressed at BBB |
| MRP4 | Multidrug resistance protein 4 | Nucleotide and drug efflux |
| MRP5 | Multidrug resistance protein 5 | Cyclic nucleotide efflux |
| MATE1 | Multidrug and toxin extrusion 1 | Organic cation transporter |
| OAT3 | Organic anion transporter 3 | Removes organic anions from brain |
| A4D1D2 | ABCB1 variant | P-glycoprotein variant |
| Scale | Time | Hardware |
|---|---|---|
| 1 compound | A few seconds | CPU |
| 10 compounds | ~30 seconds | CPU |
| 100 compounds | A few minutes | CPU |
| 1,000+ compounds | Faster with GPU | GPU recommended |
To use a GPU for large batches:
export BBNUKE_PSICHIC_DEVICE=cuda
bbnuke run --input large_library.csv --output results.json
pip install bbnuke
If using conda, activate the right environment first:
conda activate my_environment
pip install bbnuke
Use --no-open and open the file manually:
bbnuke heatmap --input results.json --no-open
open bbnuke_heatmap.html # Mac
xdg-open bbnuke_heatmap.html # Linux
start bbnuke_heatmap.html # Windows
| What you want to do | Command |
|---|---|
| Score one molecule | bbnuke score-single --smiles "..." --name X |
| Screen many (JSON) | bbnuke run --input compounds.csv --output results.json |
| Screen many (CSV) | bbnuke run --input compounds.csv --output results.csv --format csv |
| Generate heatmap | bbnuke heatmap --input results.json |
| Report cards (all) | bbnuke report --input results.json |
| Report card (one) | bbnuke report --input results.json --compound-id caffeine |
| Open this tutorial | bbnuke tutorial |
| Get help | bbnuke --help |