[BioC] Installing Bioconductor packages on R 2.14.0 *without* administrator rights / from a script

Dan Tenenbaum dtenenba at fhcrc.org
Tue Nov 29 22:15:43 CET 2011


Hi Firas,

On Tue, Nov 29, 2011 at 1:06 PM, Firas Swidan <firas at biomatters.com> wrote:
> I see there is a misunderstanding regarding the nature of the problem I am
> trying to describe. To try and eliminate any confusing, the problem that I
> am describing happens when running this command:
>
> 'source("http://bioconductor.org/biocLite.R")'
>
> not when trying later on to use the
>
> 'biocLite'
>
> command. I have been using the lib.loc argument with the biocLite command,
> and that works great.
>
>
> The problem is that the recent modifications to
> the "http://bioconductor.org/biocLite.R" script make it install packages
> without the user having the ability to specify the lib.loc location.
>
>
> Does that help clarifying the problem?


I understand.

Have a look at the documentation for
?install.packages

Notice that lib defaults to the first element of .libPaths().
If you look at ?.libPaths, you can see how to change that first
element, namely something like this:

.libPaths(c("c:/a/writeable/directory", .libPaths()))

Try doing that prior to your source() line.

Thanks
Dan


>
>
> On Wed, Nov 30, 2011 at 9:56 AM, Dan Tenenbaum <dtenenba at fhcrc.org> wrote:
>>
>> Hi Firas,
>>
>> On Tue, Nov 29, 2011 at 12:49 PM, Firas Swidan <firas at biomatters.com>
>> wrote:
>> > Hi all,
>> >
>> > thanks for the suggestions - I just got to read them after recovering
>> > from a
>> > bad flu.
>> >
>> > I think Dan's experience probably resembles most the one that I had. The
>> > problem though gets more troublesome when one tries to automate the
>> > process
>> > through a script installation. More specifically, imagine that a script
>> > needs to install a bioconduct package on different machines (running
>> > Windows, and maybe also other OSs) on a fresh R install. Then the
>> > 'source'
>> > command needs to be run from inside the R script that is executed
>> > through 'R
>> > CMD BATCH'. In this case there is no pop-up dialog asking to create
>> > another
>> > user-writable directory, and the command
>> > 'install.packages("BiocInstaller",
>> > repos=a["BioCsoft",
>> >> "URL"])' fails. It would be great in case one could pass an argument
>> >> specifying the lib.loc to the 'install.packages' command above, but I
>> >> understand this is not possible through 'sourcing'. The old way of just
>> >> defining a 'biocLite' function in the biocLite.R script, and then being
>> >> able
>> >> to pass the lib.loc argument to it seems to fair better in this
>> >> use-case
>> >> model.
>>
>> Thanks for posting the detailed use case so we can understand the issue
>> better.
>>
>> Please have a look at
>> ?biocLite
>>
>> You'll see that it takes a '...' argument which is passed to
>> install.packages, so you can pass lib (not lib.loc) to
>> install.packages and specify where packages are to be installed. Be
>> sure that any directory you pass here also ends up in .libPaths() so
>> that R will look in it for packages.
>>
>> I don't see a need to use install.packages() directly in the situation
>> you describe. biocLite() should do it, and you won't need to specify
>> the repos argument.
>>
>> >
>> > I do not really have access to the machines where the installation is
>> > going
>> > to be done, so I cannot change permissions and the like. Also, the
>> > installed
>> > bioconduct packages need later on to be loaded and used, so I need to
>> > specify a specific location for their installation. The saga goes on, as
>> > I
>> > cannot use the 'R_LIBS_USER' directory because of complications on
>> > Windows
>> > that diving in would just clutter this post.
>> >
>> > I am still puzzled why the biocLite.R script had to undergo such a huge
>> > change following the new R 2.14 release. Is it safe to fall back to the
>> > old
>> > behavior under this version, i.e., use the 'else' part in the script:
>> >
>> >         source("http://bioconductor.org/getBioC.R")
>> >         biocLite <<-
>> >             function(pkgs, groupName="lite", ...)
>> >             {
>> >                 if (missing(pkgs))
>> >                     biocinstall(groupName=groupName, ...)
>> >                 else
>> >                     biocinstall(pkgs=pkgs, groupName=groupName, ...)
>> >             }
>>
>>
>>
>> No, it's not safe, but more importantly, it won't work on R >= 2.14.
>>
>> Please let us know if you still are having problems.
>>
>> Thanks
>> Dan
>>
>>
>>
>>
>> >
>> >
>> > Thanks,
>> >
>> > Firas.
>> >
>> >
>> > On Sun, Nov 27, 2011 at 9:57 AM, Dan Tenenbaum <dtenenba at fhcrc.org>
>> > wrote:
>> >>
>> >> Hello,
>> >>
>> >> On Thu, Nov 24, 2011 at 6:32 PM, Firas Swidan <firas at biomatters.com>
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > I used to be able to install Bioconductor packages from a script
>> >> > *without*
>> >> > having administrator rights (e.g., on Windows) by specifying the
>> >> > library
>> >> > location to where the packages are to be installed.
>> >> >
>> >> > However, with the new R (2.14.0) and Bioconductor releases, the
>> >> > command
>> >> >
>> >> >
>> >> >
>> >> > source("http://bioconductor.org/biocLite.R")
>> >> >
>> >> >
>> >> >
>> >> > would fail without administrator rights, because it tries to install
>> >> > packages to directories that require administrator rights.
>> >> >
>> >> > I checked the file biocLite.R and located the line where this
>> >> > problematic
>> >> > install happens (install.packages("BiocInstaller",
>> >> > repos=a["BioCsoft",
>> >> > "URL"]))
>> >> >
>> >> >
>> >> > Is there a safe way to avoid the requirement for administrator
>> >> > rights? I
>> >> > know that I could modify the above command and add a library location
>> >> > argument, but is that safe?
>> >> >
>> >> > In particular I am wondering why the r-script was modified to require
>> >> > the
>> >> > administrator right?
>> >> >
>> >>
>> >> The script was not modified specifically to require administrator
>> >> rights.
>> >>
>> >> I tried to reproduce your situation, as I understand it, but perhaps I
>> >> don't have enough information. When I (as a Windows user without
>> >> administrative rights) ran the source() command above, I got a popup
>> >> asking me if I wanted to create a personal library directory. If I
>> >> said Yes, BiocInstaller installed itself just fine, and I was then
>> >> able to install packages with biocLite(). I did get some warnings
>> >> about packages that cannot be updated because they are installed in
>> >> directories that are not writeable. However, those are just warnings;
>> >> if you need to update any of those packages, you can install them
>> >> yourself with biocLite().
>> >>
>> >> It would be helpful if you could send the complete output of your
>> >> session, including sessionInfo() and all the commands you tried, plus
>> >> any errors/warnings.
>> >>
>> >> Thanks
>> >> Dan
>> >>
>> >>
>> >>
>> >> > Thanks,
>> >> > Firas.
>> >> >
>> >> >        [[alternative HTML version deleted]]
>> >> >
>> >> > _______________________________________________
>> >> > Bioconductor mailing list
>> >> > Bioconductor at r-project.org
>> >> > https://stat.ethz.ch/mailman/listinfo/bioconductor
>> >> > Search the archives:
>> >> > http://news.gmane.org/gmane.science.biology.informatics.conductor
>> >> >
>> >
>> >
>> >
>> >
>> > --
>> > Dr Firas Swidan, PhD Computer Science / Computational Biology
>> > Bioinformatics Software Engineer
>> > Biomatters Ltd
>> > firas at biomatters.com
>
>
>
>
> --
> Dr Firas Swidan, PhD Computer Science / Computational Biology
> Bioinformatics Software Engineer
> Biomatters Ltd
> firas at biomatters.com



More information about the Bioconductor mailing list