Train the toy model, then SURF your data.

SURF combines DNA sequence with a low-coverage experiment to predict genomic signal. Start with the DNase-seq toy example, then adapt it to your assay.

Run the toy example

1. Install SURF

Install uv, then clone SURF and install its dependencies. The toy example requires a CUDA-compatible GPU.

git clone https://github.com/jzhoulab/SURF.git
cd SURF
uv sync

2. Download the toy data

Follow the download link in the SURF README to get the toy data from Zenodo. Unpack it into your SURF folder. Check that the paths in confs/dnase.txt point to these files:

For prediction, you will also need chrom_lengths.tsv: a tab-separated file with chromosome names in the first column and lengths in the second, matching your reference and BigWig.

3. Train the toy model

Run this command from the SURF folder. The example trains for 1,000 iterations, splitting reads equally between input and target. It uses chr8 for validation and reserves chr9 and chr10 for testing.

uv run surf train -c confs/dnase.txt

Results go in dnase.test.com/: model checkpoints, settings in conf.txt, logs, and training curves. Check the curves for failed training (NaN or infinite losses), and confirm the data paths and chromosome splits in conf.txt.

4. Generate predictions

Use the saved model and your chromosome-length file to make a BigWig prediction track:

uv run surf predict -i dnase.test.com -m best.model.checkpoint -c chrom_lengths.tsv -o predictions.bw

Open dnase.test.com/predictions.bw alongside the input in IGV. Check an active region and a quiet one; the PTEN example shows this comparison. To measure accuracy, compare both tracks against the same held-out reads on a test chromosome.

Train on your assay

Split reads before processing

SURF splits an experiment’s reads into two groups: input and target. It learns to predict the target from DNA sequence and the input. This approach, called Direct Predictive Inference, requires the groups to independently sample the same biological signal. You do not need a matched high-coverage experiment.

Use SURF’s built-in split for raw counts where each read contributes at one position, such as DNase cuts or CAGE 5′ ends. For normalized, smoothed, binned, or extended-fragment tracks, split reads or UMIs first, then process each group separately. Otherwise, the same read can contribute to both input and target.

Use the same reference, filters, and processing for both groups. Keep validation and test chromosomes out of training.

Choose a starting model

Your assayStarting pointWhat to change
One track of raw point countsDNase modelUpdate the configuration: data paths, read and chromosome splits, sequence window, model, and loss.
Multiple channels or different output typesCustom assay strategyAdd code for your inputs, outputs, loss, and handling of missing data.

Match the model to your measurements. CAGE uses point counts but benefits from longer sequence windows. Methylation needs separate methylated and unmethylated channels and a different loss.

Adapt with a coding agent

The development Skill explains how to configure or extend SURF; the prediction Skill covers prediction and BigWig export. Ask your coding agent to follow them:

Example adaptation prompt
Read skills/develop-surf-model/SKILL.md. Adapt SURF for [assay and data format] at [target resolution]. Set up independent input and target read groups, choose a model and loss, and reserve chromosomes for validation and testing. Run a small training test, then compare SURF and the input against the same held-out target.

Start with a small region and a short run. If you need a new strategy, use src/surf/strategies/dnase.py as a starting point.

Validate, then scale up

  1. Check input dimensions, strands, coordinates, and counts against the reference.
  2. Confirm that read groups are independent and training, validation, and test chromosomes do not overlap.
  3. Compare SURF and the input against the same held-out target.
  4. Try sequence-only and data-only models to check what drives any improvement.
  5. Check active and quiet regions across the read depths, cell types, and resolutions you need.

Once these checks pass, train with uv run surf train -c path/to/assay.json. Predict with the selected checkpoint. Save the data version, processing steps, splits, settings, random seed, checkpoints, and evaluation results together so you can repeat the analysis.

For uncertainty estimates, follow the SCAN predictions guide.