Commit 06372595 authored by Fernando Hernandez's avatar Fernando Hernandez
Browse files

Update Agilent_Arrays.R

parent 12e04fd4
# Author = Fernando Hernandez
# CABANA secondee @ Evangelia Petsalaki Lab
##############################
#Setting up working directory#
##############################
# Set your working directory accordingly to your files
setwd("Personal/Tesis/Analisis_General/analisis agilent.old/")
######################################
#Loading into R session the libraries#
######################################
# Annotation db for Agilent 4x44k Whole Genome Array
library(hgug4112a.db)
# This library is no longer maintained but it incorporates every algorithm needed for Agilent 4x44k Whole Genome Array Analysis
library(Agi4x44PreProcess)
# Pathway enrichment analysis is conducted with this library
library(enrichR)
# Transcription factors activity analysis
library(dorothea)
# Data wrangling and graph plotting
library(tidyverse)
#####################
#Reading target file#
#####################
targets <- read.targets(infile = "Target.txt")
######################################################
#Reading files extracted from FE and obtaining RGList#
######################################################
dd <- read.AgilentFE(targets, makePLOT = FALSE)
################################################
#BG Correction and Normalization Between Arrays#
################################################
ddNORM <- BGandNorm(dd, BGmethod = "half", NORMmethod = "quantile",
foreground = "MeanSignal", background = "BGMedianSignal",
offset = 50, makePLOTpre = FALSE, makePLOTpost = FALSE)
##################
#Probes Filtering#
##################
ddFILT <- filter.probes(ddNORM, control = TRUE, wellaboveBG = TRUE, isfound = TRUE,
wellaboveNEG = TRUE, sat = TRUE, PopnOL = TRUE, NonUnifOL = TRUE,
nas = TRUE, limWellAbove = 75, limISF = 75, limNEG = 75, limSAT = 75,
limPopnOL = 75, limNonUnifOL = 75, limNAS = 100, makePLOT = FALSE,
annotation.package = "hgug4112a.db", flag.counts = TRUE, targets)
################
#Summarization##
################
ddPROC <- summarize.probe(ddFILT, makePLOT = FALSE, targets)
#########################
#Expression set creation#
#########################
esetPROC <- build.eset(ddPROC, targets, makePLOT = FALSE,
annotation.package = "hgug4112a.db")
############################################################
#Archivo de texto con los datos del Conjunto de Expresion###
############################################################
write.eset(esetPROC, ddPROC, "hgug4112a.db", targets)
#########################
#Agrupamiento jerarquico#
#########################
hierclus(exprs(esetPROC),GErep,methdis="euclidean",methclu="complete",sel=T,
size=100)
#########
#HeatMap#
#########
HeatMap(exprs(esetPROC),size=100,"100 genes con mayor Variacion")
# Limma Analysis
GErep <- targets$GErep
design <- model.matrix(~ 0 + factor(GErep))
design <- model.matrix(~ 0 + factor(c(1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5,
5,6,6,6)))
colnames(design) <- c("ni_c", "three", "six", "twelve", "twenty_four",
"i_c")
fit <- lmFit(esetPROC, design)
contrast.matrix <- makeContrasts(three-ni_c, six-ni_c, twelve-ni_c,
twenty_four-ni_c, i_c-ni_c,levels = design)
fit2 <- contrasts.fit(fit, contrast.matrix)
fit2 <- eBayes(fit2)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment