Hello all I need your help.  I currently have a website that calls a python
script that uses rpy to create graphs.  When I run the script from the
console it works great but when I run the script via the website it is only
creating a zero byte png file.  The webserver that we are running is Apache,
on a linux box.

The code I am using is the following:

<pre>
import os, random, rpy
from rpy import r

stat_table = []
real_table = []
separator = '\t'

for (stat, real) in self.dumpListStatReal():
    stat_table.append(stat)
    real_table.append(real)

r.lm.local_mode(rpy.NO_CONVERSION)
linear_model = r.lm(r("y ~ x"), data = r.data_frame(x = stat_table, y =
real_table))
gradient = linear_model['coeffients']['x']
yintercept = linear_model['coeffients']['Intercept']
os.chown(fileName,-1,608)
r.png(fileName, width = 480, height = 640)
r.plot(x = stat_table, y = real_table, xlab = "Computationally Derived
Binding Free Energy\\nkcal/mol", ylab = "Experimentally Derived Binding Free
Energy\\nkcal/mol", main = "Parametrically Derived Scoring Function
Performance -- r=%.2f", col = "blue")
r.abline(a = yintercept, b = gradient, col = "red")
r.dev_off()
</pre>
Any help would be great.  Thanks
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to