Issue with taxon object for dnMultiSpeciesCoalescentUniformPrior RB 1.2.3

16 views
Skip to first unread message

Torsten Hauffe

unread,
May 15, 2024, 5:35:07 AM5/15/24
to revbayes-users
Hi,

Does anyone knows how the taxon object for dnMultiSpeciesCoalescentUniformPrior needs to look like?

The function is not working for me on RB 1.2.3 (rapture-2578-gfc964c) due to a mismatch in the function call related to the taxon object. 
The help says a Taxon[][]<any> taxa is required, which I do not understand.

However, the other multispecies coalescent functions (dnMultiSpeciesCoalescent and dnMultiSpeciesCoalescentUniformPrior) need Taxon[]<any> taxa (one set of square brackets less). 
The latter taxon structure is also required by dnMultiSpeciesCoalescentUniformPrior for RB 1.1 (rapture-1237-gc3d458), which works for me.

Taxon[]<any> taxa  is a vector of taxon objects with names of the individual and the respective species.


Minimal example:

n_species <- 10
n_alleles <- 3
# species names
for (i in 1:n_species) {
    species[i] <- taxon(taxonName="Species_"+i, speciesName="Species_"+i)
}
# simulate an ultrametric species tree
spTree ~ dnBirthDeath(lambda=0.3, mu=0.2, rootAge=10, rho=1, samplingStrategy="uniform", condition="nTaxa", taxa=species)
# constant parameters for the inverse gamma distribution:
alpha <- abs(3.0)
beta <- abs(0.001)
# taxa names
for (i in 1:n_species) {
    for (j in 1:n_alleles) {
        taxons[(i-1)*n_alleles+j] <- taxon(taxonName = "Species_"+i+"_"+j, speciesName = "Species_"+i)
    }
}

# simulate gene tree working with RB 1.1
geneTrees ~ dnMultiSpeciesCoalescentInverseGamma(speciesTree=spTree, shape=alpha, rate=beta, taxa=taxons)

# fail to simulate  with RB 1.2.3
geneTrees ~ dnMultiSpeciesCoalescentInverseGamma(speciesTree=spTree, shape=alpha, scale=beta, num_genes = 1, taxa=taxons)


Thanks for any suggestion,
Torsten
Reply all
Reply to author
Forward
0 new messages