Helmut
★★★
avatar
Homepage
Vienna, Austria,
2015-10-31 19:41
(3071 d 05:01 ago)

Posting: # 15593
Views: 9,809
 

 Phoenix hint [Software]

Dear all,

last Monday Simon Davis posted a trick at the Certara-Forum:

[…] viewing an analysis is to […] right-click on the root workflow and choose dependencies, this will generate an XML dump of the whole project that can be rendered in any web browser etc.

Almost perfect – if you want to make the life of monitors, auditors, and inspectors easier. There is a little bug in the XML-engine of PHX. The XML starts with…

<?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="Workflow.xslt"?>
<?xml version="1.0" encoding="utf-8"?>

… which is not well-formed XLM (double declaration of the encoding). Will give a blank page in IE and in more standard-conform browsers an error similar to this one:

Address: file:///C:/foo/bar/Workflow.xml
Row No. 2, Column 1:<?xml version="1.0" encoding="utf-8"?>
^

Easy: Overwrite <?xml version="1.0" encoding="ISO-8859-1"?> with <?xml version="1.0" encoding="utf-8"?>, delete the second line, and safe in UTF-8 (otherwise special characters might not be displayed properly).

The stylesheet Workflow.xslt sucks up too much space, IMHO. This is mine:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html>
      <style type="text/css">
        body {
          font: normal 1em Tahoma, Verdana, Arial, sans-serif;
        }
        table {
          width: 100%;
          font: normal 0.83em Tahoma, Verdana, Arial, sans-serif;
          border: 1px solid #000;
          border-collapse: collapse;
        }
        caption {
          font-size: 1em;
        }
        tfoot td {
          text-align: left;
        }
        tbody {
          border: 1px solid #000;
          border-collapse: collapse;
        }
        th, td {
          padding: 0.1em 0.75em;
          height: 1em;
          border: 1px solid #000;
          border-collapse: collapse;
        }
      </style>
      <body>
        <xsl:apply-templates select="Workflow" />
      </body>
    </html>
  </xsl:template>
  <xsl:template match="Workflow">
    <tr>
      <xsl:if test="@Level &gt; 1">
        <td></td>
      </xsl:if>
      <td>
        <br/>
        <table border="1" rules="groups">
          <thead>
            <tr>
              <xsl:if test="@Level &gt; 1">
                <th></th>
              </xsl:if>
              <th>
                <h3>
                  <xsl:value-of select="@Name"/>
                </h3>
              </th>
            </tr>
          </thead>
          <xsl:apply-templates select="Executable" />
          <xsl:apply-templates select="Workflow" />
        </table>
      </td>
    </tr>
  </xsl:template>
  <xsl:template match="Executable">
    <xsl:if test="position() = 1">
      <thead>
        <tr>
          <th>Object Type</th>
          <th>Object Name</th>
          <th>Object Status</th>
        </tr>
      </thead>
    </xsl:if>
    <tbody>
      <tr>
        <td><xsl:value-of select="@Type"/></td>
        <td><xsl:value-of select="@Name"/></td>
        <td><xsl:value-of select="@Status"/></td>
      </tr>
      <xsl:apply-templates select="Datasource" />
      <xsl:apply-templates select="Result" />
    </tbody>
  </xsl:template>
  <xsl:template match="Datasource">
    <tr>
    <tr>
      <td><a name="{@Guid}" id="{@Guid}">Datasource</a></td>
      <td><xsl:value-of select="@Name"/></td>
      <xsl:choose>
        <xsl:when test="@Generated='False'">
          <td>Not Generated</td>
        </xsl:when>
        <xsl:otherwise>
          <td><a href="{@FileName}">Source</a></td>
        </xsl:otherwise>
      </xsl:choose>
    </tr>
  </tr>
  <xsl:if test="Mappings">
    <tr>
      <td></td>
      <td colspan="2"><xsl:apply-templates select="Mappings" /></td>
    </tr>
  </xsl:if>
  </xsl:template>
  <xsl:template match="Result">
    <tr>
      <td><a name="{@Guid}" id="{@Guid}">Result</a></td>
      <td><xsl:value-of select="@Name"/></td>
      <xsl:choose>
        <xsl:when test="@Generated='False'">
          <td>Not Generated</td>
        </xsl:when>
        <xsl:otherwise>
          <td><a href="{@FileName}">Generated</a></td>
        </xsl:otherwise>
      </xsl:choose>
    </tr>
  </xsl:template>
  <xsl:template match="Mappings">
    <table>
      <tr><th colspan="2">Mappings</th></tr>
      <tr>
        <th>Variable</th>
        <th>Column</th>
      </tr>
      <xsl:apply-templates select="Map" />
    </table>
  </xsl:template>
  <xsl:template match="Map">
    <tr>
      <td><xsl:value-of select="@Variable"/></td>
      <td><xsl:value-of select="@Column"/></td>
    </tr>
  </xsl:template>
</xsl:stylesheet>


Screenshot:
[image]

All links point to the respective data (Source) or results (Generated). Data are in csv-format (comma delimited, decimal separator period). Plots are rendered to jpeg. Guess what *.txt means. These files are particularly interesting because they document the mapping of variables, the PHX version and build, and date/time of execution. Note that this is the timestamp of the object, not when you exported it to XML. Example for a nonparametric crossover-setup:

Date: Oct 28, 2015 15:40:37 Local
/********************************* Begin Mappings *********************************/
Main : BENonparCross.Data.SennTable4_9
   Sort :
   Subject : subj
   Sequence : seq
   Response : var
   Treatment : trt
/********************************* End Mappings   *********************************/

Phoenix Build 6.4.0.768
Treatment Data Layout = Stacked


The result (always in full precision) is given in a csv-file as:

Variables,Median,Confidence_Level,Exact,CI_Lower,CI_Upper
Treatment_Diff_( T - R ),1.25,0.8,0.8,-5,8.5
Treatment_Diff_( T - R ),1.25,0.9,0.9,-6,12.5
Treatment_Diff_( T - R ),1.25,0.95,0.95,-10,16
T,112.5,0.8,0.85400390625,100,125
T,112.5,0.9,0.85400390625,100,125
T,112.5,0.95,0.96142578125,90,130
R,110,0.8,0.85400390625,100,118
R,110,0.9,0.85400390625,100,118
R,110,0.95,0.96142578125,98,125

Ugly. However, my browser suggests to open it in Excel – which takes care of the columns. For Senn’s example I was interested in the 95% CI. I set up a filter and renamed the results.

Date: Oct 28, 2015 15:40:37 Local
Phoenix Build 6.4.0.768
Step 1 Filter
--- Mappings ---
Worksheet : BENonparCross.Workflow.SennTable4_9.Crossover.Confidence Intervals
Exclude : Exact
--- Settings ---
Include where [Variables] = 'Treatment_Diff_( T - R )' (Tolerance = 0) Entire Row
Include where [Confidence_Level] = '0.95' (Tolerance = 0) Entire Row

Step 2 Properties
--- Mappings ---
Sort :
--- Settings ---
Median => PE
CI_Lower => CL_lo
CI_Upper => CL_hi

The result in another csv (formatted here):

Variables                  PE Confidence_Level CL_lo  CL_hi
Treatment_Diff_( T - R ) 1.25             0.95  -10      16


I think that the XML-file gives reviewers an opportunity to dive into what has been done – without needing a (trial)license of Phoenix or even on a different operating system. Furthermore, the output is tiny: My 1.32 MiB project-file boiled down to just 68 KiB. ;-)

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
ElMaestro
★★★

Denmark,
2015-11-01 08:55
(3070 d 15:47 ago)

@ Helmut
Posting: # 15594
Views: 7,819
 

 Phoenix hint

Hi Hötzi,

whaaa???
I can't say I understand much of this, but some of this is interesting and could be quite useful, thanks :-D

❝ last Monday Simon Davis posted a trick at the Certara-Forum:

[…] viewing an analysis is to […] right-click on the root workflow and choose dependencies, this will generate an XML dump of the whole project that can be rendered in any web browser etc.

Almost perfect – if you want to make the life of monitors, auditors, and inspectors easier.


All this is based on 'the project', which may imply that you know it exists. I guess you could call the xml a naïve (and somewhat inaccessible for mere mortals like me) type of project audit trail. Perhaps not so much who did what when but at least a tool for secondary result verification.
I recall Certara recently went from a yearly license to one that is basically "pay per view". This implies that the software keeps track of and counts the projects, and therefore I wonder if we can generate an xml detailing the (all!) projects, like the equivalent of an instrument (work station) audit trail?

Have a good day.

Pass or fail!
ElMaestro
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2015-11-01 15:01
(3070 d 09:41 ago)

@ ElMaestro
Posting: # 15595
Views: 8,509
 

 No audit trail in PHX (what about SAS?)

Hi ElMaestro,

❝ All this is based on 'the project', which may imply that you know it exists.


In Phoenix a collection of data, methods, transformations, results, plots, :blahblah: (objects) is called a “pro­ject”. Hence, the filename extension phxproj. Has nothing to do with projects in the real world, which may consist of many PHX-projects.
If a project doesn’t exist, on which button would you click? ;-)

❝ I guess you could call the xml a naïve […] type of project audit trail. Perhaps not so much who did what when but at least a tool for secondary result verification.


Yes. There is an implementation of “who–what–when” within Phoenix-projects (but not given in the XML). Every object has three tabs, called
  1. Proporties
    The data, specifications of the data format of variables (numeric, text), and associated units.
  2. Information
    Created, saved (timestamp in UTC)
    Status (Current or Out of Date). The latter appears only if something was changed and not exe­cuted.
    Created with, last executed with, last saved with: PHX release(s) and build(s).
  3. History
    Screenshot
    [image]
    The “when”, “by whom”, and “what” is automatically tracked and can’t be switched off. In the last column one could (but not must!) add the “why”. Giving a reason could be handled by SOPs.
However, there are some problems with the History-tab:
  • It is only accessible from within Phoenix – which a reviewera might not have.
  • Theoretically a reviewer could ask for hardcopies. For a simple BE-study this could easily result in hundreds of pages.
  • Another option would be to right-click an object > Export > Excel (*.xls or *.xlsx). Then you get a file with two tabs. In Sheet1 the data and – tada! – the History.
  • Since the annotation is not mandatory and changes are possible without saving the file, it is not a sub­sti­tute for an audit-trail (see this presentation, slides 23–25).
If one wants to be fully 21 CFR Part 11 compliant the Phoenix Knowledgebase Server is a must. Costly…

❝ I recall Certara recently went from a yearly license to one that is basically "pay per view". This implies that the software keeps track of and counts the projects,


Talked about it with Certara. They claimed that no “tracker” exists in the software. Essentially I believe them since the software was released well before the new license model came out. The new license model is based on projects in the “real world”, not Phoenix-projects. Users are asked to submit the number of projectsb evaluated per year. How that practically will work, no idea.

❝ and therefore I wonder if we can generate an xml detailing the (all!) projects,


With an in-depth (!) knowledge of XML, yes. F.i. one of my TSDs (two enantiomers, PK and PD data) resulted in 1,012 (!) files linked from the XML-file. If one uses templates, common parts of different pro­jects will have the same names. Doable, but no fun.

❝ like the equivalent of an instrument (work station) audit trail?


:-D


  1. By reviewer I mean the usual suspects wanting to gain insight about what was done (monitors, auditors, inspectors, agents of the NSA, …).
  2. According to Certara’s definition the entirety of studies performed on a particular drug for a given company. Therefore, if you performed five studies (each evaluated by three Phoenix-projects) on drug A for company B, the number will be 1 (not 5 or 15). Given that, the license model is cheap for inno­va­tors and generic companies, but expensive for CROs.


PS: IMHO, Phoenix’ History is better than nothing. What do we get in SAS? A plain txt-file with a footer like:

Program: X:\foo\bar\blup.sas      Date/Time generated: DDMMMYYYY hh:mm
Datasets used: a,b,c

Any dummy can change 125.01 to 125.00 in a simple editor, safe, and modify the properties of the file (in UNIX-flavours the touch-command; similar stuff exists for other OSs). Now what? If one wants to be sure that no fraudulent action has taken place the study has to be re-calculated from raw data – as the FDA does.
Is anybody aware of a wrapper of SAS implementing an audit trail?

In “classical” WinNonlin (i.e., up to v5.3) it was possible to call functions (stated in “Win­Non­lin’s object-oriented scripting language”) from a batch file (pre­vent­ing any user-interaction). From a PK-perspective this was not optimal, since it relied solely on auto­matic methods (e.g., selection of time points for the estimation of λz). Some big players told me “It is more important for us to have reproducible results than optimal ones. We want to avoid discussions with regulators.” Bayer was pissed when Pharsight removed scripts in Phoenix. They had a validated system (data import, evaluation, report generation including audit trails) which they trashed at the end. Since Phoenix is based on .NET Framework 4.5, gifted C++ coders should be able to come up with a wrapper. ;-)

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
d_labes
★★★

Berlin, Germany,
2015-11-02 10:11
(3069 d 14:31 ago)

@ Helmut
Posting: # 15596
Views: 7,606
 

 What about SAS?

Dear Helmut,


PS: IMHO, Phoenix’ History is better than nothing. What do we get in SAS? A plain txt-file with a footer like:

Program: X:\foo\bar\blup.sas      Date/Time generated: DDMMMYYYY hh:mm

Datasets used: a,b,c

Where does this came from?

❝ Is anybody aware of a wrapper of SAS implementing an audit trail?


There is no such thing in SAS like a project. Therefore you can't get by design an audit trail with all activities done within such thing.

The only audit trail available is for SAS datasets. And this is not available as default but has to be implemented in the SAS code dealing with datasets. See f.i. an introduction here. Ugly IMHO.

Regards,

Detlew
SDavis
★★  
Homepage
UK,
2015-11-12 10:36
(3059 d 14:06 ago)

@ Helmut
Posting: # 15631
Views: 7,063
 

 Phoenix dependencies dump and 'control' of SAS via Connect

Hi Helmut et al.

<disclaimer if you don't know already - I work for Certara as a trainer etc.>

I think this is a nice and useful review of the 'Dependencies' export feature and I am glad you shared it as I think it's a great option to know of particularly for an additional archive version since it should be readable on just about any OS. I'll feedback to my colleagues to keep sharing this in their own presentations when training and demonstrating the tool.

An additional note I would add is that an installation of Phoenix without a license is permitted and acts as a 'viewer' of project and maybe suitable for the QA types you mentioned as well as on the occasion you have to look at a project created in a newer release than the one you have validated/installed as your working version.

Secondly, in response to;

Is anybody aware of a wrapper of SAS implementing an audit trail?


That is one of the objectives of the Connect module of Phoenix; giving the user an option to have a 'batched' run of SAS, or other common Pharmacometric tools like R, NONMEM, PsN, S-plus, SigmaPlot etc. The code you run is yours, and is run on your existing SAS installation but the run is initiated from Phoenix and results returned there. Should your source data, or SAS code change, then the output would be 'pinked', prompting a re-run.

Lastly as regards Phoenix Knowledgebase Server, a more attractive price for some groups would be 'PKS Online'; where each customer has a dedicated hosted Oracle instance assigned to them and the fee is per year, per user. I trust it's OK to provide this link;

http://www.certara.com/software/pkpd-modeling-and-simulation/phoenix-knowledgebase/pks-online

Where people can read a bit more and contact Certara for more information if desired, or you can contact me directly off list and I'll try to help you with your questions.

Simon

Simon
Senior Scientific Trainer, Certara™
[link=https://www.youtube.com/watch?v=xX-yCO5Rzag[/link]
https://www.certarauniversity.com/dashboard
https://support.certara.com/forums/
UA Flag
Activity
 Admin contact
22,957 posts in 4,819 threads, 1,636 registered users;
59 visitors (0 registered, 59 guests [including 11 identified bots]).
Forum time: 00:43 CET (Europe/Vienna)

Nothing shows a lack of mathematical education more
than an overly precise calculation.    Carl Friedrich Gauß

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5