Back to prompt library
Build a RefSeq Homology Alignment and FHIR Molecular Evidence Indexer — implementation
Linked challenge: Build a RefSeq Homology Alignment and FHIR Molecular Evidence Indexer
Prompt source
implementation63 lines11 sectionsNo variables1 code block
## Build
Align homologous transcript sequences retrieved from NCBI Datasets using Biopython pairwise routines. Generate FHIR R5 Molecular Observation entities capturing sequence divergence metrics.
## User
Comparative Genomics Researcher
## Workflow
1. Ingest FASTA files for homologous eukaryotic gene packages fetched via NCBI Datasets taxonomy flags.
2. Execute pairwise sequence alignments across homologs using Biopython alignment classes.
3. Calculate sequence identity percentages, insertion count, and deletion gaps across CDS regions.
4. Export divergence summaries as FHIR Observation resources linked to ResearchStudy identifiers.
## Interface
Web workspace with sequence comparison matrix viewer and FHIR bundle inspection drawer.
## Data
Download ACRV1 gene sequences across human and murine taxa via NCBI Datasets command mock directory.
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/)
Leverages NCBI Datasets taxon flag '--taxon human' and multi-accession download conventions for homologous gene extraction.
## Tools
dspy, biopython, qdrant.
Optimizes prompt pipelines that convert complex alignment matrices into plain-language molecular divergence summaries.
Fast remote instruction-tuned language model with 16k context window for multi-sequence 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
- Calculates exact pairwise identity percentage over Biopython sequence alignments.
- Structures divergence scores into compliant FHIR Molecular Observation code-value pairs.
- Detects frameshift indels and marks affected sequence records with distinct warning flags.
## Starter Examples
```json
[
{
"input": {
"query_gene": "ACRV1",
"query_seq": "ATGAAACTCCTTCTCCTGGCTTCAGTGTTGTTTTCATTGGTGTTCACCCAAGAATCT",
"target_seq": "ATGAAACTCCTTCTCCTGGCTTCAGTGTTGTTTTCATTGGTGTTCACCCAAGAATCT"
},
"expected_output": {
"alignment_score": 57,
"percent_identity": 100,
"gap_count": 0,
"frameshift_detected": false,
"fhir_observation_code": "sequence-homology"
}
},
{
"input": {
"query_gene": "ACRV1",
"query_seq": "ATGAAACTCCTTCTCCTGGCTTCAGTGTTGTTTTCATTGGTGTTCACCCAAGAATCT",
"target_seq": "ATGAAACTCCTTCTCCTGGCTTC---TTGTTTTCATTGGTGTTCACCCAAGAATCT"
},
"expected_output": {
"alignment_score": 51,
"percent_identity": 94.74,
"gap_count": 3,
"frameshift_detected": true,
"fhir_observation_code": "sequence-homology"
}
}
]
```
## Safety
Operates strictly on de-identified public reference genomes; not used for diagnostic variant interpretation.
Use mock external writes. Require human review before any real deployment.