display subset of gene symbols in heatmap
1
0
Entering edit mode
Pete Shepard ▴ 240
@pete-shepard-3324
Last seen 10.2 years ago
Dear List, I am attempting to visualize some affymetrix data from the hgu133a2.db chip using heatmap. So far, what I've done is as follows dat<-ReadAffy(filenames = "GSM448823.CEL", "GSM448824.CEL","GSM448816.CEL", "GSM448817.CEL") #puts .CEL files into a data frame dat2<-rma(dat) #normalizes data dat.n<-exprs(dat2) What I would like to do next is for a subset of gene symbols, ~ 10, I would like to make a heatmap and display the gene symbols instead of the probe ids. So, I need to first get gene symbols from the probe ids and then select only a subset of these symbols from "dat.n" and make a heatmap of these symbols. Can anyone help me regarding this problem? Thanks [[alternative HTML version deleted]]
hgu133a2 probe hgu133a2 probe • 1.9k views
ADD COMMENT
0
Entering edit mode
Pete Shepard ▴ 240
@pete-shepard-3324
Last seen 10.2 years ago
Hi Tim, Thanks for your response. rownames(dat.n) <- make.names(mget(rownames(dat.n), hgu133a2SYMBOL, ifnotfound=NA)) and rownames(dat.n) <- mget(rownames(dat.n), hgu133a2SYMBOL, ifnotfound=NA) seems to give me the same output. dat.plotme <- dat.n[ "NPEPL1",] using this command, I can only enter one gene symbol. If I run: heatmap(dat.plotme) I get the folllowing output: Error in heatmap(dat.plotme) : 'x' must be a numeric matrix Confused here On Tue, Feb 15, 2011 at 1:58 PM, Tim Triche <tim.triche@gmail.com> wrote: > library(hgu133plus2.db) > rownames(dat.n) <- mget(rownames(dat.n), hgu133plus2SYMBOL, > ifnotfound=NA) > dat.plotme <- dat.n[ some.symbols, ] > heatmap(dat.plotme) > > > On Tue, Feb 15, 2011 at 1:43 PM, Pete Shepard <peter.shepard@gmail.com>wrote: > >> Dear List, >> >> I am attempting to visualize some affymetrix data from the hgu133a2.db >> chip >> using heatmap. So far, what I've done is as follows >> >> dat<-ReadAffy(filenames = "GSM448823.CEL", >> "GSM448824.CEL","GSM448816.CEL", >> "GSM448817.CEL") #puts .CEL files into a data frame >> >> dat2<-rma(dat) #normalizes data >> >> dat.n<-exprs(dat2) >> >> >> What I would like to do next is for a subset of gene symbols, ~ 10, I >> would >> like to make a heatmap and display the gene symbols instead of the probe >> ids. >> >> So, I need to first get gene symbols from the probe ids and then select >> only >> a subset of these symbols from "dat.n" and make a heatmap of these >> symbols. >> >> Can anyone help me regarding this problem? >> >> Thanks >> >> [[alternative HTML version deleted]] >> >> _______________________________________________ >> 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="" %7ehistory="" biographies="" von_neumann.html=""> > > [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
alternative with probe names as row names (now I remember why it's better that way): > some.probes <- unlist(mget(c('ASXL1','WIT1','DAPK1'), hgu133plus2ALIAS2PROBE)) > named <- data.matrix(my.exprs[ some.probes, grep('CD34', names(my.exprs)) ]) > rownames(named) <- make.names( unlist(mget(some.probes, hgu133plus2SYMBOL)) ) > heatmap(named, main='a heatmap') On Tue, Feb 15, 2011 at 3:10 PM, Pete Shepard <peter.shepard@gmail.com>wrote: > Hi Tim, > > Thanks for your response. > > rownames(dat.n) <- make.names(mget(rownames(dat.n), hgu133a2SYMBOL, > ifnotfound=NA)) > > and > > rownames(dat.n) <- mget(rownames(dat.n), hgu133a2SYMBOL, ifnotfound=NA) > > seems to give me the same output. > > dat.plotme <- dat.n[ "NPEPL1",] > > using this command, I can only enter one gene symbol. > > If I run: > > heatmap(dat.plotme) > > I get the folllowing output: > > Error in heatmap(dat.plotme) : 'x' must be a numeric matrix > > Confused here > > On Tue, Feb 15, 2011 at 1:58 PM, Tim Triche <tim.triche@gmail.com> wrote: > >> library(hgu133plus2.db) >> rownames(dat.n) <- mget(rownames(dat.n), hgu133plus2SYMBOL, >> ifnotfound=NA) >> dat.plotme <- dat.n[ some.symbols, ] >> heatmap(dat.plotme) >> >> >> On Tue, Feb 15, 2011 at 1:43 PM, Pete Shepard <peter.shepard@gmail.com>wrote: >> >>> Dear List, >>> >>> I am attempting to visualize some affymetrix data from the hgu133a2.db >>> chip >>> using heatmap. So far, what I've done is as follows >>> >>> dat<-ReadAffy(filenames = "GSM448823.CEL", >>> "GSM448824.CEL","GSM448816.CEL", >>> "GSM448817.CEL") #puts .CEL files into a data frame >>> >>> dat2<-rma(dat) #normalizes data >>> >>> dat.n<-exprs(dat2) >>> >>> >>> What I would like to do next is for a subset of gene symbols, ~ 10, I >>> would >>> like to make a heatmap and display the gene symbols instead of the probe >>> ids. >>> >>> So, I need to first get gene symbols from the probe ids and then select >>> only >>> a subset of these symbols from "dat.n" and make a heatmap of these >>> symbols. >>> >>> Can anyone help me regarding this problem? >>> >>> Thanks >>> >>> [[alternative HTML version deleted]] >>> >>> _______________________________________________ >>> 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="" %7ehistory="" biographies="" von_neumann.html=""> >> >> > -- Pure reason shows that reason is not enough. Dennis V. Lindley<http: www.york.ac.uk="" depts="" maths="" histstat="" people="" lindley.gif=""> [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Hi Tim, That worked at least in getting the names in the list, although I don't understand what this grep section is doing? I just want the names in some.probes? named <- data.matrix(my.exprs[ some.probes, grep('CD34', names(my.exprs)) ]) Sadly: heatmap(named, main='a heatmap') gives the same error as before: 'x' must have at least 2 rows and 2 columns On Tue, Feb 15, 2011 at 3:41 PM, Tim Triche, Jr. <ttriche@usc.edu> wrote: > alternative with probe names as row names (now I remember why it's better > that way): > > > some.probes <- unlist(mget(c('ASXL1','WIT1','DAPK1'), > hgu133plus2ALIAS2PROBE)) > > named <- data.matrix(my.exprs[ some.probes, > grep('CD34', names(my.exprs)) ]) > > rownames(named) <- make.names( unlist(mget(some.probes, > hgu133plus2SYMBOL)) ) > > heatmap(named, main='a heatmap') > > > > > On Tue, Feb 15, 2011 at 3:10 PM, Pete Shepard <peter.shepard@gmail.com>wrote: > >> Hi Tim, >> >> Thanks for your response. >> >> rownames(dat.n) <- make.names(mget(rownames(dat.n), hgu133a2SYMBOL, >> ifnotfound=NA)) >> >> and >> >> rownames(dat.n) <- mget(rownames(dat.n), hgu133a2SYMBOL, ifnotfound=NA) >> >> seems to give me the same output. >> >> dat.plotme <- dat.n[ "NPEPL1",] >> >> using this command, I can only enter one gene symbol. >> >> If I run: >> >> heatmap(dat.plotme) >> >> I get the folllowing output: >> >> Error in heatmap(dat.plotme) : 'x' must be a numeric matrix >> >> Confused here >> >> On Tue, Feb 15, 2011 at 1:58 PM, Tim Triche <tim.triche@gmail.com> wrote: >> >>> library(hgu133plus2.db) >>> rownames(dat.n) <- mget(rownames(dat.n), hgu133plus2SYMBOL, >>> ifnotfound=NA) >>> dat.plotme <- dat.n[ some.symbols, ] >>> heatmap(dat.plotme) >>> >>> >>> On Tue, Feb 15, 2011 at 1:43 PM, Pete Shepard <peter.shepard@gmail.com>wrote: >>> >>>> Dear List, >>>> >>>> I am attempting to visualize some affymetrix data from the hgu133a2.db >>>> chip >>>> using heatmap. So far, what I've done is as follows >>>> >>>> dat<-ReadAffy(filenames = "GSM448823.CEL", >>>> "GSM448824.CEL","GSM448816.CEL", >>>> "GSM448817.CEL") #puts .CEL files into a data frame >>>> >>>> dat2<-rma(dat) #normalizes data >>>> >>>> dat.n<-exprs(dat2) >>>> >>>> >>>> What I would like to do next is for a subset of gene symbols, ~ 10, I >>>> would >>>> like to make a heatmap and display the gene symbols instead of the probe >>>> ids. >>>> >>>> So, I need to first get gene symbols from the probe ids and then select >>>> only >>>> a subset of these symbols from "dat.n" and make a heatmap of these >>>> symbols. >>>> >>>> Can anyone help me regarding this problem? >>>> >>>> Thanks >>>> >>>> [[alternative HTML version deleted]] >>>> >>>> _______________________________________________ >>>> 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="" %7ehistory="" biographies="" von_neumann.html=""> >>> >>> >> > > > -- > Pure reason shows that reason is not enough. > > Dennis V. Lindley<http: www.york.ac.uk="" depts="" maths="" histstat="" people="" lindley.gif=""> > > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
the grep is retrieving some control samples out of the 278 columns in the matrix I used. if you have mapped some symbols which you wish to extract onto the corresponding probes (in the vector 'some.probes') and there is no data to plot, that is a different issue. I suspect you do not have any columns labeled as being from CD34+ samples, thus no data was returned... sorry about leaving that in the example. try some.probes <- mget( c('MLL','TET1'), hgu133plus2ALIAS2PROBE ) named <- data.matrix(my.exprs[ some.probes, ]) names(named) <- mget(rownames(named), hgu133plus2SYMBOL) heatmap(named, main='a heatmap') and see if that doesn't produce the desired result (at least for MLL and TET1 ;-)) On Tue, Feb 15, 2011 at 4:53 PM, Pete Shepard <peter.shepard@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? I just want the names in > some.probes? > > > named <- data.matrix(my.exprs[ some.probes, > grep('CD34', names(my.exprs)) ]) > > Sadly: > > > heatmap(named, main='a heatmap') > > gives the same error as before: > > 'x' must have at least 2 rows and 2 columns > > > > > On Tue, Feb 15, 2011 at 3:41 PM, Tim Triche, Jr. <ttriche@usc.edu> wrote: > >> alternative with probe names as row names (now I remember why it's better >> that way): >> >> > some.probes <- unlist(mget(c('ASXL1','WIT1','DAPK1'), >> hgu133plus2ALIAS2PROBE)) >> > named <- data.matrix(my.exprs[ some.probes, >> grep('CD34', names(my.exprs)) ]) >> > rownames(named) <- make.names( unlist(mget(some.probes, >> hgu133plus2SYMBOL)) ) >> > heatmap(named, main='a heatmap') >> >> >> >> >> On Tue, Feb 15, 2011 at 3:10 PM, Pete Shepard <peter.shepard@gmail.com>wrote: >> >>> Hi Tim, >>> >>> Thanks for your response. >>> >>> rownames(dat.n) <- make.names(mget(rownames(dat.n), hgu133a2SYMBOL, >>> ifnotfound=NA)) >>> >>> and >>> >>> rownames(dat.n) <- mget(rownames(dat.n), hgu133a2SYMBOL, ifnotfound=NA) >>> >>> seems to give me the same output. >>> >>> dat.plotme <- dat.n[ "NPEPL1",] >>> >>> using this command, I can only enter one gene symbol. >>> >>> If I run: >>> >>> heatmap(dat.plotme) >>> >>> I get the folllowing output: >>> >>> Error in heatmap(dat.plotme) : 'x' must be a numeric matrix >>> >>> Confused here >>> >>> On Tue, Feb 15, 2011 at 1:58 PM, Tim Triche <tim.triche@gmail.com>wrote: >>> >>>> library(hgu133plus2.db) >>>> rownames(dat.n) <- mget(rownames(dat.n), hgu133plus2SYMBOL, >>>> ifnotfound=NA) >>>> dat.plotme <- dat.n[ some.symbols, ] >>>> heatmap(dat.plotme) >>>> >>>> >>>> On Tue, Feb 15, 2011 at 1:43 PM, Pete Shepard <peter.shepard@gmail.com>wrote: >>>> >>>>> Dear List, >>>>> >>>>> I am attempting to visualize some affymetrix data from the hgu133a2.db >>>>> chip >>>>> using heatmap. So far, what I've done is as follows >>>>> >>>>> dat<-ReadAffy(filenames = "GSM448823.CEL", >>>>> "GSM448824.CEL","GSM448816.CEL", >>>>> "GSM448817.CEL") #puts .CEL files into a data frame >>>>> >>>>> dat2<-rma(dat) #normalizes data >>>>> >>>>> dat.n<-exprs(dat2) >>>>> >>>>> >>>>> What I would like to do next is for a subset of gene symbols, ~ 10, I >>>>> would >>>>> like to make a heatmap and display the gene symbols instead of the >>>>> probe >>>>> ids. >>>>> >>>>> So, I need to first get gene symbols from the probe ids and then select >>>>> only >>>>> a subset of these symbols from "dat.n" and make a heatmap of these >>>>> symbols. >>>>> >>>>> Can anyone help me regarding this problem? >>>>> >>>>> Thanks >>>>> >>>>> [[alternative HTML version deleted]] >>>>> >>>>> _______________________________________________ >>>>> 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="" %7ehistory="" biographies="" von_neumann.html=""> >>>> >>>> >>> >> >> >> -- >> Pure reason shows that reason is not enough. >> >> Dennis V. Lindley<http: www.york.ac.uk="" depts="" maths="" histstat="" people="" lindley.gif=""> >> >> > -- Pure reason shows that reason is not enough. Dennis V. Lindley<http: www.york.ac.uk="" depts="" maths="" histstat="" people="" lindley.gif=""> [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
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
ADD REPLY

Login before adding your answer.

Traffic: 640 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6