Review ask

As a clinical trial statistician or programmer, answer three short questions in Your review: the task, the inputs and outputs, and the AI-assisted review. Agreeing with all three approves this benchmark; disagreeing with any needs a comment. Propose a fix with the Edit button on any source file, or add it to your comments.

We suggest spending no more than 5 minutes on a review. The other tabs beside Your review are background for assessment, not under review.

Summary

Lifecycle: draftEditUnder review
What this benchmark means
README.md

Public entries: Python and R. Passing coverage requires an installed inventory.

Goal: flag, for each planned test-versus-reference comparison of a three-period crossover, the pharmacokinetic (PK) parameter records the comparison uses (ANL01FL, ANL02FL), and carry the planned sequence (TRTSEQP).

Input: one record per PK parameter, subject and period with the actual treatment (TRTA) and the value (AVAL); the subject-level dataset with the planned sequence; and a table of the planned comparisons, each with its number (COMPNO), test treatment (TESTTRT) and reference treatment (REFTRT).

Variables:

  • APERIOD and TRTA are the record's period and the treatment actually given in it, unchanged.
  • TRTSEQP is the subject's planned sequence of treatments.
  • AVAL is the parameter value, unchanged.
  • ANL01FL is Y on the records comparison 1 uses and empty on every other record; ANL02FL does the same for comparison 2. A record is used when its treatment is one of the comparison's two treatments, its own value is evaluable, and the same subject has an evaluable value of the same parameter under the comparison's other treatment. Evaluable means present and greater than zero.

Note: pairs are judged per parameter, so a subject can be in a comparison for one parameter and out of it for another, and a value that is missing or zero also takes its partner record out of that comparison. A treatment that is the test of one comparison and the reference of the other can carry both flags. Every record stays in the dataset.

Inputs

Under review
3 source files

input/adpp_raw.csv

Edit
20 rows
input/adpp_raw.csv
STUDYIDUSUBJIDPARAMCDPARAMAPERIODTRTAAVAL
YAMAA-01CMAXMax Conc (ng/mL)1TEST FASTED120
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)1TEST FASTED960
YAMAA-01CMAXMax Conc (ng/mL)2TEST FED90
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)2TEST FED—
YAMAA-01CMAXMax Conc (ng/mL)3REFERENCE FASTED110
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)3REFERENCE FASTED900
YAMAA-01CMAXMax Conc (ng/mL)1TEST FED80
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)1TEST FED1000
YAMAA-01CMAXMax Conc (ng/mL)2REFERENCE FASTED0
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)2REFERENCE FASTED—
YAMAA-01CMAXMax Conc (ng/mL)3TEST FASTED100
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)3TEST FASTED800
YAMAA-01CMAXMax Conc (ng/mL)1TEST FASTED140
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)1TEST FASTED1100
YAMAA-01CMAXMax Conc (ng/mL)2TEST FED105
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)2TEST FED1200
YAMAA-01CMAXMax Conc (ng/mL)1REFERENCE FASTED95
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)1REFERENCE FASTED850
YAMAA-01CMAXMax Conc (ng/mL)2TEST FED70
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)2TEST FED880

input/adsl.csv

Edit
5 rows
input/adsl.csv
STUDYIDUSUBJIDTRTSEQP
YAMAA-01TEST FASTED/TEST FED/REFERENCE FASTED
YAMAA-01TEST FED/REFERENCE FASTED/TEST FASTED
YAMAA-01TEST FASTED/TEST FED/REFERENCE FASTED
YAMAA-01REFERENCE FASTED/TEST FED/TEST FASTED
YAMAA-01TEST FED/TEST FASTED/REFERENCE FASTED

input/compare.csv

Edit
2 rows
input/compare.csv
COMPNOCOMPARISONTESTTRTREFTRT
1FOOD EFFECTTEST FEDTEST FASTED
2RELATIVE BIOAVAILABILITYTEST FASTEDREFERENCE FASTED

Expected output

Under review
20 expected rows

expected/adpp.csv

Edit
20 rows
expected/adpp.csv
STUDYIDUSUBJIDPARAMCDPARAMAPERIODTRTATRTSEQPAVALANL01FLANL02FL
YAMAA-01CMAXMax Conc (ng/mL)1TEST FASTEDTEST FASTED/TEST FED/REFERENCE FASTED120YY
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)1TEST FASTEDTEST FASTED/TEST FED/REFERENCE FASTED960—Y
YAMAA-01CMAXMax Conc (ng/mL)2TEST FEDTEST FASTED/TEST FED/REFERENCE FASTED90Y—
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)2TEST FEDTEST FASTED/TEST FED/REFERENCE FASTED———
YAMAA-01CMAXMax Conc (ng/mL)3REFERENCE FASTEDTEST FASTED/TEST FED/REFERENCE FASTED110—Y
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)3REFERENCE FASTEDTEST FASTED/TEST FED/REFERENCE FASTED900—Y
YAMAA-01CMAXMax Conc (ng/mL)1TEST FEDTEST FED/REFERENCE FASTED/TEST FASTED80Y—
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)1TEST FEDTEST FED/REFERENCE FASTED/TEST FASTED1000Y—
YAMAA-01CMAXMax Conc (ng/mL)2REFERENCE FASTEDTEST FED/REFERENCE FASTED/TEST FASTED0——
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)2REFERENCE FASTEDTEST FED/REFERENCE FASTED/TEST FASTED———
YAMAA-01CMAXMax Conc (ng/mL)3TEST FASTEDTEST FED/REFERENCE FASTED/TEST FASTED100Y—
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)3TEST FASTEDTEST FED/REFERENCE FASTED/TEST FASTED800Y—
YAMAA-01CMAXMax Conc (ng/mL)1TEST FASTEDTEST FASTED/TEST FED/REFERENCE FASTED140Y—
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)1TEST FASTEDTEST FASTED/TEST FED/REFERENCE FASTED1100Y—
YAMAA-01CMAXMax Conc (ng/mL)2TEST FEDTEST FASTED/TEST FED/REFERENCE FASTED105Y—
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)2TEST FEDTEST FASTED/TEST FED/REFERENCE FASTED1200Y—
YAMAA-01CMAXMax Conc (ng/mL)1REFERENCE FASTEDREFERENCE FASTED/TEST FED/TEST FASTED95——
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)1REFERENCE FASTEDREFERENCE FASTED/TEST FED/TEST FASTED850——
YAMAA-01CMAXMax Conc (ng/mL)2TEST FEDREFERENCE FASTED/TEST FED/TEST FASTED70——
YAMAA-01AUCIFOAUC Infinity Obs (h*ng/mL)2TEST FEDREFERENCE FASTED/TEST FED/TEST FASTED880——
Shaded columns are derived— = missing value

Human review and assessment

Your review

3 questions and your comments · View benchmark discussions

Mapping spec

Generated from the benchmark YAML; do not edit by hand

Dataset NameVariable NameVariable LabelTypeCodelist/Controlled TermsCoreComputational MethodOrigin
ADPPSTUDYIDStudy IdentifiercharacterCopy value from ADPP_RAW.STUDYID.Predecessor
ADPPUSUBJIDUnique Subject IdentifiercharacterCopy value from ADPP_RAW.USUBJID.Predecessor
ADPPPARAMCDParameter CodecharacterCopy value from ADPP_RAW.PARAMCD.Predecessor
ADPPPARAMParametercharacterCopy value from ADPP_RAW.PARAM.Predecessor
ADPPAPERIODPeriodnumericCopy value from ADPP_RAW.APERIOD.Predecessor
ADPPTRTAActual TreatmentcharacterCopy value from ADPP_RAW.TRTA.Predecessor
ADPPTRTSEQPPlanned Sequence of TreatmentscharacterCopy value from ADSL.TRTSEQP.Predecessor
ADPPAVALAnalysis ValuenumericCopy value from ADPP_RAW.AVAL.Predecessor
ADPPANL01FLAnalysis Flag 01characterY"Y" when AVAL > 0 AND PAVAL1 > 0; blank otherwise.Derived
ADPPANL02FLAnalysis Flag 02characterY"Y" when AVAL > 0 AND PAVAL2 > 0; blank otherwise.Derived
VariablePermitted values
ANL01FLY
ANL02FLY
VersionDateAuthorDescriptionReviewerSign-off
1.72026-10-20yamaa docs buildRead a specification in the 1.0 surface as its 0.5 counterpart; state that missing values stay missing where a mapping declares no missing handler, and leave out a declared missing answer that restates a handler's default
1.62026-10-17yamaa docs buildDescribe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight
1.52026-10-17yamaa docs buildName collected precision in words instead of letter codes; state imputation fallbacks, minimum source precision, bounds ignored outside the collected period, and invalid text with no handler as an error; describe date and datetime shifts, imputation flag codes, and partial text giving no date part
1.42026-10-15yamaa docs buildState datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks
1.32026-09-29yamaa docs buildShow study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata
1.22026-09-29yamaa docs buildClassify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived
1.12026-09-29yamaa docs buildResolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML
1.0yamaa docs buildInitial generation from spec.yaml

Agent prompt

The request an agent receives with the input files; each tier states no more than the one above

prompts/adam-adpp-comparison-sets/full.md

Edit
25 lines

Following CDISC ADaM standards, use the provided ADPP_RAW, ADSL, and COMPARE datasets to create an ADPP dataset with one record per subject, parameter, and period.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, APERIOD, TRTA, TRTSEQP, AVAL, ANL01FL, ANL02FL

TRTSEQP is the subject's planned sequence of treatments. ANL01FL is "Y" on the records comparison 1 uses and has no value on every other record, and ANL02FL is "Y" on the records comparison 2 uses and has no value on every other record. A record is used by a comparison when its treatment is one of the comparison's two treatments, its own AVAL is evaluable, and the same subject has an evaluable AVAL for the same parameter under the comparison's other treatment. The two treatments of a comparison are the test treatment and the reference treatment COMPARE lists for it. An evaluable AVAL is present and greater than zero. A value that is missing or zero also takes its partner record out of that comparison. Pairs are judged per parameter, so a subject can be in a comparison for one parameter and out of it for another. A treatment that is the test treatment of one comparison and the reference treatment of the other can carry both flags. Every record stays in the dataset.

Read the source datasets from /app/input and save the completed dataset as /app/output/adpp.csv.

prompts/adam-adpp-comparison-sets/conventions.md

Edit
12 lines

Following CDISC ADaM standards, use the provided ADPP_RAW, ADSL, and COMPARE datasets to create an ADPP dataset with one record per subject, parameter, and period.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, APERIOD, TRTA, TRTSEQP, AVAL, ANL01FL, ANL02FL

ANL01FL is "Y" or has no value, and ANL02FL is "Y" or has no value.

Read the source datasets from /app/input and save the completed dataset as /app/output/adpp.csv.

prompts/adam-adpp-comparison-sets/brief.md

Edit
10 lines

Following CDISC ADaM standards, use the provided ADPP_RAW, ADSL, and COMPARE datasets to create an ADPP dataset with one record per subject, parameter, and period.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, APERIOD, TRTA, TRTSEQP, AVAL, ANL01FL, ANL02FL

Read the source datasets from /app/input and save the completed dataset as /app/output/adpp.csv.

yamaa code

Public calls generated from benchmark.yaml; results must match the expected output

R

Edit
3 lines
library(yamaa)yamaa_spec("spec.yaml")$run()$output

Python

Edit
3 lines
import yamaayamaa.spec("spec.yaml").run().output

Solution without yamaa

Written from the full prompt and the inputs alone; CI checks it reproduces the expected output

solutions/adam-adpp-comparison-sets/result.R

Edit
56 lines
# Reference solution for the yamaa benchmark adam-adpp-comparison-sets (R track).## Written from the benchmark's full prompt and its inputs alone, as an agent# would write it. Harbor's oracle agent runs it to check that the prompt can# be solved and that the grader scores a correct answer 1.library(dplyr, warn.conflicts = FALSE)library(readr)raw <- read_csv(  "/app/input/adpp_raw.csv",  col_types = cols(    APERIOD = col_integer(),    AVAL = col_double(),    .default = col_character()  ))adsl <- read_csv("/app/input/adsl.csv", col_types = cols(.default = col_character()))compare <- read_csv(  "/app/input/compare.csv",  col_types = cols(COMPNO = col_integer(), .default = col_character()))keys <- c("STUDYID", "USUBJID", "PARAMCD")stopifnot(!anyDuplicated(raw[c(keys, "TRTA")]))adpp <- raw |>  left_join(select(adsl, STUDYID, USUBJID, TRTSEQP), by = c("STUDYID", "USUBJID"))# Flag nn belongs to comparison nn. A record is used when its treatment is# one of the two, its own value is evaluable (present and > 0), and the same# subject has an evaluable value of the same parameter under the other one.partner <- raw |> transmute(STUDYID, USUBJID, PARAMCD, OTHER = TRTA, PAVAL = AVAL)for (number in 1:2) {  row <- filter(compare, COMPNO == number)  stopifnot(nrow(row) == 1)  test <- row$TESTTRT  ref <- row$REFTRT  flag <- sprintf("ANL%02dFL", number)  adpp <- adpp |>    mutate(OTHER = case_when(TRTA == test ~ ref, TRTA == ref ~ test)) |>    left_join(partner, by = c(keys, "OTHER")) |>    mutate(      "{flag}" := if_else(        !is.na(OTHER) & !is.na(AVAL) & AVAL > 0 & !is.na(PAVAL) & PAVAL > 0,        "Y", NA_character_      )    ) |>    select(-OTHER, -PAVAL)}adpp <- adpp |>  select(STUDYID, USUBJID, PARAMCD, PARAM, APERIOD, TRTA, TRTSEQP, AVAL, ANL01FL, ANL02FL)dir.create("/app/output", showWarnings = FALSE)write_csv(adpp, "/app/output/adpp.csv", na = "")

solutions/adam-adpp-comparison-sets/result.py

Edit
82 lines
# Reference solution for the yamaa benchmark adam-adpp-comparison-sets (Python track).## Written from the benchmark's full prompt and its inputs alone, as an agent# would write it. Harbor's oracle agent runs it to check that the prompt can# be solved and that the grader scores a correct answer 1."""Build ADPP from ADPP_RAW, ADSL, and COMPARE.One record per subject, parameter, and period. ANL01FL / ANL02FL markthe records used by comparison 1 / comparison 2: a record is used whenits treatment is one of the comparison's two treatments, its own AVALis evaluable (present and greater than zero), and the same subject hasan evaluable AVAL for the same parameter under the comparison's othertreatment."""import csvINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"def read_csv(name):    with open(f"{INPUT_DIR}/{name}", newline="") as f:        return list(csv.DictReader(f))def evaluable(value):    if value is None or value == "":        return False    return float(value) > 0def main():    raw = read_csv("adpp_raw.csv")    adsl = read_csv("adsl.csv")    compare = read_csv("compare.csv")    trtseqp = {row["USUBJID"]: row["TRTSEQP"] for row in adsl}    comparisons = {        int(row["COMPNO"]): (row["TESTTRT"], row["REFTRT"]) for row in compare    }    # Evaluable (subject, parameter, treatment) combinations present.    evaluable_keys = set()    for row in raw:        if evaluable(row["AVAL"]):            evaluable_keys.add((row["USUBJID"], row["PARAMCD"], row["TRTA"]))    def used(row, compno):        test, ref = comparisons[compno]        if row["TRTA"] not in (test, ref):            return False        if not evaluable(row["AVAL"]):            return False        other = ref if row["TRTA"] == test else test        return (row["USUBJID"], row["PARAMCD"], other) in evaluable_keys    columns = [        "STUDYID", "USUBJID", "PARAMCD", "PARAM", "APERIOD", "TRTA",        "TRTSEQP", "AVAL", "ANL01FL", "ANL02FL",    ]    with open(f"{OUTPUT_DIR}/adpp.csv", "w", newline="") as f:        writer = csv.DictWriter(f, fieldnames=columns)        writer.writeheader()        for row in raw:            writer.writerow({                "STUDYID": row["STUDYID"],                "USUBJID": row["USUBJID"],                "PARAMCD": row["PARAMCD"],                "PARAM": row["PARAM"],                "APERIOD": row["APERIOD"],                "TRTA": row["TRTA"],                "TRTSEQP": trtseqp.get(row["USUBJID"], ""),                "AVAL": row["AVAL"],                "ANL01FL": "Y" if used(row, 1) else "",                "ANL02FL": "Y" if used(row, 2) else "",            })if __name__ == "__main__":    main()

solutions/adam-adpp-comparison-sets/result.sas

Edit
95 lines
/* opensas reference solution for the yamaa benchmark adam-adpp-comparison-sets.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data raw;  length STUDYID USUBJID PARAMCD PARAM TRTA $200;  infile "/app/input/adpp_raw.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char200. USUBJID : $char200. PARAMCD : $char200.        PARAM : $char200. APERIOD TRTA : $char200. AVAL;  ORD = _n_;run;data adsl;  length STUDYID USUBJID TRTSEQP $200;  infile "/app/input/adsl.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char200. USUBJID : $char200. TRTSEQP : $char200.;run;data compare;  length COMPARISON TESTTRT REFTRT $200;  infile "/app/input/compare.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input COMPNO COMPARISON : $char200. TESTTRT : $char200. REFTRT : $char200.;run;/* Each comparison's two treatments, one column pair per comparison. */data pairs;  length TEST1 REF1 TEST2 REF2 $200;  retain TEST1 REF1 TEST2 REF2 N1 N2 0;  set compare end=last;  if COMPNO = 1 then do; TEST1 = TESTTRT; REF1 = REFTRT; N1 = N1 + 1; end;  if COMPNO = 2 then do; TEST2 = TESTTRT; REF2 = REFTRT; N2 = N2 + 1; end;  if last then do;    if N1 ne 1 or N2 ne 1 then abort;    output;  end;  keep TEST1 REF1 TEST2 REF2;run;/* The other treatment of each comparison for every record. */data others;  length OTHER1 OTHER2 $200;  if _n_ = 1 then set pairs;  set raw;  if TRTA = TEST1 then OTHER1 = REF1;  else if TRTA = REF1 then OTHER1 = TEST1;  if TRTA = TEST2 then OTHER2 = REF2;  else if TRTA = REF2 then OTHER2 = TEST2;run;data partner;  length PSTUDY PSUBJ PPARAM PTRT $200;  set raw;  PSTUDY = STUDYID; PSUBJ = USUBJID; PPARAM = PARAMCD; PTRT = TRTA; PAVAL = AVAL;  keep PSTUDY PSUBJ PPARAM PTRT PAVAL;run;proc sql;  create table with1 as    select o.*, p.PAVAL as PAVAL1    from others as o left join partner as p      on o.STUDYID = p.PSTUDY and o.USUBJID = p.PSUBJ and o.PARAMCD = p.PPARAM         and o.OTHER1 = p.PTRT;  create table with2 as    select o.*, p.PAVAL as PAVAL2    from with1 as o left join partner as p      on o.STUDYID = p.PSTUDY and o.USUBJID = p.PSUBJ and o.PARAMCD = p.PPARAM         and o.OTHER2 = p.PTRT;  create table withseq as    select o.*, a.TRTSEQP    from with2 as o left join adsl as a      on o.STUDYID = a.STUDYID and o.USUBJID = a.USUBJID;quit;/* Y when the record and its partner under the comparison's other treatment   are both present and greater than 0. */data final;  length ANL01FL ANL02FL $1;  set withseq;  if not missing(OTHER1) and not missing(AVAL) and AVAL > 0     and not missing(PAVAL1) and PAVAL1 > 0 then ANL01FL = 'Y';  else ANL01FL = ' ';  if not missing(OTHER2) and not missing(AVAL) and AVAL > 0     and not missing(PAVAL2) and PAVAL2 > 0 then ANL02FL = 'Y';  else ANL02FL = ' ';run;proc sort data=final; by ORD; run;proc sql;  create table adpp as    select STUDYID, USUBJID, PARAMCD, PARAM, APERIOD, TRTA, TRTSEQP, AVAL,           ANL01FL, ANL02FL    from final;quit;proc export data=adpp outfile="/app/output/adpp.csv" dbms=csv replace; run;