Back to prompt library
Build a Gene Transcript Isoform Exon Splice Junction Reconciler — implementation
Linked challenge: Build a Gene Transcript Isoform Exon Splice Junction Reconciler
Prompt source
implementation87 lines11 sectionsNo variables1 code block
## Build
Parse multi-transcript FASTA and CDS files from NCBI Datasets to detect exon boundary truncation errors. Structure verified splice junctions into FHIR Molecular Observation resources.
## User
Bioinformatics Research Curator
## Workflow
1. Extract CDS and transcript sequences from downloaded NCBI gene data packages using Biopython SeqIO.
2. Calculate open reading frame coordinates and check terminal codon termination consistency.
3. Compare translated peptide sequences against expected NCBI protein records to detect premature truncation.
4. Format junction discrepancies and translational status into valid FHIR Observation resources.
## Interface
FastAPI service exposing ingestion endpoints and a React review grid displaying transcript CDS alignment anomalies.
## Data
Download public gene packages via NCBI Datasets CLI using sample accessions like NM_020107.5 and NP_001334352.2 into mock storage.
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 package command options including --include gene,rna,cds,protein to process transcript and protein sequences.
## Tools
pydantic-ai, biopython, fastapi.
Pydantic AI enforces strict type validation on complex genomic coordinate models and FHIR R5 payload structures.
Requires an LLM with structured output support via API or local execution for anomalous transcript explanation.
## 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
- Successfully parses FASTA CDS files using Biopython SeqIO with zero unhandled format exceptions.
- Identifies stop codon mismatches between CDS translation and NCBI protein reference accessions.
- Outputs compliant FHIR Observation JSON resources with coding system 'http://hl7.org/fhir/sid/ncbi-gene'.
## Starter Examples
```json
[
{
"input": {
"gene_id": "672",
"accession": "NM_020107.5",
"cds_seq": "ATGGCTGTAGATAACTGA",
"protein_seq": "MAVDN"
},
"expected_output": {
"status": "concordant",
"orf_complete": true,
"translated_length": 5,
"fhir_observation": {
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/sid/ncbi-gene",
"code": "NM_020107.5"
}
]
},
"valueString": "Concordant CDS and protein translation"
}
}
},
{
"input": {
"gene_id": "672",
"accession": "NM_020107.5",
"cds_seq": "ATGGCTGTA",
"protein_seq": "MAVDN"
},
"expected_output": {
"status": "discordant",
"orf_complete": false,
"translated_length": 3,
"fhir_observation": {
"resourceType": "Observation",
"status": "preliminary",
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/sid/ncbi-gene",
"code": "NM_020107.5"
}
]
},
"valueString": "Premature truncation: length mismatch between CDS translation (3) and reference (5)"
}
}
}
]
```
## Safety
Handles only synthetic or public reference sequence accessions; produces no patient clinical diagnostic claims.
Use mock external writes. Require human review before any real deployment.