[Bioc-devel] Keeping all BioC and CRAN installed packages up to date the easy way

James MacDonald jmacdon at med.umich.edu
Fri Sep 21 15:16:48 CEST 2007


Hi Mark,

Mark W Kimpel wrote:
> Well, I guess I didn't understand this as well as I thought. I get a 
> warnings and odd behavior when I use biocLite and it is almost certainly 
> because I am being fancy and using a separate library for my non-base 
> packages so they don't always need to be reinstalled when I update R.
> 
> here is what is in my .Rprofile (everything else has been commented out 
> for now):
> .libPaths(new= "~/R_HOME/site-library") #tell R where site-library is
> 
> I thought I was following the instructions in the R manual to do this, 
> and I wasn't getting error with my previous code, but now I am.
> 
> This is the behavior I am observing:
> 1.  source("http://www.bioconductor.org/biocLite.R")
>     biocLite("Biobase")
>     leads to Biobase repeatedly updating whether it needs to or not

What do you mean by 'repeatedly'? If you mean Biobase is installed 
whether or not it is out of date, then that is the correct behavior. The 
function biocLite() is a wrapper to install.packages(), not 
update.packages(), so this is as it should be.

> 
> update.packages(repos="http://www.bioconductor.org/packages/2.1/bioc",   
> ask = FALSE)
> 
> does not do this.
> 
> 2. also, with
> source("http://www.bioconductor.org/biocLite.R")
> Warning messages:
> 1: In safeSource() : Redefining ‘biocinstall’
> 2: In safeSource() : Redefining ‘biocinstallPkgGroups’
> 3: In safeSource() : Redefining ‘biocinstallRepos’
> 
> and with
> 
> repos <- biocReposList()
> Error: could not find function "biocReposList"

Oh yeah, I forgot. There is one more step that I neglected to mention:

library(Biobase)

So here is the background; Biobase contains a list of repository URLs 
that are correct for whatever version of Biobase will be installed by 
biocLite(). So what we are doing here is ensuring that the current 
version of Biobase is the most up-to-date, loading the package and 
extracting the list of repositories. We have to do this step because 
update.packages() won't update any package that is already loaded, and 
we need to load Biobase to get the repos list.

So once we have resolved this chicken-egg problem, we can run 
update.packages() and update all the other packages.

Long story short, you are not being stupid. However, any time you see 
that error, about 75% of the time it is because you haven't loaded the 
package that contains the function. The other 25% happens when you have 
loaded the package, but it has a namespace and the function isn't 
exported. I am wearing a t-shirt today that reads 'I make stuff up' 
(required attire for all statisticians in my wife's view), so you can 
rest assured that those percentages are quite accurate ;-D

Best,

Jim


>  >
> 
> So, I am puzzled. I am redirecting this to Bioc-Devel as I suspect this 
> is a development issue and/or I am just doing something stupid.
> 
> Mark W. Kimpel MD  ** Neuroinformatics ** Dept. of Psychiatry
> Indiana University School of Medicine
> 
> 15032 Hunter Court, Westfield, IN  46074
> 
> (317) 490-5129 Work, & Mobile & VoiceMail
> (317) 663-0513 Home (no voice mail please)
> 
> ******************************************************************
> 
> Mark W Kimpel wrote:
>> Jim,
>>
>> Thanks for your advice.
>>
>> Your little code snippet might me a good inclusion in the "how to 
>> install bioconductor" page of the website under "how to update your 
>> packages". It is perhaps obvious to an experienced user, but may be 
>> very helpful to many, as it was to me.
>>
>> I'm posting this as a new thread on the main list just so your 
>> response is seen by others who may find it useful.
>>
>> Mark
>>
>> ---
>>
>> Mark W. Kimpel MD  ** Neuroinformatics ** Dept. of Psychiatry
>> Indiana University School of Medicine
>>
>> 15032 Hunter Court, Westfield, IN  46074
>>
>> (317) 490-5129 Work, & Mobile & VoiceMail
>> (317) 663-0513 Home (no voice mail please)
>>
>> ******************************************************************
>>
>> James MacDonald wrote:
>>  > Hi Mark,
>>  >
>>  > I think a much easier and safer way to update is as follows:
>>  >
>>  > source("http://www.bioconductor.org/biocLite.R")
>>  >
>>  > ## I just have the above in my .Rprofile file, so biocLite() is always
>>  > there for me.
>>  >
>>  > biocLite("Biobase")
>>  > repos <- biocReposList()
>>  > update.packages(repos=repos, ask=FALSE)
>>  >
>>  > this will get all CRAN and BioC packages, and got me correctly updated
>>  > this morning.
>>  >
>>  > Probably the problem with your script is you are hitting the IL 
>> mirror,
>>  > and it might be out of synch with fhcrc. Try the above and see if 
>> it helps.
>>  >
>>  > Best,
>>  >
>>  > Jim
>>  >

-- 
James W. MacDonald, MS
Biostatistician
UMCCC cDNA and Affymetrix Core
University of Michigan
1500 E Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623



More information about the Bioc-devel mailing list