Search
Question: two-color microarray - technical replicates
0
gravatar for Sanches
24 days ago by
Sanches0
Sanches0 wrote:

Hi all, 

I am using Limma for the first time to analyze my two-color microarray data. So, I would like to know the best way to proceed to create my Targets file. My experiment has the following technical replicates:

        CY3                                  CY5

1. gene of interest                       control

2. gene of interest                       control

3. control                                     gene of interest

4. control                                     gene of interest

5. gene of interest (treated)         control (treated)

6. gene of interest (treated)          control (treated) 

7. control (treated)                        gene of interest(treated)

 

.  1=2 / 3=4 / 5=6

My question is: how can I proceed in this part below? 

biolrep<- c(1, 1, 2,2, 3) ## I am not sure about this part
design <- c(-1,1,-1,1) ## I am not sure about this part too
corfit<- duplicateCorrelation(MA, design, ndups = 1, block=biolrep)
fit <- lmFit(MA, design, block = biolrep, cor = corfit$consensus) 
fit<-eBayes(fit)
topTable(fit, adjust = "BH")

Thanks in advance

cheers,

Sanches

 

ADD COMMENTlink modified 23 days ago • written 24 days ago by Sanches0

Dear Gordon Smyth, 

Thanks for your reply.

So, in this case, do I have to write my script the following way below?

 

targets <- cbind(Cy3=c("Gene of interest","Gene of interest", "Control", "Control", "Gene of interest_Treatment", "Gene of interest_Treatment", "Control_Treatment"),  Cy5=c("Control", "Control", "Gene of interest", "Gene of interest", "Control_Treatment",

"Control_Treatment", "Gene of interest_Treatment"))

rownames(targets) <- paste("Array",1:7)

parameters <- cbind(C=c(-1,-1, 0, 0, 1, 1, 2), T=c(0, 0, -1, -1, 2 , 2, 1))
rownames(parameters) <- c("Reference","Control","Treatment")  #  What is the right way to write this part?                     


modelMatrix(targets, parameters)

modelMatrix(targets, ref="Reference")

design<- model.matrix(targets, parameters)

 

# OBS.: I ran the script but it appears an error.

Thanks in advance.

ADD REPLYlink modified 23 days ago by Gordon Smyth31k • written 23 days ago by Sanches0

No, that isn't right, for a few different reasons. If you use the 'parameters' argument to modelMatrix() then it has to refer to samples that appear in your experiment. You can't just make up names like "Reference" that don't actually appear in your targets file.

Anyway, see my answer below.

ADD REPLYlink modified 23 days ago • written 23 days ago by Gordon Smyth31k
1
gravatar for Gordon Smyth
24 days ago by
Gordon Smyth31k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth31k wrote:

You have 7 arrays, so the design matrix has to have 7 rows and biolrep has to have 7 entries.

Why don't you use modelMatrix(), which makes the design matrix for you?

Edit:

You ask how to make the targets file. The targets file just contains the two columns Cy3 and Cy5 that you already posted as part of your question. So you seem to have made the targets file ok already.

I see now that your experiment is a little more complicated in that you have two controls rather than one. modelMatrix() can make the design matrix for you, but it's probably easier to do it manually:

design <- cbind(Dye=1, GeneVsCtrl.Untreated=c(-1,-1,1,1,0,0,0), GeneVs.Ctrl.Treated=c(0,0,0,0,-1,-1,1))

With this design matriix, the second coefficient compares your gene of interest to the control without treatment, while the second coefficient commpares your gene of interest to the control with treatment. The first column is a good idea to account for gene-specific dye effects.

ADD COMMENTlink modified 23 days ago • written 24 days ago by Gordon Smyth31k

Hi Gordon, 

Actually, I would like to compare:  Gene Vs Control, Gene Vs Control(treated), Gene Vs Gene(treated) and, Gene(treated) Vs Control (Treated). So I have been having trouble designing the matrix.  

Problem 1: my target file is composed by two block corresponding to biological replicates (Array1=Array2 / Array 3=Array4 / Array5=Array6).  Problem 2: There are also technical replicates in dye-swap pairs: Array12 vs Array34 / Array 56 vs Array7.

Question: Is it necessary use "duplicateCorrelation function? Is there another fast way to do that?

 

Thanks in advance

ADD REPLYlink written 22 days ago by Sanches0

Dear Gordon, 

I think I can use separate channel analysis to analyze my data.  What is your opinion about that?

Thanks in advance

 

 

ADD REPLYlink written 22 days ago by Sanches0

Dear Gordon, 

I have used  SEPARATE CHANNEL ANALYSIS to analyze my data. But I had to remove the following array: 1, 4, 6. Thus, I used the method cited before. Is it right to do that? I put my script below. I know that I removed the technical replicates, but I did not find out a better way to do the design it to compare: Gene Vs ControlGene Vs Control(treated), Gene Vs Gene(treated) and, Gene(treated)Vs Control (Treated)


       CY3                                  CY5

2. gene of interest                       control

3. control                            gene of interest

5. gene of interest (treated)         control (treated)

7. control (treated)                  gene of interest(treated)


targets <- readTargets("Targets.txt")

RG <- read.maimages(targets$FileName, source="agilent", sep="\t", path="./")

MA <- normalizeWithinArrays(RG, method="loess") 

boxplot(MA$M~col(MA$M),names=colnames(MA$M),col = rainbow(5))

MA <- normalizeBetweenArrays(MA, method = "scale") # I got a better result using this method

boxplot(as.data.frame(MA$M),col = rainbow(5))

RGb <- backgroundCorrect(RG, method="minimum")
MA <- normalizeWithinArrays(RGb)

RG <- backgroundCorrect(RG, method="normexp", offset=50)

targets2 <-targetsA2C(targets)

u <- unique(targets2$Target) 

f <- factor(targets2$Target, levels=u) 

design <- model.matrix(~0+f)

u<-colnames(design) 

corfit<- intraspotCorrelation(MA,design)

fit <-lmscFit(MA, design, correlation=corfit$consensus)

names(fit)

############### Gene of interest vs Control ######################################3

cont.matrix <- makeContrasts("gene of interest-control",levels=design) 

fit2 <- contrasts.fit(fit, cont.matrix) 

fit2 <- eBayes(fit2)

names(fit2)

options(digits = 3)
topTable(fit2, adjust="BH")

y<-topTable(fit2, sort.by="B",number=nrow(MA$M), adjust="BH")
y
names(y)
plot(y[,6],-log(y[,10],10),xlab="log2(Fold-Change)",ylab="-log10(P.Value)",main=" Gene of interest vs  control",cex=0.1,pch=19)
abline(v=c(-1,1),col="blue")
abline(h=-log(0.05,10),col="red")

results <- decideTests(fit2, lfc=1) 
  
vennDiagram(results, include=c("up","down"))

################### Gene of interest vs control (treated)######################################

cont.matrix <- makeContrasts("gene of interest-control(treated)",levels=design) 

fit2 <- contrasts.fit(fit, cont.matrix) 

fit2 <- eBayes(fit2)

names(fit2)

options(digits = 3)
topTable(fit2, adjust="BH")

y<-topTable(fit2, number=nrow(MA$M), adjust="fdr")
names(y)
plot(y[,6],-log(y[,10],10),xlab="log2(Fold-Change)",ylab="-log10(P.Value)",main=" Gene of interest vs  control(treated)",cex=0.1,pch=19)
abline(v=c(-1,1),col="blue")
abline(h=-log(0.05,10),col="red")

############## Gene of interest vs  Gene of interest (Treated) ###################################

cont.matrix <- makeContrasts("gene of interest-gene of interest.treatment",levels=design) 

fit2 <- contrasts.fit(fit, cont.matrix) 

fit2 <- eBayes(fit2)

names(fit2)

options(digits = 3)
topTable(fit2, adjust="BH")

y<-topTable(fit2, number=nrow(MA$M), adjust="fdr")
names(y)
plot(y[,6],-log(y[,10],10),xlab="log2(Fold-Change)",ylab="-log10(P.Value)",main=" Gene of interest vs gene of interest(Treated)",cex=0.1,pch=19)
abline(v=c(-1,1),col="blue")
abline(h=-log(0.05,10),col="red")

.

.

.

Just to recap the question: Is there a problem if I do that way? Could anyone help me?

Thanks in advance.

ADD REPLYlink written 21 days ago by Sanches0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 264 users visited in the last hour