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 Gene Transcript FASTA Curation Pipeline with DSPy and FHIR
Format
Code-aware
Lines
91
Sections
11
Linked challenge
Build a Gene Transcript FASTA Curation Pipeline with DSPy and FHIR
Prompt source
Original prompt text with formatting preserved for inspection.
91 lines
11 sections
No variables
1 code block
## Build
Parse eukaryotic gene packages from NCBI Datasets to validate transcript coding sequences with Biopython. Structure sequence verification summaries into FHIR Molecular Observation resources.
## User
Bioinformatics Curation Specialist
## Workflow
1. Unpack NCBI Datasets zip archive containing transcript rna.fna and data_report.jsonl.
2. Parse transcript sequences using Biopython SeqIO to check start and stop codon integrity.
3. Execute a DSPy signature to categorize transcript completeness based on sequence coordinates.
4. Construct FHIR R5 Observation resources containing sequence validity status for curator review.
## Interface
Web curation console with sequence audit tables and interactive JSON bundle inspector.
## Data
Download open NCBI Datasets packages using CLI for gene ID 672 or read bundled mock fixture zip archives.
Starter examples below are synthetic. They are not downloaded records.
## Source
[NCBI Datasets gene download](https://www.ncbi.nlm.nih.gov/datasets/docs/v2/how-tos/genes/download-gene-data-package/)
Utilizes the NCBI Datasets gene data package structure containing transcript RNA sequences and data report lines.
## Tools
dspy, biopython, pydantic.
DSPy compiles robust prompt pipelines to extract structured metadata assessments from open reading frame audits.
Local quantized Llama 3 or hosted small instruction model via standard API.
## 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
- Extracts valid SeqRecord instances from transcript FASTA input without fatal parser exceptions.
- Outputs valid FHIR R5 Observation JSON containing code 'molecular-sequence-assessment'.
- Flags incomplete reading frames lacking standard ATG initiation codons with warning status.
## Starter Examples
```json
[
{
"input": {
"gene_id": "672",
"fasta_header": "NM_007294.4 Homo sapiens BRCA1 transcript variant 1",
"sequence": "ATGGATTTATCTGCTCTTCGCGTTGAAGAAGTACAAAATGTCATTAATGCTATGCAGAAAATCTTAGAGTGTCCCATCTGA"
},
"expected_output": {
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "http://example.org/fhir/codes",
"code": "molecular-sequence-assessment"
}
]
},
"valueString": "complete_cds",
"component": [
{
"code": {
"text": "has_valid_start_and_stop"
},
"valueBoolean": true
}
]
}
},
{
"input": {
"gene_id": "672",
"fasta_header": "NM_007294.4_truncated Homo sapiens BRCA1 partial",
"sequence": "TTATCTGCTCTTCGCGTTGAAGAAGTACAAAATGTCATTAATGCTATGCAGAAAATCTTAGAGTGTCCC"
},
"expected_output": {
"resourceType": "Observation",
"status": "preliminary",
"code": {
"coding": [
{
"system": "http://example.org/fhir/codes",
"code": "molecular-sequence-assessment"
}
]
},
"valueString": "incomplete_cds",
"component": [
{
"code": {
"text": "has_valid_start_and_stop"
},
"valueBoolean": false
}
]
}
}
]
```
## Safety
Research software only; outputs are non-diagnostic and must undergo curator sign-off before biobank indexing.
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.