Skip to content
New issue

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

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

Already on GitHub? # to your account

results produced by ilp_solver #188

Open
ask-more-questions opened this issue Feb 26, 2023 · 5 comments
Open

results produced by ilp_solver #188

ask-more-questions opened this issue Feb 26, 2023 · 5 comments

Comments

@ask-more-questions
Copy link

Hi,

I used ilp Solver on around 20 taxa dataset. The output from ilp Solver is a Digragh. When i try to export it into a newick fomat. Sometimes it will succeed and sometimes not. I wonder why would this happen?
Another question is , when i have the output as a newick, some subtree/groups of taxa will appear more than once. the itol view will display them randomly. However, how should choose the best tree.

Thank you for your answer.

@mattjones315
Copy link
Collaborator

Hi @ask-more-questions --

Can you please provide a small reproducible example? I'd be happy to look into this.

-Matt

@ask-more-questions
Copy link
Author

problem_example.txt

Hi Matt,
Thank you for your quick response!
the attached file described my problem,please check it !
:D

-- Qin

@mattjones315
Copy link
Collaborator

mattjones315 commented Mar 6, 2023

Hi @ask-more-questions ,

I have taken a look at your code example and am unable to reproduce the error here. My ILP run was successful, and I could output a newick tree that looks like this (without duplicate leaves, by the look of it):

(((((35:1,36:2):1,34:2):1,((37:1,38:2):1,39:2):1):2,((49:2,50:2):1,55:2):2):1,(((5:2,16:2):1,((9:2,10:2):1,11:2):2):1,(((24:2,26:2):1,25:2,20:2):1,28:3):1):2);

However, one thing I did notice is that you are passing in names=range(10) while reading in the character matrix. However there appears to be 20 characters. Is this necessary? Perhaps this can be causing the issue? When I try to use this, I get an error. I suggest you use this way of reading in the character matrix:

character_mtx=pd.read_csv("test_cm.txt", sep=',', header=None, index_col=0)
character_mtx.index = character_mtx.index.astype(str)

@ask-more-questions
Copy link
Author

Hi Matt

Yes, this problem occurs occasionally and i may give the wrong example.

I have tried what you suggested. The ilp_solver works all right before and now. The problem is the function cassiopeia_tree.get_newick(). For the updated example this time. sometimes I have the error "Recursion Error: maximum recursion depth exceeded". When this problem happened, i inspected the output cassiopeia tree structure and i found there are some problem in the edge structure which is abnormal for a tree.

If you are interested, for this example i give below, please run the code several times without changing anything. the output is not consistent each time.

problem_example2.txt

@ask-more-questions
Copy link
Author

Hi Matt,
Sorry to bother you here, does this error also appear with your version of ILP. Looking forward to any updates on this issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants