knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

Loading the epimedtools library

library(epimedtools)

Creating a new study.

study = create_study()

The .CEL.gz files are stored into two directories the ctrl directory and the kc directory:

kc_cel_filedir = system.file(
  "extdata/trscr_raw_kc", 
  package = "epimeddata"
)
print(kc_cel_filedir)
ctrl_cel_filedir = system.file(
  "extdata/trscr_raw_ctrl", 
  package = "epimeddata"
)
print(ctrl_cel_filedir)
study$cel_filedirs = c(kc_cel_filedir, ctrl_cel_filedir)
print(study$cel_filedirs)

The experimental grouping of kc samples is laoded before loading data.

exp_grp_filename = system.file(
  "extdata/trscr_raw_kc", 
  "expgrp_kc.csv.gz", 
  package = "epimeddata"
)
exp_grp = read.table(file=gzfile(exp_grp_filename), stringsAsFactors=FALSE, sep=";", header=TRUE)
rownames(exp_grp) = paste(exp_grp$sample, ".CEL.gz", sep="")
study$exp_grp = exp_grp

The RMA normalized data matrix is extract using the get_data method.

head(study$get_data())

The origin of sample is injected into the experimental grouping thank to the column orig.

study$get_exp_grp()

This study deals with data obtained using the GPL570 platform.

study$platform_name = "GPL570"

Plot density of expression for this 1-sample dataset.

plot(density(study$get_data()[,1]))

Plot density of expression for this 1-sample dataset using ratio.

ctrl_sample_names = rownames(study$exp_grp)[study$get_exp_grp()$orig == "trscr_raw_ctrl"]
plot(density(study$get_ratio(ctrl_sample_names)[,1]))

Saving the study on the file system.

study$save("/tmp/study.rds")


fchuffar/epimedtools documentation built on Feb. 3, 2024, 2:21 a.m.