try this, I use it all the time (lsos() then rm() a bunch of the offending
objects... helps a lot with the 450k data)

 .ls.objects <- function(pos=1,pattern,order.by
,decreasing=FALSE,head=FALSE,n=5){
    napply <- function(names, fn) sapply(names, function(x)
                                         fn(get(x, pos = pos)))
    names <- ls(pos = pos, pattern = pattern)
    obj.class <- napply(names, function(x) as.character(class(x))[1])
    obj.mode <- napply(names, mode)
    obj.type <- ifelse(is.na(obj.class), obj.mode, obj.class)
    obj.size <- napply(names, object.size)
    obj.dim <- t(napply(names, function(x) as.numeric(dim(x))[1:2]))
    vec <- is.na(obj.dim)[, 1] & (obj.type != "function")
    obj.dim[vec, 1] <- napply(names, length)[vec]
    out <- data.frame(obj.type, obj.size, obj.dim)
    names(out) <- c("Type", "Size", "Rows", "Columns")
    if (!missing(order.by))
        out <- out[order(out[[order.by]], decreasing=decreasing), ]
    if (head) out <- head(out, n)
    out
}

lsos <- function(..., n=10) {
    .ls.objects(..., order.by="Size", decreasing=TRUE, head=TRUE, n=n)
}


On Thu, Jun 16, 2011 at 12:49 PM, Ina Hoeschele <inah@vbi.vt.edu> wrote:

> yes, thanks ... with enough rm()'s I got through ...
>
> ----- Original Message -----
> From: "Sean Davis" <sdavis2@mail.nih.gov>
> To: "Harris A. Jaffee" <hj@jhu.edu>
> Cc: bioconductor@r-project.org
> Sent: Thursday, June 16, 2011 3:27:19 PM
> Subject: Re: [BioC] memory problem
>
> On Thu, Jun 16, 2011 at 3:23 PM, Harris A. Jaffee <hj@jhu.edu> wrote:
> > Where is it a replacement?  Her input and output were different:
> >
> >        batch2Meth.colQ
> >
> >        batch2Meth.colQ.bg
> >
> > If you meant this code inside the function:
> >
> >        if (method == "bgAdjust2C") {
> >             methyLumiM <- bgAdjustMethylation(methyLumiM,
> > separateColor = separateColor,
> >                 ...)
> >         }
> >        ........
> >        methyLumiM <- estimateM(methyLumiM)
> >
> > these are new copies, but I don't think you meant these.
>
> Thanks, Harris.  You are definitely correct in your assumption.  I
> meant Ina's code and misread her variable names.
>
> Sean
>
>
> > On Jun 16, 2011, at 2:52 PM, Sean Davis wrote:
> >
> >> On Thu, Jun 16, 2011 at 2:29 PM, Ina Hoeschele <inah@vbi.vt.edu>
> >> wrote:
> >>> Hi all,
> >>>  I'm running the methlumiB function in the lumi package on a
> >>> Methylumi object of 8 450K meth bead chips - all it should be
> >>> doing is to subtract the median intensity of my negative control
> >>> data, but I am getting the error message below
> >>>> batch2Meth.colQ.bg <- lumiMethyB
> >>>> (batch2Meth.colQ,method="bgAdjust2C",separateColor=F)
> >>> Perform bgAdjust2C background correction ...
> >>> Error: cannot allocate vector of size 355.6 Mb
> >>
> >> Yes.  Looks like you are out-of-memory.  Make sure that you are using
> >> a clean workspace (ls()), so remove anything that you think you do not
> >> need.  You are showing a "replacement" operation, but R doesn't do
> >> that in-place; instead it makes a copy and then replaces the original.
> >>
> >> Just out of curiosity, how much memory does the machine have?
> >>
> >> Sean
> >>
> >>> Does anyone have a hint for me (this is not hardware limitation!)?
> >>>
> >>> Thanks, Ina
> >>>
> >>>> sessionInfo()
> >>> R version 2.14.0 Under development (unstable) (2011-05-19 r55967)
> >>> Platform: x86_64-unknown-linux-gnu (64-bit)
> >>>
> >>> locale:
> >>>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
> >>>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
> >>>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
> >>>  [7] LC_PAPER=C                 LC_NAME=C
> >>>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> >>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> >>>
> >>> attached base packages:
> >>> [1] stats     graphics  grDevices utils     datasets  methods   base
> >>>
> >>> other attached packages:
> >>>  [1] affy_1.31.1                           lattice_0.19-26
> >>>  [3] IlluminaHumanMethylation450k.db_1.4.6 org.Hs.eg.db_2.5.0
> >>>  [5] RSQLite_0.9-4                         DBI_0.2-5
> >>>  [7] AnnotationDbi_1.15.3                  lumi_2.5.1
> >>>  [9] nleqslv_1.8.5                         methylumi_1.9.0
> >>> [11] Biobase_2.13.2
> >>>
> >>> loaded via a namespace (and not attached):
> >>>  [1] affyio_1.21.1         annotate_1.31.0       grid_2.14.0
> >>>  [4] hdrcde_2.15           KernSmooth_2.23-5     MASS_7.3-13
> >>>  [7] Matrix_0.999375-50    mgcv_1.7-6            nlme_3.1-101
> >>> [10] preprocessCore_1.15.0 tools_2.14.0          xtable_1.5-6
> >>>
> >>>
> >>> ----- Original Message -----
> >>> From: "Ina Hoeschele" <inah@vbi.vt.edu>
> >>> To: "Pan Du" <dupan.mail@gmail.com>
> >>> Cc: bioconductor@r-project.org
> >>> Sent: Wednesday, June 15, 2011 4:40:41 PM
> >>> Subject: Re: [BioC] lumi, Illumina Methylation 450k,    and robust
> >>> methylation calls
> >>>
> >>> thank you very much, Pan, so the color adjustment makes perfect
> >>> sense to me now. Now for the background correction, lumi subtracts
> >>> the median intensity of the negative control probes, while
> >>> GenomeStudio subtracts the 5th percentile - does anyone know why?
> >>> Thanks again, Ina
> >>>
> >>> ----- Original Message -----
> >>> From: "Pan Du" <dupan.mail@gmail.com>
> >>> To: "Ina Hoeschele" <inah@vbi.vt.edu>, "Tim Rayner"
> >>> <tfrayner@gmail.com>, bioconductor@r-project.org
> >>> Sent: Tuesday, June 14, 2011 11:34:27 AM
> >>> Subject: Re: [BioC] lumi, Illumina Methylation 450k, and robust
> >>> methylation calls
> >>>
> >>> Hi Ina and Tim
> >>>
> >>> For the methylation call part, I haven't work on that for a while
> >>> because
> >>> there are other priorities.
> >>>
> >>> For the color bias adjustment of 450K array, you need to use the
> >>> development
> >>> version, which perform color bias adjustment for both type I and
> >>> II designs.
> >>> Basically, it estimates the color bias based on type I design
> >>> (methylated
> >>> and unmenthylated measurements of the same CpG-site has  the same
> >>> color),
> >>> which is the same as Infinium 27k, and then use the fitted curve
> >>> to adjust
> >>> probes with type II design (methylated and unmenthylated
> >>> measurements of the
> >>> same CpG-site has different colors).
> >>>
> >>>
> >>> Pan
> >>>
> >>>
> >>> Date: Mon, 13 Jun 2011 18:05:16 -0400
> >>> From: Ina Hoeschele <inah@vbi.vt.edu>
> >>> To: Tim Rayner <tfrayner@gmail.com>
> >>> Cc: Bioconductor <bioconductor@stat.math.ethz.ch>
> >>> Subject: Re: [BioC] lumi, Illumina Methylation 450k,    and robust
> >>>       methylation calls
> >>> Message-ID: <9267536a-70f6-4582-a38f-
> >>> 8d2288c2afed@zimbra>
> >>> Content-Type: text/plain; charset="utf-8"
> >>>
> >>> <<
> >>> I have recently started to use the lumi package to analyse some
> >>> Illumina Human Methylation 450k data, and I have run into some
> >>> problems which seem to revolve around division by zero in the
> >>> gammaFitEM() function. I have adjusted the colour balance and
> >>> quantile
> >>> normalised as suggested in the vignette
> >>>>>
> >>>
> >>> Hi Pan and Tim (et al),
> >>>  this is in regard to an earlier email from Tim - is the colour
> >>> balance
> >>> adjustment performed for ALL probes or only for probes with
> >>> Infinium I
> >>> assay? Is the quantile normalization done for both Inf I and II
> >>> together
> >>> (rather than separately) in the current (development) version of
> >>> lumi? I
> >>> would be reluctant to do it that way, and I apologize if this is
> >>> described
> >>> somewhere and I misssed this informaiton.
> >>> Thanks, Ina
> >>>
> >>> _______________________________________________
> >>> Bioconductor mailing list
> >>> Bioconductor@r-project.org
> >>> https://stat.ethz.ch/mailman/listinfo/bioconductor
> >>> Search the archives: http://news.gmane.org/
> >>> gmane.science.biology.informatics.conductor
> >>>
> >>> _______________________________________________
> >>> Bioconductor mailing list
> >>> Bioconductor@r-project.org
> >>> https://stat.ethz.ch/mailman/listinfo/bioconductor
> >>> Search the archives: http://news.gmane.org/
> >>> gmane.science.biology.informatics.conductor
> >>>
> >>
> >> _______________________________________________
> >> Bioconductor mailing list
> >> Bioconductor@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/bioconductor
> >> Search the archives: http://news.gmane.org/
> >> gmane.science.biology.informatics.conductor
> >
> >
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>



-- 
If people do not believe that mathematics is simple, it is only because they
do not realize how complicated life is.
John von Neumann<http://www-groups.dcs.st-and.ac.uk/~history/Biographies/Von_Neumann.html>

	[[alternative HTML version deleted]]

