runSccsAnalyses: Run a list of analyses

View source: R/RunAnalyses.R

runSccsAnalysesR Documentation

Run a list of analyses

Description

Run a list of analyses

Usage

runSccsAnalyses(
  connectionDetails,
  cdmDatabaseSchema,
  tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
  exposureDatabaseSchema = cdmDatabaseSchema,
  exposureTable = "drug_era",
  outcomeDatabaseSchema = cdmDatabaseSchema,
  outcomeTable = "cohort",
  customCovariateDatabaseSchema = cdmDatabaseSchema,
  customCovariateTable = "cohort",
  nestingCohortDatabaseSchema = cdmDatabaseSchema,
  nestingCohortTable = "cohort",
  cdmVersion = "5",
  outputFolder = "./SccsOutput",
  sccsAnalysisList,
  exposuresOutcomeList,
  analysesToExclude = NULL,
  combineDataFetchAcrossOutcomes = FALSE,
  sccsMultiThreadingSettings = createSccsMultiThreadingSettings(),
  controlType = "outcome"
)

Arguments

connectionDetails

An R object of type ConnectionDetails created using the function DatabaseConnector::createConnectionDetails().

cdmDatabaseSchema

The name of the database schema that contains the OMOP CDM instance. Requires read permissions to this database. On SQL Server, this should specify both the database and the schema, so for example 'cdm_instance.dbo'.

tempEmulationSchema

Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created.

exposureDatabaseSchema

The name of the database schema that is the location where the exposure data used to define the exposure cohorts is available. If exposureTable = "DRUG_ERA", exposureDatabaseSchema is not used but assumed to be cdmDatabaseSchema. Requires read permissions to this database.

exposureTable

The table name that contains the exposure cohorts. If ⁠exposureTable <> "DRUG_ERA"⁠, then expectation is exposureTable has format of COHORT table: cohort_concept_id, SUBJECT_ID, COHORT_START_DATE, COHORT_END_DATE.

outcomeDatabaseSchema

The name of the database schema that is the location where the data used to define the outcome cohorts is available. Requires read permissions to this database.

outcomeTable

The table name that contains the outcome cohorts.

customCovariateDatabaseSchema

The name of the database schema that is the location where the custom covariate data is available.

customCovariateTable

Name of the table holding the custom covariates. This table should have the same structure as the cohort table.

nestingCohortDatabaseSchema

The name of the database schema that is the location where the nesting cohort is defined.

nestingCohortTable

Name of the table holding the nesting cohort. This table should have the same structure as the cohort table.

cdmVersion

Define the OMOP CDM version used: currently supports "5".

outputFolder

Name of the folder where all the outputs will written to.

sccsAnalysisList

A list of objects of SccsAnalysis as created using the createSccsAnalysis() function.

exposuresOutcomeList

A list of objects of type ExposuresOutcome as created using the createExposuresOutcome() function.

analysesToExclude

Analyses to exclude. See the Analyses to Exclude section for details.

combineDataFetchAcrossOutcomes

Should fetching data from the database be done one outcome at a time, or for all outcomes in one fetch? Combining fetches will be more efficient if there is large overlap in the subjects that have the different outcomes.

sccsMultiThreadingSettings

An object of type SccsMultiThreadingSettings as created using the createSccsMultiThreadingSettings() or createDefaultSccsMultiThreadingSettings() functions.

controlType

Type of negative (and positive) controls. Can be "outcome" or "exposure". When set to "outcome", controls with the same exposure (and nesting cohort) are grouped together for calibration. When set to "exposure", controls with the same outcome are grouped together.

Details

Run a list of analyses for the exposures-outcomes of interest. This function will run all specified analyses against all hypotheses of interest, meaning that the total number of outcome models is length(sccsAnalysisList) * length(exposuresOutcomeList) When you provide several analyses it will determine whether any of the analyses have anything in common, and will take advantage of this fact.

Analyses to Exclude

Normally, runSccsAnalyses will run all combinations of exposures-outcome-analyses settings. However, sometimes we may not need all those combinations. Using the analysesToExclude argument, we can remove certain items from the full matrix. This argument should be a data frame with at least one of the following columns:

  • exposureId

  • outcomeId

  • nestingCohortId

  • analysisId

This data frame will be joined to the outcome model reference table before executing, and matching rows will be removed. For example, if one specifies only one exposure ID and analysis ID, then any analyses with that exposure and that analysis ID will be skipped.

Value

A tibble describing for each exposure-outcome-analysisId combination where the intermediary and outcome model files can be found, relative to the outputFolder.


OHDSI/SelfControlledCaseSeries documentation built on Sept. 7, 2024, 8:24 a.m.