tooluniverse-computational-biophysics
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseComputational Biophysics & Quantitative Biology Skill
计算生物物理与定量生物学技能
1. Recognize the Physical Process
1. 识别物理过程
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.
最重要的一步:确定问题描述的物理过程。在定量生物学中,几乎每个问题都对应以下类别之一:
- 药物进入体内→分布→消除:pharmacokinetics。关键参数:剂量、生物利用度、分布容积、清除率、半衰期。人体是一个房室模型。
- 放射性示踪剂随时间衰变:核医学。数学模型与药物消除相同(指数衰减),但速率常数是同位素的物理属性,而非患者变量。
- 病原体在人群中传播:epidemiology。R₀决定疫情是扩散还是消退。群体免疫阈值 = 1 - 1/R₀。所有疫情模型均以此为基础。
- 配体与受体结合:结合平衡。配体浓度较低时,结合呈线性;饱和状态下,所有位点被占据。Kd = 半数最大结合浓度。该曲线同样适用于酶动力学、药物-受体占据率和表面吸附。
- 污染物进入环境:稀释+持久性。两个核心问题:混合后的浓度是多少(质量守恒),以及能持续多久(环境半衰期的指数衰减)?
- 两个种群存在遗传差异:群体遗传学。Fst衡量分化程度。HWE检验交配是否随机。基因流动与遗传漂变相互对抗。
- 神经元在网络中通信:计算神经科学。积分-发放模型、突触动力学、兴奋/抑制平衡。平均放电率取决于输入电流与阈值的相对关系。
确定过程后,数学结构随之明确。先进行代数求解,再代入数值,始终检查单位是否抵消正确、结果量级是否符合物理合理性。
2. Reasoning Patterns by Problem Type
2. 按问题类型划分的推理模式
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).
“X何时等于Y?”或“浓度何时降至治疗水平以下?”将两个表达式相等并求解。示例:达到目标药物浓度的时间、环境浓度超过安全限值的时间、群体免疫阈值(有效R降至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?
对比两个群体。需要差异度量(Fst、优势比、相对风险)和差异真实性度量(p值、置信区间)。核心思考:效应量是多少,是否可与噪声区分?
3. When to Compute vs. Estimate vs. Look Up
3. 计算、估算与查询的适用场景
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 | |
| Drug PK properties, mechanism | |
| Binding affinity (Kd, Ki, IC50) | |
| Allele frequencies | |
| Literature values (R0, BCF, etc.) | |
Just compute when:
- The problem gives you all the numbers
- No specific real-world compound/gene is named
需精确计算的情况:
- 答案影响患者(药物剂量、诊断解读)
- 问题给出精确数值并要求精确答案
- 需要将曲线拟合到数据(使用scipy)
需估算并说明不确定性的情况:
- 答案需要数量级(环境风险、群体层面)
- 输入值本身存在不确定性(R₀估算、基于log Kow回归的BCF)
- 表述方式:“此结果约为X,主要不确定性来自Y”
需通过ToolUniverse查询的情况:
- 需要物理常数:半衰期、分子量、Kd、log Kow、等位基因频率
- 用户提及特定药物、化合物、基因或变异体
- 需要验证计算结果与已知案例是否一致
| 需要的数据 | 使用工具 |
|---|---|
| Molecular weight, log Kow, SMILES | |
| 药物PK特性、作用机制 | |
| 结合亲和力(Kd, Ki, IC50) | |
| 等位基因频率 | |
| 文献数值(R₀, BCF等) | |
直接计算的情况:
- 问题提供所有所需数值
- 未提及具体现实世界的化合物/基因
4. Python Computation Templates
4. Python计算模板
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.
undefined重要提示:当问题给出数值并要求数值答案时,使用Bash工具编写并运行Python代码。不要尝试心算——编写脚本、执行并报告结果。多步骤问题的心算会引入错误。以下模板为起点——根据具体问题调整后执行。
答案格式规则:匹配问题要求的精度和格式。若数据保留2位小数,结果也保留2位。大数(>10^6)使用科学计数法;若问题要求“以10^28为单位”,仅给出系数。小数匹配问题格式(例如:“1.776 × 10^-3”而非“1.8e-3”)。仅给出数字——除非明确要求,否则不附带单位或描述。
undefinedPattern for every computation problem:
所有计算问题的通用模式:
1. Extract ALL given values from the problem — write them down with units
1. 从问题中提取所有给定值——写下数值及单位
2. Identify EXACTLY what quantity the question asks for
2. 明确问题要求计算的精确量
3. Write a Python script connecting givens to the unknown
3. 编写Python脚本连接已知值与未知量
4. Run it with: python3 -c "..."
4. 使用以下命令运行: python3 -c "..."
5. VERIFY: substitute your answer back into the original problem — does it make sense?
5. 验证: 将答案代入原问题——是否合理?
e.g., if computing a drip rate, check: rate × time = total volume?
例如: 计算滴注速率时,检查: 速率 × 时间 = 总容积?
e.g., if computing vaccine coverage, check: coverage × efficacy × population > herd immunity?
例如: 计算疫苗覆盖率时,检查: 覆盖率 × 效力 × 人口 > 群体免疫阈值?
undefinedundefinedTemplate 1: Exponential Decay / Growth
模板1: 指数衰减/增长
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)适用场景:药物清除、放射性衰变、环境持久性、细菌生长、疫情倍增。
python
import numpy as np
def exponential_process(initial, half_life, time):
"""指数衰变后的剩余量。增长时使用负半衰期。"""
return initial * (0.5 ** (time / half_life))
def time_to_reach(initial, target, half_life):
"""指数过程达到目标值所需时间。"""
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
药物: 500 mg剂量,t½ = 6 h,24小时后→31.25 mg
Radioactive: 20 mCi Tc-99m, t½ = 6 h, after 12 h → 5 mCi
放射性: 20 mCi Tc-99m,t½ = 6 h,12小时后→5 mCi
Environmental: 100 ppm pesticide, t½ = 30 days, after 90 days → 12.5 ppm
环境: 100 ppm农药,t½ = 30天,90天后→12.5 ppm
undefinedundefinedTemplate 2: Conservation / Dilution / Mixing
模板2: 守恒/稀释/混合
Covers: C1V1=C2V2, stream mixing, serial dilutions. Core logic: (pass 3 knowns, solve for 4th). For mixing n streams: .
C1*V1 = C2*V2final_conc = sum(Ci*Qi) / sum(Qi)适用场景:C1V1=C2V2、流体混合、连续稀释。核心逻辑:(已知3个参数,求解第4个)。多流体混合:。
C1*V1 = C2*V2final_conc = sum(Ci*Qi) / sum(Qi)Template 3: Threshold / Equilibrium Solver
模板3: 阈值/平衡求解器
Covers: when drug drops below therapeutic level, herd immunity threshold. Use to find the crossover point.
scipy.optimize.brentq(lambda x: func(x) - target, lo, hi)适用场景:药物浓度降至治疗水平以下的时间、群体免疫阈值。使用找到交叉点。
scipy.optimize.brentq(lambda x: func(x) - target, lo, hi)Template 4: Saturation / Binding Curve
模板4: 饱和/结合曲线
Covers: receptor binding, enzyme kinetics, adsorption, dose-response. Shape: . Fit with using .
response = Rmax * C / (C + Kd)scipy.optimize.curve_fitp0=[median(C), max(response)]适用场景:受体结合、酶动力学、吸附、剂量-响应。曲线形式:。使用拟合,初始参数。
response = Rmax * C / (C + Kd)scipy.optimize.curve_fitp0=[median(C), max(response)]Template 5: Statistical Comparison
模板5: 统计比较
Covers: HWE chi-square, contingency tables, group comparisons. Use for goodness-of-fit, for group comparisons.
scipy.stats.chisquare(observed, expected)stats.ttest_ind/ttest_rel适用场景:HWE卡方检验、列联表、组间比较。使用进行拟合优度检验,进行组间比较。
scipy.stats.chisquare(observed, expected)stats.ttest_ind/ttest_relTemplate 6: Rate / Dimensional Analysis
模板6: 速率/量纲分析
Covers: IV drip rate, clearance, flux, dosing rate. Core: , . Arrange units to cancel correctly.
rate = amount / timemass_rate = concentration * flow_rate适用场景:静脉滴注速率、清除率、通量、给药速率。核心:,。调整单位使其抵消正确。
rate = amount / timemass_rate = concentration * flow_rateTemplate 7: Compartmental Models & R0
模板7: 房室模型与R₀
Covers: SIR/SEIR, R0 derivation. (basic SIR). General: . Derive by tracing one infected individual through all compartments.
R0 = beta * N / gammaR0 = transmission_rate * infectious_duration * susceptible_contacts适用场景:SIR/SEIR模型、R₀推导。基础SIR模型:。通用公式:。通过追踪一名感染者在所有房室中的传播过程推导。
R0 = beta * N / gammaR0 = transmission_rate * infectious_duration * susceptible_contacts5. Multiple-Choice Strategy
5. 选择题策略
Multiple-choice questions in biophysics, pharmacology, and clinical medicine are frequently answered incorrectly not because of missing knowledge but because of process errors: skipping an option, confusing a letter with the text, or committing to the first plausible-sounding choice. Use the systematic approach below every time.
生物物理学、药理学和临床医学中的选择题常因流程错误而非知识缺失答错:跳过选项、混淆字母与文本、选择第一个看似合理的选项。每次都使用以下系统化方法。
The Mandatory MC Process
必选选择题流程
- Read the stem twice. Identify the exact action being asked: "MOST likely", "FIRST step", "BEST describes", "EXCEPT". These qualifiers change the answer.
- Force evaluation of every choice. For each option ask:
- Why would this be correct? — does it align with the core concept?
- Why would this be wrong? — does the reasoning contradict it, or is it only partially true?
- Eliminate with explicit justification. Mark a choice eliminated only when you can state a factual reason (not just a feeling).
- Count survivors. One survivor → that is your answer. Two or more → go back to the stem and look for the qualifier that distinguishes them.
- Verify letter-to-text alignment. Before writing your answer, confirm the letter you intend to write corresponds to the option text you reasoned about. This catches the common error of reasoning "B is correct" but writing "C".
- Quantitative MC: Calculate the exact answer FIRST using Python, THEN match to the closest option. Do not let the listed choices bias your computation — compute independently.
- MC traps: "All/None of the above" is correct only ~25% of the time. Absolute language ("always", "never", "only") is usually wrong. The longest/most detailed option is correct more often. When two options are opposites, one is usually correct.
CRITICAL FOR BATCH PROCESSING: When answering multiple MC questions in sequence, do NOT rush. Apply the FULL elimination process to EVERY question. Common batch error: answering based on first impression without elimination. For each MC question, you MUST:
- Write out at least 2 eliminated options with reasons BEFORE selecting your answer
- If you cannot eliminate any options, that's a sign you need to LOOK UP information
- 读两遍题干。明确问题要求的精确动作:“最可能”、“第一步”、“最佳描述”、“除了”。这些限定词会改变答案。
- 强制评估每个选项。对每个选项问:
- 为什么该选项正确? ——是否符合核心概念?
- 为什么该选项错误? ——推理是否与之矛盾,或仅部分正确?
- 给出明确理由后排除选项。只有能陈述事实理由(而非感觉)时,才标记选项为排除。
- 统计剩余选项。仅剩一个→即为答案。两个及以上→回到题干寻找区分它们的限定词。
- 验证字母与文本的对应关系。写下答案前,确认你选择的字母对应你推理的选项文本。这能避免常见错误:推理“B正确”但写下“C”。
- 定量选择题:先使用Python计算精确答案,再匹配最接近的选项。不要让列出的选项影响你的计算——独立完成计算。
- 选择题陷阱:“以上所有/都不是”正确的概率约为25%。绝对化语言(“总是”、“从不”、“只有”)通常错误。最长/最详细的选项正确概率更高。当两个选项对立时,其中一个通常正确。
批量处理关键提示:连续回答多个选择题时,不要仓促。对每个问题应用完整的排除流程。常见批量错误:基于第一印象回答而不进行排除。每个选择题必须:
- 写出至少2个被排除的选项及理由,再选择答案
- 若无法排除任何选项,说明需要查询信息
mc_analyzer.py
— Automated MC Scaffold
mc_analyzer.pymc_analyzer.py
—— 自动化选择题框架
mc_analyzer.pyLocated in .
skills/tooluniverse-computational-biophysics/scripts/mc_analyzer.pyundefined位于。
skills/tooluniverse-computational-biophysics/scripts/mc_analyzer.pyundefinedAnalysis mode: systematic elimination
分析模式:系统化排除
python mc_analyzer.py --question "..." --choices "A:opt1,B:opt2,C:opt3,D:opt4" --reasoning "..."
python mc_analyzer.py --question "..." --choices "A:opt1,B:opt2,C:opt3,D:opt4" --reasoning "..."
Verify mode: confirm letter-text alignment
验证模式:确认字母-文本对应关系
python mc_analyzer.py --verify --answer "B" --question "..." --choices "A:opt1,B:opt2,C:opt3,D:opt4"
Analysis mode scans reasoning for elimination signals, reports survivor count. Verify mode checks letter-text alignment. Use for any scored MC question.
---python mc_analyzer.py --verify --answer "B" --question "..." --choices "A:opt1,B:opt2,C:opt3,D:opt4"
分析模式扫描推理内容中的排除信号,报告剩余选项数量。验证模式检查字母与文本的对应关系。适用于所有计分选择题。
---6. Bundled Scripts
6. 捆绑脚本
These ready-to-run scripts live in .
Use them via the Bash tool instead of computing by hand — they include verification steps and handle edge cases.
skills/tooluniverse-computational-biophysics/scripts/这些可直接运行的脚本位于。
使用Bash工具运行,而非手动计算——它们包含验证步骤并处理边缘情况。
skills/tooluniverse-computational-biophysics/scripts/epidemiology.py
— Epidemiology calculations (5 types via --type
)
epidemiology.py--typeepidemiology.py
—— 流行病学计算(通过--type
指定5种类型)
epidemiology.py--typePreferred: Use ToolUniverse tools (via MCP/SDK) instead of the script:
- tool -- R0 and herd immunity threshold
Epidemiology_r0_herd - tool -- Vaccine coverage from field data
Epidemiology_vaccine_coverage - tool -- Number needed to treat
Epidemiology_nnt - tool -- Diagnostic test performance (2x2 table)
Epidemiology_diagnostic - tool -- Bayesian pre/post-test probability
Epidemiology_bayesian
Fallback: Pure stdlib script. Types: , , , , .
r0_herdvaccine_coveragenntdiagnosticbayesianpython epidemiology.py --type r0_herd --R0 3.5 --VE 0.90
python epidemiology.py --type nnt --control_rate 0.30 --treatment_rate 0.20
python epidemiology.py --type diagnostic --tp 90 --fp 10 --tn 880 --fn 20
python epidemiology.py --type bayesian --prevalence 0.01 --sensitivity 0.95 --specificity 0.90Key formulas: : Hc=1-1/R0, Vc=Hc/VE. : derives VE from PCV/PPV field data. : ARR=control-treatment, NNT=1/ARR. : full 2x2 table. : pre-test odds → LR → post-test probability.
r0_herdvaccine_coveragenntdiagnosticbayesian优先选择:使用ToolUniverse工具(通过MCP/SDK)而非脚本:
- 工具 —— R₀和群体免疫阈值
Epidemiology_r0_herd - 工具 —— 基于现场数据的疫苗覆盖率
Epidemiology_vaccine_coverage - 工具 —— 需治疗人数
Epidemiology_nnt - 工具 —— 诊断测试性能(2x2表)
Epidemiology_diagnostic - 工具 —— 贝叶斯验前/验后概率
Epidemiology_bayesian
备选方案:纯标准库脚本。类型:、、、、。
r0_herdvaccine_coveragenntdiagnosticbayesianpython epidemiology.py --type r0_herd --R0 3.5 --VE 0.90
python epidemiology.py --type nnt --control_rate 0.30 --treatment_rate 0.20
python epidemiology.py --type diagnostic --tp 90 --fp 10 --tn 880 --fn 20
python epidemiology.py --type bayesian --prevalence 0.01 --sensitivity 0.95 --specificity 0.90核心公式:: Hc=1-1/R0, Vc=Hc/VE。: 从PCV/PPV现场数据推导VE。: ARR=control-treatment, NNT=1/ARR。: 完整2x2表。: 验前赔率→似然比→验后概率。
r0_herdvaccine_coveragenntdiagnosticbayesianherd_immunity.py
— Legacy vaccination threshold
herd_immunity.pyherd_immunity.py
—— 旧版疫苗阈值
herd_immunity.pypython herd_immunity.py --R0 4.2 --VE 0.94Formula: . Prefer for new work.
Vc = (1 - 1/R0) / VEepidemiology.py --type r0_herdpython herd_immunity.py --R0 4.2 --VE 0.94公式:。新工作优先使用。
Vc = (1 - 1/R0) / VEepidemiology.py --type r0_herdradioactive_decay.py
— Activity remaining / time to target / parent-daughter
radioactive_decay.pyradioactive_decay.py
—— 剩余活性/达到目标的时间/母核-子核
radioactive_decay.pyThree modes: forward (), reverse (), parent-daughter ( with Bateman equation).
--A0 --half_life --time--A0 --half_life --target--parent_daughterpython radioactive_decay.py --A0 8 --half_life 67.3 --time 72 # forward
python radioactive_decay.py --A0 8 --half_life 67.3 --target 5 # reverse
python radioactive_decay.py --parent_daughter --half_life_parent 306.05 --half_life_daughter 40.27 --A1 1.4 --A2 2.1 --delta_t 336 --counted daughterFormulas: . Parent-daughter: Bateman equation. : daughter/both/parent.
A(t) = A0 * 0.5^(t/t_half)--counted三种模式:正向()、反向()、母核-子核(,使用Bateman方程)。
--A0 --half_life --time--A0 --half_life --target--parent_daughterpython radioactive_decay.py --A0 8 --half_life 67.3 --time 72 # 正向
python radioactive_decay.py --A0 8 --half_life 67.3 --target 5 # 反向
python radioactive_decay.py --parent_daughter --half_life_parent 306.05 --half_life_daughter 40.27 --A1 1.4 --A2 2.1 --delta_t 336 --counted daughter公式:。母核-子核:Bateman方程。: daughter/both/parent。
A(t) = A0 * 0.5^(t/t_half)--countedenv_risk_assessment.py
— Environmental risk (hazard quotient)
env_risk_assessment.pyenv_risk_assessment.py
—— 环境风险(危害商数)
env_risk_assessment.pyComputes HQ for soil contaminant exposure via food pathway. Food format: .
"name:intake_g:bioavailability:PUF:TSCF"python env_risk_assessment.py --total_mass_ug 1e9 --area_m2 250000 --depth_m 0.6 \
--bulk_density 1500 --theta_w 0.35 --foc 0.03 --Koc 28.3 \
--food "fruit:300:0.5:0.1:5" --body_weight 80 --RfD 0.02Formulas: C_soil → Kd=foc*Koc → C_sw → DI per pathway → HQ = sum(DI)/BW/RfD.
计算土壤污染物通过食物途径暴露的HQ。食物格式:。
"name:intake_g:bioavailability:PUF:TSCF"python env_risk_assessment.py --total_mass_ug 1e9 --area_m2 250000 --depth_m 0.6 \
--bulk_density 1500 --theta_w 0.35 --foc 0.03 --Koc 28.3 \
--food "fruit:300:0.5:0.1:5" --body_weight 80 --RfD 0.02公式:C_soil → Kd=foc*Koc → C_sw → 各途径DI → HQ = sum(DI)/BW/RfD。
fluid_calculations.py
— Clinical fluid and dosing (4 types via --type
)
fluid_calculations.py--typefluid_calculations.py
—— 临床液体与剂量(通过--type
指定4种类型)
fluid_calculations.py--typeTypes: , , , . Preferred over legacy .
drip_ratebsa_dosemaintenancedilutioniv_drip_rate.pypython fluid_calculations.py --type drip_rate --volume_ml 50 --time_min 60 --drop_factor 60
python fluid_calculations.py --type bsa_dose --dose_per_m2 25 --bsa 0.8
python fluid_calculations.py --type maintenance --weight_kg 22
python fluid_calculations.py --type dilution --c1 20 --v1 4.7 --v2 50Formulas: drip_rate = (vol/time)drop_factor. bsa_dose = dose_per_m2BSA. maintenance = Holliday-Segar. dilution = C1V1=C2V2.
类型:、、、。优先于旧版。
drip_ratebsa_dosemaintenancedilutioniv_drip_rate.pypython fluid_calculations.py --type drip_rate --volume_ml 50 --time_min 60 --drop_factor 60
python fluid_calculations.py --type bsa_dose --dose_per_m2 25 --bsa 0.8
python fluid_calculations.py --type maintenance --weight_kg 22
python fluid_calculations.py --type dilution --c1 20 --v1 4.7 --v2 50公式:drip_rate = (vol/time)drop_factor。bsa_dose = dose_per_m2BSA。maintenance = Holliday-Segar公式。dilution = C1V1=C2V2。
enzyme_kinetics.py
— Km/Vmax, Hill, Ki (3 types via --type
)
enzyme_kinetics.py--typeenzyme_kinetics.py
—— Km/Vmax、Hill、Ki(通过--type
指定3种类型)
enzyme_kinetics.py--typePreferred: use tool (via MCP/SDK) with and data parameters. Fallback: run directly.
EnzymeKinetics_calculatetypeenzyme_kinetics.pyPure stdlib. Types: (Lineweaver-Burk + nonlinear), (cooperativity), (competitive/uncompetitive/noncompetitive).
km_vmaxhillkipython enzyme_kinetics.py --type km_vmax --substrate "1,2,5,10,20" --velocity "0.5,0.8,1.2,1.5,1.7"
python enzyme_kinetics.py --type ki --substrate "1,2,5,10,20" --velocity_no_inh "0.5,0.8,1.2,1.5,1.7" --velocity_inh "0.3,0.5,0.8,1.0,1.1" --inhibitor_conc 5 --inhibition_type competitive优先选择:使用工具(通过MCP/SDK),指定和数据参数。备选方案:直接运行。
EnzymeKinetics_calculatetypeenzyme_kinetics.py纯标准库脚本。类型:(Lineweaver-Burk + 非线性拟合)、(协同性)、(竞争性/非竞争性/反竞争性抑制)。
km_vmaxhillkipython enzyme_kinetics.py --type km_vmax --substrate "1,2,5,10,20" --velocity "0.5,0.8,1.2,1.5,1.7"
python enzyme_kinetics.py --type ki --substrate "1,2,5,10,20" --velocity_no_inh "0.5,0.8,1.2,1.5,1.7" --velocity_inh "0.3,0.5,0.8,1.0,1.1" --inhibitor_conc 5 --inhibition_type competitiveburn_fluids.py
— Burn resuscitation + maintenance
burn_fluids.pyburn_fluids.py
—— 烧伤复苏+维持液
burn_fluids.pyAdult: Parkland (). Pediatric (<30kg): Galveston ().
4*kg*%TBSA5000*BSA*%TBSA + 2000*BSApython burn_fluids.py --weight_kg 80 --tbsa_pct 40
python burn_fluids.py --weight_kg 25 --age_years 7 --tbsa_pct 45 --bsa_m2 0.95Output: hourly rates (first 8h / next 16h), total volume, urine output target. 8h clock starts from burn time.
成人:Parkland公式()。儿科(<30kg):Galveston公式()。
4*kg*%TBSA5000*BSA*%TBSA + 2000*BSApython burn_fluids.py --weight_kg 80 --tbsa_pct 40
python burn_fluids.py --weight_kg 25 --age_years 7 --tbsa_pct 45 --bsa_m2 0.95输出:每小时速率(前8小时/后16小时)、总容积、目标尿量。8小时计时从烧伤时间开始。
7. Combinatorics & Counting Problems
7. 组合学与计数问题
For genetics combinatorics (F2 haplotypes, genotype counts, specimen tallies) or any counting/permutation/combination problem: ALWAYS write and execute Python code. Never attempt to enumerate or count mentally — even simple-looking problems (e.g., "how many unique chromosomes from 5 SNPs") have subtleties that cause errors without code. Use , , or direct formulas, then verify the count.
itertools.productitertools.combinations对于遗传学组合学(F2单倍型、基因型计数、样本统计)或任何计数/排列/组合问题:务必编写并运行Python代码。切勿尝试手动枚举或计数——即使看似简单的问题(例如:“5个SNP可产生多少独特染色体”)也存在易引发错误的细节。使用、或直接公式,然后验证计数结果。
itertools.productitertools.combinations8. Common Pitfalls to Flag
8. 需要注意的常见陷阱
- Unit mismatch: mg vs g, mL vs L, hours vs seconds. Always write units next to every number and verify cancellation before computing.
- Mono- vs multi-exponential: Drug clearance is often biexponential (distribution + elimination phases). Simple half-life decay assumes one compartment. State this assumption.
- R0 vs Re: R0 = fully susceptible population. Re = R0 x fraction_susceptible. Most real-world questions want Re.
- Single-site estimates are noisy: One SNP's Fst, one patient's response, one measurement's Kd. Always note when genome-wide averages, population means, or replicate experiments would be more reliable.
- Regression estimates are order-of-magnitude: BCF from log Kow, toxicity from QSAR. Flag the uncertainty explicitly.
- SI units in simulations: Neuron models, diffusion, thermodynamics — always convert to SI (seconds, meters, joules, volts) before computing. Mixed ms/mV causes silent factor-of-1000 errors.
- 单位不匹配:mg vs g、mL vs L、小时 vs 秒。始终在每个数值旁标注单位,计算前验证单位是否抵消正确。
- 单指数vs多指数:药物清除通常为双指数(分布+消除阶段)。简单半衰期衰变假设单房室模型。需说明该假设。
- R₀ vs Re:R₀ = 完全易感人群。Re = R₀ × 易感人群比例。大多数现实问题需要Re。
- 单一位点估计存在噪声:单个SNP的Fst、单个患者的响应、单次测量的Kd。始终注意,全基因组平均值、群体均值或重复实验结果更可靠。
- 回归估计为数量级:基于log Kow的BCF、基于QSAR的毒性。需明确标注不确定性。
- 模拟中使用SI单位:神经元模型、扩散、热力学——计算前务必转换为SI单位(秒、米、焦耳、伏特)。毫秒/毫伏混用会导致无提示的1000倍误差。