[BioC] display subset of gene symbols in heatmap

Steve Lianoglou mailinglist.honeypot at gmail.com
Wed Feb 16 02:27:20 CET 2011


Hi,

On Tue, Feb 15, 2011 at 7:53 PM, Pete Shepard <peter.shepard at gmail.com> wrote:
> Hi Tim,
>
> That worked at least in getting the names in the list, although I don't
> understand what this grep section is doing?

Just look at what the function call grep returns:

> I just want the names in some.probes?
>
> named <- data.matrix(my.exprs[ some.probes,
>                                 grep('CD34', names(my.exprs)) ])

For example:

R> wut <- grep('CD34', names(my.exprs))
R> head(wut)
R> head(names(my.exprs)[wut])

Alternatively, you could always read the documentation found via ?grep

> Sadly:
>
> heatmap(named, main='a heatmap')
>
> gives the same error as before:
>
> 'x' must have at least 2 rows and 2 columns

Your previous error said that "x must be a numeric matrix", and now
it's telling you that x needs at least two rows and two columns.

The `x` that is being referred to is the `x` you are passing into the
heatmap function, so you might want to take a look to see what `x` is.
In this case, you are setting `named` to x, so what is the output of:

R> is(named)
R> dim(named)
R> head(named)

A little exploration of your data (or what you assume your data is)
via the intermediary vars/steps you are creating will get you a long
way.


-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the Bioconductor mailing list