This repository curates Tsao Lab lung cancer drug-screen data into a reproducible XevaSet object using a Snakemake workflow, Python utilities, and an R step executed inside Docker (Bioconductor 3.20).
The pipeline scans & validates raw inputs, processes and updates annotations, builds Xeva input CSVs, calculate drug response statistics, and finally creates an .rds XevaSet.
- What You Get
- Requirements
- Quick Start
- Inputs Expected
- Configuration
- Workflow Outline
- Outputs
- Load the XevaSet in R
- Troubleshooting
- Repo Layout
- Citation
- License
- A fully reproducible Snakemake workflow orchestrated via pixi (Python env manager).
- Clean CSV inputs for Xeva:
model.csv,drug.csv,experiment.csv,expDesign.csv,modToBiobaseMap.csv, and per-omics*_pdata.csv. - An XevaSet saved as
results/xevaset/<NAME>.rds(name configurable). - Logs at each step under
logs/.
- Docker (Desktop) : https://www.docker.com/
- pixi (to provide Snakemake + Python deps): https://pixi.sh/
- Git (to clone this repo)
- Internet access during the R step (biomaRt Ensembl gene mapping & PubChem calls if enabled).
Windows users: Docker Desktop with WSL2 backend works fine with this workflow.
# 1) Clone
git clone git@github.com:BHKLAB-DataProcessing/Xevacurate_Snakemake_UHN_Lung.git
cd Xevacurate_Snakemake_UHN_Lung
# 2) Dry run
PYTHONPATH=src pixi run snakemake -n
# 3) Execute (adjust cores to taste)
PYTHONPATH=src pixi run snakemake --cores 4 --printshellcmdsThe final XevaSet appears at:
results/xevaset/UHN_Tsao_Lung_DrugResponse_2022_v1.rds # default, configurable
Place the following under data/input/:
data/
└── input/
├── drug_screen/ # raw drug-response inputs (time/volume etc.)
├── additional/
│ ├── models_to_remove.xlsx
│ ├── all_model_clinical.csv
│ └── all_drug_mapping.xlsx
└── omics/
├── data_expression_mRNA.txt # log2 microarray intensity matrix (rows: genes, cols: samples)
├── Tsao_Lung_WES_mutation_2025.tsv # WES mutation matrix
└── data_CNA.tsv # CNV matrix
Notes
-
Gene IDs in omics matrices are expected as HGNC symbols (rows). The R script will annotate via biomaRt.
-
Sample (column) IDs must match what
*_pdata.csvfiles (generated during build) will contain. The R script ensures ordering & sanity checks.
All knobs live in config.yaml. Minimal example:
docker:
xeva_r_image: docker.io/gfeng2023/xeva-build-r:bioc-3.20 # public image with Xeva deps
xevaset:
name: Tsao_Lung_2022
rds_name: UHN_Tsao_Lung_DrugResponse_2022_v1.rds
-
scan →
workflow/scripts/run_scan.py- Scans
data/input/drug_screenand writes a manifest + QC info. - Output:
results/scan/all_file_scan.json
- Scans
-
process →
workflow/scripts/run_process.py- Validates/normalizes raw data and emits a clean TSV + QC.
- Outputs:
results/process/processed_data.tsv,results/process/qc_report.json
-
update →
workflow/scripts/run_update.py- Maps models/drugs, applies removal lists, updates batches.
- Outputs:
results/update/update_model_data.tsvresults/update/update_model_drug_data.tsvresults/update/drug_filtered_out.tsvresults/update/update_model_drug_batch_data.tsv
-
build →
workflow/scripts/run_build.py- Produces Xeva input CSVs:
results/build/model.csvresults/build/drug.csvresults/build/experiment.csvresults/build/expDesign.csvresults/build/modToBiobaseMap.csvresults/build/CNV_pdata.csvresults/build/mutation_pdata.csvresults/build/RNASeq_pdata.csv
- Plus feature annotations created by the R step:
results/build/rna_fdata.csvresults/build/mutation_fdata.csvresults/build/cnv_fdata.csv
- Produces Xeva input CSVs:
-
create_xevaset (Dockerized R) →
workflow/scripts/create_xevaset.R- Runs inside the configured Docker image (Bioconductor 3.20).
- Builds
ExpressionSets, merges with experiment & design, computes responses, and writes the final xevaset as.rdsfile.
results/
├── scan/
│ └── all_file_scan.json
├── process/
│ ├── processed_data.tsv
│ └── qc_report.json
├── update/
│ ├── update_model_data.tsv
│ ├── update_model_drug_data.tsv
│ ├── drug_filtered_out.tsv
│ └── update_model_drug_batch_data.tsv
├── build/
│ ├── model.csv
│ ├── drug.csv
│ ├── experiment.csv
│ ├── expDesign.csv
│ ├── modToBiobaseMap.csv
│ ├── CNV_pdata.csv
│ ├── mutation_pdata.csv
│ ├── RNASeq_pdata.csv
│ ├── rna_fdata.csv
│ ├── mutation_fdata.csv
│ └── cnv_fdata.csv
└── xevaset/
└── UHN_Tsao_Lung_DrugResponse_2022_v1.rds # configurable
# From the repo root or any R session with Xeva installed:
xset <- readRDS("results/xevaset/UHN_Tsao_Lung_DrugResponse_2022_v1.rds")
# Inspect
xset
responseType(xset) # Which response measures were computed (e.g., slope, AUC, angle, abc, mRECIST)
modelInfo(xset)[1:5,]
head(summarizeResponse(xset, by="model"))
-
docker: command not foundInstall Docker Desktop (and enable WSL2 on Windows).
Restart your shell/terminal.
-
Bioconductor/CRAN packages fail to install
The default image
gfeng2023/xeva-build-r:bioc-3.20already contains the required R/Bioc packages (e.g., Xeva, Biobase, biomaRt).If you build your own image, use Bioconductor 3.20 (or newer) and avoid packages unavailable in older Bioc releases (e.g.,
AnnotationGxis not on 3.19). -
Omics sample mismatches
The R script performs sanity checks. Ensure column names of omics matrices match the
*_pdata.csvIDs produced in the build step. -
Windows path quirks
Always run from inside WSL2 (Ubuntu) and keep the repo on the WSL filesystem (e.g., under
~/).Bind-mounting Windows paths can be slower and occasionally tricky.
.
├── config.yaml
├── src/ # Python package(s): xevacurate_new/...
├── workflow/
│ ├── rules/ # Snakemake rules (*.smk)
│ │ └── curation.smk
│ ├── scripts/
│ │ ├── run_scan.py
│ │ ├── run_process.py
│ │ ├── run_update.py
│ │ ├── run_build.py
│ │ └── create_xevaset.R
│ └── Snakefile # includes rules/curation.smk
├── data/
│ └── input/ # place your inputs here (see Inputs Expected)
├── results/ # pipeline outputs
└── logs/ # stepwise logs
If you use this workflow or the produced XevaSet in a publication, please cite:
-
Xeva (Bioconductor)
Mer A, Haibe-Kains B (2025). Xeva: Analysis of patient-derived xenograft (PDX) data. doi:10.18129/B9.bioc.Xeva.
R package version 1.24.0. https://bioconductor.org/packages/Xeva.
-
The Original Dataset/Source
Weiss J, Pham NA, Pintilie M, Li M, Liu G et al (2022) Optimizing Drug Response Study Design in Patient-Derived Tumor Xenografts. doi.org/10.1177/11769351221136056.
MIT
Guanqiao Feng
Contributions are welcome!