Claude
Skills
Sign in
Back

tooluniverse-computational-biophysics

Included with Lifetime
$97 forever

Solve quantitative problems in biophysics — pharmacokinetics (PK volume of distribution, clearance, half-life), epidemiology (R0, attack rate), toxicology (LD50, NOAEL), population genetics (Hardy-Weinberg, Fst), enzyme kinetics (Michaelis-Menten), thermodynamics. Use for first-principles quantitative biology calculations, dose calculations, exposure assessment, and biophysical-property estimation.

Generalscripts

What this skill does


# Computational Biophysics & Quantitative Biology Skill

## 1. Recognize the Physical Process

The single most important step: identify what physical process the problem describes. In quantitative biology, almost every problem maps to one of these:

- **Drug enters body → distributes → is eliminated**: pharmacokinetics. Key quantities: dose, bioavailability, volume of distribution, clearance, half-life. The body is a compartment model.
- **Radioactive tracer decays over time**: nuclear medicine. Same math as drug elimination (exponential decay) but the rate constant is a physical property of the isotope, not a patient variable.
- **Pathogen spreads through population**: epidemiology. R₀ determines whether an epidemic grows or dies. Herd immunity threshold = 1 - 1/R₀. Every epidemic model starts here.
- **Ligand binds receptor**: binding equilibrium. At low [ligand], binding is linear. At saturation, all sites occupied. Kd = concentration at half-maximal binding. This same curve describes enzyme kinetics, drug-receptor occupancy, and surface adsorption.
- **Contaminant enters environment**: dilution + persistence. Two questions: what is the concentration after mixing (conservation of mass), and how long does it persist (exponential decay with environmental half-life)?
- **Two populations differ genetically**: population genetics. Fst measures differentiation. HWE tests if mating is random. Gene flow opposes drift.
- **Neurons communicate in a network**: computational neuroscience. Integrate-and-fire models, synaptic dynamics, balanced excitation/inhibition. Mean firing rate depends on input current relative to threshold.

Once you name the process, the mathematical structure follows. Solve algebraically first, substitute numbers second, and always check that units cancel correctly and the magnitude is physically reasonable.

## 2. Reasoning Patterns by Problem Type

These are not formulas. They are ways of thinking about what is happening physically.

### Conservation / Dilution Problems
Something is being spread into a larger volume, or two streams are mixing. The total amount of substance is conserved. Think: **amount_before = amount_after**, where amount = concentration x volume. This covers serial dilutions, mixing streams, stock solution preparation, and environmental discharge into rivers.

### Exponential Decay / Growth Problems
Something is disappearing (or growing) at a rate proportional to how much is currently there. The signature: "half-life" or "doubling time" appears in the problem. This single pattern covers drug clearance, radioactive decay, environmental persistence, bacterial growth, and epidemic doubling. The only things that change between applications are the rate constant and what is decaying.

### Saturation / Binding Problems
Something binds to a limited number of sites. At low concentrations, binding is proportional to concentration. At high concentrations, sites fill up and adding more has diminishing effect. This covers receptor-ligand binding, enzyme kinetics, surface adsorption, and oxygen-hemoglobin curves. The shape is always hyperbolic: response = max_response x [thing] / ([thing] + half_max_constant).

### Threshold / Crossover Problems
"At what point does X equal Y?" or "When does the concentration drop below the therapeutic level?" Set two expressions equal and solve. Examples: time to reach a target drug level, when an environmental concentration exceeds a safety limit, herd immunity threshold (where effective R drops to 1).

### Ratio / Rate Problems
Output = input x time, or output = concentration x flow rate. Clearance, flux, dosing rate, and drip rate calculations are all just dimensional analysis: arrange the given quantities so the units work out.

### Population Comparison Problems
Two groups are being compared. You need a measure of difference (Fst, odds ratio, relative risk) and a measure of whether the difference is real (p-value, confidence interval). Think: what is the effect size, and is it distinguishable from noise?

## 3. When to Compute vs. Estimate vs. Look Up

**Compute carefully** when:
- The answer affects a patient (drug dosing, diagnostic interpretation)
- The problem gives you exact numbers and asks for an exact answer
- You need to fit a curve to data (use scipy)

**Estimate and state uncertainty** when:
- The answer needs an order of magnitude (environmental risk, population-level)
- Input values are themselves uncertain (R0 estimates, BCF from log Kow regressions)
- Say: "This is approximately X, with the main uncertainty coming from Y"

**Look up via ToolUniverse** when:
- You need a physical constant: half-life, molecular weight, Kd, log Kow, allele frequency
- The user names a specific drug, compound, gene, or variant
- You want to validate your calculation against a known case

| Data needed | Tool to use |
|-------------|-------------|
| Molecular weight, log Kow, SMILES | `PubChem_get_CID_by_compound_name`, `PubChem_get_compound_properties_by_CID` |
| Drug PK properties, mechanism | `ChEMBL_get_molecule` |
| Binding affinity (Kd, Ki, IC50) | `BindingDB_search_by_target` |
| Allele frequencies | `gnomad_get_variant`, `MyVariant_query_variants` |
| Literature values (R0, BCF, etc.) | `EuropePMC_search_articles` |

**Just compute** when:
- The problem gives you all the numbers
- No specific real-world compound/gene is named

## 4. Python Computation Templates

**CRITICAL: When a problem gives you numbers and asks for a numerical answer, WRITE AND RUN Python code using the Bash tool.** Do not try to compute in your head — write a script, execute it, and report the result. Mental arithmetic on multi-step problems introduces errors. The templates below are starting points — adapt them to the specific problem, then EXECUTE.

**Answer Format Rules**: Match the precision and format the question expects. If data uses 2 decimal places, round to 2. For large numbers (>10^6), use scientific notation; if the question says "in units of 10^28", give just the coefficient. For small numbers, match the question's format (e.g., "1.776 × 10^-3" not "1.8e-3"). Give ONLY the number — no units or descriptions unless explicitly asked.

```
# Pattern for every computation problem:
# 1. Extract ALL given values from the problem — write them down with units
# 2. Identify EXACTLY what quantity the question asks for
# 3. Write a Python script connecting givens to the unknown
# 4. Run it with: python3 -c "..."
# 5. VERIFY: substitute your answer back into the original problem — does it make sense?
#    e.g., if computing a drip rate, check: rate × time = total volume?
#    e.g., if computing vaccine coverage, check: coverage × efficacy × population > herd immunity?
```

### Template 1: Exponential Decay / Growth

Covers: drug clearance, radioactive decay, environmental persistence, bacterial growth, epidemic doubling.

```python
import numpy as np

def exponential_process(initial, half_life, time):
    """Amount remaining after exponential decay. For growth, use negative half_life."""
    return initial * (0.5 ** (time / half_life))

def time_to_reach(initial, target, half_life):
    """Time for exponential process to reach a target value."""
    return half_life * np.log2(initial / target)

# Examples — same math, different domains:
# Drug: 500 mg dose, t½ = 6 h, after 24 h → 31.25 mg
# Radioactive: 20 mCi Tc-99m, t½ = 6 h, after 12 h → 5 mCi
# Environmental: 100 ppm pesticide, t½ = 30 days, after 90 days → 12.5 ppm
```

### Template 2: Conservation / Dilution / Mixing

Covers: C1V1=C2V2, stream mixing, serial dilutions. Core logic: `C1*V1 = C2*V2` (pass 3 knowns, solve for 4th). For mixing n streams: `final_conc = sum(Ci*Qi) / sum(Qi)`.

### Template 3: Threshold / Equilibrium Solver

Covers: when drug drops below therapeutic level, herd immunity threshold. Use `scipy.optimize.brentq(lambda x: func(x) - target, lo, hi)` to find the crossover point.

### Template 4: Saturation / Binding Curve

Covers: receptor

Related in General