trouble hacking plotPCA
3
0
Entering edit mode
Jenny Drnevich ★ 2.2k
@jenny-drnevich-382
Last seen 9.6 years ago
Hi Jim, I was trying to modify 'plotPCA' so it could take a matrix instead of an exprSet object, but in doing so somehow R can't find the function 'pca.legend', even though it pulls up the documentation for it when I query '?pca.legend". I didn't even touch the code that had to do with 'pca.legend'! Any ideas why and/or what I can do to get the legend? Code and sessionInfo() below. Thanks, Jenny >plotPCA(rma.data) # no problem with this - the legend was fine > source("C:/Statistics/JDplotPCA.R") > JDplotPCA(exprs(rma.data)) Error in JDplotPCA(exprs(rma.data)) : could not find function "pca.legend" > JDplotPCA function (eset, groups = NULL, groupnames = NULL, addtext = NULL, x.coord = NULL, y.coord = NULL, screeplot = FALSE, squarepca = FALSE, pch = NULL, col = NULL, ...) { require(affycoretools) if (is.null(groupnames)) groupnames <- colnames(eset) if (is.factor(groupnames)) groupnames <- as.character(groupnames) pca <- prcomp(t(eset)) if (screeplot) { plot(pca, main = "Screeplot") } else { if (squarepca) { ylim <- max(abs(range(pca$x[, 1]))) ylim <- c(-ylim, ylim) } else ylim <- NULL if (!is.null(groups)) { if (is.null(pch)) pch <- groups if (is.null(col)) col <- groups plot(pca$x[, 1:2], pch = pch, col = col, ylab = "PC2", xlab = "PC1", main = "Principal Components Plot", ylim = ylim, ...) } else { if (is.null(pch)) pch <- 0:length(colnames(eset)) if (is.null(col)) col <- 1:length(colnames(eset)) plot(pca$x[, 1:2], pch = pch, col = col, ylab = "PC2", xlab = "PC1", main = "Principal Components Plot", ylim = ylim, ...) } if (is.null(addtext)) { pca.legend(pca, groupnames, pch, col, x.coord = x.coord, y.coord = y.coord, ...) } else { smidge <- pca.legend(pca, groupnames, pch, col, x.coord = x.coord, y.coord = y.coord, saveup = TRUE, ...) text(pca$x[, 1], pca$x[, 2] + smidge, label = addtext, cex = 0.7) } } } > sessionInfo() R version 2.4.0 (2006-10-03) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] "splines" "tools" "methods" "stats" "graphics" "grDevices" [7] "utils" "datasets" "base" other attached packages: affyQCReport simpleaffy made4 scatterplot3d ade4 "1.12.0" "2.8.0" "1.8.0" "0.3-24" "1.4-2" affyPLM gcrma matchprobes affydata affycoretools "1.10.0" "2.6.0" "1.6.0" "1.10.0" "1.6.0" biomaRt RCurl XML GOstats Category "1.8.0" "0.7-0" "1.2-0" "2.0.3" "2.0.3" genefilter survival KEGG RBGL annotate "1.12.0" "2.29" "1.14.1" "1.10.0" "1.12.0" GO graph limma affy affyio "1.14.1" "1.12.0" "2.9.1" "1.12.1" "1.2.0" Biobase RWinEdt "1.12.2" "1.7-5" Jenny Drnevich, Ph.D. Functional Genomics Bioinformatics Specialist W.M. Keck Center for Comparative and Functional Genomics Roy J. Carver Biotechnology Center University of Illinois, Urbana-Champaign 330 ERML 1201 W. Gregory Dr. Urbana, IL 61801 USA ph: 217-244-7355 fax: 217-265-5066 e-mail: drnevich at uiuc.edu
GO Survival Biobase genefilter affy affydata graph limma gcrma matchprobes affyPLM RBGL • 2.7k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 17 hours ago
United States
Hi Jenny, Ha Ha, you can't foil my anti-hack barrier code! ;-D Actually, I use a namespace, so when you hack plotPCA() and dump it into your .GlobalEnv, it is no longer part of the affycoretools namespace and thus can't find helper functions that are sealed in the namespace. The alternatives are: 1.) Make the hacks to the source package and then install using R CMD INSTALL 2.) Wait until tomorrow when I can make the changes and send you the package. I would normally have you wait until it propagates through the build process, but annaffy is busted and keeping affycoretools from building, so no propagation for me ;-( Let me know your preference. Best, Jim Jenny Drnevich wrote: > Hi Jim, > > I was trying to modify 'plotPCA' so it could take a matrix instead of an > exprSet object, but in doing so somehow R can't find the function > 'pca.legend', even though it pulls up the documentation for it when I query > '?pca.legend". I didn't even touch the code that had to do with > 'pca.legend'! Any ideas why and/or what I can do to get the legend? Code > and sessionInfo() below. > > Thanks, > Jenny > > > >plotPCA(rma.data) > # no problem with this - the legend was fine > > > source("C:/Statistics/JDplotPCA.R") > > > JDplotPCA(exprs(rma.data)) > Error in JDplotPCA(exprs(rma.data)) : could not find function "pca.legend" > > > JDplotPCA > function (eset, groups = NULL, groupnames = NULL, addtext = NULL, > x.coord = NULL, y.coord = NULL, screeplot = FALSE, squarepca = FALSE, > pch = NULL, col = NULL, ...) > { > require(affycoretools) > if (is.null(groupnames)) > groupnames <- colnames(eset) > if (is.factor(groupnames)) > groupnames <- as.character(groupnames) > pca <- prcomp(t(eset)) > if (screeplot) { > plot(pca, main = "Screeplot") > } > else { > if (squarepca) { > ylim <- max(abs(range(pca$x[, 1]))) > ylim <- c(-ylim, ylim) > } > else ylim <- NULL > if (!is.null(groups)) { > if (is.null(pch)) > pch <- groups > if (is.null(col)) > col <- groups > plot(pca$x[, 1:2], pch = pch, col = col, ylab = "PC2", > xlab = "PC1", main = "Principal Components Plot", > ylim = ylim, ...) > } > else { > if (is.null(pch)) > pch <- 0:length(colnames(eset)) > if (is.null(col)) > col <- 1:length(colnames(eset)) > plot(pca$x[, 1:2], pch = pch, col = col, ylab = "PC2", > xlab = "PC1", main = "Principal Components Plot", > ylim = ylim, ...) > } > if (is.null(addtext)) { > pca.legend(pca, groupnames, pch, col, x.coord = x.coord, > y.coord = y.coord, ...) > } > else { > smidge <- pca.legend(pca, groupnames, pch, col, x.coord = > x.coord, > y.coord = y.coord, saveup = TRUE, ...) > text(pca$x[, 1], pca$x[, 2] + smidge, label = addtext, > cex = 0.7) > } > } > } > > > sessionInfo() > R version 2.4.0 (2006-10-03) > i386-pc-mingw32 > > locale: > LC_COLLATE=English_United States.1252;LC_CTYPE=English_United > States.1252;LC_MONETARY=English_United > States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 > > attached base packages: > [1] "splines" "tools" "methods" "stats" "graphics" "grDevices" > [7] "utils" "datasets" "base" > > other attached packages: > affyQCReport simpleaffy made4 scatterplot3d ade4 > "1.12.0" "2.8.0" "1.8.0" "0.3-24" "1.4-2" > affyPLM gcrma matchprobes affydata affycoretools > "1.10.0" "2.6.0" "1.6.0" "1.10.0" "1.6.0" > biomaRt RCurl XML GOstats Category > "1.8.0" "0.7-0" "1.2-0" "2.0.3" "2.0.3" > genefilter survival KEGG RBGL annotate > "1.12.0" "2.29" "1.14.1" "1.10.0" "1.12.0" > GO graph limma affy affyio > "1.14.1" "1.12.0" "2.9.1" "1.12.1" "1.2.0" > Biobase RWinEdt > "1.12.2" "1.7-5" > > Jenny Drnevich, Ph.D. > > Functional Genomics Bioinformatics Specialist > W.M. Keck Center for Comparative and Functional Genomics > Roy J. Carver Biotechnology Center > University of Illinois, Urbana-Champaign > > 330 ERML > 1201 W. Gregory Dr. > Urbana, IL 61801 > USA > > ph: 217-244-7355 > fax: 217-265-5066 > e-mail: drnevich at uiuc.edu > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald University of Michigan Affymetrix and cDNA Microarray Core 1500 E Medical Center Drive Ann Arbor MI 48109 734-647-5623 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
ADD COMMENT
0
Entering edit mode
I have also been foiled by the sophistication of Bioconductor code. Is there a manual that explains namespace and other code-hiding tools (.e.g generic functions) that would provide some guidance. The beauty of R is that I can hack - when I can find the code. Thanks, Naomi At 08:04 PM 12/13/2006, James W. MacDonald wrote: >Hi Jenny, > >Ha Ha, you can't foil my anti-hack barrier code! ;-D > >Actually, I use a namespace, so when you hack plotPCA() and dump it into >your .GlobalEnv, it is no longer part of the affycoretools namespace and >thus can't find helper functions that are sealed in the namespace. > >The alternatives are: >1.) Make the hacks to the source package and then install using R CMD >INSTALL >2.) Wait until tomorrow when I can make the changes and send you the >package. I would normally have you wait until it propagates through the >build process, but annaffy is busted and keeping affycoretools from >building, so no propagation for me ;-( > >Let me know your preference. > >Best, > >Jim > >Jenny Drnevich wrote: > > Hi Jim, > > > > I was trying to modify 'plotPCA' so it could take a matrix instead of an > > exprSet object, but in doing so somehow R can't find the function > > 'pca.legend', even though it pulls up the documentation for it > when I query > > '?pca.legend". I didn't even touch the code that had to do with > > 'pca.legend'! Any ideas why and/or what I can do to get the legend? Code > > and sessionInfo() below. > > > > Thanks, > > Jenny > > > > > > >plotPCA(rma.data) > > # no problem with this - the legend was fine > > > > > source("C:/Statistics/JDplotPCA.R") > > > > > JDplotPCA(exprs(rma.data)) > > Error in JDplotPCA(exprs(rma.data)) : could not find function "pca.legend" > > > > > JDplotPCA > > function (eset, groups = NULL, groupnames = NULL, addtext = NULL, > > x.coord = NULL, y.coord = NULL, screeplot = FALSE, squarepca = FALSE, > > pch = NULL, col = NULL, ...) > > { > > require(affycoretools) > > if (is.null(groupnames)) > > groupnames <- colnames(eset) > > if (is.factor(groupnames)) > > groupnames <- as.character(groupnames) > > pca <- prcomp(t(eset)) > > if (screeplot) { > > plot(pca, main = "Screeplot") > > } > > else { > > if (squarepca) { > > ylim <- max(abs(range(pca$x[, 1]))) > > ylim <- c(-ylim, ylim) > > } > > else ylim <- NULL > > if (!is.null(groups)) { > > if (is.null(pch)) > > pch <- groups > > if (is.null(col)) > > col <- groups > > plot(pca$x[, 1:2], pch = pch, col = col, ylab = "PC2", > > xlab = "PC1", main = "Principal Components Plot", > > ylim = ylim, ...) > > } > > else { > > if (is.null(pch)) > > pch <- 0:length(colnames(eset)) > > if (is.null(col)) > > col <- 1:length(colnames(eset)) > > plot(pca$x[, 1:2], pch = pch, col = col, ylab = "PC2", > > xlab = "PC1", main = "Principal Components Plot", > > ylim = ylim, ...) > > } > > if (is.null(addtext)) { > > pca.legend(pca, groupnames, pch, col, x.coord = x.coord, > > y.coord = y.coord, ...) > > } > > else { > > smidge <- pca.legend(pca, groupnames, pch, col, x.coord = > > x.coord, > > y.coord = y.coord, saveup = TRUE, ...) > > text(pca$x[, 1], pca$x[, 2] + smidge, label = addtext, > > cex = 0.7) > > } > > } > > } > > > > > sessionInfo() > > R version 2.4.0 (2006-10-03) > > i386-pc-mingw32 > > > > locale: > > LC_COLLATE=English_United States.1252;LC_CTYPE=English_United > > States.1252;LC_MONETARY=English_United > > States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 > > > > attached base packages: > > [1] "splines" "tools" "methods" "stats" "graphics" "grDevices" > > [7] "utils" "datasets" "base" > > > > other attached packages: > > affyQCReport simpleaffy made4 scatterplot3d ade4 > > "1.12.0" "2.8.0" "1.8.0" "0.3-24" "1.4-2" > > affyPLM gcrma matchprobes affydata affycoretools > > "1.10.0" "2.6.0" "1.6.0" "1.10.0" "1.6.0" > > biomaRt RCurl XML GOstats Category > > "1.8.0" "0.7-0" "1.2-0" "2.0.3" "2.0.3" > > genefilter survival KEGG RBGL annotate > > "1.12.0" "2.29" "1.14.1" "1.10.0" "1.12.0" > > GO graph limma affy affyio > > "1.14.1" "1.12.0" "2.9.1" "1.12.1" "1.2.0" > > Biobase RWinEdt > > "1.12.2" "1.7-5" > > > > Jenny Drnevich, Ph.D. > > > > Functional Genomics Bioinformatics Specialist > > W.M. Keck Center for Comparative and Functional Genomics > > Roy J. Carver Biotechnology Center > > University of Illinois, Urbana-Champaign > > > > 330 ERML > > 1201 W. Gregory Dr. > > Urbana, IL 61801 > > USA > > > > ph: 217-244-7355 > > fax: 217-265-5066 > > e-mail: drnevich at uiuc.edu > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor at stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > >-- >James W. MacDonald >University of Michigan >Affymetrix and cDNA Microarray Core >1500 E Medical Center Drive >Ann Arbor MI 48109 >734-647-5623 > > > >********************************************************** >Electronic Mail is not secure, may not be read every day, and should >not be used for urgent or sensitive issues. > >_______________________________________________ >Bioconductor mailing list >Bioconductor at stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor >Search the archives: >http://news.gmane.org/gmane.science.biology.informatics.conductor Naomi S. Altman 814-865-3791 (voice) Associate Professor Dept. of Statistics 814-863-7114 (fax) Penn State University 814-865-1348 (Statistics) University Park, PA 16802-2111
ADD REPLY
0
Entering edit mode
Hi Naomi, Naomi Altman wrote: > I have also been foiled by the sophistication of Bioconductor code. > > Is there a manual that explains namespace and other code-hiding tools > (.e.g generic functions) that would provide some guidance. > The beauty of R is that I can hack - when I can find the code. > I don't know of any manual that covers the topic, but there are only a few things you really need to know to find things. ____________________ NAMESPACE ____________________ General description: http://en.wikipedia.org/wiki/Namespace_%28computer_science%29 R manual info: http://cran.r-project.org/doc/manuals/R-exts.html See section 1.6 To find/see/use methods in a namespace ?methods ?'::' For example: > t.test function (x, ...) UseMethod("t.test") <environment: namespace:stats=""> Not very useful. > methods("t.test") [1] t.test.default* t.test.formula* Non-visible functions are asterisked Getting closer. > stats:::t.test.default Will show the function. ____________________ S4 methods ____________________ http://www.bioconductor.org/developers/progRef/S4Objects.pdf Finding things: ?showMethods In particular the includeDefs argument. For example: > library(GOstats) > hyperGTest standardGeneric for "hyperGTest" defined from package "Category" defined with value class: "HyperGResultBase" function (p) .valueClassTest(standardGeneric("hyperGTest"), "HyperGResultBase", "hyperGTest") <environment: 0x039c1314=""> Methods may be defined for arguments: p Not very helpful. > showMethods("hyperGTest", includeDefs=T) Will show the function(s) As many BioC packages use both S4 methods and a namespace, you often need to use a combination of the two in order to find things. Best, Jim > Thanks, > Naomi > -- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
ADD REPLY
0
Entering edit mode
Thanks, Jim. That helps greatly. --Naomi At 10:03 AM 12/14/2006, James W. MacDonald wrote: >Hi Naomi, > >Naomi Altman wrote: >>I have also been foiled by the sophistication of Bioconductor code. >>Is there a manual that explains namespace and other code-hiding >>tools (.e.g generic functions) that would provide some guidance. >>The beauty of R is that I can hack - when I can find the code. > >I don't know of any manual that covers the topic, but there are only >a few things you really need to know to find things. > >____________________ >NAMESPACE >____________________ > >General description: >http://en.wikipedia.org/wiki/Namespace_%28computer_science%29 > >R manual info: >http://cran.r-project.org/doc/manuals/R-exts.html >See section 1.6 > >To find/see/use methods in a namespace >?methods >?'::' > >For example: > > > t.test >function (x, ...) >UseMethod("t.test") ><environment: namespace:stats=""> > >Not very useful. > > > methods("t.test") >[1] t.test.default* t.test.formula* > > Non-visible functions are asterisked > >Getting closer. > > > stats:::t.test.default > >Will show the function. > >____________________ >S4 methods >____________________ > >http://www.bioconductor.org/developers/progRef/S4Objects.pdf > >Finding things: > >?showMethods > >In particular the includeDefs argument. > >For example: > > > library(GOstats) > > hyperGTest >standardGeneric for "hyperGTest" defined from package "Category" > defined with value class: "HyperGResultBase" > >function (p) >.valueClassTest(standardGeneric("hyperGTest"), "HyperGResultBase", > "hyperGTest") ><environment: 0x039c1314=""> >Methods may be defined for arguments: p > >Not very helpful. > > > showMethods("hyperGTest", includeDefs=T) > >Will show the function(s) > >As many BioC packages use both S4 methods and a namespace, you often >need to use a combination of the two in order to find things. > >Best, > >Jim > > >>Thanks, >>Naomi > >-- >James W. MacDonald, M.S. >Biostatistician >Affymetrix and cDNA Microarray Core >University of Michigan Cancer Center >1500 E. Medical Center Drive >7410 CCGC >Ann Arbor MI 48109 >734-647-5623 > > >********************************************************** >Electronic Mail is not secure, may not be read every day, and should >not be used for urgent or sensitive issues. Naomi S. Altman 814-865-3791 (voice) Associate Professor Dept. of Statistics 814-863-7114 (fax) Penn State University 814-865-1348 (Statistics) University Park, PA 16802-2111
ADD REPLY
0
Entering edit mode
Hi Jim, I thought it might have something to do with namespaces. All those links you sent in response to Naomi's query are just what I've been needing as well - thanks again. I would like to be able to do alternative #1 below, and I think I know what to do, and my PC is capable of installing packages - just have to take time to try it. I would like to see plotPCA function on matrices, and if you agree then it would also be good to add this functionality for everyone. I'll try to bumble through it on my own, but if I hit a wall, do you mind if I contact you for advice? On- or off- list? Thanks, Jenny At 07:04 PM 12/13/2006, James W. MacDonald wrote: >Hi Jenny, > >Ha Ha, you can't foil my anti-hack barrier code! ;-D > >Actually, I use a namespace, so when you hack plotPCA() and dump it into >your .GlobalEnv, it is no longer part of the affycoretools namespace and >thus can't find helper functions that are sealed in the namespace. > >The alternatives are: >1.) Make the hacks to the source package and then install using R CMD INSTALL >2.) Wait until tomorrow when I can make the changes and send you the >package. I would normally have you wait until it propagates through the >build process, but annaffy is busted and keeping affycoretools from >building, so no propagation for me ;-( > >Let me know your preference. > >Best, > >Jim > >Jenny Drnevich wrote: >>Hi Jim, >>I was trying to modify 'plotPCA' so it could take a matrix instead of an >>exprSet object, but in doing so somehow R can't find the function >>'pca.legend', even though it pulls up the documentation for it when I >>query '?pca.legend". I didn't even touch the code that had to do with >>'pca.legend'! Any ideas why and/or what I can do to get the legend? Code >>and sessionInfo() below. >>Thanks, >>Jenny >> >> >plotPCA(rma.data) >># no problem with this - the legend was fine >> > source("C:/Statistics/JDplotPCA.R") >> > JDplotPCA(exprs(rma.data)) >>Error in JDplotPCA(exprs(rma.data)) : could not find function "pca.legend" >> > JDplotPCA >>function (eset, groups = NULL, groupnames = NULL, addtext = NULL, >> x.coord = NULL, y.coord = NULL, screeplot = FALSE, squarepca = FALSE, >> pch = NULL, col = NULL, ...) >>{ >> require(affycoretools) >> if (is.null(groupnames)) >> groupnames <- colnames(eset) >> if (is.factor(groupnames)) >> groupnames <- as.character(groupnames) >> pca <- prcomp(t(eset)) >> if (screeplot) { >> plot(pca, main = "Screeplot") >> } >> else { >> if (squarepca) { >> ylim <- max(abs(range(pca$x[, 1]))) >> ylim <- c(-ylim, ylim) >> } >> else ylim <- NULL >> if (!is.null(groups)) { >> if (is.null(pch)) >> pch <- groups >> if (is.null(col)) >> col <- groups >> plot(pca$x[, 1:2], pch = pch, col = col, ylab = "PC2", >> xlab = "PC1", main = "Principal Components Plot", >> ylim = ylim, ...) >> } >> else { >> if (is.null(pch)) >> pch <- 0:length(colnames(eset)) >> if (is.null(col)) >> col <- 1:length(colnames(eset)) >> plot(pca$x[, 1:2], pch = pch, col = col, ylab = "PC2", >> xlab = "PC1", main = "Principal Components Plot", >> ylim = ylim, ...) >> } >> if (is.null(addtext)) { >> pca.legend(pca, groupnames, pch, col, x.coord = x.coord, >> y.coord = y.coord, ...) >> } >> else { >> smidge <- pca.legend(pca, groupnames, pch, col, x.coord = >> x.coord, >> y.coord = y.coord, saveup = TRUE, ...) >> text(pca$x[, 1], pca$x[, 2] + smidge, label = addtext, >> cex = 0.7) >> } >> } >>} >> > sessionInfo() >>R version 2.4.0 (2006-10-03) >>i386-pc-mingw32 >>locale: >>LC_COLLATE=English_United States.1252;LC_CTYPE=English_United >>States.1252;LC_MONETARY=English_United >>States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 >>attached base packages: >>[1] "splines" "tools" "methods" "stats" "graphics" "grDevices" >>[7] "utils" "datasets" "base" >>other attached packages: >> affyQCReport simpleaffy made4 scatterplot3d ade4 >> "1.12.0" "2.8.0" "1.8.0" "0.3-24" "1.4-2" >> affyPLM gcrma matchprobes affydata affycoretools >> "1.10.0" "2.6.0" "1.6.0" "1.10.0" "1.6.0" >> biomaRt RCurl XML GOstats Category >> "1.8.0" "0.7-0" "1.2-0" "2.0.3" "2.0.3" >> genefilter survival KEGG RBGL annotate >> "1.12.0" "2.29" "1.14.1" "1.10.0" "1.12.0" >> GO graph limma affy affyio >> "1.14.1" "1.12.0" "2.9.1" "1.12.1" "1.2.0" >> Biobase RWinEdt >> "1.12.2" "1.7-5" >>Jenny Drnevich, Ph.D. >>Functional Genomics Bioinformatics Specialist >>W.M. Keck Center for Comparative and Functional Genomics >>Roy J. Carver Biotechnology Center >>University of Illinois, Urbana-Champaign >>330 ERML >>1201 W. Gregory Dr. >>Urbana, IL 61801 >>USA >>ph: 217-244-7355 >>fax: 217-265-5066 >>e-mail: drnevich at uiuc.edu >>_______________________________________________ >>Bioconductor mailing list >>Bioconductor at stat.math.ethz.ch >>https://stat.ethz.ch/mailman/listinfo/bioconductor >>Search the archives: >>http://news.gmane.org/gmane.science.biology.informatics.conductor > > >-- >James W. MacDonald >University of Michigan >Affymetrix and cDNA Microarray Core >1500 E Medical Center Drive >Ann Arbor MI 48109 >734-647-5623 > > > >********************************************************** >Electronic Mail is not secure, may not be read every day, and should not >be used for urgent or sensitive issues. Jenny Drnevich, Ph.D. Functional Genomics Bioinformatics Specialist W.M. Keck Center for Comparative and Functional Genomics Roy J. Carver Biotechnology Center University of Illinois, Urbana-Champaign 330 ERML 1201 W. Gregory Dr. Urbana, IL 61801 USA ph: 217-244-7355 fax: 217-265-5066 e-mail: drnevich at uiuc.edu
ADD REPLY
0
Entering edit mode
@martin-morgan-1513
Last seen 6 days ago
United States
Jenny et al., Just wanted to temper enthusiasm a bit for (1). It means that you lock yourself into 'your' version of the package, so when Jim updates some other part you'll either have to stick with your modified package and not get the benefits of Jim's change, or 'port' your customizations to Jim's update. A marginally better approach might be to place your customizations into a file that you then 'source', but provide access to the 'hidden' functions, e.g., in the file you're going to source change references to pca.legend to affycoretools:::pca.legend. Usually there are at most a couple of such references in a typical function. Now you're only locked into a particular version of JDplotPCA, at least until Jim decides he'd rather name pca.legend legend.of.pca (which is his prerogative, since the function isn't 'public'). This kind of solution can be problematic when a function inside a package is the one that calls the one you're trying to modify -- in some circumstance it will see the package version of the function before it sees yours. All of this is quite messy. Martin Jenny Drnevich <drnevich at="" uiuc.edu=""> writes: > Hi Jim, > > I thought it might have something to do with namespaces. All those links > you sent in response to Naomi's query are just what I've been needing as > well - thanks again. I would like to be able to do alternative #1 below, > and I think I know what to do, and my PC is capable of installing packages > - just have to take time to try it. I would like to see plotPCA function on > matrices, and if you agree then it would also be good to add this > functionality for everyone. I'll try to bumble through it on my own, but if > I hit a wall, do you mind if I contact you for advice? On- or off- list? > > Thanks, > Jenny > > At 07:04 PM 12/13/2006, James W. MacDonald wrote: >>Hi Jenny, >> >>Ha Ha, you can't foil my anti-hack barrier code! ;-D >> >>Actually, I use a namespace, so when you hack plotPCA() and dump it into >>your .GlobalEnv, it is no longer part of the affycoretools namespace and >>thus can't find helper functions that are sealed in the namespace. >> >>The alternatives are: >>1.) Make the hacks to the source package and then install using R CMD INSTALL >>2.) Wait until tomorrow when I can make the changes and send you the >>package. I would normally have you wait until it propagates through the >>build process, but annaffy is busted and keeping affycoretools from >>building, so no propagation for me ;-( >> >>Let me know your preference. >> >>Best, >> >>Jim >> >>Jenny Drnevich wrote: >>>Hi Jim, >>>I was trying to modify 'plotPCA' so it could take a matrix instead of an >>>exprSet object, but in doing so somehow R can't find the function >>>'pca.legend', even though it pulls up the documentation for it when I >>>query '?pca.legend". I didn't even touch the code that had to do with >>>'pca.legend'! Any ideas why and/or what I can do to get the legend? Code >>>and sessionInfo() below. >>>Thanks, >>>Jenny >>> >>> >plotPCA(rma.data) >>># no problem with this - the legend was fine >>> > source("C:/Statistics/JDplotPCA.R") >>> > JDplotPCA(exprs(rma.data)) >>>Error in JDplotPCA(exprs(rma.data)) : could not find function "pca.legend" >>> > JDplotPCA >>>function (eset, groups = NULL, groupnames = NULL, addtext = NULL, >>> x.coord = NULL, y.coord = NULL, screeplot = FALSE, squarepca = FALSE, >>> pch = NULL, col = NULL, ...) >>>{ >>> require(affycoretools) >>> if (is.null(groupnames)) >>> groupnames <- colnames(eset) >>> if (is.factor(groupnames)) >>> groupnames <- as.character(groupnames) >>> pca <- prcomp(t(eset)) >>> if (screeplot) { >>> plot(pca, main = "Screeplot") >>> } >>> else { >>> if (squarepca) { >>> ylim <- max(abs(range(pca$x[, 1]))) >>> ylim <- c(-ylim, ylim) >>> } >>> else ylim <- NULL >>> if (!is.null(groups)) { >>> if (is.null(pch)) >>> pch <- groups >>> if (is.null(col)) >>> col <- groups >>> plot(pca$x[, 1:2], pch = pch, col = col, ylab = "PC2", >>> xlab = "PC1", main = "Principal Components Plot", >>> ylim = ylim, ...) >>> } >>> else { >>> if (is.null(pch)) >>> pch <- 0:length(colnames(eset)) >>> if (is.null(col)) >>> col <- 1:length(colnames(eset)) >>> plot(pca$x[, 1:2], pch = pch, col = col, ylab = "PC2", >>> xlab = "PC1", main = "Principal Components Plot", >>> ylim = ylim, ...) >>> } >>> if (is.null(addtext)) { >>> pca.legend(pca, groupnames, pch, col, x.coord = x.coord, >>> y.coord = y.coord, ...) >>> } >>> else { >>> smidge <- pca.legend(pca, groupnames, pch, col, x.coord = >>> x.coord, >>> y.coord = y.coord, saveup = TRUE, ...) >>> text(pca$x[, 1], pca$x[, 2] + smidge, label = addtext, >>> cex = 0.7) >>> } >>> } >>>} >>> > sessionInfo() >>>R version 2.4.0 (2006-10-03) >>>i386-pc-mingw32 >>>locale: >>>LC_COLLATE=English_United States.1252;LC_CTYPE=English_United >>>States.1252;LC_MONETARY=English_United >>>States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 >>>attached base packages: >>>[1] "splines" "tools" "methods" "stats" "graphics" "grDevices" >>>[7] "utils" "datasets" "base" >>>other attached packages: >>> affyQCReport simpleaffy made4 scatterplot3d ade4 >>> "1.12.0" "2.8.0" "1.8.0" "0.3-24" "1.4-2" >>> affyPLM gcrma matchprobes affydata affycoretools >>> "1.10.0" "2.6.0" "1.6.0" "1.10.0" "1.6.0" >>> biomaRt RCurl XML GOstats Category >>> "1.8.0" "0.7-0" "1.2-0" "2.0.3" "2.0.3" >>> genefilter survival KEGG RBGL annotate >>> "1.12.0" "2.29" "1.14.1" "1.10.0" "1.12.0" >>> GO graph limma affy affyio >>> "1.14.1" "1.12.0" "2.9.1" "1.12.1" "1.2.0" >>> Biobase RWinEdt >>> "1.12.2" "1.7-5" >>>Jenny Drnevich, Ph.D. >>>Functional Genomics Bioinformatics Specialist >>>W.M. Keck Center for Comparative and Functional Genomics >>>Roy J. Carver Biotechnology Center >>>University of Illinois, Urbana-Champaign >>>330 ERML >>>1201 W. Gregory Dr. >>>Urbana, IL 61801 >>>USA >>>ph: 217-244-7355 >>>fax: 217-265-5066 >>>e-mail: drnevich at uiuc.edu >>>_______________________________________________ >>>Bioconductor mailing list >>>Bioconductor at stat.math.ethz.ch >>>https://stat.ethz.ch/mailman/listinfo/bioconductor >>>Search the archives: >>>http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> >>-- >>James W. MacDonald >>University of Michigan >>Affymetrix and cDNA Microarray Core >>1500 E Medical Center Drive >>Ann Arbor MI 48109 >>734-647-5623 >> >> >> >>********************************************************** >>Electronic Mail is not secure, may not be read every day, and should not >>be used for urgent or sensitive issues. > > Jenny Drnevich, Ph.D. > > Functional Genomics Bioinformatics Specialist > W.M. Keck Center for Comparative and Functional Genomics > Roy J. Carver Biotechnology Center > University of Illinois, Urbana-Champaign > > 330 ERML > 1201 W. Gregory Dr. > Urbana, IL 61801 > USA > > ph: 217-244-7355 > fax: 217-265-5066 > e-mail: drnevich at uiuc.edu > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Martin T. Morgan Bioconductor / Computational Biology http://bioconductor.org
ADD COMMENT
0
Entering edit mode
@rustici-gabriella-nihnci-f-1973
Last seen 9.6 years ago
Hi all, Is there a Bioconductor package I could use to visualize Nimblegen ChIP-chip data? I'd like to do a whole genome plot showing chromosome location of enriched genes for the TF of interest. Could I use "geneplotter" to do it? Thanks gaby
0
Entering edit mode
On Thursday 14 December 2006 14:43, Rustici, Gabriella (NIH/NCI) [F] wrote: > Hi all, > Is there a Bioconductor package I could use to visualize Nimblegen > ChIP-chip data? > I'd like to do a whole genome plot showing chromosome location of > enriched genes for the TF of interest. > Could I use "geneplotter" to do it? You probably could. However, you might want to look into using the Affymetrix Integrated Genome Browser (IGB) for visualizing your ChIP/chip data. It takes as input simple text files for visualization purposes. It is a Java program, so runs fine on windows, linux, and Macos. As an aside, I have an R package for chip/chip analysis that is available here: http://watson.nci.nih.gov/twiki/bin/view/Main/MeltzerLabSoftware It includes functionality to load the nimblegen GFF files, calculate some stats for each probe, and then export the results and raw data for viewing in the Affy IGB. It is still very much under development, so I would appreciate any feedback if you decide to use it. Sean
ADD REPLY
0
Entering edit mode
Quoting Sean Davis <sdavis2 at="" mail.nih.gov="">: > On Thursday 14 December 2006 14:43, Rustici, Gabriella (NIH/NCI) [F] wrote: >> Hi all, >> Is there a Bioconductor package I could use to visualize Nimblegen >> ChIP-chip data? >> I'd like to do a whole genome plot showing chromosome location of >> enriched genes for the TF of interest. >> Could I use "geneplotter" to do it? > > You probably could. However, you might want to look into using the > Affymetrix > Integrated Genome Browser (IGB) for visualizing your ChIP/chip data. It > takes as input simple text files for visualization purposes. It is a Java > program, so runs fine on windows, linux, and Macos. > > As an aside, I have an R package for chip/chip analysis that is available > here: > > http://watson.nci.nih.gov/twiki/bin/view/Main/MeltzerLabSoftware > > It includes functionality to load the nimblegen GFF files, calculate some > stats for each probe, and then export the results and raw data for viewing in > the Affy IGB. It is still very much under development, so I would appreciate > any feedback if you decide to use it. > > Sean Hi Sean, as I have Nimblegen data too, I got very happy to see this :-) However I cannot even get the package to load and I am wondering if at the moment you can only run it on a Mac? I'm running WinXP. I downloaded the .gz file, and uncompressed it with 7zip. The resulting .tar file is nothing that I seem to be able to deal with from the RGui menu, so I uncompressed it again to give a folder called 'chIPchip', containing sevral other folders. Then I compressed it into a .zip file, and tried to install it from the menu (install package from local zip files). That proceeds without errors, but then: > library(chIPchip) Error in library(chIPchip) : 'chIPchip' is not a valid package -- installed < 2.0.0? I am sure you're laughing at my naivety thinking that this roundabout would work, but I just don't know what else I could do, other than getting a Mac? :) Is there any way to install the package to run on a WinXP system? thanks! Jose > sessionInfo() R version 2.4.0 (2006-10-03) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] "methods" "stats" "graphics" "grDevices" "utils" "datasets" [7] "base" other attached packages: limma "2.9.1" -- Dr. Jose I. de las Heras Email: J.delasHeras at ed.ac.uk The Wellcome Trust Centre for Cell Biology Phone: +44 (0)131 6513374 Institute for Cell & Molecular Biology Fax: +44 (0)131 6507360 Swann Building, Mayfield Road University of Edinburgh Edinburgh EH9 3JR UK
ADD REPLY
0
Entering edit mode
On Friday 15 December 2006 05:51, J.delasHeras at ed.ac.uk wrote: > Quoting Sean Davis <sdavis2 at="" mail.nih.gov="">: > > On Thursday 14 December 2006 14:43, Rustici, Gabriella (NIH/NCI) [F] wrote: > >> Hi all, > >> Is there a Bioconductor package I could use to visualize Nimblegen > >> ChIP-chip data? > >> I'd like to do a whole genome plot showing chromosome location of > >> enriched genes for the TF of interest. > >> Could I use "geneplotter" to do it? > > > > You probably could. However, you might want to look into using the > > Affymetrix > > Integrated Genome Browser (IGB) for visualizing your ChIP/chip data. It > > takes as input simple text files for visualization purposes. It is a > > Java program, so runs fine on windows, linux, and Macos. > > > > As an aside, I have an R package for chip/chip analysis that is available > > here: > > > > http://watson.nci.nih.gov/twiki/bin/view/Main/MeltzerLabSoftware > > > > It includes functionality to load the nimblegen GFF files, calculate some > > stats for each probe, and then export the results and raw data for > > viewing in the Affy IGB. It is still very much under development, so I > > would appreciate any feedback if you decide to use it. > > > > Sean > > Hi Sean, > > as I have Nimblegen data too, I got very happy to see this :-) > However I cannot even get the package to load and I am wondering if at > the moment you can only run it on a Mac? I'm running WinXP. > > I downloaded the .gz file, and uncompressed it with 7zip. The > resulting .tar file is nothing that I seem to be able to deal with > from the RGui menu, so I uncompressed it again to give a folder called > 'chIPchip', containing sevral other folders. Then I compressed it into > a .zip file, and tried to install it from the menu (install package > > from local zip files). That proceeds without errors, but then: > > library(chIPchip) > > Error in library(chIPchip) : 'chIPchip' is not a valid package -- > installed < 2.0.0? > > I am sure you're laughing at my naivety thinking that this roundabout > would work, but I just don't know what else I could do, other than > getting a Mac? :) > > Is there any way to install the package to run on a WinXP system? I'm sorry to clutter the list with non-bioc related issues, but I inadvertently opened a can of worms yesterday in this thread. The package is a SOURCE package, so, unfortunately, you need to have tools to build the package from source. These are standard on Mac, Linux, and Unix, but of course are NOT on Windows. So, to get the software running, you will need to enable your computer to build packages from source or use a computer with another OS. When this gets moved over to bioconductor, this will no longer be an issue. Sean
ADD REPLY
0
Entering edit mode
Hi Jose, J.delasHeras at ed.ac.uk wrote: > I downloaded the .gz file, and uncompressed it with 7zip. The > resulting .tar file is nothing that I seem to be able to deal with > from the RGui menu, so I uncompressed it again to give a folder called > 'chIPchip', containing sevral other folders. Then I compressed it into > a .zip file, and tried to install it from the menu (install package > from local zip files). That proceeds without errors, but then: > > >>library(chIPchip) > > Error in library(chIPchip) : 'chIPchip' is not a valid package -- > installed < 2.0.0? > > I am sure you're laughing at my naivety thinking that this roundabout > would work, but I just don't know what else I could do, other than > getting a Mac? :) > > Is there any way to install the package to run on a WinXP system? Not surprisingly, this is a fairly common thing for people to attempt. In the past, for packages that contained only R code, you could do something quite similar and have it work. But no longer. To install a source package on windows, you need to install some software on your computer and do some other things to get set up. Instructions for doing so can be found here: http://www.murdoch-sutherland.com/Rtools/ Note that you don't need to do everything on that page (it is primarily designed to show how to build R itself on windows), but you do need everything up to 'Building R Itself', except for the part about Cross-compilers. I would recommend installing the Microsoft HTML Help Workshop because it is easy to do, and it's a pain to remember to not build chm help files. You might also install MiKTeX, so you can build vignettes, etc. This is a simple process, but the installer takes some time because of all the little packages it has to download and install. Also, the instructions on that page are quite terse (welcome to R ;-D), so it is important to follow exactly what they say, and to ensure you understand what they mean. Have fun! Best, Jim > > thanks! > > Jose > > >>sessionInfo() > > R version 2.4.0 (2006-10-03) > i386-pc-mingw32 > > locale: > LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United > Kingdom.1252;LC_MONETARY=English_United > Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 > > attached base packages: > [1] "methods" "stats" "graphics" "grDevices" "utils" "datasets" > [7] "base" > > other attached packages: > limma > "2.9.1" > > -- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
ADD REPLY

Login before adding your answer.

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