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 Biopython Multiple Alignment Outlier Detector with Qdrant

Format
Code-aware
Lines
85
Sections
11
Linked challenge
Build a Biopython Multiple Alignment Outlier Detector with Qdrant

Prompt source

Original prompt text with formatting preserved for inspection.

85 lines
11 sections
No variables
1 code block
## Build
Compute pairwise distance vectors across homologous transcripts and index representations into Qdrant. Flag outlier sequences and output FHIR DiagnosticReport payloads for biocuration teams.

## User
Phylogenomics Analyst

## Workflow
1. Align homologous transcript sets using Biopython multiple sequence alignment utilities.
2. Extract k-mer frequency vectors and alignment distance scores for each sequence record.
3. Index sequence feature embeddings into Qdrant vector collections to calculate centroid distances.
4. Flag distance outliers and assemble FHIR DiagnosticReport payloads highlighting anomalous accessions.

## Interface
Interactive dashboard showing scatter-plot cluster distributions and downloadable outlier reports.

## Data
Fetch synthetic eukaryotic gene packages for ACRV1 and homologous vertebrate loci from mock data stores.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Biopython](https://raw.githubusercontent.com/biopython/biopython/master/README.rst)
Applies Biopython multiple alignment parsing and sequence distance calculation routines documented in README.

## Tools
qdrant, biopython, fastapi.
Stores high-dimensional k-mer vectors and performs cosine distance queries to detect structural sequence outliers.
Fast remote LLM for summarizing cluster anomalies and framing curator review notes.

## 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
- Computes k-mer frequency vectors from Biopython alignment sequences.
- Stores and queries vector embeddings in a local or remote Qdrant collection.
- Identifies sequences that deviate beyond two standard deviations from cluster centroids.

## Starter Examples
```json
[
  {
    "input": {
      "dataset_id": "HOM_GRP_10",
      "sequences": [
        {
          "id": "TRANS_A",
          "seq": "ATGCGATCGATCGATC"
        },
        {
          "id": "TRANS_B",
          "seq": "ATGCGATCGATCGATC"
        },
        {
          "id": "TRANS_OUTLIER",
          "seq": "TTTTTTTTTTTTTTTT"
        }
      ]
    },
    "expected_output": {
      "dataset_id": "HOM_GRP_10",
      "total_sequences": 3,
      "outliers_detected": [
        "TRANS_OUTLIER"
      ],
      "cluster_centroid_distance": 0.89,
      "fhir_report_generated": true
    }
  },
  {
    "input": {
      "dataset_id": "HOM_GRP_11",
      "sequences": [
        {
          "id": "TRANS_1",
          "seq": "ATGGCTAGCTAG"
        },
        {
          "id": "TRANS_2",
          "seq": "ATGGCTAGCTAG"
        }
      ]
    },
    "expected_output": {
      "dataset_id": "HOM_GRP_11",
      "total_sequences": 2,
      "outliers_detected": [],
      "cluster_centroid_distance": 0,
      "fhir_report_generated": true
    }
  }
]
```

## Safety
Research-only sequence clustering; completely separate from patient diagnostic testing.
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.