Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.2 KB

File metadata and controls

50 lines (35 loc) · 1.2 KB

convergence

R-CMD-check

R package for detecting convergent substitutions in phylogenetic trees.

Installation

# install.packages("devtools")
devtools::install_github("SamT123/convergence")

Usage

library(convergence)

# Create tree and sequences object
tree_and_sequences <- makeTreeAndSequences(tree, sequences)

# Add ancestral state reconstruction
tree_and_sequences <- addASRusher(tree_and_sequences, aa_ref, nuc_ref)

# Calculate tree size and nucleotide rates
tree_info <- getTreeSizeAndNucRates(
  tree_and_sequences,
  noise_model = maxlike_models$normal_model
)

# Get substitution ratios for positions of interest
ratios <- getSubstitutionRatios(
  tree_and_sequences,
  tree_info$nuc_rates,
  tree_info$tree_size_fn,
  tree_info$sampling_function,
  positions = 1:550
)

External Dependencies

Requires external tools: