CAFE5 'inf' issue with small tree

221 views
Skip to first unread message

Sebastian Lee

unread,
Jul 15, 2023, 11:39:18 PM7/15/23
to hahnlab-cafe
Hello,
I hope all of you are doing well. I am trying to run CAFE5 on 12 species from the
Chenopodioideae subfamily of Amaranthaceae (with Beta vulgaris, the sugar beet, as an
outgroup). However, when I run CAFE5 and it tries to generate the scores, all of them are
"inf" and so the program fails to generate any output.

Based on previous conversations here, it seems that this can happen if you are looking at species that are very distantly related, but all of mine are within one family of plants and there are only 12 species. It seems that Spinacia oleracea (spinach) is the one giving
problems, as there are many rows where it has high gene counts while the other plants
have 0, which I do not believe CAFE5 likes (it suggests to delete these rows from the
analysis because of the high differential).

The output looks like this: 

~~~~

Filtering families not present at the root from: 25635 to 17300

No root family size distribution specified, using uniform distribution

Optimizer strategy: Nelder-Mead with similarity cutoff

Iterations: 300

Expansion: 2

Reflection: 1

Starting Search for Initial Parameter Values

Lambda: 0.26898759219232

Score (-lnL):             inf

Lambda: 0.16507363815491

Score (-lnL):             inf

............................... etc. etc. etc.

Families with largest size differentials:

N0.HOG0000326: 95

N0.HOG0000502: 89

N0.HOG0000005: 88

.............................. etc. etc. etc. 

You may want to try removing the top few families with the largest difference

between the max and min counts and then re-run the analysis.

Failed to initialize any reasonable values

~~~

I have attached the files as well if you wanted to look at them. They were originally generated from Orthofinder. 


Thanks!
Sebastian

A-C.tre
A-C_final.tsv

Hahn, Matthew

unread,
Jul 16, 2023, 11:29:43 AM7/16/23
to Sebastian Lee, hahnlab-cafe
Hi Sebastian,

I think CAFE is giving you the correct error message: spinach seems to have too many unique families. Does it run if you take these families (or spinach itself) out of the analysis?



Matt

--
You received this message because you are subscribed to the Google Groups "hahnlab-cafe" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hahnlabcafe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hahnlabcafe/08ae07db-de43-420a-b6ee-7c45fa46adfbn%40googlegroups.com.
<A-C.tre><A-C_final.tsv>

Sebastian Lee

unread,
Jul 17, 2023, 11:30:57 PM7/17/23
to hahnlab-cafe
Hello,

thanks for such a speedy reply! It does go through, but now there is a different error- after it finds lambda, when calculating pvalues, the program abruptly aborts. I'm not sure why. The slurm script line 12 it is referring to is just the basic cafe5 command I put in a script to submit to our schools server. Here is what it looks like below:

~~~~~~~~~

etc. etc. etc. 

Lambda: 2.3292610865312

Score (-lnL): 322701.45275759

Lambda: 2.3292564898301

Score (-lnL): 322701.45275751


Completed 33 iterations

Time: 1H 56M 6S

Best match is: 2.3292564898301

Final -lnL: 322701.45275751


70 values were attempted (0% rejected)


Inferring processes for Base model

Score (-lnL): 322701.45275751

Maximum possible lambda for this topology: 3.4525379606549

Computing pvalues...

terminate called recursively

terminate called after throwing an instance of 'std::out_of_range'

/var/lib/slurmd/job19161468/slurm_script: line 12: 76721 Aborted



Do you know what this could be? 

Thank you for your help!

Sebastian

Ben Fulton

unread,
Jul 18, 2023, 8:39:19 AM7/18/23
to hahnlab-cafe
If you haven't upgraded to CAFE 5.1, you should do that. Otherwise, can you share your tree and family files? You can send them directly to me if you like.

--
Ben Fulton
Indiana University

Ben Fulton

unread,
Jul 18, 2023, 1:58:27 PM7/18/23
to hahnlab-cafe
Thanks for sending me your files. There is a bug in CAFE here that we need to look at, but your tree branches are very short. CAFE expects branch lengths to be expressed in millions of years. As an experiment, you might try simply multiplying all your branch lengths by 10 and see if that will get CAFE to finish.

--
Ben Fulton
Indiana University

Sebastian Lee

unread,
Jul 18, 2023, 5:18:47 PM7/18/23
to hahnlab-cafe
Hello,

thank you for your response. 
I changed the branch lengths by scaling them 10x and 100x, but both of them returned the same error in cafe at the step of computing p-values. The output is like before:

Inferring processes for Base model

Score (-lnL): 375046.25200928

Maximum possible lambda for this topology: 0.061570667733892

Computing pvalues...

terminate called after throwing an instance of 'std::out_of_range'

  what():  vector::_M_range_check: __n (which is 724) >= this->size() (which is 724)

/var/lib/slurmd/job19197426/slurm_script: line 12: 16990 Aborted    


I'm bummed! If it is a bug with CAFE then would I have to wait for an update to try again? In the meantime if theres no other solution I could try to start the whole process again.


Thank you,

Sebastian


Ben Fulton

unread,
Jul 21, 2023, 11:22:22 AM7/21/23
to hahnlab-cafe
I think this is a bug in CAFE in handling family sizes > 1000. You don't actually have any families that large, but you do have a family greater than 900, and CAFE is generating some families >1000 in order to calculate the pvalue for it. You have a couple of choices, besides waiting for a fix; the first is just to remove that family from your file. That should allow CAFE to successfully calculate the pvalue. The other option is to modify the line in configure.ac that says

AC_DEFINE(MAX_STACK_FAMILY_SIZE, 1000, Maximum family size for stack allocations)

Change the 1000 to 1500 or so, and rebuild the application. 

Let me know if you have any questions.
--
Ben Fulton
Indiana University

Reply all
Reply to author
Forward
0 new messages