Build digital twin patient models to test drug efficacy and toxicity in virtual environments
Build a "digital twin" model of a patient, integrating genotype, clinical history, and imaging data to test the efficacy and toxicity of different drug doses in a virtual environment.
| Data Type | Description | Format |
|---|---|---|
genotype | Patient genotype data (SNPs, CNVs) | JSON |
clinical_history | Clinical history and laboratory indicators | JSON |
imaging_features |
| Imaging features (MRI, CT, etc.) |
| JSON |
| Output Type | Description |
|---|---|
efficacy_prediction | Efficacy prediction results |
toxicity_prediction | Toxicity reaction prediction |
optimal_dose | Optimal dose recommendation |
python scripts/main.py --patient patient_data.json --drug drug_profile.json --doses "[50, 100, 150]"
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
--patient | string | - | Yes | Path to patient data JSON file |
--drug | string | - | Yes | Path to drug profile JSON file |
--doses | string | - | Yes | Dose range to test (JSON array format) |
--output, -o | string | - | No | Output file path for simulation results |
--simulation-days | int | 30 | No | Number of days to simulate |
--timestep | float | 0.5 | No | Simulation timestep in days |
from scripts.main import DigitalTwinBuilder
builder = DigitalTwinBuilder()
twin = builder.build_twin(patient_data)
results = twin.simulate_drug_regimen(drug_profile, dose_range)
digital-twin-patient-builder/
├── SKILL.md # This file
├── scripts/
│ └── main.py # Core implementation
│
├── Core Components:
│ ├── PatientProfile # Patient profile management
│ ├── GenotypeModel # Genotype modeling
│ ├── ClinicalModel # Clinical data modeling
│ ├── ImagingModel # Imaging feature modeling
│ ├── DigitalTwin # Digital twin main class
│ ├── PharmacokineticModel # Pharmacokinetic model
│ └── DrugSimulator # Drug simulator
{
"patient_id": "P001",
"genotype": {
"CYP2D6": "*1/*4",
"TPMT": "*1/*3C",
"SNPs": {"rs12345": "AG", "rs67890": "CC"}
},
"clinical": {
"age": 58,
"weight": 70.5,
"height": 170,
"lab_values": {"creatinine": 1.2, "alt": 45, "ast": 38},
"comorbidities": ["hypertension", "diabetes"]
},
"imaging": {
"tumor_volume": 45.2,
"perfusion_rate": 0.85,
"texture_features": {"entropy": 5.2, "uniformity": 0.45}
}
}
{
"drug_name": "ExampleDrug",
"drug_class": "chemotherapy",
"metabolizing_enzymes": ["CYP2D6", "CYP3A4"],
"target_genes": ["EGFR", "KRAS"],
"pk_params": {
"clearance": 15.5,
"volume_distribution": 45.0,
"half_life": 8.0
},
"efficacy_biomarkers": ["tumor_reduction", "survival_rate"],
"toxicity_markers": ["neutropenia", "hepatotoxicity"]
}
| Risk Indicator | Assessment | Level |
|---|---|---|
| Code Execution | Python scripts with tools | High |
| Network Access | External API calls | High |
| File System Access | Read/write data | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Data handled securely | Medium |
# Python dependencies
pip install -r requirements.txt