Question: variance stabilization and normalization
0
gravatar for F
3.4 years ago by
F3.4k
Iran
F3.4k wrote:

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 • 1.7k views
ADD COMMENTlink modified 3.3 years ago by Antonio R. Franco4.0k • written 3.4 years ago by F3.4k
2
gravatar for Antonio R. Franco
3.3 years ago by
Spain. Universidad de Córdoba
Antonio R. Franco4.0k wrote:

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 COMMENTlink written 3.3 years ago by Antonio R. Franco4.0k

may you please help me to write the correct?

ADD REPLYlink written 3.3 years ago by F3.4k
2
gravatar for Antonio R. Franco
3.3 years ago by
Spain. Universidad de Córdoba
Antonio R. Franco4.0k wrote:
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 COMMENTlink written 3.3 years ago by Antonio R. Franco4.0k
2
gravatar for Antonio R. Franco
3.3 years ago by
Spain. Universidad de Córdoba
Antonio R. Franco4.0k wrote:

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 COMMENTlink written 3.3 years ago by Antonio R. Franco4.0k

thank you so much  Antonio

ADD REPLYlink written 3.3 years ago by F3.4k
1
gravatar for F
3.4 years ago by
F3.4k
Iran
F3.4k wrote:

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 COMMENTlink modified 3.4 years ago • written 3.4 years ago by F3.4k

thank you Fereshteh, you are amazing!!!

ADD REPLYlink written 3.4 years ago by F3.4k

bg.correct=F  ?? why?

ADD REPLYlink written 3.3 years ago by Antonio R. Franco4.0k

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 REPLYlink written 3.3 years ago by F3.4k
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.3.0
Traffic: 752 users visited in the last hour