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 Research Molecular Assay Quality Indexer and Haystack Search Engine

Format
Code-aware
Lines
59
Sections
11
Linked challenge
Build a Research Molecular Assay Quality Indexer and Haystack Search Engine

Prompt source

Original prompt text with formatting preserved for inspection.

59 lines
11 sections
No variables
1 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.

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.