OHDSI / Andromeda

AsynchroNous Disk-based Representation of MassivE DAta: An R package aimed at replacing ff for storing large data objects.
https://ohdsi.github.io/Andromeda/
11 stars 10 forks source link

Error in loadCohortMethodData when re-loading #3

Closed estone96 closed 3 years ago

estone96 commented 4 years ago

Hi.

In executing the cohort method and after save cohortMethodData, "Error.~~~" was occurred and no more loading. The bunch of code and message are followed

saveCohortMethodData(cohortMethodData, "c:/Documents and Settings/yeesuk/Documents/project/SystemicSteroid.zip") Disconnected Andromeda. This data object can no longer be used`

studyPop <- createStudyPopulation(cohortMethodData = cohortMethodData, outcomeId = 3, firstExposureOnly = TRUE, restrictToCommonPeriod = FALSE, washoutPeriod = 0, removeDuplicateSubjects = "keep all", removeSubjectsWithPriorOutcome = TRUE, minDaysAtRisk = 1, riskWindowStart = 0, startAnchor = "cohort start", riskWindowEnd = 30, endAnchor = "cohort end") Error: Andromeda object is no longer valid. Perhaps it was saved without maintainConnection = TRUE, or R has been restarted? cohortMethodData CohortMethodData object Target cohort ID: 1 Comparator cohort ID: 2 Outcome cohort ID(s): 3

Inherits from CovariateData: CovariateData object

All cohorts

Inherits from Andromeda: Andromeda object x Connection closed

loadCohortMethodData("c:/Documents and Settings/yeesuk/Documents/project/SystemicSteroid.zip") CohortMethodData object

Target cohort ID: 1 Comparator cohort ID: 2 Outcome cohort ID(s): 3

Inherits from CovariateData: CovariateData object

All cohorts

Inherits from Andromeda: Andromeda object Physical location: C:\Users\yeesuk\AppData\Local\Temp\Rtmpkf2mCj\file34581a31246d.sqlite

Tables: $analysisRef (analysisId, analysisName, domainId, startDay, endDay, isBinary, missingMeansZero) $cohorts (rowId, subjectId, treatment, cohortStartDate, daysFromObsStart, daysToCohortEnd, daysToObsEnd) $covariateRef (covariateId, covariateName, analysisId, conceptId) $covariates (rowId, covariateId, covariateValue) $outcomes (rowId, outcomeId, daysToEvent)

summary(cohortMethodData) Error in .local(object, ...) : Object is not valid. Probably the Andromeda object was closed.

schuemie commented 4 years ago

Yes, sorry, should have mentioned clearer. After saving the cohortMethodData object using saveCohortMethodData, you need to load it again using loadCohortMethodData. This unfortunately is a feature of RSQLite: you cannot save a SQLite database without closing it first, and you cannot open it after closing without reloading it.