Skip to content

Commit

Permalink
for v0.3.1: support for julia v1.6, DataFrames v1.0, etc. (#13)
Browse files Browse the repository at this point in the history
thanks CompatHelper and github-actions!
  • Loading branch information
github-actions[bot] committed Apr 30, 2021
1 parent 4387502 commit 8667eb5
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -4,7 +4,7 @@ os:
- linux
- osx
julia:
- 1.5
- 1.6

notifications:
email: false
Expand All @@ -25,7 +25,7 @@ coveralls: true
jobs:
include:
- stage: "Documentation"
julia: 1.5
julia: 1.6
os: linux
script:
- julia --project=docs/ -e 'using Pkg; Pkg.instantiate();
Expand Down
8 changes: 4 additions & 4 deletions Project.toml
@@ -1,7 +1,7 @@
name = "QuartetNetworkGoodnessFit"
uuid = "1382f7fc-2744-4d9d-8ec6-1e3efdec0746"
authors = ["Cecile Ane <cecileane@users.noreply.github.com>"]
version = "0.3.0"
version = "0.3.1"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand All @@ -18,9 +18,9 @@ StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"

[compat]
CSV = "0.4, 0.5, 0.6, 0.7, 0.8"
DataFrames = "0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22"
DataFrames = "0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 1.0"
NLopt = "0.5.1, 0.6"
PhyloNetworks = "0.11, 0.12, 0.13"
PhyloNetworks = "0.11, 0.12, 0.13, 0.14"
SpecialFunctions = "0.8, 0.9, 0.10, 1.0"
StatsFuns = "0.7, 0.8, 0.9"
julia = "1.2, 1.3, 1.4, 1.5"
julia = "1.2, 1.3, 1.4, 1.5, 1.6"
3 changes: 1 addition & 2 deletions docs/Project.toml
Expand Up @@ -6,6 +6,5 @@ DocumenterMarkdown = "997ab1e6-3595-5248-9280-8efb232c3433"
PhyloNetworks = "33ad39ac-ed31-50eb-9b15-43d0656eaa72"

[compat]
CSV = "0.7"
DataFrames = "0.21"
CSV = "0.8"
Documenter = "~0.26"
6 changes: 3 additions & 3 deletions docs/src/man/gof.md
Expand Up @@ -13,7 +13,7 @@ proportion of genes estimated to have each 4-taxon unrooted topology.

```@repl gof
using QuartetNetworkGoodnessFit, DataFrames, CSV
qCF = DataFrame!(CSV.File(joinpath(dirname(pathof(QuartetNetworkGoodnessFit)), "..","test","example_qCF_5taxa.csv")));
qCF = DataFrame(CSV.File(joinpath(dirname(pathof(QuartetNetworkGoodnessFit)), "..","test","example_qCF_5taxa.csv")), copycols=false);
qCF
```

Expand Down Expand Up @@ -45,7 +45,7 @@ lengths in the network, in coalescent units, before quantifying the
goodness-of-fit.

```@repl gof
res0 = quarnetGoFtest!(net0, qCF, true; seed=234, nsim=2);
res0 = quarnetGoFtest!(net0, qCF, true; seed=201, nsim=3);
nothing # hide
```

Expand All @@ -58,7 +58,7 @@ net0 = res0[5]
Now we re-run the test using the option `false` to not re-optimize
branch lengths. We use `nsim=200` simulations below to make
this example faster. For a real data analysis, delete the `nsim` option
to use the default instead (1000) or specify higher value.
to use the default instead (1000) or specify a higher value.

```@repl gof
res0 = quarnetGoFtest!(net0, qCF, false; seed=234, nsim=200);
Expand Down
4 changes: 0 additions & 4 deletions test/Project.toml
Expand Up @@ -4,7 +4,3 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
PhyloNetworks = "33ad39ac-ed31-50eb-9b15-43d0656eaa72"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
CSV = "0.7"
DataFrames = "0.21"
7 changes: 4 additions & 3 deletions test/test_qnetGoF.jl
@@ -1,6 +1,6 @@
@testset "testing GoF, multinomial distribution" begin

df = DataFrame!(CSV.File(joinpath(dirname(Base.find_package("PhyloNetworks")),"..","examples","buckyCF.csv")))
df = DataFrame(CSV.File(joinpath(dirname(Base.find_package("PhyloNetworks")),"..","examples","buckyCF.csv")), copycols=false)
d0 = readTableCF(df)
d = deepcopy(d0)
net3 = readTopology("((((D:0.4,C:0.4):4.8,((A:0.8,B:0.8):2.2)#H1:2.2::0.7):4.0,(#H1:0::0.3,E:3.0):6.2):2.0,O:11.2);");
Expand Down Expand Up @@ -63,12 +63,13 @@ Distributed.addprocs(2)
# start with: julia -p 2 --project
# or: using Distributed; @everywhere begin; using Pkg; Pkg.activate("."); using PhyloNetworks; end
@everywhere using QuartetNetworkGoodnessFit
netresult1 = quarnetGoFtest!(net3,d,false; seed=1456, nsim=5);
netresult1 = quarnetGoFtest!(net3,d,false; seed=2298, nsim=5);
@test netresult1[4] [0.0024449826689709165,0.01496306673600063,0.01496306673600063,0.0024449826689709165,0.04086460431063039,0.9998541057240138,0.1901450501005025,0.8909735618259936,0.9058717147295428,0.8909735618259936,0.1901450501005025,0.9058717147295428,0.9913859984840471,0.3656465603640152,0.04086460431063039]
@test netresult1[2] 6.21966321647047 # z stat, uncorrected
@test netresult1[3] 3.405362128771355 # sigma
@test netresult1[6] vcat(7.4043609719886545, repeat([-0.8885233166386386],4))
netresult1 = quarnetGoFtest!(net3,d,true; seed=182, nsim=2, quartetstat=:Qlog);
netresult1 = (@test_logs (:warn, r"far from 0") quarnetGoFtest!(net3,d,true; seed=182, nsim=2, quartetstat=:Qlog));
# just because 2 simulated z's only, and same values bc tiny network. may break with different RNG
# note: with verbose=true, we see hybrid-lambda's warnings:
# WARNING! NOT ULTRAMETRIC!!!
# WARNING: Gene tree is not ultrametric
Expand Down
4 changes: 2 additions & 2 deletions test/test_ticr.jl
@@ -1,7 +1,7 @@
@testset "testing TICR, Dirichlet distribution" begin
# previously in PhyloNetworks

df = DataFrame!(CSV.File(joinpath(dirname(Base.find_package("PhyloNetworks")),"..","examples","buckyCF.csv")));
df = DataFrame(CSV.File(joinpath(dirname(Base.find_package("PhyloNetworks")),"..","examples","buckyCF.csv")), copycols=false);
d = readTableCF(df);

@testset "ticr! on data frame, tree" begin
Expand All @@ -23,7 +23,7 @@ result3 = ticr!(net2_1,d,false);
@test result3[1] 0.06932031690660927 # p-value, from R
@test result3[3] == Dict("[0.0, 0.01)"=>2, "[0.01, 0.05)"=>0, "[0.05, 0.1)"=>2, "[0.1, 1.0]"=>11)
@test result3[4][2] 54.241562916699216 # pseudo log-lik obtained from R
@test result3[4][1] 20.128258663235194 # alpha obtained from R
@test result3[4][1] 20.128258663235194 atol=1e-5 # alpha obtained from R
result3_1 = ticr!(net2_1,d,false; test=:goodness);
@test result3_1[2] 25.962962962962965463 # chi-squared statistic obtained from R
@test result3_1[1] 9.7092282251534852702e-06 # p-value obtained from R
Expand Down

0 comments on commit 8667eb5

Please sign in to comment.