Bioconductor, PHP, and R
2
0
Entering edit mode
Guest User ★ 13k
@guest-user-4897
Last seen 9.6 years ago
I'm calling some R script in php and it works fine. However when I call an R script that is using a bio-conductor package the script doesn't run. Specifically I have the following script which works perfectly fine in R but when I call it from php it doesn't. Note that when I call a script that doesn't use the bio-conductor package it works fine. library(gcrma) //It stops before it hits the first line print("b") Data <- ReadAffy() eset <- rma(Data) write.exprs(eset, file="NormalizedDate.txt") -- output of sessionInfo(): This is my input: library(gcrma) //It stops before it hits the first line print("b") Data <- ReadAffy() eset <- rma(Data) write.exprs(eset, file="NormalizedDate.txt") -- Sent via the guest posting facility at bioconductor.org.
• 1.6k views
ADD COMMENT
0
Entering edit mode
Dan Tenenbaum ★ 8.2k
@dan-tenenbaum-4256
Last seen 3.2 years ago
United States
On Mon, Nov 7, 2011 at 10:57 AM, hussein bazzi [guest] <guest at="" bioconductor.org=""> wrote: > > I'm calling some R script in php and it works fine. However when I call an R script that is using a bio-conductor package the script doesn't run. Specifically I have the following script which works perfectly fine in R but when I call it from php it doesn't. Note that when I call a script that doesn't use the bio-conductor package it works fine. > > library(gcrma) //It stops before it hits the first line > print("b") > Data <- ReadAffy() > eset <- rma(Data) > write.exprs(eset, file="NormalizedDate.txt") > > > > ?-- output of sessionInfo(): > > This is my input: > > > library(gcrma) //It stops before it hits the first line > print("b") > Data <- ReadAffy() > eset <- rma(Data) > write.exprs(eset, file="NormalizedDate.txt") > > What user is your web server (presumably apache) running as? Does that user have the gcrma package installed? Dan > > -- > Sent via the guest posting facility at bioconductor.org. > > _______________________________________________ > 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 >
ADD COMMENT
0
Entering edit mode
Dan Tenenbaum ★ 8.2k
@dan-tenenbaum-4256
Last seen 3.2 years ago
United States
On Mon, Nov 7, 2011 at 11:05 AM, Hussein Hijazi <hshijazi at="" gmail.com=""> wrote: > Thank you for the reply. Yes I have apache running. I basically installed > gcrma from R using the following : > > source("http://bioconductor.org/biocLite.R") > biocLite("gcrma") > That is correct. What I am saying is that 1) R sometimes installs packages in a directory somewhere under your home directory. When other users run R, they cannot see this directory. 2) Your apache web server is probably not running as you; it's probably running as the user 'apache'. Therefore the 'apache' user does not have the gcrma package installed. The solution is something like this: if (!"gcrma" %in% installed.packages()) { source("http://bioconductor.org/biocLite.R") biocLite("gcrma") } library(gcrma) # etc etc Dan > Is this the right installation? > > > > On Mon, Nov 7, 2011 at 2:00 PM, Dan Tenenbaum <dtenenba at="" fhcrc.org=""> wrote: >> >> On Mon, Nov 7, 2011 at 10:57 AM, hussein bazzi [guest] >> <guest at="" bioconductor.org=""> wrote: >> > >> > I'm calling some R script in php and it works fine. However when I call >> > an R script that is using a bio-conductor package the script doesn't run. >> > Specifically I have the following script which works perfectly fine in R but >> > when I call it from php it doesn't. Note that when I call a script that >> > doesn't use the bio-conductor package it works fine. >> > >> > library(gcrma) //It stops before it hits the first line >> > print("b") >> > Data <- ReadAffy() >> > eset <- rma(Data) >> > write.exprs(eset, file="NormalizedDate.txt") >> > >> > >> > >> > ?-- output of sessionInfo(): >> > >> > This is my input: >> > >> > >> > library(gcrma) //It stops before it hits the first line >> > print("b") >> > Data <- ReadAffy() >> > eset <- rma(Data) >> > write.exprs(eset, file="NormalizedDate.txt") >> > >> > >> >> What user is your web server (presumably apache) running as? >> Does that user have the gcrma package installed? >> >> Dan >> >> >> > >> > -- >> > Sent via the guest posting facility at bioconductor.org. >> > >> > _______________________________________________ >> > 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 >> > > >
ADD COMMENT
0
Entering edit mode
You're right the 'apache' user does not have the gcrma package installed because when I added the if statement in my R script that gets called by php to check for gcrma I got the following output: Using R version 2.11.1, biocinstall version 2.6.10. Installing Bioconductor version 2.6 packages: [1] "gcrma" Please wait... The page just stays like that with out running any code after the if-statement. Is there a way to install it directly on the apache user server? On Mon, Nov 7, 2011 at 2:25 PM, Dan Tenenbaum <dtenenba@fhcrc.org> wrote: > On Mon, Nov 7, 2011 at 11:05 AM, Hussein Hijazi <hshijazi@gmail.com> > wrote: > > Thank you for the reply. Yes I have apache running. I basically installed > > gcrma from R using the following : > > > > source("http://bioconductor.org/biocLite.R") > > biocLite("gcrma") > > > > That is correct. What I am saying is that > 1) R sometimes installs packages in a directory somewhere under your > home directory. When other users run R, they cannot see this > directory. > 2) Your apache web server is probably not running as you; it's > probably running as the user 'apache'. Therefore the 'apache' user > does not have the gcrma package installed. > > The solution is something like this: > > if (!"gcrma" %in% installed.packages()) { > source("http://bioconductor.org/biocLite.R") > biocLite("gcrma") > } > library(gcrma) > # etc etc > > Dan > > > > > > Is this the right installation? > > > > > > > > On Mon, Nov 7, 2011 at 2:00 PM, Dan Tenenbaum <dtenenba@fhcrc.org> > wrote: > >> > >> On Mon, Nov 7, 2011 at 10:57 AM, hussein bazzi [guest] > >> <guest@bioconductor.org> wrote: > >> > > >> > I'm calling some R script in php and it works fine. However when I > call > >> > an R script that is using a bio-conductor package the script doesn't > run. > >> > Specifically I have the following script which works perfectly fine > in R but > >> > when I call it from php it doesn't. Note that when I call a script > that > >> > doesn't use the bio-conductor package it works fine. > >> > > >> > library(gcrma) //It stops before it hits the first line > >> > print("b") > >> > Data <- ReadAffy() > >> > eset <- rma(Data) > >> > write.exprs(eset, file="NormalizedDate.txt") > >> > > >> > > >> > > >> > -- output of sessionInfo(): > >> > > >> > This is my input: > >> > > >> > > >> > library(gcrma) //It stops before it hits the first line > >> > print("b") > >> > Data <- ReadAffy() > >> > eset <- rma(Data) > >> > write.exprs(eset, file="NormalizedDate.txt") > >> > > >> > > >> > >> What user is your web server (presumably apache) running as? > >> Does that user have the gcrma package installed? > >> > >> Dan > >> > >> > >> > > >> > -- > >> > Sent via the guest posting facility at bioconductor.org. > >> > > >> > _______________________________________________ > >> > Bioconductor mailing list > >> > Bioconductor@r-project.org > >> > https://stat.ethz.ch/mailman/listinfo/bioconductor > >> > Search the archives: > >> > http://news.gmane.org/gmane.science.biology.informatics.conductor > >> > > > > > > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Hi, Hussein. There are several ways to get this done, but all of them probably require someone with admin access. The simplest option is to have the administrator install things are the system level. Alternatively, you could have the admin install the software as the apache user; how you do that will depend a bit on the system you are using. Sean On Mon, Nov 7, 2011 at 2:43 PM, Hussein Hijazi <hshijazi at="" gmail.com=""> wrote: > You're right the 'apache' user does not have the gcrma package installed > because when I added the if statement in my R script that gets called by > php to check for gcrma I got the following output: > Using R version 2.11.1, biocinstall version 2.6.10. Installing Bioconductor > version 2.6 packages: [1] "gcrma" Please wait... > The page just stays like that with out running any code after the > if-statement. > Is there a way to install it directly on the apache user server? > > On Mon, Nov 7, 2011 at 2:25 PM, Dan Tenenbaum <dtenenba at="" fhcrc.org=""> wrote: > >> On Mon, Nov 7, 2011 at 11:05 AM, Hussein Hijazi <hshijazi at="" gmail.com=""> >> wrote: >> > Thank you for the reply. Yes I have apache running. I basically installed >> > gcrma from R using the following : >> > >> > ? ? source("http://bioconductor.org/biocLite.R") >> > ? ? biocLite("gcrma") >> > >> >> That is correct. What I am saying is that >> 1) R sometimes installs packages in a directory somewhere under your >> home directory. When other users run R, they cannot see this >> directory. >> 2) Your apache web server is probably not running as you; it's >> probably running as the user 'apache'. Therefore the 'apache' user >> does not have the gcrma package installed. >> >> The solution is something like this: >> >> if (!"gcrma" %in% installed.packages()) { >> ? source("http://bioconductor.org/biocLite.R") >> ?biocLite("gcrma") >> } >> library(gcrma) >> # etc etc >> >> Dan >> >> >> >> >> > Is this the right installation? >> > >> > >> > >> > On Mon, Nov 7, 2011 at 2:00 PM, Dan Tenenbaum <dtenenba at="" fhcrc.org=""> >> wrote: >> >> >> >> On Mon, Nov 7, 2011 at 10:57 AM, hussein bazzi [guest] >> >> <guest at="" bioconductor.org=""> wrote: >> >> > >> >> > I'm calling some R script in php and it works fine. However when I >> call >> >> > an R script that is using a bio-conductor package the script doesn't >> run. >> >> > Specifically I have the following script which works perfectly fine >> in R but >> >> > when I call it from php it doesn't. Note that when I call a script >> that >> >> > doesn't use the bio-conductor package it works fine. >> >> > >> >> > library(gcrma) //It stops before it hits the first line >> >> > print("b") >> >> > Data <- ReadAffy() >> >> > eset <- rma(Data) >> >> > write.exprs(eset, file="NormalizedDate.txt") >> >> > >> >> > >> >> > >> >> > ?-- output of sessionInfo(): >> >> > >> >> > This is my input: >> >> > >> >> > >> >> > library(gcrma) //It stops before it hits the first line >> >> > print("b") >> >> > Data <- ReadAffy() >> >> > eset <- rma(Data) >> >> > write.exprs(eset, file="NormalizedDate.txt") >> >> > >> >> > >> >> >> >> What user is your web server (presumably apache) running as? >> >> Does that user have the gcrma package installed? >> >> >> >> Dan >> >> >> >> >> >> > >> >> > -- >> >> > Sent via the guest posting facility at bioconductor.org. >> >> > >> >> > _______________________________________________ >> >> > 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 >> >> > >> > >> > >> > > ? ? ? ?[[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 >
ADD REPLY
0
Entering edit mode
On Mon, 2011-11-07 at 11:25 -0800, Dan Tenenbaum wrote: > On Mon, Nov 7, 2011 at 11:05 AM, Hussein Hijazi <hshijazi at="" gmail.com=""> wrote: > > Thank you for the reply. Yes I have apache running. I basically installed > > gcrma from R using the following : > > > > source("http://bioconductor.org/biocLite.R") > > biocLite("gcrma") > > > > That is correct. What I am saying is that > 1) R sometimes installs packages in a directory somewhere under your > home directory. When other users run R, they cannot see this > directory. > 2) Your apache web server is probably not running as you; it's > probably running as the user 'apache'. Therefore the 'apache' user > does not have the gcrma package installed. > > The solution is something like this: > > if (!"gcrma" %in% installed.packages()) { > source("http://bioconductor.org/biocLite.R") > biocLite("gcrma") > } > library(gcrma) > # etc etc Are you positive you want to let your web-server installing something retrieved from the web automatically? Sounds quite like a security risk to me. The solution to me is having the library installed at the system level by the system administrator. Pierre
ADD REPLY
0
Entering edit mode
Hi: [I think that this is my first message to this list, after a few months of silently reading many threads and slowly learning...] Another option is to have some permission checking at php level. For instance, this is what it was introduced in Tiki Wiki CMS/Groupware a few years ago, and then, you can allow Tiki site admins of the web site to install those packages for you (or for themselves) through the web interface (a wiki page with a PluginR call). That was partly shown in the last UseR2011 conference, with an example of a custom php-based web 2.0 interface for custom R scripts to produce HeatMaps, which required extra packages from Bioconductor. https://doc.tiki.org/PluginR http://ueb.ir.vhebron.net/tools/2011+UseR Those potentially interested, there is a free workshop shceduled for next week at the 3rd Spanish UseR meeting, in order to teach how to create safe web 2.0 interfaces for their R scritps. http://demo.usar.org.es/III+Jornadas Cheers Xavier On 07/11/11 20:41, Pierre-Yves Chibon wrote: > On Mon, 2011-11-07 at 11:25 -0800, Dan Tenenbaum wrote: >> On Mon, Nov 7, 2011 at 11:05 AM, Hussein Hijazi<hshijazi at="" gmail.com=""> wrote: >>> Thank you for the reply. Yes I have apache running. I basically installed >>> gcrma from R using the following : >>> >>> source("http://bioconductor.org/biocLite.R") >>> biocLite("gcrma") >>> >> That is correct. What I am saying is that >> 1) R sometimes installs packages in a directory somewhere under your >> home directory. When other users run R, they cannot see this >> directory. >> 2) Your apache web server is probably not running as you; it's >> probably running as the user 'apache'. Therefore the 'apache' user >> does not have the gcrma package installed. >> >> The solution is something like this: >> >> if (!"gcrma" %in% installed.packages()) { >> source("http://bioconductor.org/biocLite.R") >> biocLite("gcrma") >> } >> library(gcrma) >> # etc etc > Are you positive you want to let your web-server installing something > retrieved from the web automatically? > Sounds quite like a security risk to me. > > The solution to me is having the library installed at the system level > by the system administrator. > > Pierre > > _______________________________________________ > 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
ADD REPLY

Login before adding your answer.

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