Thanks for the replay Pierre! I have the following: 27 tumors 38 Controls
And I wonder the appropiate proccess design: Should I analize at the sametime, controls and tumors? or should I analize them individually? first, the set of tumors and then the set of controls. Finally, in order to obtain the log2ratio and considering both sets, what could be the best? Thanks again! David On Aug 11, 9:22 am, Pierre Neuvial <pie...@stat.berkeley.edu> wrote: > Hi David, > > Your code seems to be correct, but see remarks below. > > > > On Fri, Jul 24, 2009 at 6:39 PM, David<daescarc...@gmail.com> wrote: > > > Hi, to everyone! > > > I working with a set of 27 Cervican Cancer tumors using Affy 100k. I > > would like to get the log2 value for each SNP. > > > I´m running the vignette (Everything runs just fine): > > > library(aroma.affymetrix) > > verbose <- Arguments$getVerbose(-8) > > timestampOn(verbose) > > name <- "oscar" > > chipTypes <- c("Mapping50K_Hind240", "Mapping50K_Xba240") > > cdfs <- lapply(chipTypes, FUN=function(chipType) { AffymetrixCdfFile > > $byChipType(chipType) }) > > print(cdfs) > > gis <- lapply(cdfs, getGenomeInformation) > > print(gis) > > sis <- lapply(cdfs, getSnpInformation) > > print(sis) > > cesNList <- list() > > > chipType <- chipTypes[1] > > cs <- AffymetrixCelSet$byName(name, chipType=chipType) > > cs <- extract(cs, !isDuplicated(cs)) > > print(cs) > > qn <- QuantileNormalization(cs) > > print(qn) > > csN <- process(qn, verbose=-20) > > plm <- RmaCnPlm(csN, combineAlleles=TRUE, mergeStrands=TRUE) > > print(plm) > > fit(plm, verbose=-20) > > ces <- getChipEffectSet(plm) > > fln <- FragmentLengthNormalization(ces) > > print(fln) > > cesNList[[chipType]] <- process(fln, verbose=verbose) > > > chipType <- chipTypes[2] > > cs <- AffymetrixCelSet$byName(name, chipType=chipType) > > cs <- extract(cs, !isDuplicated(cs)) > > print(cs) > > qn <- QuantileNormalization(cs) > > print(qn) > > csN <- process(qn, verbose=-20) > > plm <- RmaCnPlm(csN, combineAlleles=TRUE, mergeStrands=TRUE) > > print(plm) > > fit(plm, verbose=-20) > > ces <- getChipEffectSet(plm) > > fln <- FragmentLengthNormalization(ces) > > print(fln) > > cesNList[[chipType]] <- process(fln, verbose=verbose) > > > glad <- GladModel(cesNList, mediancenter = FALSE, smoothfunc = > > "lawsglad", bandwidth = 10, round = 1.5, model = "Gaussian", lkern = > > "Exponential", qlambda = 0.999, base = FALSE, lambdabreak = 8, > > lambdacluster = 8, lambdaclusterGen = 40, type = "tricubic", param = c > > (d = 100), alpha = 0.001, msize = 5, method = "centroid", nmax = 8, > > verbose = FALSE) > > fit(glad, chromosomes=1:23, verbose=verbose) > > writeRegions(glad, chromosomes=1:23, verbose=verbose) > > Note that if you are interested in the raw copy numbers (ie the values > after normalization) then you don't need the last two lines: you can > just call > > extractRawCopyNumbers(glad) > > without having fit the segmentation model (which makes sense because > these are raw copy numbers, so segmentation is not needed to get > them). And for the same reason the raw copy numbers will be the same > if you were using other parameters for GladModel, or even if you were > using CbsModel (or HaarSegModel) instead. > > > > > #from this point I´m a little lost > > dataName <- getNames( glad ) > > for( j in 1:27 ) { > > df<-NULL > > for ( i in 1:23 ) { > > rawCNs <- extractRawCopyNumbers(glad, array=j, chromosome=i); > > print(rawCNs); > > rawCNs <- as.data.frame(rawCNs); > > str(rawCNs); > > v<-c(i); > > df2<-data.frame(cbind(rawCNs, chr=rep(v,dim(rawCNs)[1]))); > > df<-rbind(df,df2) > > } > > nam <- paste( dataName[j] , j, ".txt", sep="" ) > > write.table(df, nam , quote = FALSE, sep = '\t',row.names = > > FALSE,col.names = TRUE); > > } > > > How could I calculate the log2 data? > > In theory the above loop does what you expect and gives you log2ratios > (relative to a reference defined for each SNP as a robust average (ie > median) of the signal intensities of all chips). However as you have > probably experienced the data.frame you will be creating a huge > data.frame, and doing cbind at each step will be slower and slower, > until you run out of memory. > > As far as I understand, this is why extractRawCopyNumbers only > supports one array and one chromosome at a time. > > The best option for you depends on what you want to do with your data > afterwards. Do you really need all your data in a big text file ? > > Hope this helps, > > Pierre. > > > > > is there any documentation to extractRawCopyNumbers? > > > Thanks in advance! > > > David --~--~---------~--~----~------------~-------~--~----~ When reporting problems on aroma.affymetrix, make sure 1) to run the latest version of the package, 2) to report the output of sessionInfo() and traceback(), and 3) to post a complete code example. You received this message because you are subscribed to the Google Groups "aroma.affymetrix" group. To post to this group, send email to aroma-affymetrix@googlegroups.com To unsubscribe from this group, send email to aroma-affymetrix-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/aroma-affymetrix?hl=en -~----------~----~----~----~------~----~------~--~---