agents-last-exam/agents-last-exam huggingface dataset:
Title: Amber Implicit-Solvent Minimization Workflow Construction
Domain: life_sciences — Biomolecular Structure & Design

Summary: Construct three Linux Amber workflow files from a cleaned protein-complex structure: a tleap build file, an implicit-solvent minimization control file, and a SLURM submission script.

Task prompt:
You are preparing a Linux Amber workflow definition from a cleaned protein-complex structure.

Task directory:
- `base`

Input directory:
- `base/input`

Available environment:
- Linux terminal access
- Python 3 on the VM

Your task:
1. Inspect `complex_structure.pdb`
2. Create exactly these three files under `base/output`:
   - `leap.in`
   - `step2_implicit.mini.mdin`
   - `submit_min.sh`

Requirements:
- Build the system from `complex_structure.pdb`
- Use basename `GLN_phb2_lc3_aurka_model_0` consistently
- Define a realistic implicit-solvent Amber minimization workflow
- Write a SLURM submission script for one GPU using Amber 22 and CUDA 11.6.2 module loads
- Do not write extra files

## Canonical Workflow Contract

- In `leap.in`, source `leaprc.protein.ff14SB`, set `default PBRadii mbondi3`, load `complex_structure.pdb`, and write `GLN_phb2_lc3_aurka_model_0.prmtop`, `GLN_phb2_lc3_aurka_model_0.inpcrd`, and `GLN_phb2_lc3_aurka_model_0_fixed.pdb`.
- In `step2_implicit.mini.mdin`, use `imin=1`, `ntb=0`, the canonical spelling `cut=999.0`, `igb=7` or `igb=8`, and include both `ntpr` and `ntxo`. Use at least 2000 minimization cycles with `0 < ncyc < maxcyc`. If supplied, use `saltcon` in `[0.0, 0.2]`, `intdiel` in `[1.0, 4.0]`, and `extdiel` in `[60.0, 90.0]`.
- In `submit_min.sh`, request one node, exactly one GPU, and exactly one task using `#SBATCH --ntasks-per-node=1`. Request 1-4 CPUs per task, 8-32 GB of memory, and 1-12 hours.
- Load modules whose command text contains `amber/22` and `cuda/11.6.2`. Create/use a `params` directory, run `tleap` conditionally when topology or coordinates are absent, and invoke `pmemd.cuda -O` exactly once.
- Wire `step2_implicit.mini.mdin`, the named topology and starting/reference coordinates, `min.out`, and `min.rst` to the corresponding `-i`, `-p`, `-c`, `-ref`, `-o`, and `-r` options.


The agent must:
Inspect `complex_structure.pdb` and infer the workflow wiring needed for an Amber minimization setup.
Create `leap.in` that loads the structure, uses `leaprc.protein.ff14SB`, sets `mbondi3`, and writes the required Amber outputs.
Create `step2_implicit.mini.mdin` defining a realistic implicit-solvent GB minimization stage.
Create `submit_min.sh` as a SLURM one-GPU Amber minimization submission script.
Write exactly the three required files and no extras.

Software: Amber 22
AmberTools tleap
SLURM
CUDA 11.6.2

Input files:
name: complex_structure.pdb
format: PDB
path: input/complex_structure.pdb
description: Cleaned three-chain protein complex structure.
name: input_environment_spec.md
format: Markdown
path: input/input_environment_spec.md
description: Reference environment and workflow expectations.
name: task_sop.md
format: Markdown
path: input/task_sop.md
description: Workflow instructions and required deliverables.
Title: Amber Three-Stage MMGBSA Workflow Authoring
Domain: life_sciences — Biomolecular Structure & Design

Summary: Author a Linux Amber workflow bundle for a three-chain protein complex, including the two SLURM driver scripts, the MMGBSA submission script, and the final MMGBSA result file based on a staged trajectory.

Task prompt:
You are preparing a Linux Amber workflow definition for a protein-only three-chain complex.

Task directory:
- `base`

Input directory:
- `base/input`

Software:
- Benchmark-owned AmberTools 23 CLI wrapper: `base/software/run_ambertools.sh`
- Invoke staged AmberTools commands as: `base/software/run_ambertools.sh <tool> ...`
- Supported tool names: `tleap, cpptraj, MMPBSA.py, ante-MMPBSA.py, antechamber, parmchk2`
- `pmemd.cuda`, CUDA, and SLURM remain reference-environment details for the authored scripts; they are not benchmark-provided on this VM.

Your task:
1. Inspect `complex_structure.pdb` and the two markdown specs under `input/`.
2. Treat chain `A` as the receptor and chains `B` plus `C` together as the ligand.
3. Create exactly these four files under `base/output`:
   - `submit_min.sh`
   - `submit_prod.sh`
   - `submit_mmgbsa.sh`
   - `FINAL_RESULTS_MMGBSA.dat`

Requirements:
- Use basename `GLN_phb2_parl_pgam5_model_0` consistently in the workflow.
- `submit_min.sh` should define topology/build plus minimization and short equilibration.
- `submit_prod.sh` should define one implicit-solvent production MD stage with `pmemd.cuda`.
- `submit_mmgbsa.sh` should run `MMPBSA.py` with complex / receptor-A / ligand-BC roles wired correctly.
- The graded MMGBSA result must use the provided `input/prod.mdcrd` as trajectory input.
- Do not write extra deliverable files.



The agent must:
Inspect `complex_structure.pdb` and the two staged markdown specs under `input/`.
Treat chain `A` as the receptor and chains `B` plus `C` together as the ligand.
Write `submit_min.sh` that covers topology construction plus minimization and short equilibration.
Write `submit_prod.sh` for one implicit-solvent production MD stage using `pmemd.cuda`.
Write `submit_mmgbsa.sh` plus `FINAL_RESULTS_MMGBSA.dat`, using the staged `prod.mdcrd` as the deterministic MMGBSA trajectory input.

Software: AmberTools 23 via software/run_ambertools.sh
Amber 22 / SLURM / CUDA 11.6.2 (reference environment only)

Input files:
name: task_sop.md
format: Markdown
path: input/task_sop.md
description: Agent-facing Amber workflow instructions and deliverable expectations.
name: input_environment_spec.md
format: Markdown
path: input/input_environment_spec.md
description: Reference environment notes and naming conventions for the workflow.
name: complex_structure.pdb
format: PDB
path: input/complex_structure.pdb
description: Cleaned three-chain protein complex structure used to define the workflow.
name: prod.mdcrd
format: Amber trajectory
path: input/prod.mdcrd
description: Deterministic staged trajectory that the final MMGBSA step must use.
Title: Cell Tracking Instance 1
Domain: life_sciences — Cell & Imaging Biology

Summary: Segment and track cells across a 30-frame fluorescence microscopy sequence and export Cell Tracking Challenge style masks and lineage metadata.

Task prompt:
You are performing cell tracking on a fluorescence microscopy time-lapse sequence.

Task directory:
- `base`

Visible inputs:
- 30 grayscale TIFF frames: `base/input/01/t000.tif` through `base/input/01/t029.tif`
- Optional Python dependency manifest: `base/input/runtime_env/pyproject.toml`
- Optional Python dependency lockfile: `base/input/runtime_env/uv.lock`
- Optional Python wrapper: `base/software/python_cell_tracking.sh`

Recommended setup:
- Work on Linux in `base`.
- If you need common image-processing packages, run:
  `UV_PROJECT_ENVIRONMENT=/tmp/agenthle_cell_tracking_runtime_env uv sync --project "base/input/runtime_env"`
- You may run scripts through `base/software/python_cell_tracking.sh`.

Your task:
1. Segment individual cells in every frame.
2. Track cells across all 30 frames so the same cell keeps a consistent positive integer label.
3. Save labeled tracking masks as `base/output/mask000.tif` through `base/output/mask029.tif`.
4. Save the lineage table as `base/output/res_track.txt`.

Output format:
- Masks must be 2D labeled TIFF images with the same dimensions as the input frames.
- Pixel value `0` is background; positive integer values are cell IDs.
- `res_track.txt` must use Cell Tracking Challenge format with four whitespace-separated integer columns per row: `L B E P`.
- `L` is the cell label, `B` is the first frame index, `E` is the last frame index, and `P` is the parent label or `0`.

A successful result should accurately segment the cells and keep their identities consistent over time. Do not modify files under `input/`; write final result files only under `base/output`.


The agent must:
Inspect the 30 staged fluorescence microscopy frames.
Segment individual cells in each frame.
Track cells over time with consistent positive integer labels.
Write exactly 30 labeled TIFF masks named `mask000.tif` through `mask029.tif`.
Write a valid CTC-style `res_track.txt` lineage table.

Software: Python
NumPy
Pillow
tifffile

Input files:
name: t000.tif ... t029.tif
format: TIFF image sequence
path: input/01/
description: Thirty grayscale 1024 by 1024 fluorescence microscopy frames.
name: pyproject.toml
format: Python project manifest
path: input/runtime_env/pyproject.toml
description: Optional agent-runtime dependency manifest for common image-processing libraries.
name: uv.lock
format: uv lockfile
path: input/runtime_env/uv.lock
description: Optional lockfile for reproducible agent-runtime dependency installation.
Title: Cell Translocation Analysis
Domain: life_sciences — Cell & Imaging Biology

Summary: Analyze paired DNA and GFP microscopy images to quantify nuclear translocation across a drug dose series and report the minimum effective dose.

Task prompt:
You are analyzing two-channel cell microscopy images for GFP nuclear translocation.

Task directory:
- `base`

Visible inputs:
- Paired TIFF images: `base/input/images`
- Dose and control metadata: `base/input/images/Translocation_doses_and_controls.csv`
- Detailed task instructions: `base/input/task_instructions.md`
- Optional Python dependency manifest: `base/input/runtime_env/pyproject.toml`
- Optional Python wrapper: `base/software/python_cell_translocation.sh`

Your task is to pair the DNA and GFP channels by well, segment nuclei and cell/cytoplasm compartments, measure GFP and channel-correlation features, classify positive translocation using the dose/control metadata, identify the minimum effective dose, and save `Cells.csv`, `Cytoplasm.csv`, `Nuclei.csv`, and `answer.json` under `base/output`.

`answer.json` must be a JSON object with numeric keys `minimum_dose` and `positive_percentage`.

Do not modify files under `input/`.

## Analysis Contract

- Use the per-cell nuclear-to-cytoplasmic mean GFP intensity ratio as the translocation score. The control-established canonical positive classification is `Math_IntensityRatio > 4.0`; apply it unchanged to every well and do not retune it against dose-well responses.
- For each non-control dose, compute the fraction of segmented cells above the threshold. `minimum_dose` is the smallest non-control dose with a positive fraction of at least `0.80`; `positive_percentage` is that fraction at `minimum_dose`, on the `[0, 1]` scale and rounded to four decimal places.
- Write one row per segmented object in each measurement CSV. Every table must contain numeric `ImageNumber` and `ObjectNumber` columns, with `ImageNumber` consistently identifying the paired well image.
- `Cells.csv` must contain `Location_` features. `Cytoplasm.csv` and `Nuclei.csv` must contain `Correlation_`, `Intensity_`, `Location_`, and `Math_` feature families, including the translocation ratio as a `Math_` feature.


The agent must:
Pair DNA (`w1`) and GFP (`w2`) TIFF images by well.
Segment nuclei and derive cell/cytoplasm compartments.
Measure GFP intensity, channel-correlation, location, and ratio-style object features.
Classify positive translocation using the dose/control metadata.
Save `Cells.csv`, `Cytoplasm.csv`, `Nuclei.csv`, and `answer.json` under the runtime output directory.

Software: CellProfiler
Python
numpy
pandas
scikit-image
tifffile

Input files:
name: BBBC013_<well>_s1_w1.tif / BBBC013_<well>_s1_w2.tif
format: tiff
path: input/images/
description: Paired DNA and GFP microscopy channels for each staged well.
name: Translocation_doses_and_controls.csv
format: csv
path: input/images/Translocation_doses_and_controls.csv
description: Well-to-dose and control metadata.
name: runtime_env
format: uv project
path: input/runtime_env/
description: Optional pinned Python image-analysis runtime.
Title: ENCODE CTCF Union Peak Intervals
Domain: life_sciences — Genomics & Sequence Analysis

Summary: Process three ENCODE CTCF narrowPeak BED files into the requested non-overlapping union peak set, with a reproducible command log and summary counts.

Task prompt:
You are a bioinformatics analyst working on a Linux genomic interval processing task.

Task directory:
- `base`

Visible input files:
- `base/input/ENCFF483KVM.bed`
- `base/input/ENCFF511NNV.bed`
- `base/input/ENCFF758CQW.bed`
- Operation specification: `base/input/operation_specification.txt`
- Detailed task instructions: `base/input/task_instructions.md`
- Output contract: `base/input/output_contract.json`
- BEDTools v2.31.1 entry point: `base/software/bedtools`
- Software note: `base/software/README.txt`

What you must do:
1. Read the operation specification and apply it to the three ENCODE CTCF narrowPeak BED files.
2. Produce the final non-overlapping CTCF union peak set as a 3-column BED file with columns `chrom`, `start`, and `end`.
3. Sort the final BED lexicographically by chromosome, then numerically by start and end.
4. Record the commands or script steps you used.
5. Write a JSON summary whose input and output counts match the files you used and produced.
6. Write exactly these required files under `base/output`:
   - `union_peaks.bed`
   - `commands.sh`
   - `summary.json`

Use `base/software/bedtools` when you need BEDTools; do not rely on a PATH-resolved `bedtools`.
Do not modify files under `base/input`.
Do not write final outputs outside `base/output`.
Use local staged files only; do not download replacement data from the internet.


The agent must:
Read `operation_specification.txt` and apply it to all three ENCODE CTCF narrowPeak BED inputs.
Write a sorted, non-overlapping 3-column BED file named `union_peaks.bed`.
Record the interval-processing commands or script steps in `commands.sh`.
Write `summary.json` with input interval counts, total input intervals, output filename, and output interval count.

Software: BEDTools
GNU sort
Python

Input files:
name: ENCFF483KVM.bed
format: BED/narrowPeak
path: input/ENCFF483KVM.bed
description: ENCODE CTCF narrowPeak-style interval file.
name: ENCFF511NNV.bed
format: BED/narrowPeak
path: input/ENCFF511NNV.bed
description: ENCODE CTCF narrowPeak-style interval file.
name: ENCFF758CQW.bed
format: BED/narrowPeak
path: input/ENCFF758CQW.bed
description: ENCODE CTCF narrowPeak-style interval file.
name: operation_specification.txt
format: txt
path: input/operation_specification.txt
description: Concise interval-operation specification supplied with the task.
Title: HG002 Chr22 Germline Variant Pipeline
Domain: life_sciences — Genomics & Sequence Analysis

Summary: Repair a staged chr22 germline variant-calling workflow for HG002 and produce the required filtered variants, annotation outputs, and QC artifacts.

Task prompt:
You are working on a Linux germline-variant-calling task.

Visible solve-time input root:
- `base/input/starter_project`

Your job is to repair the starter workflow and write a completed `submission/`
tree under:
- `base/output/submission`

Inside the visible starter project you have:
- paired-end reads under `fastq/`
- the chr22 reference FASTA and known-sites inputs under `reference/`
- the chr22 confident BED under `truth/`
- VEP resources under `vep_cache/`
- intentionally broken `samplesheet.csv`, `nextflow.config`, and `run_vep.sh`

Write these required artifacts under `base/output/submission`:
- `pipeline/samplesheet.csv`
- `pipeline/nextflow.config`
- `pipeline/known_sites_chr22/dbsnp_138.chr22.vcf.gz` and `.tbi`
- `pipeline/known_sites_chr22/Mills_and_1000G_gold_standard.indels.chr22.vcf.gz` and `.tbi`
- `results/variants/HG002.filtered.vcf.gz` and `.tbi`
- `results/annotation/HG002.filtered.annotated.vcf.gz` and `.tbi`
- `results/reports/multiqc_report.html`
- `results/reports/multiqc_data/multiqc_general_stats.txt`
- `results/reports/multiqc_data/multiqc_software_versions.txt`
- `results/qc/qc_summary.json`
- `DECISIONS.md`

Requirements:
1. Correct the samplesheet so it is valid for the HG002 chr22 run.
2. Rename the Mills contigs to `chr22` and re-index the corrected file.
3. Rebuild the missing `bwa-mem2` index.
4. Tune the workflow config for the available host.
5. Produce a hard-filtered chr22 VCF and a VEP-annotated VCF.
6. Aggregate QC into MultiQC and report at least `alignment_rate`,
   `dup_rate`, and `mean_coverage_chr22` in `results/qc/qc_summary.json`.
7. Explain any filtering choices in `DECISIONS.md` with concrete numeric values.

Rules:
- Write solver-created files only under `base/output`.


The agent must:
Read the staged HG002 chr22 starter workflow under `input/starter_project/`.
Repair the broken samplesheet, Nextflow config, known-sites naming, and `run_vep.sh` assumptions.
Rebuild the missing `bwa-mem2` index and run the chr22 calling workflow.
Write the required filtered VCF, annotated VCF, QC outputs, and `DECISIONS.md` into `output/submission/`.

Software: Nextflow
nf-core/sarek
BWA-MEM2
GATK
VEP
MultiQC

Input files:
name: starter_project/fastq/
format: gzipped FASTQ pair
path: input/starter_project/fastq/
description: Paired-end HG002 chr22 reads for the germline calling run.
name: starter_project/reference/
format: FASTA, BED, and bgzipped VCF inputs
path: input/starter_project/reference/
description: Chr22 reference FASTA, calling intervals, and known-sites inputs used by the workflow.
name: starter_project/vep_cache/
format: GTF and bgzipped VCF resources
path: input/starter_project/vep_cache/
description: Visible annotation resources used to produce the annotated chr22 VCF.
Title: RGI Contig Resistance Annotation
Domain: life_sciences — Systems & Microbial Biology

Summary: Annotate one staged antimicrobial-resistance contig with CARD RGI and report the best-hit ARO gene name, percent identity, drug class, and resistance mechanism in a JSON output.

Task prompt:
You are working on a Linux VM to annotate one plasmid-mediated antimicrobial-resistance gene from a staged DNA contig with CARD RGI.

Visible task workspace:
- `base`

Visible inputs:
- Contig FASTA: `base/input/input_contig.fasta`
- CARD database JSON: `base/input/card.json`
- Runtime manifest for installing the official GitHub RGI package: `base/input/runtime_env/pyproject.toml`

Required workflow:
1. Work from a writable directory under `base/output`.
2. Create a task-local Python environment from `base/input/runtime_env` so the `rgi` CLI is available.
3. Use the staged `base/input/card.json` with `rgi load --local -i ../input/card.json`.
4. Run RGI in contig mode against `../input/input_contig.fasta` with:
   `rgi main -i ../input/input_contig.fasta -o rgi_result -t contig --local --clean -g PYRODIGAL`
5. Parse the first data row of `rgi_result.txt`.
6. Write exactly one UTF-8 JSON file to `base/output/answer.json` with these keys:
   - `best_hit_aro`
   - `percent_identity`
   - `drug_class`
   - `resistance_mechanism`

Output requirements:
- `best_hit_aro` should be the best-hit ARO gene name string from the RGI TSV.
- `percent_identity` should be numeric.
- `drug_class` should report CARD's drug class wording for the hit.
- `resistance_mechanism` should report CARD's resistance mechanism wording for the hit.
- Keep solver-created files under `base/output`.
- Treat `base/input` as read-only source data.

Important constraints:
- Use the provided `base/input/card.json` instead of downloading a different CARD version.
- Use contig mode, not protein mode.
- Report the specific best-hit ARO gene name from the RGI TSV rather than a generic enzyme-family label.


The agent must:
Create a task-local Python environment from `input/runtime_env/pyproject.toml` so the official GitHub `rgi` package is available.
Load the staged CARD JSON with `rgi load --local -i card.json`.
Run `rgi main` in contig mode against `input_contig.fasta` with `--local --clean -g PYRODIGAL`.
Parse the first row of `rgi_result.txt`.
Write `output/answer.json` with `best_hit_aro`, `percent_identity`, `drug_class`, and `resistance_mechanism`.

Software: Python
uv
RGI
CARD
NCBI BLAST+

Input files:
name: input_contig.fasta
format: FASTA
path: input/input_contig.fasta
description: Staged DNA contig for resistance annotation.
name: card.json
format: JSON
path: input/card.json
description: CARD detection-model payload used by `rgi load --local`.
name: pyproject.toml
format: TOML
path: input/runtime_env/pyproject.toml
description: Runtime manifest pinning the official GitHub RGI install.
Title: Spatial Transcriptomics Spatial Domain Identification
Domain: life_sciences — Cell & Imaging Biology

Summary: Cluster 12 human DLPFC 10x Visium slices into spatial domains and submit per-spot labels, summary metrics, manifest metadata, and one UMAP overlay.

Task prompt:
You are given 12 human DLPFC 10x Visium slices and must identify spatial domains on every slice.

Task directory:
- `base`

Visible inputs:
- Slice data directories: `base/input/data/<slice_id>/`
- Per-slice target cluster counts: `base/input/data/slice_config.csv`
- Optional Python runtime manifest: `base/input/runtime_env/pyproject.toml`
- Optional Python lockfile: `base/input/runtime_env/uv.lock`
- Baseline uv wrapper: `base/software/uv`
- Baseline Python 3.12 wrapper: `base/software/python3.12`
- Detailed task prompt: `base/input/task_prompt.md`

If you need the staged spatial transcriptomics stack, run `base/software/uv sync --frozen --python 3.12 --project base/input/runtime_env`.

Required outputs under `base/output`:
- `summary.csv` with header `slice_id,n_spots_scored,n_clusters_pred,ari,nmi`
- `manifest.json` with method metadata, an integer seed, and graph/embedding/clustering flags
- `per_slice/<slice_id>_labels.csv` for all 12 slices with header `barcode,predicted_label`
- `umap_overlay_151673.png`

Use the exact per-slice target cluster counts from `slice_config.csv`, treat `input/` as read-only, and keep solver-created files under `output/`.

The agent must:
Load the staged matrix, features, barcodes, and spatial-coordinate files for all 12 Visium slices.
Use `input/data/slice_config.csv` as the exact target number of clusters per slice.
Run an unsupervised spatial-domain identification workflow.
Write one `per_slice/<slice_id>_labels.csv` file per slice with `barcode,predicted_label` columns.
Write `summary.csv`, `manifest.json`, and `umap_overlay_151673.png` under the runtime output directory.

Software: Python
uv
Scanpy
Squidpy
AnnData
scikit-learn

Input files:
name: matrix.mtx / features.tsv / barcodes.tsv
format: MTX/TSV
path: input/data/<slice_id>/
description: Per-slice Visium count matrices and feature/barcode tables.
name: spatial
format: CSV/JSON
path: input/data/<slice_id>/spatial/
description: Per-slice tissue positions and scale factors.
name: slice_config.csv
format: CSV
path: input/data/slice_config.csv
description: Per-slice subject IDs and required cluster counts.
name: runtime_env
format: uv project
path: input/runtime_env/
description: Optional pinned Python runtime for Scanpy/Squidpy-style analysis.
name: software wrappers
format: shell scripts
path: software/
description: Task-local wrappers for the VM baseline uv and Python 3.12 tools.