MEMORY limit in R

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MEMORY limit in R

mark salsburg
I sent this to Bioconductor, but I think it is more of an R listserv
question, because of memory allocation trouble


I am having trouble getting the function heatmap() to work on the following
gene expression

> dim(SAMPLES_log)
[1] 12626    20


           sample1 sample2...................sample20
gen1
gen2
gen3
....
gen12626



I have converted SAMPLES_log to a numeric matrix using:

as.matrix(SAMPLES_log)

when I use the following command:

heatmap(SAMPLES_log)

Error: cannot allocate vector of size 622668 Kb
In addition: Warning messages:
1: Reached total allocation of 1022Mb: see help(memory.size)
2: Reached total allocation of 1022Mb: see help(memory.size)



Is there some library in BioConductor that will allow me to output a
heatmap. I want to compare the expression of the first 10 samples with the
last 10 samples.

I have tried running that command in a Linux environment, also with no
success

thank you,

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: MEMORY limit in R

Liaw, Andy
heatmap() will do hierarchical clustering with hclust(), and to do that it
needs to compute and store the lower triangular part of the distance matrix,
which has 12626 * 12625 / 2 elements, each elements taking up 8 bytes of
storage.  That works out to about 608MB (and is about the size that R fails
to allocate, according to the error message you got).  If you really want to
do this, make sure you have sufficient memory (I'd say at least 2GB) in the
machine, and make sure you are not storing anything in R that you do not
need for the job.

Also note that even if you have your monitor set to a 1600 x 1200
resolution, it still can only display 1200 pixels vertically.  Can you
really hope to see 12626 different strips?

Andy

From: mark salsburg

>
> I sent this to Bioconductor, but I think it is more of an R
> listserv question, because of memory allocation trouble
>
>
> I am having trouble getting the function heatmap() to work on
> the following gene expression
>
> > dim(SAMPLES_log)
> [1] 12626    20
>
>
>            sample1 sample2...................sample20
> gen1
> gen2
> gen3
> ....
> gen12626
>
>
>
> I have converted SAMPLES_log to a numeric matrix using:
>
> as.matrix(SAMPLES_log)
>
> when I use the following command:
>
> heatmap(SAMPLES_log)
>
> Error: cannot allocate vector of size 622668 Kb
> In addition: Warning messages:
> 1: Reached total allocation of 1022Mb: see help(memory.size)
> 2: Reached total allocation of 1022Mb: see help(memory.size)
>
>
>
> Is there some library in BioConductor that will allow me to
> output a heatmap. I want to compare the expression of the
> first 10 samples with the last 10 samples.
>
> I have tried running that command in a Linux environment,
> also with no success
>
> thank you,
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html