Aim

Selecting only those features that were used for the paper Kartaram et al: "Plasma citrulline concentration, a marker for intestinal functionality, reflects exercise intensity in healthy young men"

if(!require("rprojroot")) install.packages("rprojroot", dependencies = TRUE)
library(rprojroot)
root <- rprojroot::find_root_file(criterion = is_rstudio_project)
root

Packages

library(tidyverse)
library(readr)

read data

data_file_path <- file.path(root, "data", "diagrams_clean.rds")
diagrams <- read_rds(path = data_file_path)

Inspect data

head(diagrams, 3)
# check factor levels
levels(diagrams$subject)
levels(diagrams$protocol)
levels(diagrams$time)
levels(diagrams$analyte %>% as.factor)

Selecting analytes:

The analytes mentioned in the paper:

The paper concerns only data from the 'GRINTA!' study

# create vector with analyte level-names
analytes_filter <- c("gln", "ala", "citrul", "arg", "UREUM", "ifabp", "CORT")

Filter data

The data is filtered for 'GRINTA!' and above mentioned analytes.

citrulline_data <- diagrams %>%
  filter(analyte %in% analytes_filter) %>%
  filter(study == "grinta") %>% droplevels(.)

# check factor levels
levels(citrulline_data$subject)
levels(citrulline_data$protocol)
levels(citrulline_data$time)
levels(citrulline_data$analyte %>% as.factor)
head(citrulline_data)

Missing values

sum(is.na(citrulline_data))

Write data to disk

Data is written to disk as a tab separated value (*.txt) file named "./data/citrulline_paper_kartaram_et_al_1_0.txt". This data is used for creating the figures of the paper.

write_tsv(citrulline_data, path = file.path(root, "data", "citrulline_paper_kartaram_et_al_1_0.txt"))


uashogeschoolutrecht/citrulliner documentation built on Dec. 12, 2020, 7:12 a.m.