Back to Prompt Library
implementation
Build the application
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a Research Specimen Biopython Quality Control and Terminology Mapper
Format
Code-aware
Lines
63
Sections
11
Linked challenge
Build a Research Specimen Biopython Quality Control and Terminology Mapper
Prompt source
Original prompt text with formatting preserved for inspection.
63 lines
11 sections
No variables
1 code block
## Build
Evaluate sequencing run quality metrics from FASTA files and align specimen metadata to standard terminology. Structure results into FHIR Specimen and ResearchStudy observation entities.
## User
Laboratory Operations Specialist
## Workflow
1. Read raw specimen FASTA sequences using Biopython SeqIO.
2. Calculate GC percentage and ambiguity counts for each sample record.
3. Validate sample metadata against FHIR Foundation administration resource models.
4. Format audit summaries into structured QC reports for human sign-off.
## Interface
Web dashboard showing specimen batch QC tables with downloadable FHIR JSON manifests.
## Data
Generate synthetic FASTA files with varied nucleotide compositions and simulated specimen identifiers.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Biopython](https://raw.githubusercontent.com/biopython/biopython/master/README.rst)
Leverages Biopython's core SeqIO module for parsing FASTA files and calculating sequence composition stats.
## Tools
mastra-ai, biopython, fastapi.
Mastra AI provides declarative workflow orchestration to link parsing, terminology matching, and report generation.
Fast hosted model or local Ollama instance for contextual anomaly explanations in QC summaries.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Biopython SeqIO correctly calculates GC content and flags degenerate base thresholds.
- Generates valid FHIR Specimen JSON representations with accurate status values.
- Includes a human review staging queue for rejected specimens.
## Starter Examples
```json
[
{
"input": {
"specimen_id": "SPEC-001",
"sequence_header": ">sample_01 human_control",
"sequence": "GCGCGCGCATATATATGCGC"
},
"expected_output": {
"specimen_id": "SPEC-001",
"length": 20,
"gc_content_pct": 60,
"qc_status": "PASS",
"fhir_resource": "Specimen"
}
},
{
"input": {
"specimen_id": "SPEC-002",
"sequence_header": ">sample_02 degraded_isolate",
"sequence": "NNNNNNCGATNNN"
},
"expected_output": {
"specimen_id": "SPEC-002",
"length": 13,
"gc_content_pct": 30.77,
"qc_status": "FAIL_HIGH_AMBIGUITY",
"fhir_resource": "Specimen"
}
}
]
```
## Safety
Confined to pre-analytical laboratory assay quality checks using deidentified research identifiers.
Use mock external writes. Require human review before any real deployment.Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.