Back to prompt library
Build a Gene Homology Alignment Distance Vectorizer with Qdrant — implementation
Linked challenge: Build a Gene Homology Alignment Distance Vectorizer with Qdrant
Prompt source
implementation78 lines11 sectionsNo variables1 code block
## Build
Align homologous eukaryotic gene transcripts using Biopython and extract pairwise sequence divergence metrics. Index representation vectors into Qdrant to detect anomalous sequence outliers.
## User
Comparative Genomics Analyst
## Workflow
1. Download homologous transcript FASTA sequences across cross-species gene sets via NCBI Datasets.
2. Perform pairwise sequence alignments with Biopython to compute substitution matrices and gap penalties.
3. Convert alignment identity scores and conservation profiles into dense distance vectors.
4. Index vectors into Qdrant collections to isolate divergent paralogs or assembly errors.
## Interface
Jupyter Notebook interface with embedded interactive 2D UMAP scatter plot of Qdrant sequence clusters.
## Data
Fetch multi-species gene FASTA files using NCBI Datasets CLI with gene symbol filters ACRV1 or A2M.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Biopython](https://raw.githubusercontent.com/biopython/biopython/master/README.rst)
Uses Biopython pairwise sequence alignment and SeqIO routines to compute alignment distance metrics.
## Tools
qdrant, biopython, numpy.
Qdrant provides high-performance vector indexing and payload filtering for sequence distance embeddings.
Local embedding generation or small transformer model to translate alignment statistics into numerical embeddings.
## 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
- Executes Biopython pairwise alignments without memory exhaustion across transcript batches.
- Computes normalized alignment identity scores between 0.0 and 1.0 for each transcript pair.
- Indexes sequence vectors into Qdrant collection and successfully flags distance outliers.
## Starter Examples
```json
[
{
"input": {
"target_seq": "ATGCGATCGATCG",
"homolog_seqs": [
{
"id": "HOM_1",
"seq": "ATGCGATCGATCG"
},
{
"id": "HOM_2",
"seq": "ATGCGATCGATCC"
}
]
},
"expected_output": {
"indexed_count": 2,
"divergence_scores": {
"HOM_1": 0,
"HOM_2": 0.077
},
"outliers_detected": []
}
},
{
"input": {
"target_seq": "ATGCGATCGATCG",
"homolog_seqs": [
{
"id": "HOM_3",
"seq": "TTTTTTTTTTTTT"
}
]
},
"expected_output": {
"indexed_count": 1,
"divergence_scores": {
"HOM_3": 1
},
"outliers_detected": [
"HOM_3"
]
}
}
]
```
## Safety
Involves only open-source non-human or reference eukaryotic sequences; no patient genomic profiling.
Use mock external writes. Require human review before any real deployment.