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 Gene Data Package FASTA Cleanser and Telemetry Monitor

Format
Code-aware
Lines
64
Sections
11
Linked challenge
Build a Gene Data Package FASTA Cleanser and Telemetry Monitor

Prompt source

Original prompt text with formatting preserved for inspection.

64 lines
11 sections
No variables
1 code block
## Build
Process multi-FASTA gene packages to detect non-IUPAC nucleotide characters and low-complexity repeats. Track data cleansing performance and error drift using Langfuse.

## User
Bioinformatics Pipeline Engineer

## Workflow
1. Stream multi-FASTA files from NCBI Datasets gene archives using Biopython SeqIO.
2. Scan each sequence entry for non-IUPAC nucleotide symbols, masked N-stretches, and degenerate codons.
3. Log cleaning latency, token counts, and sequence anomaly rates into Langfuse telemetry spans.
4. Export sanitized FASTA output alongside a structured data cleaning audit log.

## Interface
Command-line pipeline configured with environment variables sending real-time telemetry to Langfuse UI.

## Data
Generate synthetic multi-FASTA files containing random mutations, non-IUPAC characters, and poly-N stretches.
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.SeqIO and sequence validation routines to inspect sequence headers and character contents.

## Tools
langfuse, biopython, pydantic.
Langfuse provides observability, trace tracking, and latency metrics for repetitive data curation pipelines.
Local or hosted LLM for generating contextual summaries of sequence anomaly clusters.

## 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
- Correctly identifies non-standard IUPAC characters (e.g. 'Z', '?', numbers) in input FASTA records.
- Sends telemetry traces to Langfuse containing sequence identifier and processing duration.
- Generates sanitized FASTA files preserving sequence IDs and valid biological characters.

## Starter Examples
```json
[
  {
    "input": {
      "record_id": "TRANS_001",
      "raw_sequence": "ATGCGTACNNNGTACG"
    },
    "expected_output": {
      "valid_iupac": true,
      "n_ratio": 0.1875,
      "sanitized_sequence": "ATGCGTACNNNGTACG",
      "telemetry_logged": true
    }
  },
  {
    "input": {
      "record_id": "TRANS_002",
      "raw_sequence": "ATGC123GZZTAG"
    },
    "expected_output": {
      "valid_iupac": false,
      "invalid_characters": [
        "1",
        "2",
        "3",
        "Z"
      ],
      "sanitized_sequence": "ATGCGGTAG",
      "telemetry_logged": true
    }
  }
]
```

## Safety
Processes pure nucleotide strings from public or synthetic data without clinical patient associations.
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.