variance stabilization and normalization
4
0
Entering edit mode
5.4 years ago
A ★ 3.9k

hi,

i am going to perform variance stabilization on my data sets then i did like below

> library(affy)
> library(vsn)
> celFiles <- list.celfiles()
> affyraw=ReadAffy(filenames = celFiles)
> fit = vsn2(affyraw)
vsn2: 506944 x 8 matrix (1 stratum). Please use 'meanSdPlot' to verify the fit.
> nkid = predict(fit, newdata=affyraw)
> vsnrma(nkid)
vsn2: 506944 x 8 matrix (1 stratum). Please use 'meanSdPlot' to verify the fit.
Creating a generic function for ‘nchar’ from package ‘base’ in package ‘S4Vectors’

Calculating Expression
ExpressionSet (storageMode: lockedEnvironment)
assayData: 22810 features, 8 samples 
  element names: exprs 
protocolData
  sampleNames: Col-0 24h primed.CEL.CEL Col-0 24h unprimed.CEL.CEL ... Col-0 8h unprimed.CEL.CEL (8 total)
  varLabels: ScanDate
  varMetadata: labelDescription
phenoData
  sampleNames: Col-0 24h primed.CEL.CEL Col-0 24h unprimed.CEL.CEL ... Col-0 8h unprimed.CEL.CEL (8 total)
  varLabels: sample
  varMetadata: labelDescription
featureData: none
experimentData: use 'experimentData(object)'
Annotation: ath1121501 
> a <- vsnrma(nkid)
vsn2: 506944 x 8 matrix (1 stratum). Please use 'meanSdPlot' to verify the fit.
Calculating Expression

> celFiles <- list.celfiles()
> affyraw=ReadAffy(filenames = celFiles)
> eset <- justvsn(celFiles)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘vsn2’ for signature ‘"character"’
> justvsn(a)
vsn2: 22810 x 8 matrix (1 stratum). Please use 'meanSdPlot' to verify the fit.
ExpressionSet (storageMode: lockedEnvironment)
assayData: 22810 features, 8 samples 
  element names: exprs 
protocolData
  sampleNames: Col-0 24h primed.CEL.CEL Col-0 24h unprimed.CEL.CEL ... Col-0 8h unprimed.CEL.CEL (8 total)
  varLabels: ScanDate
  varMetadata: labelDescription
phenoData
  sampleNames: Col-0 24h primed.CEL.CEL Col-0 24h unprimed.CEL.CEL ... Col-0 8h unprimed.CEL.CEL (8 total)
  varLabels: sample
  varMetadata: labelDescription
featureData: none
experimentData: use 'experimentData(object)'
Annotation: ath1121501 
> a <justvsn(a)
vsn2: 22810 x 8 matrix (1 stratum). Please use 'meanSdPlot' to verify the fit.
Error in a < justvsn(a) : 
  comparison (3) is possible only for atomic and list types
> a <- justvsn(a)
vsn2: 22810 x 8 matrix (1 stratum). Please use 'meanSdPlot' to verify the fit.

>

 

thank you

myposts R • 2.5k views
ADD COMMENT
2
Entering edit mode
5.3 years ago

bg.correct should stand for background correct = FALSE

You read your CEL files with the ReadAffy function, and immediately apply the normalization without substracting the background. I don't think this is correct

The other attributes apply different methods, including the normalize.method where you are indicating the vsn method for normalization.

I don't know the expresso function, but it seems that it includes the possibility of doing a background substraction. Read the vignette with a ?expresso and it will clarify to you what it can do

ADD COMMENT
0
Entering edit mode

may you please help me to write the correct?

ADD REPLY
2
Entering edit mode
5.3 years ago

You need to investigate the expreso function since bg.correct can mean either of two things. That a correction has not been done, therefore it must be done, or that a background correction is optative

Beyond that the code included in the vignette is the one you must follow

ADD COMMENT
2
Entering edit mode
5.3 years ago

After loading the affy and vsn libraries..

Into R run

?expresso

You can read information about the function. In this case, this is written

bg.correct
a boolean to express whether background correction is wanted or not.

In your case, you need to run a bg.correct= TRUE

ADD COMMENT
0
Entering edit mode

thank you so much Antonio

ADD REPLY
1
Entering edit mode
5.4 years ago
A ★ 3.9k

Hi,

I collected this code finally

# performing variance stabilization and normalization on microarray data sets
# loading required libraries
library(affy)
library(vsn)
# listing the cel files
celFiles <- list.celfiles()
# assigning the cel files to affyraw variable
affyraw=ReadAffy(filenames = celFiles)
# performing vsn normalization
vsn.data <- expresso(affyraw, normalize.method="vsn", bg.correct=F, pmcorrect.method="pmonly", summary.method="medianpolish")
# examining the normalization
boxplot(affyraw,col="red")
plot(exprs(affyraw)[,1:2], log = "xy", pch=".",
     main="all")
# writing the result
write.table(vsn.data, file = "vsn.txt", dec = ".", sep = "\t", quote = FALSE)
ADD COMMENT
2
Entering edit mode

thank you Fereshteh, you are amazing!!!

ADD REPLY
0
Entering edit mode

bg.correct=F?? why?

ADD REPLY
0
Entering edit mode

Antonio,

Actually I did some sporadic code from internet I can't get what they mean, even finally I could not get AGI IDs and the result is with prob IDs

In brief I don't know

vsn.data <- expresso(affyraw, normalize.method="vsn", bg.correct=F, pmcorrect.method="pmonly", summary.method="medianpolish")

what means....

ADD REPLY

Login before adding your answer.

Traffic: 1163 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6