Skip to content

Commit e891d9a

Browse files
Merge pull request #101 from juliangehring/develop
Release v0.4.0
2 parents 20f206d + f70264c commit e891d9a

23 files changed

+204
-75
lines changed

.appveyor.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
4-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
3+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.7/julia-0.7-latest-win64.exe"
54

65
matrix:
76
fast_finish: true
8-
allow_failures:
9-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
107

118
notifications:
129
- provider: Email

.travis.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@ os:
44
- linux
55

66
julia:
7-
- 0.6
8-
- nightly
7+
- 0.7
98

109
matrix:
1110
fast_finish: true
12-
allow_failures:
13-
- julia: nightly
1411

1512
notifications:
1613
email:
@@ -23,5 +20,4 @@ script:
2320

2421
after_success:
2522
- julia -e 'cd(Pkg.dir("MultipleTesting")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder(), flags="julia_$(VERSION.major)_$(VERSION.minor)")'
26-
- julia -e 'Pkg.add("Documenter")'
27-
- julia -e 'cd(Pkg.dir("MultipleTesting")); include(joinpath("docs", "make.jl"))'
23+
- julia -e 'cd(Pkg.dir("MultipleTesting")); Pkg.add("Documenter"); include(joinpath("docs", "make.jl"))'

NEWS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# MultipleTesting.jl News and Changes
22

3+
## Version 0.4.0
4+
5+
### Changes
6+
7+
#### User-facing changes
8+
9+
- Require julia v0.7 as the minimum version, drop support for julia v0.6
10+
- Describe package features in the documentation
11+
12+
13+
### Support
14+
15+
- Requires julia 0.7
16+
17+
318
## Version 0.3.1
419

520
### New Features

REQUIRE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
julia 0.6
2-
StatsBase 0.15.0
3-
Distributions 0.14.1
1+
julia 0.7
2+
StatsBase 0.24.0
3+
Distributions 0.16.1
44
SpecialFunctions 0.3.8

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ makedocs(
2424

2525
deploydocs(
2626
repo = "github.com/juliangehring/MultipleTesting.jl.git",
27-
julia = "0.6",
27+
julia = "0.7",
2828
target = "build",
2929
deps = nothing,
3030
make = nothing

docs/src/index.md

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,110 @@ end
88
```
99

1010

11-
## Package Features
11+
The `MultipleTesting` package offers common algorithms for p-value adjustment
12+
and combination as well as the estimation of the proportion π₀ of true null
13+
hypotheses.
14+
15+
![xkcd p-value guide](https://imgs.xkcd.com/comics/p_values.png)
16+
17+
18+
## Features
19+
20+
### Adjustment of p-values
21+
22+
* Bonferroni
23+
* Benjamini-Hochberg
24+
* Adaptive Benjamini-Hochberg with known π₀ or π₀ estimation method (see section below)
25+
* Benjamini-Yekutieli
26+
* Benjamini-Liu
27+
* Hochberg
28+
* Holm
29+
* Hommel
30+
* Sidak
31+
* Forward Stop
32+
* Barber-Candès
33+
34+
```julia
35+
adjust(pvals, Bonferroni())
36+
adjust(pvals, BenjaminiHochberg())
37+
adjust(pvals, BenjaminiHochbergAdaptive(0.9))
38+
adjust(pvals, BenjaminiHochbergAdaptive(Storey()))
39+
adjust(pvals, BenjaminiYekutieli())
40+
adjust(pvals, BenjaminiLiu())
41+
adjust(pvals, Hochberg())
42+
adjust(pvals, Holm())
43+
adjust(pvals, Hommel())
44+
adjust(pvals, Sidak())
45+
adjust(pvals, ForwardStop())
46+
adjust(pvals, BarberCandes())
47+
```
48+
49+
The adjustment can also be performed on the `k` smallest out of `n` p-values:
50+
51+
```julia
52+
adjust(pvals, n, PValueAdjustmentMethod)
53+
```
54+
55+
56+
### Estimation of π₀
57+
58+
* Storey
59+
* Storey's closed-form bootstrap
60+
* Least Slope
61+
* Two Step
62+
* RightBoundary (Storey's estimate with dynamically chosen λ)
63+
* Beta-Uniform Mixture (BUM)
64+
* Censored BUM
65+
* Flat Grenander
66+
* Oracle for known π₀
67+
68+
```julia
69+
estimate_pi0(pvals, Storey())
70+
estimate_pi0(pvals, StoreyBootstrap())
71+
estimate_pi0(pvals, LeastSlope())
72+
estimate_pi0(pvals, TwoStep())
73+
estimate_pi0(pvals, TwoStep(0.05))
74+
estimate_pi0(pvals, TwoStep(0.05, BenjaminiHochbergAdaptive(0.9))
75+
estimate_pi0(pvals, RightBoundary())
76+
estimate_pi0(pvals, CensoredBUM())
77+
estimate_pi0(pvals, BUM())
78+
estimate_pi0(pvals, FlatGrenander())
79+
estimate_pi0(pvals, Oracle(0.9))
80+
```
81+
82+
83+
### Combination of p-values
84+
85+
* Fisher
86+
* Stouffer, optionally with weights
87+
* Logit
88+
* Tippett
89+
* Simes
90+
* Wilkinson
91+
* Minimum of adjusted p-values
92+
93+
```julia
94+
combine(pvals, FisherCombination())
95+
combine(pvals, StoufferCombination())
96+
combine(pvals, weights, StoufferCombination())
97+
combine(pvals, LogitCombination())
98+
combine(pvals, TippettCombination())
99+
combine(pvals, SimesCombination())
100+
combine(pvals, WilkinsonCombination(rank))
101+
combine(pvals, MinimumCombination(PValueAdjustment()))
102+
```
103+
104+
105+
### Higher criticism
106+
107+
* Higher criticism scores
108+
* Higher criticism threshold
109+
110+
```julia
111+
estimate(pvals, HigherCriticismScores())
112+
estimate(pvals, HigherCriticismThreshold())
113+
```
114+
12115
13116
## Manual
14117

src/MultipleTesting.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import Distributions: estimate
1717

1818
import SpecialFunctions: digamma
1919

20+
import Random: shuffle!
21+
2022
export
2123
PValues,
2224
adjust,

src/combinations.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function combine(pValues::PValues{T}, method::StoufferCombination)::T where T<:A
166166
if minimum(pValues) == 0 || maximum(pValues) == 1
167167
return NaN
168168
end
169-
z = cquantile.(Normal(), pValues)
169+
z = cquantile.(Ref(Normal()), pValues)
170170
z = sum(z) ./ sqrt(n)
171171
p = ccdf(Normal(), z)
172172
return p
@@ -180,7 +180,7 @@ function combine(pValues::PValues{T}, weights::AbstractVector{R}, method::Stouff
180180
if minimum(pValues) == 0 || maximum(pValues) == 1
181181
return NaN
182182
end
183-
z = cquantile.(Normal(), pValues) .* weights
183+
z = cquantile.(Ref(Normal()), pValues) .* weights
184184
z = sum(z) ./ sqrt(sum(abs2, weights))
185185
p = ccdf(Normal(), z)
186186
return p
@@ -307,7 +307,7 @@ function combine(pValues::PValues{T}, method::WilkinsonCombination)::T where T<:
307307
if rank < 1 || rank > n
308308
throw(ArgumentError("Rank must be in 1,..,$(n)"))
309309
end
310-
p_rank = select(pValues, rank) # faster than `sort(pValues)[rank]`
310+
p_rank = partialsort(pValues, rank)
311311
p = cdf(Beta(rank, n-rank+1), p_rank)
312312
return p
313313
end

src/higher-criticism.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function estimate(pValues::PValues{T}, method::HigherCriticismScores) where T<:A
3636
denom = F .* (one(T) .- F) ./ n
3737
# avoid denominator of 0 for last value
3838
idx0 = denom .== 0
39-
denom[idx0] = minimum(denom[.!idx0]) .+ eps() # conservative
39+
denom[idx0] .= minimum(denom[.!idx0]) .+ eps() # conservative
4040
hcs = abs.(F .- pValues) ./ sqrt.(denom)
4141
return hcs
4242
end
@@ -68,6 +68,6 @@ struct HigherCriticismThreshold
6868
end
6969

7070
function estimate(pValues::PValues{T}, method::HigherCriticismThreshold) where T<:AbstractFloat
71-
idx_hcv = indmax(estimate(pValues, HigherCriticismScores()))
71+
idx_hcv = argmax(estimate(pValues, HigherCriticismScores()))
7272
return pValues[idx_hcv]
7373
end

src/model.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ partitioning the empirical distribution of p-values. Bioinformatics 19,
4343
4444
"""
4545
function BetaUniformMixtureModel(π0::AbstractFloat, α::AbstractFloat = 0.5, β::AbstractFloat = 1.0)
46-
if !isin(π0, 0., 1.)
47-
throw(DomainError())
48-
end
49-
MixtureModel([Beta(α, β), Uniform()], [1-π0, π0])
46+
isin(π0, 0, 1) || throw(DomainError("π0 must be in [0, 1]"))
47+
bum = MixtureModel([Beta(α, β), Uniform()], [1-π0, π0])
48+
return bum
5049
end

0 commit comments

Comments
 (0)