ehrdata.io.init_omop

Contents

ehrdata.io.init_omop#

ehrdata.io.init_omop(folder_path, delimiter=',', make_filename_lowercase=True, use_dask=False, level='stay_level', load_tables=None, remove_empty_column=True)#

Initialize an OMOP database, load tables and create anndata object

Args:

folder_path: Path to the folder containing the OMOP CDM tables delimiter: If data is in csv format, delimiter can be specified. Defaults to ‘,’. make_filename_lowercase: If True, the filename will be converted to lowercase. Defaults to True. use_dask: If True, dask will be used to read the tables. For large tables, it is recommended to use dask. Defaults to False. level: For stay level, each row in anndata would be a visit_occurrence. For patient level, each row in anndata would be a patient. Defaults to “stay_level”. load_tables: Basic tables to load. Support loading one of those: [“visit_occurrence”, “person”, “death”, “visit_detail”, “provider”]. If is None, it will try to load all non-empty supported tables. remove_empty_column: If True, columns with all missing values will be removed when loading tables. Defaults to True.

Return type:

AnnData

Returns:

AnnData: Anndata object