Build a Biopython Multiple Alignment Outlier Detector with Qdrant — implementation
Linked challenge: Build a Biopython Multiple Alignment Outlier Detector with Qdrant
Prompt source
implementation85 lines11 sectionsNo variables1 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.