Hello everyone,
I'm trying to put a Hierarchical Clustering and boxplot in this code but always from error, what would be the best package to do this?
#Load limma
library(limma)
#Set-up
targetinfo <- readTargets("Targets.txt",row.names="FileName",sep="")
#Read files
project <- read.maimages(targetinfo,source="agilent", green.only=TRUE)
#Background correction
project.bgc <- backgroundCorrect(project, method="normexp", offset=16)
#Normalize the data with the 'quantile' method for 1-color
project.NormData <-normalizeBetweenArrays(project.bgc,method="quantile")
# load colour libraries
library(RColorBrewer)
# set colour palette
cols <- brewer.pal(8, "Set1")
#Histogram of non-normalized
plotDensities(project.bgc, col=cols, legend=FALSE)
#Histogram of normalized
plotDensities(project.NormData, col=cols, legend=FALSE)
#Create the study design and comparison model
design <- paste(targetinfo$Target, sep="")
design <- factor(design)
comparisonmodel <- model.matrix(~0+design)
colnames(comparisonmodel) <- levels(design)
#Checking the experimental design
design
comparisonmodel
project.fit <- lmFit(project.NormData, comparisonmodel)
project.fit <- lmFit(project.NormData,comparisonmodel)
#Applying the empirical Bayes method
project.fit.eBayes <- eBayes(project.fit)
names(project.fit.eBayes)
#Make individual contrasts and fit the new model
CaseControl <- makeContrasts(CaseControl="D0A-Control", levels=comparisonmodel)
CaseControl.fitmodel <- contrasts.fit(project.fit.eBayes, CaseControl)
CaseControl.fitmodel.eBayes <- eBayes(CaseControl.fitmodel)
#Filtering Results
nrow(topTable(CaseControl.fitmodel.eBayes, coef="CaseControl", number=99999, lfc=2))
probeset.list <- topTable(CaseControl.fitmodel.eBayes, "CaseControl", number=99999, adjust.method="BH", sort.by="P", lfc=2)
#To save results
write.table(probeset.list, "results.txt", sep="\t", quote=FALSE)
Best regards,
Leite
Hi Leite,
I assume your question is about microarray data, but you never specified that. I adapted your title to clarify this.
It's very hard for us to figure out what's going wrong if you don't show us the error message.
Cheers,
Wouter
Hey WouterDeCoster,
Sorry for the lack of information, you're correct, its about microarray data analysis.
I've tryed this code for bloxplot:
And this code for Hierarchical Clustering:
Thank you so much,
Leite