Skip to main content
Loading navigation
Back to prompt library

Build a Research Cohort Genomic Assay Quality Indexer — implementation

Linked challenge: Build a Research Cohort Genomic Assay Quality Indexer

Prompt source

implementation67 lines11 sectionsNo variables1 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.