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 Cohort Genomic Assay Quality Indexer

Format
Code-aware
Lines
67
Sections
11
Linked challenge
Build a Research Cohort Genomic Assay Quality Indexer

Prompt source

Original prompt text with formatting preserved for inspection.

67 lines
11 sections
No variables
1 code block
## Build
Aggregate sequencing quality parameters from multi-sample FASTA archives and index metrics into search records. Generate FHIR DiagnosticReport entities to support observational research cohort discovery.

## User
Bioinformatics Platform Engineer

## Workflow
1. Parse multi-sample FASTA sequence files and extract per-sequence base composition statistics.
2. Compute GC-content percentages and ambiguous N-base ratios using Biopython.
3. Index computed quality records with metadata tags into a local vector and document index.
4. Compile batch quality metrics into FHIR DiagnosticReport bundles for registry integration.

## Interface
REST API endpoint paired with a web table displaying GC% distributions, N-base ratios, and bundle download links.

## Data
Assemble public FASTA test files via NCBI Datasets command for human mitochondrial or bacterial genes.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Biopython](https://raw.githubusercontent.com/biopython/biopython/master/README.rst)
Employs Biopython's Bio.SeqUtils module to parse FASTA files and quantify GC content.

## Tools
llamaindex, biopython, chromadb.
llamaindex indexes structured bioinformatics quality metrics and allows natural-language semantic cohort querying.
Hosted or local embedding model for index construction; API-based LLM for cohort query answering.

## 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
- Calculate GC content percentage within 0.1% accuracy for each sequence.
- Construct valid FHIR DiagnosticReport resources linking sample quality metrics.
- Index at least 50 sample records and verify semantic lookup by quality criteria.

## Starter Examples
```json
[
  {
    "input": {
      "sample_id": "COHORT_S1",
      "fasta_sequence": "ATGCGATCGATCGATC"
    },
    "expected_output": {
      "sample_id": "COHORT_S1",
      "gc_percent": 50,
      "n_ratio": 0,
      "quality_flag": "PASS",
      "fhir_report": {
        "resourceType": "DiagnosticReport",
        "status": "final"
      }
    }
  },
  {
    "input": {
      "sample_id": "COHORT_S2",
      "fasta_sequence": "NNNATGCNNNNNGATC"
    },
    "expected_output": {
      "sample_id": "COHORT_S2",
      "gc_percent": 25,
      "n_ratio": 0.5,
      "quality_flag": "REJECT",
      "fhir_report": {
        "resourceType": "DiagnosticReport",
        "status": "preliminary"
      }
    }
  }
]
```

## Safety
Research data platform indexing sequence assay metrics without patient identity or health advice.
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.