Skip to content

Commit

Permalink
Merge pull request #168 from KlausVigo/master
Browse files Browse the repository at this point in the history
sync Armadillo
  • Loading branch information
KlausVigo authored Jun 19, 2024
2 parents 5e2ff98 + 5c33b58 commit 2eedf1a
Show file tree
Hide file tree
Showing 130 changed files with 4,470 additions and 1,995 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
^vignettes/MLbyHand_cache$
^vignettes/AdvancedFeatures_cache$
^vignettes/logo.png
^codemeta\.json$
^codecov\.yml$
18 changes: 18 additions & 0 deletions .github/workflows/recheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
workflow_dispatch:
inputs:
which:
type: choice
description: Which dependents to check
options:
- strong
- most

name: Reverse dependency check

jobs:
revdep_check:
name: Reverse check ${{ inputs.which }} dependents
uses: r-devel/recheck/.github/workflows/recheck.yml@v1
with:
which: ${{ inputs.which }}
23 changes: 17 additions & 6 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,54 @@ on:

name: test-coverage

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
covr::codecov(
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
15 changes: 9 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: phangorn
Title: Phylogenetic Reconstruction and Analysis
Version: 2.12.0.900
Version: 3.0.0.0
Authors@R:
c(person("Klaus", "Schliep", role = c("aut", "cre"),
email = "[email protected]",
Expand Down Expand Up @@ -38,12 +38,14 @@ URL: https://github.com/KlausVigo/phangorn,
https://klausvigo.github.io/phangorn/
BugReports: https://github.com/KlausVigo/phangorn/issues
Depends:
ape (>= 5.7),
ape (>= 5.8),
R (>= 4.1.0)
Imports:
digest,
fastmatch,
generics,
ggseqlogo,
ggplot2,
graphics,
grDevices,
igraph (>= 1.0),
Expand All @@ -62,18 +64,19 @@ Suggests:
rgl,
rmarkdown,
seqinr,
seqLogo,
testthat (>= 3.0.0),
tinytest,
vdiffr,
xtable
LinkingTo:
Rcpp, RcppArmadillo
Remotes: github::emmanuelparadis/ape
Rcpp
VignetteBuilder:
knitr,
utils
biocViews: Software, Technology, QualityControl
Encoding: UTF-8
Repository: CRAN
Roxygen: list(old_usage = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Language: en-US
Config/testthat/edition: 3
36 changes: 34 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ S3method(as.data.frame,phyDat)
S3method(as.matrix,splits)
S3method(as.networx,phylo)
S3method(as.networx,splits)
S3method(as.phyDat,AAStringSet)
S3method(as.phyDat,AAbin)
S3method(as.phyDat,DNAStringSet)
S3method(as.phyDat,DNAbin)
S3method(as.phyDat,MultipleAlignment)
S3method(as.phyDat,alignment)
S3method(as.phyDat,ancestral)
S3method(as.phyDat,character)
S3method(as.phyDat,data.frame)
S3method(as.phyDat,factor)
Expand All @@ -40,6 +44,8 @@ S3method(cbind,phyDat)
S3method(cophenetic,networx)
S3method(cophenetic,splits)
S3method(glance,phyDat)
S3method(glance,pml)
S3method(glance,pmlMix)
S3method(hash,multiPhylo)
S3method(hash,phylo)
S3method(identify,networx)
Expand All @@ -55,6 +61,7 @@ S3method(plot,pml)
S3method(plot,pmlCluster)
S3method(plot,pmlPart)
S3method(print,SOWH)
S3method(print,ancestral)
S3method(print,codonTest)
S3method(print,phyDat)
S3method(print,pml)
Expand Down Expand Up @@ -97,12 +104,14 @@ export(addTrivialSplits)
export(add_boxplot)
export(add_ci)
export(add_edge_length)
export(add_support)
export(allCircularSplits)
export(allCompat)
export(allDescendants)
export(allSitePattern)
export(allSplits)
export(allTrees)
export(ancestral)
export(ancestral.pars)
export(ancestral.pml)
export(as.Matrix)
Expand All @@ -123,6 +132,7 @@ export(coalSpeciesTree)
export(codon2dna)
export(codonTest)
export(compatible)
export(composition_test)
export(consensusNet)
export(coords)
export(createLabel)
Expand All @@ -140,10 +150,13 @@ export(dist.p)
export(distanceHadamard)
export(distinct.splits)
export(diversity)
export(dna2aa)
export(dna2codon)
export(edQt)
export(fhm)
export(fitch)
export(gap_as_ambiguous)
export(gap_as_state)
export(genlight2phyDat)
export(getClans)
export(getClips)
Expand All @@ -154,10 +167,13 @@ export(glance)
export(h2st)
export(h4st)
export(hadamard)
export(has_gap_state)
export(hash)
export(keep_as_tip)
export(ldfactorial)
export(lento)
export(lli)
export(ltg2amb)
export(map_duplicates)
export(mast)
export(matchSplits)
Expand All @@ -184,6 +200,7 @@ export(phyDat2alignment)
export(plotAnc)
export(plotBS)
export(plotRates)
export(plotSeqLogo)
export(plot_gamma_plus_inv)
export(pml)
export(pml.control)
Expand All @@ -203,7 +220,6 @@ export(rNNI)
export(rSPR)
export(random.addition)
export(ratchet.control)
export(read.aa)
export(read.nexus.dist)
export(read.nexus.networx)
export(read.nexus.partitions)
Expand All @@ -218,17 +234,20 @@ export(simSeq)
export(splitsNetwork)
export(sprdist)
export(superTree)
export(supgma)
export(threshStateC)
export(tidy)
export(transferBootstrap)
export(treedist)
export(upgma)
export(wRF.dist)
export(wpgma)
export(write.ancestral)
export(write.nexus.dist)
export(write.nexus.networx)
export(write.nexus.splits)
export(write.phyDat)
export(write.pml)
export(write.splits)
export(writeDist)
import(Rcpp)
Expand All @@ -243,6 +262,14 @@ importFrom(Matrix,sparseMatrix)
importFrom(fastmatch,fmatch)
importFrom(generics,glance)
importFrom(generics,tidy)
importFrom(ggplot2,facet_grid)
importFrom(ggplot2,facet_wrap)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,scale_x_continuous)
importFrom(ggseqlogo,geom_logo)
importFrom(ggseqlogo,ggseqlogo)
importFrom(ggseqlogo,make_col_scheme)
importFrom(ggseqlogo,theme_logo)
importFrom(grDevices,adjustcolor)
importFrom(grDevices,col2rgb)
importFrom(grDevices,hcl.colors)
Expand Down Expand Up @@ -274,9 +301,9 @@ importFrom(graphics,title)
importFrom(igraph,E)
importFrom(igraph,all_shortest_paths)
importFrom(igraph,decompose)
importFrom(igraph,graph)
importFrom(igraph,graph_from_adjacency_matrix)
importFrom(igraph,layout_nicely)
importFrom(igraph,make_graph)
importFrom(igraph,shortest_paths)
importFrom(igraph,topo_sort)
importFrom(igraph,vcount)
Expand All @@ -286,8 +313,12 @@ importFrom(stats,AIC)
importFrom(stats,BIC)
importFrom(stats,aggregate)
importFrom(stats,as.dist)
importFrom(stats,binomial)
importFrom(stats,chisq.test)
importFrom(stats,constrOptim)
importFrom(stats,cophenetic)
importFrom(stats,cor)
importFrom(stats,dbinom)
importFrom(stats,dgamma)
importFrom(stats,ecdf)
importFrom(stats,hclust)
Expand All @@ -313,6 +344,7 @@ importFrom(stats,update)
importFrom(stats,xtabs)
importFrom(utils,combn)
importFrom(utils,download.file)
importFrom(utils,head)
importFrom(utils,installed.packages)
importFrom(utils,packageDescription)
importFrom(utils,read.table)
Expand Down
55 changes: 51 additions & 4 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,45 @@
CHANGES in PHANGORN VERSION 2.12.0
CHANGES in PHANGORN VERSION 3.0.0

NEW FEATURES

o new function supgma, performing serial sampled UPGMA

(Drummond, Rodrigo 2000)

o new function gap_as_state, treating gaps as a state.

o new function keep_as_tip allows to prune a tree and keep nodes as a tip

(suggested by Hedvig Skirgård)

o nnls now can estimate trees with calibrations and tip dated trees

o the functions Descendants, Ancestors, Siblings, mrca.phy now also accept a

character vector for the node argument and not only integers.

o Ancestral state reconstructionwas in parts rewritten. Output is now an

object of class ancestral. E.g. ancestral states of constant sites are now

always this state.

o Improvements to several plot functions to get nicer plots out of the box.

o Nicer defaults for plot.pml, mainly for rooted trees.

o plotAnc got an argument scheme allowing to use different color schemes,

especially for amino acid models shared with image.AAbin.

o plot.networx gets two additional arguments, direction is in plot.phylo and

angle to rotate the network.

o new function composition_test comparing indicating possible problems

with base / state composition.


OTHER CHANGES

Expand All @@ -12,11 +53,17 @@ OTHER CHANGES

which were implicitly using "estimated".

o some improvements to pmlPart
o some improvements to pmlPart.

o the sankoff algorithm has been rewritten.

BUG FIXES

o pml_bb roots the tree, if method is either ultrametric or tipdated. Fixes

o nicer defaults for plot.pml
problem when modelTest object was supplied.

o the sankoff algorithm has been rewritten
o nnls.tree now checks if the tree has singletons.


CHANGES in PHANGORN VERSION 2.11.0
Expand Down
10 changes: 7 additions & 3 deletions R/Coalescent.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ comp2 <- function(x, y) {
#' @references Liu, L., Yu, L. and Pearl, D. K. (2010) Maximum tree: a
#' consistent estimator of the species tree. \emph{Journal of Mathematical
#' Biology}, \bold{60}, 95--106.
#' @examples
#' ## example in Liu et al. (2010)
#' tr1 <- read.tree(text = "(((B:0.05,C:0.05):0.01,D:0.06):0.04,A:0.1);")
#' tr2 <- read.tree(text = "(((A:0.07,C:0.07):0.02,D:0.09):0.03,B:0.12);")
#' TR <- c(tr1, tr2)
#' sp_tree <- coalSpeciesTree(TR)
#' @keywords cluster
#'
#' @export
coalSpeciesTree <- function(tree, X = NULL, sTree = NULL) {
if (is.null(X)) return(speciesTree(tree))
Expand Down Expand Up @@ -98,8 +103,7 @@ coalSpeciesTree <- function(tree, X = NULL, sTree = NULL) {
Labels = attr(X, "levels"), Size = l, class = "dist",
Diag = FALSE, Upper = FALSE
)

sTree <- upgma(dm, "single")
sTree <- as.phylo(hclust(dm, method = "single"))
# dm of pairwise states
}
else {
Expand Down
Loading

0 comments on commit 2eedf1a

Please sign in to comment.