[Bioc-devel] affy's cleancdfname
Hi Jim,
On 27 Sep 2005, jmacdon at med.umich.edu wrote:
Say I don't have the wherewithal to create a cdf package, so I am just going to make the env and have it sitting in my .GlobalEnv. hgfocuscdf <- make.cdf.env(dir()[11]) Reading CDF file. Creating CDF environment Wait for about 88 dots..................[snip] Now I read in some HG-Focus celfiles.
dat <- read.affybatch(filenames=list.celfiles()[1:3])
Warning message: Incompatible phenoData object. Created a new one. in: read.affybatch(filenames = list.celfiles()[1:3]) And I want to do something with the resulting AffyBatch.
dat
Error in library("hgfocuscdf", lib.loc = "C:/rw2020dev/library") :
there is no package called 'hgfocuscdf'
AffyBatch object
size of arrays=448x448 features (4709 kb)
cdf=HG-Focus (??? affyids)
number of samples=3
Error in library("hgfocuscdf", lib.loc = "C:/rw2020dev/library") :
there is no package called 'hgfocuscdf'
In addition: Warning message:
missing cdf environment ! in: show(list())
Since cdfFromEnvironment() is called without user intervention,
there is no way for the end user to feed it the correct cdfname,
since it doesn't call cleancdfname(), it looks for 'HG-Focus', which
doesn't follow the normal naming rules for a cdfenv. Therefore you
either have to know a priori what getFromEnvironment() is going to
look for, or you have to figure it out after the fact and rename
your env.
Since none of the getFromXXX functions are actually called by the
end user, I think they all have to use cleancdfname() to keep things
consistent. This is the only way an end user has a fighting chance
of getting the name of their env right.
This is an easy change. I would like to be able to call cdfFromLibPath from cdfFromBioC, this means repeated calls to cleancdfname need to do nothing. Do you see any problem with not appending "cdf" if the string already ends in "cdf"? To summarize, the proposed change: 1. Add call to cleancdfname() to all cdfFrom* funcs 2. Make cleancdfname idempotent so that repeated calls return the same thing. If it is already clean, don't make it dirty ;-)
There is another problem here that may be irrelevant given that Seth wants to deprecate reposTools. If I use remove.packages() to remove a BioC package (say, the hgfocuscdf package I removed for the above exercise), it doesn't remove anything from liblisting.Rda, so as far as reposTools is concerned, the package is still installed. getCdfInfo() went through all the getFromXXX functions and when it hit getFromBioC(), is.installed() said the package was installed, but since it isn't actually installed anymore it errored out.
This will be fixed because we will rely on R built-in tools to detect whether or not a package is installed. Best, + seth