UUPharmacometrics / PsN

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

PsN 4.7.0 execute cannot parse "1THERE" #67

Closed billdenney closed 6 years ago

billdenney commented 6 years ago

When running PsN 4.7.0 with NONMEM 7.4.1, I got the following error at the end of a run:

could not match 1THERE at /opt/PsN/4.7.0/PsN_4_7_0/output/problem/subproblem.pm line 3240.

Unfortunately, I can't share the entire .lst file, but the offending line appears to be the second of the below (these are the last 4 lines of the .lst file):

 Elapsed finaloutput time in seconds:     0.58
1THERE ARE ERROR MESSAGES IN FILE PRDERR
 #CPUT: Total CPU Time in Seconds,     6640.001
Stop Time:
Sun Jan  7 16:05:28 UTC 2018

The model converged with two parameters near their boundaries:

0MINIMIZATION SUCCESSFUL
 NO. OF FUNCTION EVALUATIONS USED:     2495
 NO. OF SIG. DIGITS IN FINAL EST.:  3.4
0PARAMETER ESTIMATE IS NEAR ITS BOUNDARY
rikardn commented 6 years ago

Thanks for reporting this. It seems to be a bug in the output file parser in PsN. The code line where PsN crashes is actually in the parser for sparse format THETA/OMEGA/SIGMA results so I think I would need the entire lst file to be able to fix the issue. Would it be possible to mask secret stuff in the lst file, to still have a lst file that crashes with sumo (I am guessing that it also crashes if run through sumo) and submit it here?

billdenney commented 6 years ago

After cleaning the file of secret stuff, I get an error at the same line of subproblem.pm but the text that isn't matched is "TH1". Hopefully this is, in practice, the same error and not an issue with the file cleaning that I did. run1_cleaned.txt

rikardn commented 6 years ago

Thanks! I can confirm that this is a bug in PsN.

rikardn commented 6 years ago

Ok, I have a fix for this problem. It will be included in the next PsN release. It is quite easy to patch if you want it fixed in your version.

In subproblem.pm file just above the error indication find the line: if ( /^\s*(TH|OM|SG)\s*\d+\s*|\s*(TH|OM|SG)/ ) { # sparse format and replace with if ( /^\s*(TH|OM|SG)\s*\d+\s*|^\s*(TH|OM|SG)/ ) { # sparse format

Notice the added circumflex anchor that was missing causing the regex to trigger on the 1THERE in the error message.

Is it ok to use and distribute your stripped lst-file in the PsN test suite for regression testing?

rikardn commented 6 years ago

Here is the fix 55687a947eeee78a4c83949116022625764a4f08

billdenney commented 6 years ago

Thanks for the fix, and you can use the file for regression testing.

rikardn commented 6 years ago

Thanks! Regression test added d827541e3a2dd3bea7424762708c5b130f0efb58