2.3 Create Study Design Tables

Aside from the fractions table, the other study design tables can be the same as those created for the global proteomics data. This is because the datasets are different. The study design tables have been added to the data package (end of Section 1.3.3), so we can use get_study_design_by_dataset_package.

# Create fractions table
datasets <- unique(intersect(msnid$Dataset, masic_data$Dataset))
fractions <- data.frame(Dataset = datasets) %>% 
  mutate(PlexID = gsub(".*_P_(S\\d{1})_.*", "\\1", Dataset))

# Use global samples and references tables
study_design <- get_study_design_by_dataset_package(3442)
samples <- study_design$samples
references <- study_design$references
# Save phospho fractions table
write.table(fractions, file = "data/3626_fractions.txt",
            sep = "\t", quote = FALSE, row.names = FALSE)