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

Database related error when calling CiCalibration::execute #26

Open
hon-hwang-unsw-edu-au opened this issue Nov 19, 2019 · 3 comments
Open

Comments

@hon-hwang-unsw-edu-au
Copy link

I am attempting to run CiCalibration::execute function by following the instructions at
https://github.com/OHDSI/StudyProtocols/tree/master/CiCalibration

I have installed the dependencies R packages, installed PostgreSQL server and created the database, as well as the cdm_data and results schemas. When I ran the code shown at the web page, I get this error

Creating exposure and outcome cohorts Connecting using PostgreSQL driver Creating cohort: DabigatranSouthworth |== | 3%Error: Error executing SQL: org.postgresql.util.PSQLException: ERROR: relation "cdm_data.concept" does not exist Position: 155

Am I supposed to setup other tables before I can run CiCalibration::execute?

Thanks!

@schuemie
Copy link
Member

Yes, this code, pretty much like all OHDSI software, requires you to have fully instantiated the OMOP Common Data Model (CDM). Part of the CDM are the Standardized Vocabularies (e.g. the contents of the CONCEPT table), which can be downloaded from ATHENA.

It seems this is your first time using the CDM, in which case I would recommend not starting by running an actual study like CiCalibration. Instead, a recommended first step is to run ACHILLES. This will allow you to profile your data, and perform initial checks of your CDM instance. I also recommend reading the chapter on Data Quality before proceeding.

@hon-hwang-unsw-edu-au
Copy link
Author

Thanks for the info.

I was able to initialise the CDM using the scripts from the CommonDataModel repository. The README for CiCalibration uses version 5 of CDM, and because I am using PostgreSQL database, I used this particular version of PostgreSQL script to initialise my database.

I then encountered problems with regards to createAnalysesDetails() (residing in the file CreateStudyAnalysesDetails.R) and injectSignals() (residing in the file SignalInjection.R),
calling the function FeatureExtraction::createCovariateSettings(). It seems the function's arguments have changed.

I then modified the code in createAnalysesDetails() and injectSignals() to match the new function arguments of FeatureExtraction::createCovariateSettings(). Many of the arguments have similar names, however, for some arguments such as useCovariateConditionEraEver, I don't know what's the proper match should be.

I also encountered a similar problem where the CohortMethod::loadDrugComparatorOutcomesList() no longer exists. I ended up replacing it with CohortMethod::loadTargetComparatorOutcomesList().

When I ran CiCalibration::execute() after my modifications, I get the following errors

Creating exposure and outcome cohorts
Connecting using PostgreSQL driver
Creating cohort: DabigatranSouthworth
  |============================================================================================| 100%
Executing SQL took 0.107 secs
Creating cohort: WarfarinSouthworth
  |============================================================================================| 100%
Executing SQL took 0.111 secs
Creating cohort: GiBleed
  |============================================================================================| 100%
Executing SQL took 0.0578 secs
- Creating negative control outcome cohort
  |============================================================================================| 100%
Executing SQL took 0.00299 secs
[1] cohortDefinitionId count              cohortName        
<0 rows> (or 0-length row.names)
Connecting using PostgreSQL driver

Creating risk windows
  |============================================================================================| 100%
Executing SQL took 0.0378 secs
Fitting outcome models
Generating outcomes

Warning: the condition has length > 1 and only the first element will be used
  |                                                                                            |   0%
Thread 2 returns error: "argument is of length zero" when using argument(s): list(exposureId = integer(0), outcomeId = integer(0), modelFolder = character(0), covarFileName = "c:/schuemie2018-studies_southworth-results/signalInjection/covarsForModel_g"),list(exposureId = integer(0), outcomeId = integer(0), targetEffectSize = numeric(0), newOutcomeId = numeric(0), trueEffectSize = numeric(0), trueEffectSizeFirstExposure = numeric(0), trueEffectSizeItt = numeric(0), injectedOutcomes = numeric(0), modelFolder = character(0), outcomesToInjectFile = character(0), observedOutcomes = numeric(0), observedOutcomesFirstExposure = numeric(0), observedOutcomesItt = numeric(0), observedOutcomesFirstExposureItt = numeric(0)),c:/schuemie2018-studies_southworth-results/signalInjection/exposures.rds,c:/schuemie2018-studies_southworth-results/signalInjection/outcomes.rds,c:/schuemie2018-studies_southworth-results/signalInjection/priorOutcomes.rds,TRUE,survival,c(1.5, 2, 4),0.01,c:/schuemie2018-studies_southworth-results/signalInjection,FALSE

and so on.

I think my modifications may not match what the latest version of FeatureExtraction::createCovariateSettings() is expecting.

@schuemie
Copy link
Member

The error message indicates no cohorts were created. I'd be willing to bet something is not right with your CDM installation. Did you run ACHILLES, and asses data quality in other ways?

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

2 participants