I am doing a school assignment and I find a snippet of code extremely confusing. I have copied and pasted it from the assignment to here. library(limma) library(tidyverse) library(ggplot2) library(knitr) library(Biobase) library(GEOquery)
eset <- getGEO("GSE4051", getGPL = FALSE)[[1]]
This part is what I find confusing. Later on pData(eset) gets called and the value of the method being called has been changed. What is going on? pData(eset) is actually an object or something? I don't understand why this isn't being saved as a global variable.
pData(eset) <- pData(eset) %>%
mutate(sample_id = geo_accession) %>%
mutate(dev_stage = case_when(
grepl("E16", title) ~ "E16",
grepl("P2", title) ~ "P2",
grepl("P6", title) ~ "P6",
grepl("P10", title) ~ "P10",
grepl("4 weeks", title) ~ "4_weeks"
)) %>%
mutate(genotype = case_when(
grepl("Nrl-ko", title) ~ "NrlKO",
grepl("wt", title) ~ "WT"
))
pData(eset) %>%
with(table(dev_stage, genotype))