Opal data "validate" plug in

8 views
Skip to first unread message

Tom Bishop

unread,
Feb 15, 2023, 6:15:01 AM2/15/23
to obiba...@googlegroups.com
Hi,

I am trying to implement some data checks for our latest project using the data validate plug in. I tried a simple test based on the example given in the validate R package vignette. The view has a variable called AGE_BASE, and I specified this when setting up the test. The code I used was:

validator(AGE_BASE > 0)

I get the error:

Job has failed due to the following error : Error while evaluating 'rmarkdown::render('report.Rmd')' -> Error in if (status) "PASSED" else "FAILED" : missing value where TRUE/FALSE needed

I need a bit of help interpreting what has gone wrong here. Was the validate code incorrect, or has something else gone wrong?

Thanks

Tom

 

Cédric Fontin

unread,
Feb 15, 2023, 8:11:39 AM2/15/23
to obiba...@googlegroups.com
Hi,

The error seems to be due to the keyword `validator`.
You'd normally need to only add `AGE_BASE > 0` in the "rule" input (assuming you defined "name" as `AGE_BASE`).

Here is a working example:
image.png

Are you doing something similar to the above?

--
You received this message because you are subscribed to the Google Groups "obiba-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to obiba-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/obiba-users/LO4P265MB3792F6A9055ADB2B82D855A3B9A39%40LO4P265MB3792.GBRP265.PROD.OUTLOOK.COM.

Cédric Fontin

unread,
Feb 15, 2023, 8:22:41 AM2/15/23
to obiba...@googlegroups.com
Small correction with respect to what to put under "Validation expressions",
The "name" of the expression is important insofar you want to reuse the expression in another rule.
However, "rule" accepts any or all the variable names you defined in the "variables" field.

Tom Bishop

unread,
Feb 15, 2023, 8:24:49 AM2/15/23
to obiba...@googlegroups.com
Hi Cédric,

Thank you, that is a great help. You are correct that removing the validator keyword allowed it run. For me, clicking on Show Report doesn't seem to do anything, though. Should something pop up?

I think I will raise an issue on the plugin's Github to recommend a very simple example like this to help future users

Tom

From: obiba...@googlegroups.com <obiba...@googlegroups.com> on behalf of Cédric Fontin <cfo...@maelstrom-research.org>
Sent: Wednesday, February 15, 2023 1:11 PM
To: obiba...@googlegroups.com <obiba...@googlegroups.com>
Subject: Re: [OBiBa] Opal data "validate" plug in
 

Cédric Fontin

unread,
Feb 15, 2023, 8:55:27 AM2/15/23
to obiba...@googlegroups.com
Hi,

Glad that helped.
Agreed, more explanation would be helpful.

The "Show" button is supposed to open a new tab with the report of the analysis.

Similar to this:
image.png

Tom Bishop

unread,
Feb 15, 2023, 11:47:35 AM2/15/23
to obiba...@googlegroups.com
One last question is whether you can export your validations for use on a different cohort. In our case, we have a lot of different cohorts all with the same variables. We would want to apply the same validations to them all, but I don't to have to go through the GUI each time typing them out. Maybe I missed how to export it?

Thanks,
Tom

Sent: Wednesday, February 15, 2023 1:55 PM

Cédric Fontin

unread,
Feb 21, 2023, 7:02:02 AM2/21/23
to obiba...@googlegroups.com

Hi,

Sorry for the late reply.
Since Opal is a restful application, you could call the _analyse command to automate the process.

Here is an example input file:

{
        "project": "FNAC",
        "analyses": [
                {
                        "name": "cli-test1",
                        "plugin": "opal-analysis-validate",
                        "table": "FNAC",
                        "template": "validator",
                        "variables": "VYOTARO,LANTIO",
                        "params": "{\"expressions\":[{\"name\":\"x\",\"rule\":\"VYOTARO > 50 && LANTIO > 40\"}]}"
                }
        ]
}

Where, using curl you do: curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: X-Opal-Authecho -n ‘:‘|base64" http://localhost:8080/ws/project/<PROJECT_NAME>/commands/_analyse -d @analysis.json

Note that params (a string representation of a json object, keep the same schema as the example: expressions is an array of object with name and rule as proeprties), variables, table, name and project are the properties that you should be modifying.

Hope this is clear enough.


Yannick Marcon

unread,
Feb 21, 2023, 8:02:01 AM2/21/23
to obiba...@googlegroups.com
There are some python commands that can help:

See:

opal analysis-plugin --help
opal export-analysis-plugin --help

Yannick


Reply all
Reply to author
Forward
0 new messages