Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in obtaining the PlpData with the getPlpData() function: #463

Open
malihamashkoor123 opened this issue Jun 19, 2024 · 7 comments
Open

Comments

@malihamashkoor123
Copy link

I am trying to obtain the cohort covariates with the createCohortCovariateSettings() function from the PatientLevelPrediction package. However, I am running into the following error when I execute the getPlpData() function:

Capture1

The code that I am using to obtain the plpData is as follow:

image

I am supplying the covaraiteSettings as a list of default covariates and cohort covariates obtained by the functions createCovariateSettings() and createCohortCovariateSettings(), in the following way:

image

Additionally, on the other hand if I provide the covaraiteSettings in the following way:

image

Then the code is hanging:

image

Can you pls let me know how can I resolve the above errors and how should I provide the covaraiteSettings object so that I am able to execute my code and obtain the PlpData object?

My session info is as follow:

image

@egillax
Copy link
Collaborator

egillax commented Jun 19, 2024

The error you're encountering was fixed in v6.3.7 of PLP. It seems you're using v6.3.6. I suggest you update to the latest version (v6.3.8) with:

remotes::install_github("OHDSI/PatientLevelPrediction")

I'm not sure about the hang. From your description I'm missing how you create cs and cohort_covariates.

@malihamashkoor123
Copy link
Author

Hi @egillax ,

I have updated the PLP package to the latest version (V6.3.8). However I still get the following error when I execute the getPlpData() function:

image

My session info is as follow:

image

Additionally, I am creating the cohort covariates by using the createCohortBasedCovariateSettings() in the following way:

image

@egillax
Copy link
Collaborator

egillax commented Aug 7, 2024

Hi @malihamashkoor123 ,

I'm struggling a bit to reproduce it. Using v6.3.8 of PLP and FeatureExtraction v3.5.2 or v3.6.0 it seems to work for me. But the minCharacterizationMean parameter was new in FeatureExtraction v3.5.0 which the error is pointing at.

Could you restart your rsession and rerun the code to make sure R is using the correct package versions (nothing old lingering in your workspace).

If you encounter the error again could you run traceback() and share the output here, that way I get more info about the error. Could you also share how you're calling getPlpData just to make sure everything's good there.

@malihamashkoor123
Copy link
Author

Hi @egillax ,

I have restarted the system, the error with the minCharacterizationMean is resolved now. However, I am still unable to fully execute the getPlpData() function. The code is hanging, I have attached herewith a screenshot to show that and also how the getPlpData() function is called:

image

The output of traceback() is as follow:

image

The list of covariates are provided in the following way:

image

The ‘cs’ variable is obtained from the createCovariateSettings() function. ‘cohort_covariates’ is obtained in the following way:

image

And custom covariates (‘looCovSet’) is obtained by using the createLooCovariateSettings().

My session Info is as follow:

image

@egillax
Copy link
Collaborator

egillax commented Aug 23, 2024

Hi @malihamashkoor123,

I don't see any error? Seems to be hanging after Fetching data took ... line. Is that correct? It hangs for very long and then you stop it?

The tasks your analysis should be doing after that are cleaning sql temporary tables and moving on to construct the cohort_covariates. Unfortunately we are not printing the progress well during that step.

I've made a version with debug printing. If you install it with:

remotes::install_github("OHDSI/PatientLevelPrediction@logs_cohort_covs") 

Then restart your R session. Rerun the analysis and share what's printed to the R console with me. That way I can see exactly in what step the hang is happening in.

@jreps
Copy link
Collaborator

jreps commented Aug 23, 2024

I wonder whether the issue is the way you are combining the covariateSettings. The cohort_covariates is a list and then you create a list with the standard covariates, the list of cohort covariates and the loo covariates, so I don't think you have a list of covariate settings, you have a list with two settings and a list of settings. Try this:

add cs, looCovSet to list

cohort_covariates[[length(cohort_covariates)+1]] <- cs
cohort_covariates[[length(cohort_covariates)+1]] <- looCovSet

then

data <- PatientLevelPrediction::getPlpData(
covariateSettings = cohort_covariates,
...)

@egillax - we should probs have a check in the package for the covariateSetting to make sure it is a covariateSetting object or a list of covariateSettings. Then we can print out the issue if the covariateSettings is in the wrong format. I'll add this as an issue.

@egillax
Copy link
Collaborator

egillax commented Aug 23, 2024

thanks ! @jreps

That's exactly the issue. I managed to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants