Skip to content

Commit d38046a

Browse files
Merge branch 'dev' into general-step-functions
2 parents dbea112 + 96fd750 commit d38046a

File tree

8 files changed

+69
-45
lines changed

8 files changed

+69
-45
lines changed

README.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ The `MultipleTesting` package offers common algorithms for p-value adjustment an
55
![xkcd p-value guide](pvalues.png)
66

77

8-
## Package Status
9-
10-
[![Package Status](http://pkg.julialang.org/badges/MultipleTesting_0.5.svg)](http://pkg.julialang.org/?pkg=MultipleTesting)
11-
[![Linux/Mac Build Status](https://travis-ci.org/juliangehring/MultipleTesting.jl.svg?branch=master)](https://travis-ci.org/juliangehring/MultipleTesting.jl)
12-
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/1ld0ppptisirryt1/branch/master?svg=true)](https://ci.appveyor.com/project/juliangehring/multipletesting-jl/branch/master)
13-
[![Coverage Status](https://codecov.io/gh/juliangehring/MultipleTesting.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/juliangehring/MultipleTesting.jl)
14-
15-
168
## Features
179

1810
### Adjustment of p-values
@@ -76,7 +68,7 @@ estimate_pi0(pvals, Oracle(0.9))
7668
```
7769
7870
79-
### p-values combination
71+
### Combination of p-values
8072
8173
* Fisher
8274
* Stouffer, optionally with weights
@@ -96,3 +88,35 @@ combine(pvals, SimesCombination())
9688
combine(pvals, WilkinsonCombination(rank))
9789
combine(pvals, MinimumCombination(PValueAdjustment()))
9890
```
91+
92+
93+
## Installation
94+
95+
The `MultipleTesting` package is part of the Julia ecosphere and the latest
96+
release version can be installed with
97+
98+
```julia
99+
Pkg.add("MultipleTesting")
100+
```
101+
102+
More details on packages and how to manage them can be found in the
103+
[package section](http://docs.julialang.org/en/stable/manual/packages/#adding-and-removing-packages)
104+
of the Julia documentation.
105+
106+
107+
## Feedback and Contributions
108+
109+
Contributions of any kind are very welcome. Please feel free to open pull
110+
requests or issues with your questions or ideas.
111+
112+
113+
## Package Status
114+
115+
The package is actively developed and uses [semantic versioning](http://semver.org/).
116+
117+
[![DOI](https://zenodo.org/badge/27935122.svg)](https://zenodo.org/badge/latestdoi/27935122)
118+
119+
[![Package Status](http://pkg.julialang.org/badges/MultipleTesting_0.5.svg)](http://pkg.julialang.org/?pkg=MultipleTesting)
120+
[![Linux/Mac Build Status](https://travis-ci.org/juliangehring/MultipleTesting.jl.svg?branch=master)](https://travis-ci.org/juliangehring/MultipleTesting.jl)
121+
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/1ld0ppptisirryt1/branch/master?svg=true)](https://ci.appveyor.com/project/juliangehring/multipletesting-jl/branch/master)
122+
[![Coverage Status](https://codecov.io/gh/juliangehring/MultipleTesting.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/juliangehring/MultipleTesting.jl)

src/MultipleTesting.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using Distributions
1616
export
1717
PValues,
1818
adjust,
19-
PValueAdjustmentMethod,
19+
PValueAdjustment,
2020
Bonferroni,
2121
BenjaminiHochberg,
2222
BenjaminiHochbergAdaptive,
@@ -44,7 +44,7 @@ export
4444
isin,
4545
fit,
4646
BetaUniformMixtureModel,
47-
PValueCombinationMethod,
47+
PValueCombination,
4848
combine,
4949
FisherCombination,
5050
LogitCombination,

src/combinations.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
### Combination methods for p-values ###
22

3-
combine{T<:AbstractFloat, M<:PValueCombinationMethod}(pValues::AbstractVector{T}, method::M) = combine(PValues(pValues), method)
3+
combine{T<:AbstractFloat, M<:PValueCombination}(pValues::AbstractVector{T}, method::M) = combine(PValues(pValues), method)
44

5-
combine{T<:AbstractFloat, M<:PValueCombinationMethod}(pValues::AbstractVector{T}, weights::WeightVec, method::M) = combine(PValues(pValues), weights, method)
5+
combine{T<:AbstractFloat, M<:PValueCombination}(pValues::AbstractVector{T}, weights::WeightVec, method::M) = combine(PValues(pValues), weights, method)
66

7-
combine{T<:AbstractFloat, R<:Real, M<:PValueCombinationMethod}(pValues::AbstractVector{T}, weights::AbstractVector{R}, method::M) = combine(PValues(pValues), weights, method)
7+
combine{T<:AbstractFloat, R<:Real, M<:PValueCombination}(pValues::AbstractVector{T}, weights::AbstractVector{R}, method::M) = combine(PValues(pValues), weights, method)
88

99

1010
## Fisher combination ##
1111

12-
immutable FisherCombination <: PValueCombinationMethod
12+
immutable FisherCombination <: PValueCombination
1313
end
1414

1515
function combine{T<:AbstractFloat}(pValues::PValues{T}, method::FisherCombination)
@@ -32,7 +32,7 @@ end
3232

3333
## Logit combination ##
3434

35-
immutable LogitCombination <: PValueCombinationMethod
35+
immutable LogitCombination <: PValueCombination
3636
end
3737

3838
function combine{T<:AbstractFloat}(pValues::PValues{T}, method::LogitCombination)
@@ -57,7 +57,7 @@ end
5757

5858
## Stouffer combination ##
5959

60-
immutable StoufferCombination <: PValueCombinationMethod
60+
immutable StoufferCombination <: PValueCombination
6161
end
6262

6363
function combine{T<:AbstractFloat}(pValues::PValues{T}, method::StoufferCombination)
@@ -105,7 +105,7 @@ end
105105

106106
## Tippett combination ##
107107

108-
immutable TippettCombination <: PValueCombinationMethod
108+
immutable TippettCombination <: PValueCombination
109109
end
110110

111111
function combine{T<:AbstractFloat}(pValues::PValues{T}, method::TippettCombination)
@@ -124,7 +124,7 @@ end
124124

125125
## Simes combination ##
126126

127-
immutable SimesCombination <: PValueCombinationMethod
127+
immutable SimesCombination <: PValueCombination
128128
end
129129

130130
function combine{T<:AbstractFloat}(pValues::PValues{T}, method::SimesCombination)
@@ -144,7 +144,7 @@ end
144144

145145
## Wilkinson combination ##
146146

147-
immutable WilkinsonCombination <: PValueCombinationMethod
147+
immutable WilkinsonCombination <: PValueCombination
148148
rank::Int
149149

150150
function WilkinsonCombination(rank)
@@ -175,15 +175,15 @@ end
175175

176176
## Generalised minimum combination ##
177177

178-
immutable MinimumCombination <: PValueCombinationMethod
179-
method::PValueAdjustmentMethod
178+
immutable MinimumCombination <: PValueCombination
179+
method::PValueAdjustment
180180
end
181181

182182
function combine{T<:AbstractFloat}(pValues::PValues{T}, method::MinimumCombination)
183183
minimum_combination(pValues, method.method)
184184
end
185185

186-
function minimum_combination{T<:AbstractFloat}(pValues::PValues{T}, pAdjustMethod::PValueAdjustmentMethod)
186+
function minimum_combination{T<:AbstractFloat}(pValues::PValues{T}, pAdjustMethod::PValueAdjustment)
187187
n = length(pValues)
188188
if n == 1
189189
return pValues[1]

src/pi0-estimators.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Reference: Benjamini, Krieger and Yekutieli, 2006
157157
"""
158158
immutable TwoStep <: Pi0Estimator
159159
α::AbstractFloat
160-
method::PValueAdjustmentMethod
160+
method::PValueAdjustment
161161

162162
TwoStep(α, method) = isin(α, 0., 1.) ? new(α, method) : throw(DomainError())
163163
end
@@ -170,7 +170,7 @@ function estimate_pi0{T<:AbstractFloat}(pValues::PValues{T}, pi0estimator::TwoSt
170170
twostep_pi0(pValues, pi0estimator.α, pi0estimator.method)
171171
end
172172

173-
function twostep_pi0{T<:AbstractFloat}(pValues::AbstractVector{T}, alpha::AbstractFloat, method::PValueAdjustmentMethod)
173+
function twostep_pi0{T<:AbstractFloat}(pValues::AbstractVector{T}, alpha::AbstractFloat, method::PValueAdjustment)
174174
padj = adjust(pValues, method)
175175
pi0 = sum(padj .>= (alpha/(1+alpha))) / length(padj)
176176
return(pi0)

src/pval-adjustment.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
# promotion from float vectors to PValues type
44

5-
adjust{T<:AbstractFloat, M<:PValueAdjustmentMethod}(pvals::Vector{T}, method::M) = adjust(PValues(pvals), method)
5+
adjust{T<:AbstractFloat, M<:PValueAdjustment}(pvals::Vector{T}, method::M) = adjust(PValues(pvals), method)
66

7-
adjust{T<:AbstractFloat, M<:PValueAdjustmentMethod}(pvals::Vector{T}, n::Int, method::M) = adjust(PValues(pvals), n, method)
7+
adjust{T<:AbstractFloat, M<:PValueAdjustment}(pvals::Vector{T}, n::Int, method::M) = adjust(PValues(pvals), n, method)
88

99

1010
# Bonferroni
1111

12-
immutable Bonferroni <: PValueAdjustmentMethod
12+
immutable Bonferroni <: PValueAdjustment
1313
end
1414

1515
adjust(pvals::PValues, method::Bonferroni) = adjust(pvals, length(pvals), method)
@@ -25,7 +25,7 @@ end
2525

2626
# Benjamini-Hochberg
2727

28-
immutable BenjaminiHochberg <: PValueAdjustmentMethod
28+
immutable BenjaminiHochberg <: PValueAdjustment
2929
end
3030

3131
adjust(pvals::PValues, method::BenjaminiHochberg) = adjust(pvals, length(pvals), method)
@@ -49,7 +49,7 @@ bejamini_hochberg_step(p::AbstractFloat, i::Int, k::Int, n::Int) = p * n/(k-i)
4949

5050
# Benjamini-Hochberg Adaptive
5151

52-
immutable BenjaminiHochbergAdaptive <: PValueAdjustmentMethod
52+
immutable BenjaminiHochbergAdaptive <: PValueAdjustment
5353
pi0estimator::Pi0Estimator
5454
end
5555

@@ -68,7 +68,7 @@ end
6868

6969
# Benjamini-Yekutieli
7070

71-
immutable BenjaminiYekutieli <: PValueAdjustmentMethod
71+
immutable BenjaminiYekutieli <: PValueAdjustment
7272
end
7373

7474
adjust(pvals::PValues, method::BenjaminiYekutieli) = adjust(pvals, length(pvals), method)
@@ -92,7 +92,7 @@ benjamini_yekutieli_step(p::AbstractFloat, i::Int, k::Int, n::Int) = p * harmoni
9292

9393
# Benjamini-Liu
9494

95-
immutable BenjaminiLiu <: PValueAdjustmentMethod
95+
immutable BenjaminiLiu <: PValueAdjustment
9696
end
9797

9898
adjust(pvals::PValues, method::BenjaminiLiu) = adjust(pvals, length(pvals), method)
@@ -121,7 +121,7 @@ end
121121

122122
# Hochberg
123123

124-
immutable Hochberg <: PValueAdjustmentMethod
124+
immutable Hochberg <: PValueAdjustment
125125
end
126126

127127
adjust(pvals::PValues, method::Hochberg) = adjust(pvals, length(pvals), method)
@@ -145,7 +145,7 @@ hochberg_step(p::AbstractFloat, i::Int, k::Int, n::Int) = p * (n-k+i+1)
145145

146146
# Holm
147147

148-
immutable Holm <: PValueAdjustmentMethod
148+
immutable Holm <: PValueAdjustment
149149
end
150150

151151
adjust(pvals::PValues, method::Holm) = adjust(pvals, length(pvals), method)
@@ -169,7 +169,7 @@ holm_step(p::AbstractFloat, i::Int, k::Int, n::Int) = p * (n-i+1)
169169

170170
# Hommel
171171

172-
immutable Hommel <: PValueAdjustmentMethod
172+
immutable Hommel <: PValueAdjustment
173173
end
174174

175175
adjust(pvals::PValues, method::Hommel) = adjust(pvals, length(pvals), method)
@@ -201,7 +201,7 @@ end
201201

202202
# Sidak
203203

204-
immutable Sidak <: PValueAdjustmentMethod
204+
immutable Sidak <: PValueAdjustment
205205
end
206206

207207
adjust(pvals::PValues, method::Sidak) = adjust(pvals, length(pvals), method)
@@ -216,7 +216,7 @@ end
216216

217217
# Forward Stop
218218

219-
immutable ForwardStop <: PValueAdjustmentMethod
219+
immutable ForwardStop <: PValueAdjustment
220220
end
221221

222222
adjust(pvals::PValues, method::ForwardStop) = adjust(pvals, length(pvals), method)

src/types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ abstract Pi0Estimator
44

55
abstract Pi0Fit
66

7-
abstract PValueAdjustmentMethod
7+
abstract PValueAdjustment
88

99
# consistent naming
10-
abstract PValueCombinationMethod
10+
abstract PValueCombination
1111

1212

1313
## concrete types ##

test/test-combinations.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ using Base.Test
4646

4747
@testset "$(method)" for method in keys(ref2)
4848

49-
@test issubtype(method, PValueCombinationMethod)
50-
@test issubtype(typeof(method()), PValueCombinationMethod)
49+
@test issubtype(method, PValueCombination)
50+
@test issubtype(typeof(method()), PValueCombination)
5151

5252
ref = ref1[method]
5353
@test isapprox( combine(PValues(p1), method()), ref, atol = 1e-8)
@@ -75,7 +75,7 @@ using Base.Test
7575
@test_throws MethodError WilkinsonCombination() # TODO default value
7676
@test_throws ArgumentError WilkinsonCombination(0)
7777

78-
@test issubtype(typeof(method), PValueCombinationMethod)
78+
@test issubtype(typeof(method), PValueCombination)
7979

8080
# Wilkinson with rank = 1 is Tippett's method
8181
ref = ref1[TippettCombination]
@@ -117,7 +117,7 @@ using Base.Test
117117

118118
padj_comb = MinimumCombination( p_adjustment() )
119119

120-
@test issubtype(typeof(padj_comb), PValueCombinationMethod)
120+
@test issubtype(typeof(padj_comb), PValueCombination)
121121

122122
@test isapprox( combine(PValues(p1), padj_comb), ref1[p_combination], atol = 1e-8)
123123
@test isapprox( combine(p1, padj_comb), ref1[p_combination], atol = 1e-8)

test/test-pval-adjustment.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ using Base.Test
4646

4747
@testset "pvalue adjustment $method" for method in keys(ref1)
4848

49-
@test issubtype(method, PValueAdjustmentMethod)
50-
@test issubtype(typeof(method()), PValueAdjustmentMethod)
49+
@test issubtype(method, PValueAdjustment)
50+
@test issubtype(typeof(method()), PValueAdjustment)
5151

5252
@test_throws MethodError method(0.1)
5353

0 commit comments

Comments
 (0)