nlmixr2 / nonmem2rx

nonmem2rx
https://nlmixr2.github.io/nonmem2rx/
9 stars 0 forks source link

Feature request. Support $DATA TRANSLATE otption #181

Open TheoPapath opened 1 month ago

TheoPapath commented 1 month ago

When trying to translate a model with the TRANSLATE option in $DATA:

$DATA ../../DATASETS/DERIVED/.. IGNORE=@ TRANSLATE = (TIME/24)

I get the error:

$DATA syntax error: :002: IGNORE=@ TRANSLATE = (TIME/24) ^ :005: :006:

Error: $DATA syntax error:

mattfidler commented 3 weeks ago

From NONMEM help:

 TRANSLATE=(list)
      "list"  describes modifications to be made to the contents of the
      data file.  It may contain one of:
      TIME/F, TIME/F/D
      and/or one of
      II/F, II/F/D

      F ("factor") may be an integer or a real value.  If F is  a  real
      number,  the  translated value in FDATA will have the same number
      of digits after the decimal point.  If F is an integer and  D  is
      omitted, there will be 2 digits.  Alternately, the number of dig-
      its may be specified explicitly by D ("digits").  If D is a  real
      number,  it  is truncated to integer.  If D is specified as 0, it
      defaults to 2.  The maximum value of D is 12.  The number of dig-
      its that may be requested in F is limited by the precision of the
      computer.

      For example, either of the following can be used to request  val-
      ues of TIME in FDATA that have 4 digits to the right of the deci-
      mal point:
      TIME/1.0000
      TIME/1/4

      Another example is
      II/0.01/6
      which divides II values by 0.01, and writes 6 digits to the right
      of the decimal point.

      If F is specified as "24" (or 24.0..), the options involving TIME
      (II) can be used to convert the units of  time  (of  the  steady-
      state  interval)  from hours to days.  The TIME (II) data item is
      first processed as if the option  were  not  present.   Then  the
      resulting value is divided by F.

      Note:  The value of TIME is divided by F, whether or not day-time
      translation occurs (i.e., whether or not relative times are being
      computed by NM-TRAN).  Similarly, the value of II is  divided by F
      whether or not ":" appears in any II data value.

I'm unclear if when the value is TIME/24 if this both time and II are converted to days.

Otherwise it could be implemented.