Challenge

Build a Pydantic AI Type-Safe Pan-Cancer Allele Dosage Analysis Agent

Somatic copy number alterations and mutant gene dosage dictate prognosis and metastatic tropism across thousands of cancer samples. Build a type-safe agent using Pydantic AI that parses pan-cancer genomic profiling datasets, validates mutant dosage ratios, and outputs organ-specific tropism risk scores.

Data ScienceHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Develop a Pydantic AI agent with strict type validation to calculate gene mutant dosage and predict metastatic tropism.

Delivery guide

How work is evaluated

Evaluation

Evaluates Pydantic AI agent calculations of allele dosage and metastatic organ predictions.

Datasets

Shared data for this challenge

Review public datasets and any private uploads tied to your build.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

mutant_dosage_math_check

Verifies that mutant dosage formula calculation (copy_number * vaf) is mathematically accurate.

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

tropism_prediction_accuracy

Accuracy of organ-specific metastatic predictions matching gold standard clinical trial records. • target: 0.9 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Construct type-safe AI agents with Pydantic AI and Pydantic validation models

  • Calculate mutant allele dosage ratios from somatic copy number and VAF data

  • Predict organ-specific metastatic tropism (e.g., liver, brain, bone) based on mutation dosage

  • Ensure end-to-end type safety and validated structured outputs for clinical reporting

Resources and assets

Reference links and supporting material

Dataset notes

Dataset of 50 patient genomic profiles detailing copy number amplification, VAF, primary tumor origin, and validated metastatic sites.

How this agent runs

Evaluates Pydantic AI agent calculations of allele dosage and metastatic organ predictions.

Challenge input

JSON containing gene (string), copy_number (int), vaf (float), and primary_site (string).

Pydantic AI

Type-safe Python framework for structured output validation.

Evaluated output

JSON containing mutant_dosage (float), predicted_tropism (list of strings), and risk_category (string).

Checks for
  • Verifies that mutant dosage formula calculation (copy_number * vaf) is mathematically accurate.
  • Accuracy of organ-specific metastatic predictions matching gold standard clinical trial records. • target:...
Proof of success
  • Benchmark: Pan-Cancer Tropism Prediction Benchmark
  • Tropism Prediction Accuracy target: 0.9
  • 1 public reference case
Runtime evidence
  • Python execution harness
  • Python sandbox (unavailable on Versalist)
View technical recipe

Configured tools

Action Space
  • Pydantic AI · Required
  • Meta · Optional
Reward / Eval
  • Guardrails AI · Optional
Safety / Guardrails
  • Guardrails AI · Optional
Orchestration
  • Pydantic AI · Required

Evaluation contract

  • mutant_dosage_math_check · Weight 1
  • tropism_prediction_accuracy · Weight 1

Recipe state

This is a preview. The configuration can change before the evaluation recipe is locked.

Frequently Asked Questions about Build a Pydantic AI Type-Safe Pan-Cancer Allele Dosage Analysis Agent