Skip to main content
Loading navigation
Back to prompt library

Build a Research Molecular Assay Quality Indexer and Haystack Search Engine — implementation

Linked challenge: Build a Research Molecular Assay Quality Indexer and Haystack Search Engine

Prompt source

implementation59 lines11 sectionsNo variables1 code block
## Build
Aggregate sequencing quality scores and coverage metrics from FASTA batches. Index quality metrics into Haystack document stores to assist observational study cohort selection.

## User
Genomics Core Facility Manager

## Workflow
1. Parse multi-sample FASTA archives to compute sequence length distributions and GC content percentages.
2. Aggregate run-level quality control indicators across research specimen batches.
3. Index structured assay quality documents into a Haystack in-memory or OpenSearch document store.
4. Query assay cohorts using conversational parameters and export filtered FHIR DiagnosticReport bundles.

## Interface
React web application with cohort filter sliders, interactive GC-content histograms, and search query box.

## Data
Construct mock high-throughput sequencing run archives containing synthetic FASTA files with varied lengths and base distributions.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Biopython](https://raw.githubusercontent.com/biopython/biopython/master/README.rst)
Uses Biopython SeqIO to parse multi-record FASTA files and compute sequence composition properties.

## Tools
haystack, biopython, pydantic.
Haystack coordinates document store indexing, hybrid metadata filtering, and semantic query pipelines.
Local or hosted LLM to interpret complex natural language criteria for research cohort retrieval.

## 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
- Calculates GC content and sequence length metrics for all FASTA entries using Biopython.
- Populates Haystack Document Store with metadata attributes for rapid cohort filtering.
- Returns valid search results matching specified GC content and quality threshold filters.

## Starter Examples
```json
[
  {
    "input": {
      "batch_id": "RUN_001",
      "fasta_content": ">seq1\nATGCGATCGA\n>seq2\nGCGCGCGCGC\n"
    },
    "expected_output": {
      "total_sequences": 2,
      "mean_gc_content": 0.75,
      "indexed": true,
      "eligible_for_high_gc_cohort": true
    }
  },
  {
    "input": {
      "batch_id": "RUN_002",
      "fasta_content": ">seq_empty\n\n"
    },
    "expected_output": {
      "total_sequences": 0,
      "mean_gc_content": 0,
      "indexed": false,
      "error": "Empty FASTA records detected in batch RUN_002"
    }
  }
]
```

## Safety
Research assay quality metrics only; contains no protected patient identifiers or clinical diagnoses.
Use mock external writes. Require human review before any real deployment.