Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is CORNETO installation incompatible with LIANA? #149

Open
jiangzh-coder opened this issue Oct 16, 2024 · 3 comments
Open

Is CORNETO installation incompatible with LIANA? #149

jiangzh-coder opened this issue Oct 16, 2024 · 3 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@jiangzh-coder
Copy link

In "Differential Expression Analysis for CCC & Downstream Signalling Networks" part ,
i met following error:
Is CORNETO installation incompatible with LIANA?
########1 i have tried used 2 ways to install corneto:
pip install corneto cvxpy scipy gurobipy or
pip install git+https://github.com/saezlab/corneto.git#egg=corneto[os]
#2 gurobipy i have followed "Differential Expression..." tutorial to install.

Currently my versions are;
pip show liana #Version: 1.4.0
pip show corneto #Version: 1.0.0a0

AttributeError Traceback (most recent call last)
Cell In[21], line 1
----> 1 df_res, problem = li.mt.find_causalnet(
2 prior_graph,
3 input_scores,
4 output_scores,
5 node_weights,
6 # penalize (max_penalty) nodes with counts in less than 0.1 of the cells
7 node_cutoff=0.1,
8 max_penalty=1,
9 # the penaly of those in > 0.1 prop of cells set to:
10 min_penalty=0.01,
11 edge_penalty=0.1,
12 verbose=False,
13 max_runs=50, # NOTE that this repeats the solving either until the max runs are reached
14 stable_runs=10, # or until X number of consequitive stable runs are reached (i.e. no new edges are added)
15 solver='gurobi' # 'scipy' is available by default, but often results in suboptimal solutions
16 )

File ~/miniconda3/envs/omicverse/lib/python3.10/site-packages/liana/method/fun/_causalnet.py:193, in find_causalnet(prior_graph, input_node_scores, output_node_scores, node_weights, node_cutoff, min_penalty, max_penalty, missing_penalty, edge_penalty, solver, seed, max_runs, stable_runs, verbose, **kwargs)
189 c_node_penalties = {k: node_penalties.get(k, missing_penalty) + rng.uniform(min_penalty/20, min_penalty/10)
190 if k not in measured_nodes else 0.0 for k in prior_graph.vertices}
192 _logg("Building CORNETO problem...", verbose=verbose)
--> 193 P, G = cn.methods.carnival._extended_carnival_problem(
194 prior_graph,
195 input_node_scores,
196 output_node_scores,
197 node_penalties=c_node_penalties,
198 edge_penalty=edge_penalty
199 )
201 # E is the variable with 1 if edge activates or inhibits, 0 otherwise
202 E = P.symbols['reaction_sends_activation_c0'] + P.symbols['reaction_sends_inhibition_c0']

AttributeError: module 'corneto.methods.carnival' has no attribute '_extended_carnival_problem'

@jiangzh-coder jiangzh-coder added bug Something isn't working help wanted Extra attention is needed labels Oct 16, 2024
@dbdimitrov
Copy link
Collaborator

pip install corneto==0.9.1-alpha.5 this should make it work :)

@jiangzh-coder
Copy link
Author

Thank you vey much!

@Cladors
Copy link

Cladors commented Oct 24, 2024

Just saying that I have had the same issue. _extended_carnival_problem does not exists in the corneto.methods.carnival.py file any more. They have done multiple edits to that file in the past year or so. See here: https://github.com/saezlab/corneto/commits/dev/corneto/methods/carnival.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants