Skip to main content
Loading navigation
Back to prompt library

Build a Multi-Species Sequence Catalog Contamination Reviewer — implementation

Linked challenge: Build a Multi-Species Sequence Catalog Contamination Reviewer

Prompt source

implementation94 lines11 sectionsNo variables1 code block
## Build
Evaluate multi-species FASTA sequence packages downloaded from public repositories to identify cross-taxa read contamination. Generate structured taxonomic audit summaries and quarantine contaminated records before catalog federation.

## User
Bioinformatics Biocurator

## Workflow
1. Ingest multi-species FASTA records and target taxon labels downloaded via NCBI Datasets packages.
2. Scan sequences with Biopython to calculate base composition and k-mer similarity against target taxa.
3. Detect alien sequence contamination and low-complexity artifact clusters across catalog entries.
4. Generate a verified multi-species curation report with quarantined sequence accessions for human sign-off.

## Interface
Browser dashboard displaying sequence accession queues, taxonomic match confidence scores, and flag-for-quarantine controls.

## Data
Download public gene packages using NCBI Datasets CLI (--taxon human, rodent, yeast) or mock via simplified FASTA fixture 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/)
Extract multi-species FASTA sequence streams and taxon identifiers specified in NCBI Datasets download flags (--taxon and gene data reports).

## Tools
dspy, biopython, pydantic.
dspy compiles structured assertion rules to evaluate sequence classification reasoning and explain foreign contaminant flags.
Local or hosted LLM with structured JSON output capabilities for taxonomic 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
- Parses input multi-species FASTA files with Biopython SeqIO without unhandled syntax exceptions.
- Correctly identifies cross-species sequence contamination exceeding a 20% divergence threshold.
- Emits a normalized JSON quarantine report containing accession, detected taxon, and confidence score.
- Supports human biocurator review by generating override tokens for ambiguous sequence entries.

## Starter Examples
```json
[
  {
    "input": {
      "catalog_id": "CAT-2026-01",
      "declared_taxon": "Homo sapiens",
      "records": [
        {
          "accession": "SEQ_HS_001",
          "sequence": "ATGCGATCGATCGATCGATCGATCGATC"
        },
        {
          "accession": "SEQ_CONTAM_002",
          "sequence": "GGCCGGCCGGCCAATTCCGGAATTCCGG"
        }
      ],
      "divergence_threshold": 0.25
    },
    "expected_output": {
      "catalog_id": "CAT-2026-01",
      "reviewed_count": 2,
      "quarantined": [
        {
          "accession": "SEQ_CONTAM_002",
          "divergence_score": 0.42,
          "flag": "suspected_cross_contamination",
          "action": "quarantine"
        }
      ],
      "passed": [
        "SEQ_HS_001"
      ]
    }
  },
  {
    "input": {
      "catalog_id": "CAT-2026-02",
      "declared_taxon": "Mus musculus",
      "records": [
        {
          "accession": "SEQ_MM_001",
          "sequence": "NNNNNNNNNNNN"
        }
      ],
      "divergence_threshold": 0.2
    },
    "expected_output": {
      "catalog_id": "CAT-2026-02",
      "reviewed_count": 1,
      "quarantined": [
        {
          "accession": "SEQ_MM_001",
          "divergence_score": 1,
          "flag": "undetermined_low_quality_bases",
          "action": "reject"
        }
      ],
      "passed": []
    }
  }
]
```

## Safety
Research-only sequence catalog cleaning tool; does not provide diagnostic classification or clinical decisions.
Use mock external writes. Require human review before any real deployment.