jcrozum / pystablemotifs

Python library for attractor identification and control in Boolean networks
MIT License
28 stars 7 forks source link

gringo/clasp error when run-in Basic Usage Tutorial #87

Closed MarioGutierrezR closed 2 years ago

MarioGutierrezR commented 2 years ago

Hi, I'm new to pystablemotifs so I was trying the Basic Usage Tutorial.ipynb. However, when I get to the AttractorRepertoire line (i.e. ar = sm.AttractorRepertoire.from_primes(primes, max_simulate_size=max_simulate_size) I get the following error messages:

ar = sm.AttractorRepertoire.from_primes(primes, max_simulate_size=max_simulate_size)
ERROR call to gringo and / or clasp failed.
ERROR command: /Users/mariogutierrez/miniconda3/lib/python3.9/site-packages/pyboolnet/binaries/gringo-4.4.0/gringo_mac64 | /Users/mariogutierrez/miniconda3/lib/python3.9/site-packages/pyboolnet/binaries/clasp-3.2.0/clasp-3.2.0_mac64 --models=10000 --project --enum-mode=domRec --heuristic=Domain --dom-mod=5,16
ERROR error: *** ERROR: (clasp): parse error in line 0: bad input stream
*** Info : (clasp): Try '--help' for usage information

Traceback (most recent call last):

  Input In [7] in <cell line: 1>
    ar = sm.AttractorRepertoire.from_primes(primes, max_simulate_size=max_simulate_size)

  File ~/miniconda3/lib/python3.9/site-packages/pystablemotifs/AttractorRepertoire.py:98 in from_primes
    x.analyze_system(primes,max_simulate_size=max_simulate_size,max_simulate_size_vc=max_simulate_size_vc,max_stable_motifs=max_stable_motifs,max_in_degree=max_in_degree,MPBN_update=MPBN_update)

  File ~/miniconda3/lib/python3.9/site-packages/pystablemotifs/AttractorRepertoire.py:196 in analyze_system
    self.succession_diagram = sm_succession.build_succession_diagram(primes,max_simulate_size=max_simulate_size,max_simulate_size_vc=max_simulate_size_vc,max_stable_motifs=max_stable_motifs,max_in_degree=max_in_degree,MPBN_update=MPBN_update)

  File ~/miniconda3/lib/python3.9/site-packages/pystablemotifs/succession.py:515 in build_succession_diagram
    myMotifReduction=sm_reduction.MotifReduction(motif_history,fixed.copy(),primes,max_simulate_size=max_simulate_size,max_simulate_size_vc=max_simulate_size_vc,prioritize_source_motifs=prioritize_source_motifs,max_stable_motifs=max_stable_motifs,MPBN_update=MPBN_update)

  File ~/miniconda3/lib/python3.9/site-packages/pystablemotifs/reduction.py:413 in __init__
    self.stable_motifs = pyboolnet.trap_spaces.compute_trap_spaces(self.reduced_primes, "max",max_output=max_stable_motifs)

  File ~/miniconda3/lib/python3.9/site-packages/pyboolnet/trap_spaces.py:245 in compute_trap_spaces
    return potassco_handle(primes, type_, bounds=bounds, project=[], max_output=max_output, fname_asp=fname_asp, representation=representation)

  File ~/miniconda3/lib/python3.9/site-packages/pyboolnet/external/potassco.py:82 in potassco_handle
    raise Exception

Exception

I know it says the call to gringo and clasp failed, but both of them are installed and pyboolnet didn't have trouble during the installation process. Do you think you can help me find a solution in order to use pystablemotifs subsequently?

Best, Mario

jcrozum commented 2 years ago

This looks like it might be a pyboolnet error. Could you please verify that pyboolnet is working properly? Specifically, can you verify that the tutorial script here runs for you: https://github.com/hklarner/pyboolnet/blob/master/tutorials/09_trap_spaces.py

MarioGutierrezR commented 2 years ago

It doesn't work either. This is the message:

python 09_trap_spaces.py
ERROR call to gringo and / or clasp failed.
ERROR command: /Users/mariogutierrez/miniconda3/lib/python3.9/site-packages/pyboolnet/binaries/gringo-4.4.0/gringo_mac64 | /Users/mariogutierrez/miniconda3/lib/python3.9/site-packages/pyboolnet/binaries/clasp-3.2.0/clasp-3.2.0_mac64 --models=10000 --project --enum-mode=domRec --heuristic=Domain --dom-mod=3,16
ERROR error: *** ERROR: (clasp): parse error in line 0: bad input stream
*** Info : (clasp): Try '--help' for usage information

Traceback (most recent call last):
  File "/Users/mariogutierrez/Documents/red_Booleana/RekaAlbert/pyboolnet/tutorials/09_trap_spaces.py", line 11, in <module>
    mints = compute_trap_spaces(primes, "min")
  File "/Users/mariogutierrez/miniconda3/lib/python3.9/site-packages/pyboolnet/trap_spaces.py", line 245, in compute_trap_spaces
    return potassco_handle(primes, type_, bounds=bounds, project=[], max_output=max_output, fname_asp=fname_asp, representation=representation)
  File "/Users/mariogutierrez/miniconda3/lib/python3.9/site-packages/pyboolnet/external/potassco.py", line 82, in potassco_handle
    raise Exception
Exception
jcrozum commented 2 years ago

That means there is a problem with your pyboolnet installation.

I recommend that you post an issue on the pyboolnet GitHub page (https://github.com/hklarner/pyboolnet/issues), as they will be better equipped to help you resolve this particular problem.

Because this is not a pystablemotifs issue, I will close this thread.

luckydoudouli commented 1 year ago

It doesn't work either. This is the message:

python 09_trap_spaces.py
ERROR call to gringo and / or clasp failed.
ERROR command: /Users/mariogutierrez/miniconda3/lib/python3.9/site-packages/pyboolnet/binaries/gringo-4.4.0/gringo_mac64 | /Users/mariogutierrez/miniconda3/lib/python3.9/site-packages/pyboolnet/binaries/clasp-3.2.0/clasp-3.2.0_mac64 --models=10000 --project --enum-mode=domRec --heuristic=Domain --dom-mod=3,16
ERROR error: *** ERROR: (clasp): parse error in line 0: bad input stream
*** Info : (clasp): Try '--help' for usage information

Traceback (most recent call last):
  File "/Users/mariogutierrez/Documents/red_Booleana/RekaAlbert/pyboolnet/tutorials/09_trap_spaces.py", line 11, in <module>
    mints = compute_trap_spaces(primes, "min")
  File "/Users/mariogutierrez/miniconda3/lib/python3.9/site-packages/pyboolnet/trap_spaces.py", line 245, in compute_trap_spaces
    return potassco_handle(primes, type_, bounds=bounds, project=[], max_output=max_output, fname_asp=fname_asp, representation=representation)
  File "/Users/mariogutierrez/miniconda3/lib/python3.9/site-packages/pyboolnet/external/potassco.py", line 82, in potassco_handle
    raise Exception
Exception

Hi, I had the same problem. how did you finally solve it?