Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pbastide committed Feb 27, 2024
1 parent b69f4e1 commit 80741de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions R/phylogeneticCorrelations.R
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ get_consensus_tree_OUfixedRoot <- function(phy, all_phyfit, measurement_error, t
}

get_lambda_error_OU <- function(phyfit) {
if (is.na(phyfit$optpar)) return(NA)
tree_model <- phylolm::transf.branch.lengths(phy, "OUfixedRoot",
parameters = list(alpha = phyfit$optpar))$tree
tilde_t <- tree_height(tree_model) / (2 * phyfit$optpar)
Expand Down
4 changes: 2 additions & 2 deletions R/phylolmFit.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ phylolmFit <- function(object, design = NULL, phy, col_species = NULL,

} else {
## one phylo model per gene
C_tree_params <- get_chol_tree(y_data, design, phy, 1, model, measurement_error, REML, ddf_method, ...)
C_tree_params <- get_chol_tree(y_data, design, phy, NULL, model, measurement_error, REML, ddf_method, ...)
C_tree <- C_tree_params$C_tree

ddf_fits <- C_tree_params$ddf
Expand Down Expand Up @@ -271,7 +271,7 @@ get_chol_tree <- function(y_data, design, phy, phy_ind = NULL, model, measuremen
C_tree_chol_and_params <- format_list(C_tree_chol_and_params)
}
} else {
if (!length(unique(phy_ind)) == 1) stop("Can only have one tree in the non BM case.")
if (!is.null(phy_ind)) stop("Can only have one tree in the non BM case.")
C_tree_chol_and_params <- apply(y_data, 1,
get_C_tree, design, phy, model, measurement_error, REML, ddf_method, ...)
C_tree_chol_and_params <- format_list(C_tree_chol_and_params)
Expand Down

0 comments on commit 80741de

Please sign in to comment.