Error in fnDECRateMatrix() function (Biogeography Tutorial)

150 views
Skip to first unread message

Marco

unread,
Mar 21, 2017, 2:34:03 PM3/21/17
to revbayes-users
Dear All,

I am trying to complete the biogeography tutorial. However, I get an error when trying to create the relative rate matrix Q_DEC (page 11 on the tutorial) from the extirpation rates and dispersal rate matrices.

Following exactly the tutorial, I get the following error:

Q_DEC := fnDECRateMatrix(dispersalRates=dr, extirpationRates=er)
   Error:       Argument or label mismatch for function call 'fnDECRateMatrix' with arguments ( Probability[][]<deterministic> 'dispersalRates',
   RealPos[][]<deterministic> 'extirpationRates' ).
   Correct usage is:
   fnDECRateMatrix (RealPos[][]<any> dispersalRates,
                    RealPos[][]<any> extirpationRates,
                    Simplex<any> rangeSize,
                    String<any> nullRange {valid options: "CondSurv"|"Exclude"|"Include"},
                    Natural<any> maxRangeSize)

I am not sure what triggers the error, but by checking the data type of the matrices "dr" and "er", I realised that type(dr) is not assigned as RealPos.

> type(er)
   RealPos[][]
> type(dr)
   Probability[][]

Do you have any idea how to fix the code in order to be able to complete the tutorial?

Another less important comment:

On page 10, when executing the following command:
> state_desc = dat_range_n.getStateDescriptions()
   Error:       No function named 'getStateDescriptions'

Best wishes,
Marco

Michael Landis

unread,
Mar 21, 2017, 3:23:37 PM3/21/17
to Marco, revbayes-users
Hi Marco,

I suspect those two errors might occur under older versions of RevBayes (< v1.0.3) with the newest version of the biogeography tutorial hosted at revbayes.com/tutorials.

Would you try upgrading to v1.0.4? https://github.com/revbayes/revbayes/releases/tag/v1.0.4-release

Best,
Michael
--
You received this message because you are subscribed to the Google Groups "revbayes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to revbayes-user...@googlegroups.com.
To post to this group, send email to revbaye...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/revbayes-users/de598ecd-cf84-4bd7-adb4-0490006b0c1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marco

unread,
Mar 29, 2017, 1:22:47 PM3/29/17
to revbayes-users, marc...@gmail.com
Hi Michael,

after upgrading RevBayes, the function works! Thanks for that.

However, I am running into a different, rather minor problem: While going through the tutorial for species tree inference under the coalescence model, some of the functions don't work.

E.g.:
n_species <- primate_tree.ntips()
   Error:       No function named 'ntips'
similarily with the .taxa() function.

taxa <- primate_tree.taxa()
   Error:       No function named 'taxa'

Am I missing something obvious here?

Thanks for your help,
Marco

Michael Landis

unread,
Mar 30, 2017, 9:02:02 AM3/30/17
to revbayes-users, marc...@gmail.com
Hi Marco,


Unfortunately, I need more info to provide a certain fix. My guess is that your `primate_tree` variable is a vector of Tree objects (Tree[]) rather than a single Tree object. The function `readTrees()` returns a vector of trees, so it's important to select a single Tree (e.g. the first one) from that vector access the features of a Tree.

Some example code:

> phy1 = readTrees("data_msc/primates.tree")
   Attempting to read the contents of file "primates.tree"
   Successfully read file
> type(phy1)
   TimeTree[]
> phy1.ntips()
   Error: No function named 'ntips'

> phy2 = readTrees("data_msc/primates.tree")[1]
   Attempting to read the contents of file "primates.tree"
   Successfully read file
> type(phy2)
   TimeTree
> phy2.ntips()
   23

Hope this helps, but if it doesn't, please provide an example of the code and data that causes the problem: https://groups.google.com/forum/#!topic/revbayes-users/fxSfw8LObVc

Best,
Michael
Reply all
Reply to author
Forward
0 new messages