Skip to content

This repository contains the documentation for reproducibility of the study "Preoperative atelectasis in patients with obesity undergoing bariatric surgery: a cross-sectional study".

License

Notifications You must be signed in to change notification settings

javimangal/preoperative-atelectasis

Repository files navigation


PABA logo

Repository DOI Dataverse Preprint DOI

Description

This repository contains the documentation for reproducibility of the study "Preoperative atelectasis in patients with obesity undergoing bariatric surgery: a cross-sectional study". The linked dataset for this study can be found in the Harvard Dataverse. The current version of the manuscript is available in medRxiv. The first version of this manuscript is also available through medRxiv, and both the replication data (v1) and code (v1) for that manuscript are cited within the preprint. The current status of the repository is reflective of the manuscript that is undergoing peer review in an international journal and will be deposited in zenodo as v2 upon publication of the peer-reviewed article.

This study was presented in the Annual Netherlands Epidemiology Congress WEON 2024. The poster presented in the congress is available in the docs folder.

Getting started

In order to replicate these analyses, I suggest that the user follows these steps:

  1. Install R and RStudio on your computer if you haven't done so. (Note that these analyses were conducted under R version 4.3.3 and RStudio 2023.12.1).
  2. Clone this repository. If you do not know how to do this, you can follow these instructions. Alternatively, you can go to zenodo and download the ZIP file, unpack it, and place it in a folder in your computer.
  3. You should now have all these files in your computer with an identical folder structure (described in the following section).
  4. In the main directory, open the file named preoperative_atelectasis.Rproj in RStudio.
  5. You can navigate through the folders on the right-bottom panel of R Studio. Open the R folder. You should now see a series of files starting with Part_ and ending with .qmd.
  6. Open one of these files. You can run every chunk of code sequentially to reproduce the analyses. Make sure to respect the order and if something fails, I recommend that you start running al chunks of code from the beginning. If you don't know how to run a chunk of code, you can imitate what this person is doing. If you get a message saying "Access denied", change from Visual to Source mode which can be done with the Ctrl+Shift+F4 command.

I recommend that the .qmd files are opened and ran in sequential order, although some may only be interested in one of the parts of the analyses. If you are not able to follow the prior steps, you may also consider reviewing the PDF reports documenting the analyses. The sequence of these files is as follows:

  • Part 1. Application of selection criteria and assessment of missing data. PDF
  • Part 2. Descriptive analyses. PDF
  • Part 3. Assessment of relationships between independent variables. PDF
  • Part 4. Assessment of outcomes. PDF
  • Part 5. Statistical modelling: Atelectasis. PDF
  • Part 6. Mediation analysis of the effect of BMI on SpO2, mediated through atelectasis. PDF
  • Part 7. Posthoc analyses. PDF
  • Part 8. Mediation analysis of the effect of BMI on SpO2, mediated through atelectasis, distinguishing between high and low SpO2 values. PDF

Although I have made significant efforts to ensure reproducibility of this project, I encourage you to contact me or post a request in this repository in case you encounter any issues.

Project Structure

The project structure distinguishes three kinds of folders:

  • read-only (RO): not edited by either code or researcher
  • human-writeable (HW): edited by the researcher only.
  • project-generated (PG): folders generated when running the code; these folders can be deleted or emptied and will be completely reconstituted as the project is run.
.
├── .gitignore
├── CITATION.cff
├── LICENSE
├── README.md
├── preoperative_atelectasis.Rproj
├── data                  <- All project data files
│   ├── processed         <- The final, canonical data sets for modeling. (PG)
│   ├── raw               <- The original, immutable data. (RO)
│   └── temp              <- Intermediate data that has been transformed. (PG)
├── docs                  <- Documentation for users (HW)
│   ├── manuscript        <- Manuscript source, docx. (HW)
│   ├── reports           <- Project reports, pdf. (HW)
│   └── DAG               <- Directed Acyclic Graph documentation, txt. (HG)
├── results
│   ├── output_figures    <- Figures for the manuscript or reports (PG)
│   └── output_tables     <- Output tables for the manuscript (PG)
└── R                     <- Source code for this project (HW)
│   ├── scripts           <- Scripts sourced in main R markdown documents (PG)
│   └── sessions          <- Text files with information of R sessions (PG)
└── renv                  <- Packaging dependencies (RO)

Documentation

The full documentation with comments of statistical analyses can be found in the reports folder. Each PDF file documents sequential parts of the analyses, identified as Part 1 to Part 8 files as mentioned before. These reports describe the operating system of R and package versions dependencies to reproduce each part of the analyses. I have also included package dependencies in the renv folder in a lockfile.

License

This project is licensed under the terms of the MIT License.

This project structure template repository is adapted from the Good Enough Project Cookiecutter template by Barbara Vreede (2019).

About

This repository contains the documentation for reproducibility of the study "Preoperative atelectasis in patients with obesity undergoing bariatric surgery: a cross-sectional study".

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages