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 Biopython FASTA Cleanser and IUPAC Code Quality Auditor

Format
Code-aware
Lines
66
Sections
11
Linked challenge
Build a Biopython FASTA Cleanser and IUPAC Code Quality Auditor

Prompt source

Original prompt text with formatting preserved for inspection.

66 lines
11 sections
No variables
1 code block
## Build
Audit high-throughput FASTA sequence submissions for non-standard nucleotide characters and low-complexity regions. Generate structured FHIR DiagnosticReport payloads with quality metrics.

## User
Sequencing Core Analyst

## Workflow
1. Read uploaded multi-FASTA files using Biopython SeqIO parsing iterators.
2. Identify ambiguous IUPAC nucleotide symbols, degenerate stretches, and uncalled base runs.
3. Compute per-sequence GC percentage, sequence length, and ambiguous character frequencies.
4. Construct FHIR Molecular Observation entries detailing quality scores for bioinformatic pipelines.

## Interface
Interactive upload web portal with real-time sequence quality charts and downloadable audit reports.

## Data
Generate synthetic FASTA files with intentional IUPAC ambiguous characters (N, R, Y, S, W) locally.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Biopython](https://raw.githubusercontent.com/biopython/biopython/master/README.rst)
Uses Biopython Bio.SeqIO and sequence manipulation methods described in Biopython README and documentation.

## Tools
langfuse, biopython, fastapi.
Tracks audit latency, quality parameter distributions, and sequence drift metrics across incoming batches.
Lightweight hosted language model for summarizing sequence anomaly reports into natural language.

## 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
- Flags non-IUPAC characters and calculates ambiguous base percentages accurately.
- Serializes sequence quality statistics into valid FHIR Molecular Observation resources.
- Processes multi-record FASTA files streaming line-by-line without high memory consumption.

## Starter Examples
```json
[
  {
    "input": {
      "record_id": "SEQ-001",
      "sequence": "ATGCGTACCGGTTACGTACCGTTAGGCTAGCTAGGCTACGTACGTAGCTAGCTAG"
    },
    "expected_output": {
      "record_id": "SEQ-001",
      "length_bp": 56,
      "gc_content_pct": 51.79,
      "ambiguous_count": 0,
      "pass_qc": true,
      "fhir_observation_status": "final"
    }
  },
  {
    "input": {
      "record_id": "SEQ-002",
      "sequence": "ATGCGNNNNCGGTTRYSTAGCTAGZZZCTAG"
    },
    "expected_output": {
      "record_id": "SEQ-002",
      "length_bp": 31,
      "gc_content_pct": 38.71,
      "ambiguous_count": 8,
      "invalid_chars": [
        "Z"
      ],
      "pass_qc": false,
      "fhir_observation_status": "preliminary"
    }
  }
]
```

## Safety
Quality assurance on research and de-identified sequencing data only; no medical decision support.
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.