Skip to main content
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 Vector-Based Sequence Catalog Cross-Contamination Screener

Format
Code-aware
Lines
123
Sections
11
Linked challenge
Build a Vector-Based Sequence Catalog Cross-Contamination Screener

Prompt source

Original prompt text with formatting preserved for inspection.

123 lines
11 sections
No variables
1 code block
## Build
Convert sequence k-mer profiles into vector embeddings to detect non-target species fragments in public sequence submissions. Index reference taxa profiles in Qdrant and isolate anomalous sequence entries.

## User
Sequence Repository Quality Manager

## Workflow
1. Read input FASTA files and decompose reads into standardized oligonucleotide k-mer frequency vectors.
2. Index canonical species reference profiles within Qdrant collection spaces.
3. Query uploaded sequence vectors against reference spaces to compute cosine similarity scores.
4. Produce an automated contamination triage manifest flagging outliers for biocurator inspection.

## Interface
Vector similarity scatter workspace with nearest-neighbor taxon matches and manual quarantine actions.

## Data
Synthesize normalized FASTA records and obtain reference k-mers from public NCBI eukaryotic gene downloads.
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 records using NCBI Datasets parameters (--taxon human, --include rna).

## Tools
qdrant, biopython, numpy.
qdrant enables vector indexing and similarity search over sequence k-mer embedding representations.
Local Python vectorizer runtime without specialized neural weights.

## 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
- Transforms FASTA nucleotide strings into normalized k-mer frequency vectors.
- Indexes reference vectors into Qdrant collection and queries query sequence distances.
- Identifies alien sequences that show top similarity to non-target taxon profiles.
- Provides human-in-the-loop review actions to override or confirm sequence quarantine.

## Starter Examples
```json
[
  {
    "input": {
      "collection_name": "taxa_vectors",
      "target_taxon": "human",
      "query_sequences": [
        {
          "id": "SEQ_01",
          "vector": [
            0.95,
            0.05,
            0
          ]
        },
        {
          "id": "SEQ_02",
          "vector": [
            0.05,
            0.9,
            0.05
          ]
        }
      ],
      "reference_centroids": {
        "human": [
          0.92,
          0.08,
          0
        ],
        "bacterial_contaminant": [
          0.08,
          0.88,
          0.04
        ]
      }
    },
    "expected_output": {
      "target_taxon": "human",
      "results": [
        {
          "id": "SEQ_01",
          "matched_taxon": "human",
          "confidence": 0.99,
          "status": "approved"
        },
        {
          "id": "SEQ_02",
          "matched_taxon": "bacterial_contaminant",
          "confidence": 0.98,
          "status": "quarantined"
        }
      ]
    }
  },
  {
    "input": {
      "collection_name": "taxa_vectors",
      "target_taxon": "human",
      "query_sequences": [
        {
          "id": "SEQ_EMPTY",
          "vector": [
            0,
            0,
            0
          ]
        }
      ],
      "reference_centroids": {
        "human": [
          0.92,
          0.08,
          0
        ]
      }
    },
    "expected_output": {
      "target_taxon": "human",
      "results": [
        {
          "id": "SEQ_EMPTY",
          "matched_taxon": "unassigned",
          "confidence": 0,
          "status": "flagged_error"
        }
      ]
    }
  }
]
```

## Safety
Bioinformatics sequence quality control tool; operates on public or synthetic DNA sequences only.
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.