UUPharmacometrics / PsN

Perl-Speaks-NONMEM
https://uupharmacometrics.github.io/PsN
GNU General Public License v2.0
65 stars 19 forks source link

Linearized scm fails to filter data #12

Closed bguiastr closed 7 years ago

bguiastr commented 7 years ago

I experienced what seems to be a bug in the scm function of PsN when using the linearize option. The cause seems to be that the ignore statements present in the original model were not removed from the code generated inbase_model.mod or base_model_with_included_relations.mod.

Here is the PsN generated INPUT and DATA

$INPUT      ID DV MDV OPRED D_EPS1 D_EPS2 D_EPS3 D_EPS4 D_ETA1 D_ETA2
            D_ETA3 D_ETA4 D_ETA5 D_ETA6 D_ETA7 D_ETA8 D_ETA9 D_ETA10
            D_ETA11 OETA1 OETA2 OETA3 OETA4 OETA5 OETA6 OETA7 OETA8
            OETA9 OETA10 OETA11 D_EPSETA1_1 D_EPSETA1_2 D_EPSETA1_3
            D_EPSETA1_4 D_EPSETA1_5 D_EPSETA1_6 D_EPSETA1_7
            D_EPSETA1_8 D_EPSETA1_9 D_EPSETA1_10 D_EPSETA1_11
            D_EPSETA2_1 D_EPSETA2_2 D_EPSETA2_3 D_EPSETA2_4
            D_EPSETA2_5 D_EPSETA2_6 D_EPSETA2_7 D_EPSETA2_8
            D_EPSETA2_9 D_EPSETA2_10 D_EPSETA2_11 D_EPSETA3_1
            D_EPSETA3_2 D_EPSETA3_3 D_EPSETA3_4 D_EPSETA3_5
            D_EPSETA3_6 D_EPSETA3_7 D_EPSETA3_8 D_EPSETA3_9
            D_EPSETA3_10 D_EPSETA3_11 D_EPSETA4_1 D_EPSETA4_2
            D_EPSETA4_3 D_EPSETA4_4 D_EPSETA4_5 D_EPSETA4_6
            D_EPSETA4_7 D_EPSETA4_8 D_EPSETA4_9 D_EPSETA4_10
            D_EPSETA4_11 STUDY ARM MEAL SEX AGE HT WT FAT CARB OGZ_FAU
            OGK_FAU OGZ_TON OGK_TON OGZ_SGR OGK_SGR OGZ_HLRB OGK_HLRB
            OGZ_MTTAL OGK_MTTAL OGZ_EH OGK_EH
$DATA      ../../derivatives_covariates.dta IGNORE=@ IGNORE=(IGN>0)
            IGNORE=(STUDY/=1) IGNORE=(FIPP>=1) IGNORE=(FTBA==1)

Hence NONMEM returned the following error and the scm stopped.

 AN ERROR WAS FOUND ON LINE  23 AT THE APPROXIMATE POSITION NOTED:
 $DATA      ../../derivatives_covariates.dta IGNORE=@ IGNORE=(IGN>0)
                                                              X  
 THE CHARACTERS IN ERROR ARE: IGN
 508  IGNORE LIST OR ACCEPT LIST CONTAINS AN UNKNOWN DATA ITEM LABEL.

I used PsN v.4.7.0 and here is some of the options I have used in the scm file:

linearize=1
foce=1 
lst_file=run701.lst
bguiastr commented 7 years ago

There is another issue if a $SIGMA 0 FIX is present in the original model, PsN will generate linearized models with the following code $SIGMA 0. The FIX has been removed resulting in the following nonmem error:

 AN ERROR WAS FOUND ON LINE 180 AT THE APPROXIMATE POSITION NOTED:
  0  ; SIG 4.4 ADD. ERROR (UMOL/L)
  X                                     
 THE CHARACTERS IN ERROR ARE: 0
  76  INITIAL ESTIMATE OF VARIANCE CANNOT BE ZERO UNLESS FIXED.
rikardn commented 7 years ago

The $SIGMA 0 FIX issue should be be fixed (pun not intended :-) in PsN 4.7.5. Which version did you run?

bguiastr commented 7 years ago

Both issues were encountered under PsN version 4.7.0

rikardn commented 7 years ago

The IGNORE issue has also been fixed in PsN 4.7.5. The derivatives run retains the ignores when creating the linearized dataset and then the _linbase model does not need (and indeed can crash) the ignore statements any longer.