richelbilderbeek / razzo

Research project by Giovanni Laudanno and Richel J.C. Bilderbeek
GNU General Public License v3.0
2 stars 2 forks source link

Create trees with 80-100 tips mean/median #278

Closed richelbilderbeek closed 5 years ago

richelbilderbeek commented 5 years ago

From @rsetienne:

The parameters result in relatively small trees. I would like to see an average/median of about 80-100 tips. Do you think that is possible?

Giappo commented 5 years ago

We need to rescale something by a factor of k. I think we have to options for this:

1) Change the parameters:

I suggest we start with something like k = 10 / 7 and we simulate to obtain the median amount of tips. The we'll adjust for higher or lower k, if necessary.

richelbilderbeek commented 5 years ago

Will write a test to help us guide in our decisions.

richelbilderbeek commented 5 years ago

I have written a test for the function's implementation:

test_that("use", {

  # Issue 278, Issue #278: 'calc_n_taxas' is only a stub

  # Create a testing parameter set
   mbd_paramses <- create_test_mbd_paramses()

  # Per mbd_params, get the number of taxa of the true tree,
  # e.g. by simulating it in the same way razzo already does
  n_taxas <- calc_n_taxas(mbd_paramses)

  # n_taxa is a simple numerical list
  expect_true(is.numeric(n_taxas))

  # with as much elements as the razzo_paramses
  expect_equal(length(mbd_paramses), length(n_taxas))
})
richelbilderbeek commented 5 years ago

@Giappo: I assign you this Issue, as I think you would enjoy it. No worries about the time: I will re-assign to myself when really needing this :+1:

Giappo commented 5 years ago

Will do. What if make calc_n_taxas(mbd_paramses) in such a way we get more info than just the average number of taxa? Something like median+stdev or the entire distribution even

richelbilderbeek commented 5 years ago

calc_n_taxas gives the number of taxa per parameter set, e.g { 1,2,3,4,5,6 }, exactly the raw material we can calculate the mean, median, etc. of.

Giappo commented 5 years ago

Function is available on my branch.

richelbilderbeek commented 5 years ago

Cool, well done :+1: