librelist archives

« back to archive

Re: Using pysb with Kappa

Re: Using pysb with Kappa

From:
Danny Wells
Date:
2013-08-08 @ 20:10
On Thu, Aug 8, 2013 at 2:14 PM, Danny Wells <danny.k.wells@gmail.com> wrote:

> Hello ,
>
> I am excited to use the pysb package, but am having a hard time getting it
> to work with Kappa. In particular, I am getting the error:
>
> "
> Exception: Problem running KaSim: [Errno 2] No such file or directory
> "
> from line 273 of kappa.py
>
> I imagine that this is because I don't have kappa placed (or installed) in
> the right folder. Would you be able to give me more explicit directions on
> how to get this to work?
>
> I really appreciate the help - thank you.
>
> Best,
> Danny Wells
>

Re: [pysb] Re: Using pysb with Kappa

From:
John Bachman
Date:
2013-08-08 @ 20:30
Hi Danny,

As you suggest, the problem is likely that PySB can't find KaSim on
your system. There is some extra code in pysb/bng.py that helps to
find the BNG executable via environment variables etc, but we haven't
yet implemented the equivalent for kappa. However, we can fix this
ASAP.

In the meantime, can you try adding the directory containing the KaSim
executable to your PATH and let us know if this takes care of your
error?

Thanks for your interest in PySB!

John

On Thu, Aug 8, 2013 at 4:10 PM, Danny Wells <danny.k.wells@gmail.com> wrote:
>
>
>
> On Thu, Aug 8, 2013 at 2:14 PM, Danny Wells <danny.k.wells@gmail.com> wrote:
>>
>> Hello ,
>>
>> I am excited to use the pysb package, but am having a hard time getting it
>> to work with Kappa. In particular, I am getting the error:
>>
>> "
>> Exception: Problem running KaSim: [Errno 2] No such file or directory
>> "
>> from line 273 of kappa.py
>>
>> I imagine that this is because I don't have kappa placed (or installed) in
>> the right folder. Would you be able to give me more explicit directions on
>> how to get this to work?
>>
>> I really appreciate the help - thank you.
>>
>> Best,
>> Danny Wells
>
>

Re: [pysb] Re: Using pysb with Kappa

From:
Danny Wells
Date:
2013-08-09 @ 00:21
Hi John,

I added your suggested line to the path, but still didn't have any luck:
the error I am getting now is

"

Parsing ./pysbtest_48426_3007_temp.ka...
Error (./pysbtest_48426_3007_temp.ka) line 2, character 7: Malformed agent
signature, I was expecting something of the form '%agent: A(x,y~u~v,z)'
Traceback (most recent call last):
  File "run_tutorial_a.py", line 10, in <module>
    kappa.run_simulation(model)
  File

"/Users/danielwells/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pysb/kappa.py",
line 48, in run_simulation
    outs = run_kasim(model, **kwargs)
  File

"/Users/danielwells/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pysb/kappa.py",
line 273, in run_kasim
    raise Exception("Problem running KaSim: " + str(e))
Exception: Problem running KaSim: 'NoneType' object has no attribute 'read'

"

Did I create my model wrong? It is not entirely clear what is needed for a
Kappa model beyond the most basic PySB model given in the documentation.

Best,
Danny


On Thu, Aug 8, 2013 at 4:30 PM, John Bachman <bachmanjohn@gmail.com> wrote:

> Hi Danny,
>
> As you suggest, the problem is likely that PySB can't find KaSim on
> your system. There is some extra code in pysb/bng.py that helps to
> find the BNG executable via environment variables etc, but we haven't
> yet implemented the equivalent for kappa. However, we can fix this
> ASAP.
>
> In the meantime, can you try adding the directory containing the KaSim
> executable to your PATH and let us know if this takes care of your
> error?
>
> Thanks for your interest in PySB!
>
> John
>
> On Thu, Aug 8, 2013 at 4:10 PM, Danny Wells <danny.k.wells@gmail.com>
> wrote:
> >
> >
> >
> > On Thu, Aug 8, 2013 at 2:14 PM, Danny Wells <danny.k.wells@gmail.com>
> wrote:
> >>
> >> Hello ,
> >>
> >> I am excited to use the pysb package, but am having a hard time getting
> it
> >> to work with Kappa. In particular, I am getting the error:
> >>
> >> "
> >> Exception: Problem running KaSim: [Errno 2] No such file or directory
> >> "
> >> from line 273 of kappa.py
> >>
> >> I imagine that this is because I don't have kappa placed (or installed)
> in
> >> the right folder. Would you be able to give me more explicit directions
> on
> >> how to get this to work?
> >>
> >> I really appreciate the help - thank you.
> >>
> >> Best,
> >> Danny Wells
> >
> >
>

Re: [pysb] Re: Using pysb with Kappa

From:
John Bachman
Date:
2013-08-09 @ 01:22
Hi Danny,

Try the following:

from pylab import *
from pysb import kappa
from pysb.examples.hello_pysb import model
simdata = kappa.run_simulation(model, time=100)
ion()
plot(simdata['time'], simdata['LR'])

This should hopefully work. Can you send the code for the model you
are trying to run so I can see why you're getting the error you're
getting?

John

On Thu, Aug 8, 2013 at 8:21 PM, Danny Wells <danny.k.wells@gmail.com> wrote:
> Hi John,
>
> I added your suggested line to the path, but still didn't have any luck: the
> error I am getting now is
>
> "
>
> Parsing ./pysbtest_48426_3007_temp.ka...
> Error (./pysbtest_48426_3007_temp.ka) line 2, character 7: Malformed agent
> signature, I was expecting something of the form '%agent: A(x,y~u~v,z)'
> Traceback (most recent call last):
>   File "run_tutorial_a.py", line 10, in <module>
>     kappa.run_simulation(model)
>   File
> 
"/Users/danielwells/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pysb/kappa.py",
> line 48, in run_simulation
>     outs = run_kasim(model, **kwargs)
>   File
> 
"/Users/danielwells/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pysb/kappa.py",
> line 273, in run_kasim
>     raise Exception("Problem running KaSim: " + str(e))
> Exception: Problem running KaSim: 'NoneType' object has no attribute 'read'
>
> "
>
> Did I create my model wrong? It is not entirely clear what is needed for a
> Kappa model beyond the most basic PySB model given in the documentation.
>
> Best,
> Danny
>
>
> On Thu, Aug 8, 2013 at 4:30 PM, John Bachman <bachmanjohn@gmail.com> wrote:
>>
>> Hi Danny,
>>
>> As you suggest, the problem is likely that PySB can't find KaSim on
>> your system. There is some extra code in pysb/bng.py that helps to
>> find the BNG executable via environment variables etc, but we haven't
>> yet implemented the equivalent for kappa. However, we can fix this
>> ASAP.
>>
>> In the meantime, can you try adding the directory containing the KaSim
>> executable to your PATH and let us know if this takes care of your
>> error?
>>
>> Thanks for your interest in PySB!
>>
>> John
>>
>> On Thu, Aug 8, 2013 at 4:10 PM, Danny Wells <danny.k.wells@gmail.com>
>> wrote:
>> >
>> >
>> >
>> > On Thu, Aug 8, 2013 at 2:14 PM, Danny Wells <danny.k.wells@gmail.com>
>> > wrote:
>> >>
>> >> Hello ,
>> >>
>> >> I am excited to use the pysb package, but am having a hard time getting
>> >> it
>> >> to work with Kappa. In particular, I am getting the error:
>> >>
>> >> "
>> >> Exception: Problem running KaSim: [Errno 2] No such file or directory
>> >> "
>> >> from line 273 of kappa.py
>> >>
>> >> I imagine that this is because I don't have kappa placed (or installed)
>> >> in
>> >> the right folder. Would you be able to give me more explicit directions
>> >> on
>> >> how to get this to work?
>> >>
>> >> I really appreciate the help - thank you.
>> >>
>> >> Best,
>> >> Danny Wells
>> >
>> >
>
>

Re: [pysb] Re: Using pysb with Kappa

From:
Danny Wells
Date:
2013-08-10 @ 14:55
Hi John,

That worked. I've fixed my model, and it seems to be working with both
kappa and the deterministic simulation.

I have a further question about the mechanics of PySB that I am hoping you
can help me with: I would like my model to be non-autonomous; that is, I
would like to change a particular parameter according to what time the
simulation is at (representing an input signal, for example). How would I
do so in pysb?

Thanks for all of your help,
Danny


On Thu, Aug 8, 2013 at 9:22 PM, John Bachman <bachmanjohn@gmail.com> wrote:

> Hi Danny,
>
> Try the following:
>
> from pylab import *
> from pysb import kappa
> from pysb.examples.hello_pysb import model
> simdata = kappa.run_simulation(model, time=100)
> ion()
> plot(simdata['time'], simdata['LR'])
>
> This should hopefully work. Can you send the code for the model you
> are trying to run so I can see why you're getting the error you're
> getting?
>
> John
>
> On Thu, Aug 8, 2013 at 8:21 PM, Danny Wells <danny.k.wells@gmail.com>
> wrote:
> > Hi John,
> >
> > I added your suggested line to the path, but still didn't have any luck:
> the
> > error I am getting now is
> >
> > "
> >
> > Parsing ./pysbtest_48426_3007_temp.ka...
> > Error (./pysbtest_48426_3007_temp.ka) line 2, character 7: Malformed
> agent
> > signature, I was expecting something of the form '%agent: A(x,y~u~v,z)'
> > Traceback (most recent call last):
> >   File "run_tutorial_a.py", line 10, in <module>
> >     kappa.run_simulation(model)
> >   File
> >
> 
"/Users/danielwells/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pysb/kappa.py",
> > line 48, in run_simulation
> >     outs = run_kasim(model, **kwargs)
> >   File
> >
> 
"/Users/danielwells/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pysb/kappa.py",
> > line 273, in run_kasim
> >     raise Exception("Problem running KaSim: " + str(e))
> > Exception: Problem running KaSim: 'NoneType' object has no attribute
> 'read'
> >
> > "
> >
> > Did I create my model wrong? It is not entirely clear what is needed for
> a
> > Kappa model beyond the most basic PySB model given in the documentation.
> >
> > Best,
> > Danny
> >
> >
> > On Thu, Aug 8, 2013 at 4:30 PM, John Bachman <bachmanjohn@gmail.com>
> wrote:
> >>
> >> Hi Danny,
> >>
> >> As you suggest, the problem is likely that PySB can't find KaSim on
> >> your system. There is some extra code in pysb/bng.py that helps to
> >> find the BNG executable via environment variables etc, but we haven't
> >> yet implemented the equivalent for kappa. However, we can fix this
> >> ASAP.
> >>
> >> In the meantime, can you try adding the directory containing the KaSim
> >> executable to your PATH and let us know if this takes care of your
> >> error?
> >>
> >> Thanks for your interest in PySB!
> >>
> >> John
> >>
> >> On Thu, Aug 8, 2013 at 4:10 PM, Danny Wells <danny.k.wells@gmail.com>
> >> wrote:
> >> >
> >> >
> >> >
> >> > On Thu, Aug 8, 2013 at 2:14 PM, Danny Wells <danny.k.wells@gmail.com>
> >> > wrote:
> >> >>
> >> >> Hello ,
> >> >>
> >> >> I am excited to use the pysb package, but am having a hard time
> getting
> >> >> it
> >> >> to work with Kappa. In particular, I am getting the error:
> >> >>
> >> >> "
> >> >> Exception: Problem running KaSim: [Errno 2] No such file or directory
> >> >> "
> >> >> from line 273 of kappa.py
> >> >>
> >> >> I imagine that this is because I don't have kappa placed (or
> installed)
> >> >> in
> >> >> the right folder. Would you be able to give me more explicit
> directions
> >> >> on
> >> >> how to get this to work?
> >> >>
> >> >> I really appreciate the help - thank you.
> >> >>
> >> >> Best,
> >> >> Danny Wells
> >> >
> >> >
> >
> >
>

Re: [pysb] Re: Using pysb with Kappa

From:
Danny Wells
Date:
2013-08-10 @ 17:37
Hi John,

Alternatively, it would work for me to just be able to give starting
parameters to a model that can then be used in kappa. How does this work in
PySB?

Best,
Danny


On Sat, Aug 10, 2013 at 10:55 AM, Danny Wells <danny.k.wells@gmail.com>wrote:

> Hi John,
>
> That worked. I've fixed my model, and it seems to be working with both
> kappa and the deterministic simulation.
>
> I have a further question about the mechanics of PySB that I am hoping you
> can help me with: I would like my model to be non-autonomous; that is, I
> would like to change a particular parameter according to what time the
> simulation is at (representing an input signal, for example). How would I
> do so in pysb?
>
> Thanks for all of your help,
> Danny
>
>
> On Thu, Aug 8, 2013 at 9:22 PM, John Bachman <bachmanjohn@gmail.com>wrote:
>
>> Hi Danny,
>>
>> Try the following:
>>
>> from pylab import *
>> from pysb import kappa
>> from pysb.examples.hello_pysb import model
>> simdata = kappa.run_simulation(model, time=100)
>> ion()
>> plot(simdata['time'], simdata['LR'])
>>
>> This should hopefully work. Can you send the code for the model you
>> are trying to run so I can see why you're getting the error you're
>> getting?
>>
>> John
>>
>> On Thu, Aug 8, 2013 at 8:21 PM, Danny Wells <danny.k.wells@gmail.com>
>> wrote:
>> > Hi John,
>> >
>> > I added your suggested line to the path, but still didn't have any
>> luck: the
>> > error I am getting now is
>> >
>> > "
>> >
>> > Parsing ./pysbtest_48426_3007_temp.ka...
>> > Error (./pysbtest_48426_3007_temp.ka) line 2, character 7: Malformed
>> agent
>> > signature, I was expecting something of the form '%agent: A(x,y~u~v,z)'
>> > Traceback (most recent call last):
>> >   File "run_tutorial_a.py", line 10, in <module>
>> >     kappa.run_simulation(model)
>> >   File
>> >
>> 
"/Users/danielwells/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pysb/kappa.py",
>> > line 48, in run_simulation
>> >     outs = run_kasim(model, **kwargs)
>> >   File
>> >
>> 
"/Users/danielwells/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pysb/kappa.py",
>> > line 273, in run_kasim
>> >     raise Exception("Problem running KaSim: " + str(e))
>> > Exception: Problem running KaSim: 'NoneType' object has no attribute
>> 'read'
>> >
>> > "
>> >
>> > Did I create my model wrong? It is not entirely clear what is needed
>> for a
>> > Kappa model beyond the most basic PySB model given in the documentation.
>> >
>> > Best,
>> > Danny
>> >
>> >
>> > On Thu, Aug 8, 2013 at 4:30 PM, John Bachman <bachmanjohn@gmail.com>
>> wrote:
>> >>
>> >> Hi Danny,
>> >>
>> >> As you suggest, the problem is likely that PySB can't find KaSim on
>> >> your system. There is some extra code in pysb/bng.py that helps to
>> >> find the BNG executable via environment variables etc, but we haven't
>> >> yet implemented the equivalent for kappa. However, we can fix this
>> >> ASAP.
>> >>
>> >> In the meantime, can you try adding the directory containing the KaSim
>> >> executable to your PATH and let us know if this takes care of your
>> >> error?
>> >>
>> >> Thanks for your interest in PySB!
>> >>
>> >> John
>> >>
>> >> On Thu, Aug 8, 2013 at 4:10 PM, Danny Wells <danny.k.wells@gmail.com>
>> >> wrote:
>> >> >
>> >> >
>> >> >
>> >> > On Thu, Aug 8, 2013 at 2:14 PM, Danny Wells <danny.k.wells@gmail.com
>> >
>> >> > wrote:
>> >> >>
>> >> >> Hello ,
>> >> >>
>> >> >> I am excited to use the pysb package, but am having a hard time
>> getting
>> >> >> it
>> >> >> to work with Kappa. In particular, I am getting the error:
>> >> >>
>> >> >> "
>> >> >> Exception: Problem running KaSim: [Errno 2] No such file or
>> directory
>> >> >> "
>> >> >> from line 273 of kappa.py
>> >> >>
>> >> >> I imagine that this is because I don't have kappa placed (or
>> installed)
>> >> >> in
>> >> >> the right folder. Would you be able to give me more explicit
>> directions
>> >> >> on
>> >> >> how to get this to work?
>> >> >>
>> >> >> I really appreciate the help - thank you.
>> >> >>
>> >> >> Best,
>> >> >> Danny Wells
>> >> >
>> >> >
>> >
>> >
>>
>
>