Skip to main content
Loading navigation
Back to prompt library

Build a Prokaryotic Gene RefSeq Coordinate Discrepancy Auditor — implementation

Linked challenge: Build a Prokaryotic Gene RefSeq Coordinate Discrepancy Auditor

Prompt source

implementation69 lines11 sectionsNo variables1 code block
## Build
Download prokaryotic WP_ accession metadata and FASTA sequences to detect ribosomal slippage annotation gaps. Generate FHIR Molecular Observation logs to track curated sequence revisions.

## User
Microbial Biocurator

## Workflow
1. Download prokaryotic gene packages using NCBI Datasets WP_ protein accession queries.
2. Parse FASTA headers and protein strings using Biopython to calculate amino acid lengths.
3. Compare sequence lengths against the reported gene coordinate boundaries from the metadata report.
4. Generate FHIR Observation records cataloging coordinate matching status and length discrepancies.

## Interface
Interactive data table showing prokaryotic gene accessions, length deltas, and automated FHIR output viewers.

## Data
Query NCBI Datasets CLI using synthetic mock WP_ accessions with the --include gene,protein flags.
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/)
Extracts prokaryotic gene data packages containing WP_ accessions, gene and protein sequences.

## Tools
agno, biopython, sqlite3.
agno provides lightweight workflow orchestration to manage sequential API queries and Biopython parsing tasks.
Local Python 3.12 runtime with Ollama or local LLM fallback for automated curator note generation.

## 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
- Download and parse both gene nucleotide and WP_ protein sequences from the data package.
- Detect discrepancy between expected peptide length and gene length divided by 3.
- Produce FHIR Observation resource with code indicating coordinate match status.

## Starter Examples
```json
[
  {
    "input": {
      "accession": "WP_000001.1",
      "gene_length_bp": 900,
      "protein_length_aa": 300
    },
    "expected_output": {
      "accession": "WP_000001.1",
      "length_delta": 0,
      "coordinate_match": true,
      "fhir_observation": {
        "resourceType": "Observation",
        "status": "final",
        "valueBoolean": true
      }
    }
  },
  {
    "input": {
      "accession": "WP_000002.1",
      "gene_length_bp": 900,
      "protein_length_aa": 250
    },
    "expected_output": {
      "accession": "WP_000002.1",
      "length_delta": -50,
      "coordinate_match": false,
      "fhir_observation": {
        "resourceType": "Observation",
        "status": "preliminary",
        "valueBoolean": false
      }
    }
  }
]
```

## Safety
Research-oriented microbial genomics pipeline utilizing open RefSeq accessions. No clinical diagnosis or diagnostic utility.
Use mock external writes. Require human review before any real deployment.