Documentation for `get_repeat_dose_parallel_studyids` Function
Source:vignettes/get_repeat_dose_parallel_studyids.Rmd
get_repeat_dose_parallel_studyids.RmdFunction Purpose
The get_repeat_dose_parallel_studyids function is
designed to retrieve study IDs from a database that correspond to
parallel-design studies involving repeat-dose toxicity. It filters the
studies based on the specified design and whether the species involved
are rats.
Input Parameters
The function accepts the following parameters:
| Parameter | Description | Default Value |
|---|---|---|
path_db |
The file path to the SQLite database. It must be provided as a valid string. | Required |
rat_studies |
A logical flag indicating whether to filter the studies for rats
only. Defaults to FALSE. |
FALSE |
Output
The function returns a vector of study IDs that meet the specified criteria. The returned vector contains the following:
- Study IDs: A list of study IDs that match both the parallel design and repeat-dose toxicity criteria (and rat species, if specified).
Key Steps
Database Existence Check:
The function first checks if the database file exists at the provided path. If not, an error is raised.Database Connection:
The database connection is established using thesendigRpackage. A connection to the database is initialized usingsendigR::initEnvironment().Retrieve Parallel Study IDs:
The function usessendigR::getStudiesSDESIGN()to retrieve all study IDs associated with the parallel design.Retrieve Repeat-Dose Studies:
A SQL query is executed viasendigR::genericQuery()to fetch study IDs that are associated with repeat-dose toxicity. This query looks for studies with specificTSPARMCDvalues related to repeat-dose toxicity.Intersect Parallel and Repeat-Dose Studies:
The study IDs obtained from the parallel design and the repeat-dose toxicity studies are intersected to identify common study IDs.Optionally Filter for Rat Studies:
Ifrat_studies = TRUE, the function retrieves study IDs that involve rats as the species. This is done by querying theSPECIESfield in the database and filtering based on the presence of “RAT”.Return Study IDs:
The final result is a vector of study IDs that meet the filter conditions, including parallel design, repeat-dose toxicity, and optionally, rat species.