Labels in exprs to plot
1
0
Entering edit mode
@mcolosimbrandeisedu-880
Last seen 9.7 years ago
Hi, I'm having the hardest time trying to get the correct labels from my exprs to plot correctly. I'm using the affy to read in cels and process them. However, the lables I get are the "fullpath" to the files and not the ones in pData. Is there a way to get the correct labels minus the .CEL from pData to be used as labels for plot (even exprs2excel is now printing out the full paths, which it didn't do before). Basically I clustered my arrays and want to view it, but with the full path as labels it is tiny. hcRMA <- hclust(....) plot(hcRMA, labels = ?, main = "Hierarchical clustering dendrogram" Thanks Marc
Clustering affy PROcess Clustering affy PROcess • 1.4k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States
The easiest way I know to do this is to use list.celfiles() when you read in your AffyBatch. abatch <- read.affybatch(filenames=list.celfiles()) If you simply use ReadAffy(), you will get the entire path and will have to use sub() to truncate later. HTH, Jim James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 >>> <mcolosim@brandeis.edu> 08/14/04 10:11 AM >>> Hi, I'm having the hardest time trying to get the correct labels from my exprs to plot correctly. I'm using the affy to read in cels and process them. However, the lables I get are the "fullpath" to the files and not the ones in pData. Is there a way to get the correct labels minus the .CEL from pData to be used as labels for plot (even exprs2excel is now printing out the full paths, which it didn't do before). Basically I clustered my arrays and want to view it, but with the full path as labels it is tiny. hcRMA <- hclust(....) plot(hcRMA, labels = ?, main = "Hierarchical clustering dendrogram" Thanks Marc _______________________________________________ Bioconductor mailing list Bioconductor@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/bioconductor
ADD COMMENT
0
Entering edit mode
I would like to contribute this little function if anyone is interested. exprSet.sampleNames.cleanup <- function(object){ stopifnot( is(object, "exprSet") ) cn <- sampleNames(object) cn <- sapply( strsplit(cn, split="\/"), function(x) x[ length(x) ] ) cn <- sub( ".cel$|.CEL$", "", cn) sampleNames(object) <- cn return(object) } On a particular dataset I have, I have the following : > sampleNames(obj) # before cleanup [1] "/home/adai/tmp/0029_1209_H95Av2_KF0077.cel" [2] "/home/adai/tmp/0029_1210_H95A2_KF0079.cel" [3] "/home/adai/tmp/0029_1213_H95A2_KF0110.cel" [4] "/home/adai/tmp/0029_1221_H95A2_KF0144.cel" [5] "/home/adai/tmp/0029_1222_H95A2_KF0146.cel" [6] "/home/adai/tmp/0029_1224_HU95A_KF0150.cel" [7] "/home/adai/tmp/0029_1225_H95A2_KF0157.CEL" [8] "/home/adai/tmp/0029_1237_H95A2_KF0125.CEL" [9] "/home/adai/tmp/0029_1238_H95A2_KF0128.CEL" [10] "/home/adai/tmp/0029_1239_H95A2_KF0131.CEL" [11] "/home/adai/tmp/0029_1240_H95A2_KF0133.CEL" [12] "/home/adai/tmp/0029_1377_H95A2_KF-104.CEL" obj <- exprSet.sampleNames.cleanup(obj) > sampleNames(obj) # after cleanup [1] "0029_1209_H95Av2_KF0077" "0029_1210_H95A2_KF0079" [3] "0029_1213_H95A2_KF0110" "0029_1221_H95A2_KF0144" [5] "0029_1222_H95A2_KF0146" "0029_1224_HU95A_KF0150" [7] "0029_1225_H95A2_KF0157" "0029_1237_H95A2_KF0125" [9] "0029_1238_H95A2_KF0128" "0029_1239_H95A2_KF0131" [11] "0029_1240_H95A2_KF0133" "0029_1377_H95A2_KF-104" On Sat, 2004-08-14 at 22:11, James MacDonald wrote: > The easiest way I know to do this is to use list.celfiles() when you > read in your AffyBatch. > > abatch <- read.affybatch(filenames=list.celfiles()) > > If you simply use ReadAffy(), you will get the entire path and will have > to use sub() to truncate later. > > HTH, > > Jim > > > > James W. MacDonald > Affymetrix and cDNA Microarray Core > University of Michigan Cancer Center > 1500 E. Medical Center Drive > 7410 CCGC > Ann Arbor MI 48109 > 734-647-5623 > >>> <mcolosim@brandeis.edu> 08/14/04 10:11 AM >>> > Hi, > > I'm having the hardest time trying to get the correct labels from my > exprs to > plot correctly. I'm using the affy to read in cels and process them. > However, > the lables I get are the "fullpath" to the files and not the ones in > pData. > > Is there a way to get the correct labels minus the .CEL from pData to be > used > as labels for plot (even exprs2excel is now printing out the full paths, > which it didn't do before). > > Basically I clustered my arrays and want to view it, but with the full > path as > labels it is tiny. > > hcRMA <- hclust(....) > plot(hcRMA, labels = ?, main = "Hierarchical clustering dendrogram" > > Thanks > Marc > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor >
ADD REPLY
0
Entering edit mode
I think this would be great. Thanks for the function and help. Marc Quoting Adaikalavan Ramasamy <ramasamy@cancer.org.uk>: > I would like to contribute this little function if anyone is interested. > > exprSet.sampleNames.cleanup <- function(object){ > stopifnot( is(object, "exprSet") ) > > cn <- sampleNames(object) > cn <- sapply( strsplit(cn, split="\/"), function(x) x[ length(x) ] ) > cn <- sub( ".cel$|.CEL$", "", cn) > sampleNames(object) <- cn > return(object) > } > > > On a particular dataset I have, I have the following : > > > sampleNames(obj) # before cleanup > > [1] "/home/adai/tmp/0029_1209_H95Av2_KF0077.cel" > [2] "/home/adai/tmp/0029_1210_H95A2_KF0079.cel" > [3] "/home/adai/tmp/0029_1213_H95A2_KF0110.cel" > [4] "/home/adai/tmp/0029_1221_H95A2_KF0144.cel" > [5] "/home/adai/tmp/0029_1222_H95A2_KF0146.cel" > [6] "/home/adai/tmp/0029_1224_HU95A_KF0150.cel" > [7] "/home/adai/tmp/0029_1225_H95A2_KF0157.CEL" > [8] "/home/adai/tmp/0029_1237_H95A2_KF0125.CEL" > [9] "/home/adai/tmp/0029_1238_H95A2_KF0128.CEL" > [10] "/home/adai/tmp/0029_1239_H95A2_KF0131.CEL" > [11] "/home/adai/tmp/0029_1240_H95A2_KF0133.CEL" > [12] "/home/adai/tmp/0029_1377_H95A2_KF-104.CEL" > > obj <- exprSet.sampleNames.cleanup(obj) > > sampleNames(obj) # after cleanup > > [1] "0029_1209_H95Av2_KF0077" "0029_1210_H95A2_KF0079" > [3] "0029_1213_H95A2_KF0110" "0029_1221_H95A2_KF0144" > [5] "0029_1222_H95A2_KF0146" "0029_1224_HU95A_KF0150" > [7] "0029_1225_H95A2_KF0157" "0029_1237_H95A2_KF0125" > [9] "0029_1238_H95A2_KF0128" "0029_1239_H95A2_KF0131" > [11] "0029_1240_H95A2_KF0133" "0029_1377_H95A2_KF-104" > > > > On Sat, 2004-08-14 at 22:11, James MacDonald wrote: > > The easiest way I know to do this is to use list.celfiles() when you > > read in your AffyBatch. > > > > abatch <- read.affybatch(filenames=list.celfiles()) > > > > If you simply use ReadAffy(), you will get the entire path and will have > > to use sub() to truncate later. > > > > HTH, > > > > Jim > > > > > > > > James W. MacDonald > > Affymetrix and cDNA Microarray Core > > University of Michigan Cancer Center > > 1500 E. Medical Center Drive > > 7410 CCGC > > Ann Arbor MI 48109 > > 734-647-5623 > > >>> <mcolosim@brandeis.edu> 08/14/04 10:11 AM >>> > > Hi, > > > > I'm having the hardest time trying to get the correct labels from my > > exprs to > > plot correctly. I'm using the affy to read in cels and process them. > > However, > > the lables I get are the "fullpath" to the files and not the ones in > > pData. > > > > Is there a way to get the correct labels minus the .CEL from pData to be > > used > > as labels for plot (even exprs2excel is now printing out the full paths, > > which it didn't do before). > > > > Basically I clustered my arrays and want to view it, but with the full > > path as > > labels it is tiny. > > > > hcRMA <- hclust(....) > > plot(hcRMA, labels = ?, main = "Hierarchical clustering dendrogram" > > > > Thanks > > Marc > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > > >
ADD REPLY
0
Entering edit mode
i just saw this thread and wanted to point out that in the devel version of affy the full paths wont be kept as sampleNames as default. -r On Sun, 15 Aug 2004 mcolosim@brandeis.edu wrote: > I think this would be great. > > Thanks for the function and help. > > Marc > > Quoting Adaikalavan Ramasamy <ramasamy@cancer.org.uk>: > > > I would like to contribute this little function if anyone is interested. > > > > exprSet.sampleNames.cleanup <- function(object){ > > stopifnot( is(object, "exprSet") ) > > > > cn <- sampleNames(object) > > cn <- sapply( strsplit(cn, split="\/"), function(x) x[ length(x) ] ) > > cn <- sub( ".cel$|.CEL$", "", cn) > > sampleNames(object) <- cn > > return(object) > > } > > > > > > On a particular dataset I have, I have the following : > > > > > sampleNames(obj) # before cleanup > > > > [1] "/home/adai/tmp/0029_1209_H95Av2_KF0077.cel" > > [2] "/home/adai/tmp/0029_1210_H95A2_KF0079.cel" > > [3] "/home/adai/tmp/0029_1213_H95A2_KF0110.cel" > > [4] "/home/adai/tmp/0029_1221_H95A2_KF0144.cel" > > [5] "/home/adai/tmp/0029_1222_H95A2_KF0146.cel" > > [6] "/home/adai/tmp/0029_1224_HU95A_KF0150.cel" > > [7] "/home/adai/tmp/0029_1225_H95A2_KF0157.CEL" > > [8] "/home/adai/tmp/0029_1237_H95A2_KF0125.CEL" > > [9] "/home/adai/tmp/0029_1238_H95A2_KF0128.CEL" > > [10] "/home/adai/tmp/0029_1239_H95A2_KF0131.CEL" > > [11] "/home/adai/tmp/0029_1240_H95A2_KF0133.CEL" > > [12] "/home/adai/tmp/0029_1377_H95A2_KF-104.CEL" > > > > obj <- exprSet.sampleNames.cleanup(obj) > > > sampleNames(obj) # after cleanup > > > > [1] "0029_1209_H95Av2_KF0077" "0029_1210_H95A2_KF0079" > > [3] "0029_1213_H95A2_KF0110" "0029_1221_H95A2_KF0144" > > [5] "0029_1222_H95A2_KF0146" "0029_1224_HU95A_KF0150" > > [7] "0029_1225_H95A2_KF0157" "0029_1237_H95A2_KF0125" > > [9] "0029_1238_H95A2_KF0128" "0029_1239_H95A2_KF0131" > > [11] "0029_1240_H95A2_KF0133" "0029_1377_H95A2_KF-104" > > > > > > > > On Sat, 2004-08-14 at 22:11, James MacDonald wrote: > > > The easiest way I know to do this is to use list.celfiles() when you > > > read in your AffyBatch. > > > > > > abatch <- read.affybatch(filenames=list.celfiles()) > > > > > > If you simply use ReadAffy(), you will get the entire path and will have > > > to use sub() to truncate later. > > > > > > HTH, > > > > > > Jim > > > > > > > > > > > > James W. MacDonald > > > Affymetrix and cDNA Microarray Core > > > University of Michigan Cancer Center > > > 1500 E. Medical Center Drive > > > 7410 CCGC > > > Ann Arbor MI 48109 > > > 734-647-5623 > > > >>> <mcolosim@brandeis.edu> 08/14/04 10:11 AM >>> > > > Hi, > > > > > > I'm having the hardest time trying to get the correct labels from my > > > exprs to > > > plot correctly. I'm using the affy to read in cels and process them. > > > However, > > > the lables I get are the "fullpath" to the files and not the ones in > > > pData. > > > > > > Is there a way to get the correct labels minus the .CEL from pData to be > > > used > > > as labels for plot (even exprs2excel is now printing out the full paths, > > > which it didn't do before). > > > > > > Basically I clustered my arrays and want to view it, but with the full > > > path as > > > labels it is tiny. > > > > > > hcRMA <- hclust(....) > > > plot(hcRMA, labels = ?, main = "Hierarchical clustering dendrogram" > > > > > > Thanks > > > Marc > > > > > > _______________________________________________ > > > Bioconductor mailing list > > > Bioconductor@stat.math.ethz.ch > > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > > > > > _______________________________________________ > > > Bioconductor mailing list > > > Bioconductor@stat.math.ethz.ch > > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > > > > > > > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor >
ADD REPLY
0
Entering edit mode
Dear group, Apologies for asking the most chomped FAQ. I have a file with list of gene names(genes.txt): EGF EGFR PTPN6 TIEG2 MAPK1 I have another object in R, I do not know the data type for that object that looks like this ("lidnames"): "RABGGTA" "MAPK3" "TIE" "CYP2C19" > lidnames[1:10] 100_g_at 1000_at 1001_at 1002_f_at 1003_s_at "RABGGTA" "MAPK3" "TIE" "CYP2C19" "BLR1" I want to pick list of genes from lidnames object that are in genes.txt. I am using %in% function. >mygenes<-read.table("genes.txt") > mygenes[mygenes %in% lidnames] NULL data frame with 164 rows > I am unable to pullout genes from lidnames object. Is it because that lidnames is as a list type and mygenes object is as a vector/matrix type. How can I convert mygenes to list type where I can have the elements: "EGF","EGFR","PTPN6","TIEG2","MAPK1". I think in this way I can pull out the names from lidnames object or any other complex matrix. Please help me. Thank you SP _______________________________ Win 1 of 4,000 free domain names from Yahoo! Enter now.
ADD REPLY
0
Entering edit mode
On Thu, 2004-08-19 at 17:41, S Peri wrote: > Dear group, > Apologies for asking the most chomped FAQ. > > I have a file with list of gene names(genes.txt): > EGF > EGFR > PTPN6 > TIEG2 > MAPK1 > > > I have another object in R, I do not know the data > type for that object that looks like this > ("lidnames"): > "RABGGTA" "MAPK3" "TIE" "CYP2C19" > > > > lidnames[1:10] > 100_g_at 1000_at 1001_at 1002_f_at 1003_s_at > "RABGGTA" "MAPK3" "TIE" "CYP2C19" "BLR1" lidnames[1:10] is supposed to have 10 elements, yet you only showed 5. This is similar to the following confusing command. > print(1:10) [1] 1 2 3 4 5 > > I want to pick list of genes from lidnames object that > are in genes.txt. I am using %in% function. > > >mygenes<-read.table("genes.txt") > > > mygenes[mygenes %in% lidnames] > NULL data frame with 164 rows > > You probably want mygenes[ rownames(mygenes) %in% names(lidnames) , ] Also look at and run the examples in help("merge"). I would strongly suggest you learn some R basics to do with basic data structures (vector, matrix, list) and how to subset them properly. It appears that you are trying to learn R by trial and error. R is much like any programming language in that it will only pickup syntax and coding errors not intellectual errors. > I am unable to pullout genes from lidnames object. > > Is it because that lidnames is as a list type and > mygenes object is as a vector/matrix type. > > How can I convert mygenes to list type where I can > have the elements: > > "EGF","EGFR","PTPN6","TIEG2","MAPK1". > > I think in this way I can pull out the names from > lidnames object or any other complex matrix. > > Please help me. > > Thank you > SP > > > > > _______________________________ > > Win 1 of 4,000 free domain names from Yahoo! Enter now. > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor >
ADD REPLY

Login before adding your answer.

Traffic: 659 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