scieee Science in your language
[en] (orig)

Mann-Whitney type tests for microarray experiments: the R package gMWT

Read accessible full text

Mann-Whitney type tests for microarray experiments: the R package gMWT

Author: Fischer, Daniel,Oja, Hannu
Publisher: The American Statistical Association,Alexandria, VA,us
Year: 2015
Source: https://jukuri.luke.fi/bitstream/10024/519599/1/Fischer.pdf
JSS Jou nal o S a is ical So wa e
June 2015, Volume 65, Issue 9. h p://www.js a so .o g/
Mann-Whi ney Type Tes s o Mic oa ay
Expe imen s: The RPackage gMWT
Daniel Fische
Uni e si y o Tampe e
Hannu Oja
Uni e si y o Tu ku
Abs ac
We p esen he Rpackage gMWT which is designed o he compa ison o se e al
ea men s (o g oups) o a la ge numbe o a iables. The compa isons a e made using
ce ain p obabilis ic indices (PI). The PIs compu ed he e ell how o en pai s o iples
o obse a ions coming om di e en g oups appea in a speci ic o de o magni ude.
Classical wo and se e al sample ank es s a is ics such as he Mann-Whi ney-Wilcoxon,
K uskal-Wallis, o Jonckhee e-Te ps a es s a is ics a e simple unc ions o hese PI. Also
new es s a is ics o di ec ional al e na i es a e p o ided. The package gMWT can be
used o calcula e he a iable-wise PI es ima es, o illus a e hei mul i a ia e dis ibu ion
and mu ual dependence wi h join sca e plo ma ices, and o cons uc se e al classical
and new ank es s based on he PIs. The aim o he pape is i s o b ie ly explain he
heo y ha is necessa y o unde s and he beha io o he es ima ed PIs and he ank
es s based on hem. Second, he use o he package is desc ibed and illus a ed wi h
simula ed and eal da a examples. I is s essed ha he package p o ides a new lexible
oolbox o analyze la ge gene o mic oRNA exp ession da a se s, collec ed on mic oa ays
o by o he high- h oughpu echnologies. The es ing p ocedu es can be used in an eQTL
analysis, o example, as implemen ed in he package Gene icTools.
Keywo ds: eQTL, Jonckhee e-Te ps a es , K uskal-Wallis es , Mann-Whi ney es , pe mu-
a ion es , se e al samples, simul aneous es ing, union-in e sec ion es , U-s a is ic.
1. In oduc ion
We conside nonpa ame ic es s used in he analysis o gene o mic oRNA exp ession da a
se s wi h se e al ea men s (g oups). Fo each sepa a e exp ession a iable, he null hypo h-
esis o be es ed is ha he e is no di e ence be ween he dis ibu ions o he exp ession in
di e en g oups. To a oid s ong (pa ame ic) dis ibu ional assump ions, he al e na i es
a e o mula ed using p obabili ies ha pai s o iples o obse a ions coming om di e en
2gMWT: Gene alized Mann-Whi ney Tes s in R
g oups a e in a speci ic o de o magni ude. The in e es ing p obabili ies a e called p oba-
bilis ic indices (PI), see also Thas, De Ne e, Clemen , and O oy (2012). The es s a is ics
a e based on na u al es ima es o hese PIs, ha is, he co esponding wo and se e al sam-
ple U-s a is ics. Classical se e al-sample ank es s a is ics such as he K uskal-Wallis o
Jonckhee e-Te ps a es a e special cases in his app oach. Also, as he numbe o a iables
(mic oRNAs) is ypically huge and he es s a is ics o di e en a iables a e dependen , we
ace a se ious simul aneous es ing p oblem. See Fische , Oja, Sen, Schleu ke , and Wahl o s
(2014) o mo e de ails.
The package gMWT (Fische and Oja 2015) p o ides nonpa ame ic ools o he compa ison
o se e al g oups/ ea men s when he numbe o a iables is la ge, and is a ailable om
he Comp ehensi e RA chi e Ne wo k (CRAN) a h p://CRAN.R-p ojec .o g/package=
gMWT. The ools a e he ollowing.
(i) Compu a ion o he PI es ima es o he g oup compa isons. The p obabilis ic indices
he e a e (a) he p obabili y P 0 ha a andom obse a ion om g oup is smalle han
a andom obse a ion om g oup 0, and (b) he p obabili y P 0 00 ha obse a ions
om g oups , 0, 00 appea in his same o de . The ools a e also gi en o p oduce he
plo s o a iable-wise PIs.
(ii) Compu a ion o he p alues o some classical and some new nonpa ame ic es s o
he compa ison o se e al g oups/ ea men s. The es s a e based on he use o he
p obabilis ic indices P 0and P 0 00 . Classical Mann-Whi ney-Wilcoxon, K uskal-Wallis
and Jonckhee e-Te ps a es s a e included.
(iii) Tools o he simul aneous es ing p oblem. As he package is mean o he analysis
o gene exp ession da a o example, ools o con ol he amily-wise e o a e and/o
he alse disco e y a e a e p o ided as plo s o expec ed e sus obse ed ejec ed null
hypo heses wi h he Simes (imp o ed Bon e oni) and Benjamini-Hochbe g ejec ion
lines. A lis o ejec ed null hypo heses may be ob ained as well.
Some s anda d nonpa ame ic me hods such as he Mann-Whi ney and K uskal-Wallis es s
ha e been implemen ed in he Rs a s (RCo e Team 2014) package. Linea ank s a is ics
o he wo and se e al sample loca ion p oblems wi h o de ed and uno de ed al e na i es
ha e been implemen ed also in he coin (Ho ho n, Ho nik, an de Wiel, and Zeileis 2008)
package. Exac and pe mu a ion e sions o he Jonckhee e-Te ps a es a e gi en by he
package clin un (Seshan 2014); his unc ion is used in ou package as he second op ion
in ou implemen a ion. One con ibu ion o ou package gMWT is ha hese and se e al
o he nonpa ame ic es s a e collec ed wi h he same syn ax unde he same oo wi h a
simul aneous es ing possibili y o se e al a iables. The in e aces o he unc ions a e
ailo ed o la ge da ase s wi h many g oups and se e al a iables, so ha he applica ion
and compa isons o compe ing es ing p ocedu es a e easie . Wi h sca e plo ma ices o he
ele an PIs, i is also possible o illus a e and unde s and he join a iable-wise beha io
o he s anda d es s.
The s uc u e o his pape is as ollows. A e a b ie e iew o he heo y in Sec ion 2
we p esen some p ac ical solu ions in Sec ion 3 o he compu a ion o he PIs and he
pe mu a ional p alues o he co esponding es s. In Sec ion 4a gene al desc ip ion o he
package gMWT is gi en wi h a ypical wo k low o i s use. We also discuss he calcula ion o
Jou nal o S a is ical So wa e 3
he PIs and hei sca e plo ma ices, and i is desc ibed how he es s a e pe o med. Also,
he ools o he mul iple es ing p oblem a e desc ibed. In Sec ion 5, he use o he package
is illus a ed wi h a simula ed da a se as well as wi h eal geno ype da a. In he la e case,
an exp ession quan i a i e ai locus (eQTL) analysis is pe o med wi h he packages gMWT
and Gene icTools (Fische 2014).
2. S a is ical in e ence based on p obabilis ic indices
2.1. Null hypo hesis and al e na i es based on P 0and P 0 00
Conside i s he uni a ia e case and he compa ison o Tg oups. Le x 1, . . . , x N be a
andom sample om a dis ibu ion wi h cumula i e dis ibu ion unc ion F , = 1, . . . , T,
and le he samples be independen . The o al sample size is hen N=N1+· · · +NT. We
wish o es he null hypo hesis
H0:F1=F2=· · · =FT.
The in e es ing al e na i es a e o mula ed using ce ain p obabilis ic indices. As ies may
o en be p esen , we w i e
I(x, y) = I(x<y) + 1
2I(x=y)
and
I(x, y, z) = I(x<y<z) + 1
2I(x=y < z) + 1
2I(x<y=z) + 1
6I(x=y=z),
wi h I(·) being he indica o unc ion, which is 1 i he a gumen (·) is ue and 0 else. The
in e es ing al e na i es a e hen gi en in e ms o he p obabili ies
P 0=E(I(x , x 0)) and P 0 00 =E(I(x , x 0, x 00 )).
No e ha , as
I(x, y) = I(x, y, z) + I(x, z, y) + I(z, x, y)
he p obabili ies sa is y
P 0=P 0 00 +P 00 0+P 00 0.
Unde he null hypo hesis H0:F1=F2=· · · =FT, o all , 0, 00,
P 0=1
2and P 0 00 =1
6.
We say ha F1and F2a e s ochas ically o de ed and w i e F1s F2i F1(x)≥F2(x)∀x∈R.
Then
F s F 0⇒P 0≥1
2
and
F s F 0s F 00 ⇒P 0 00 ≥1
6
bu he con e se s a emen s a e no ue.
4gMWT: Gene alized Mann-Whi ney Tes s in R
In he compa ison o T= 3 ea men s in e es ing al e na i es migh hen be o mula ed, o
example, as
H1:P12 6=1
2o P13 6=1
2o P23 6=1
2,
o
H1:P12 ≥1
2o P13 ≥1
2o P23 ≥1
2wi h a leas one s ic inequali y,
o
H1:P13 ≥1
2o P23 ≥1
2wi h a leas one s ic inequali y,
o
H1:P123 >1
6.
The es s will hen be based on he es ima es ˆ
P12,ˆ
P13,ˆ
P23 and ˆ
P123 and should be cons uc ed
keeping he in e es ing al e na i e in mind.
2.2. Es ima ion o P 0and P 0 00
The p obabili ies P 0and P 0 00 a e na u ally es ima ed by co esponding U-s a is ics
ˆ
P 0=1
N N 0
N
X
i=1
N 0
X
i0=1
I(x i, x 0i0)
and
ˆ
P 0 00 =1
N N 0N 00
N
X
i=1
N 0
X
i0=1
N 00
X
i00 =1
I(x i, x 0i0, x 00 i00 ).
A na u al s a is ic o he compa ison be ween g oup and o he g oups is
ˆ
P =1
N−N X
06=
N 0ˆ
P 0.
A gene al se e al-sample U-s a is ic heo y can be used o ind he (join ) limi ing p ope ies
o ˆ
P ,ˆ
P 0and ˆ
P 0 00 unde he null hypo hesis. See, e.g., Chap e 5 in Se ling (1980).
2.3. Tes s based on es ima es ˆ
P 0and ˆ
P 0 00
As seen be o e, we ha e a hie a chy
nˆ
P 0 00 o→nˆ
P 0o→nˆ
P o
and one can cons uc es s a is ics a di e en le els o his hie a chy. Some choices a e he
ollowing.
1. Use es s a is ics ˆ
P 0 00 o H0:F =F 0=F 00 s. H1:P 0 00 6=1
6. O cou se one-sided
al e na i es a e possible as well.
Jou nal o S a is ical So wa e 5
2. Use he Mann-Whi ney (MW) es s a is ics ˆ
P 0 o H0:F =F 0 s. H1:P 06=1
2and
he Jonckhee e-Te ps a (JT) es s a is ics o H0:F1=· · · =FT s. H1:P 0≥1
2
o all < 0wi h a leas one s ic inequali y. No e ha F1s F2s · · · s FT
wi h a leas one s ic inequali y implies he la e H1. We ha e wo e sions o JT
es s a is ic, namely,
JT =X
< 0
N N 0ˆ
P 0and JT ∗=X
< 0
ˆ
P 0.
3. Fo a ixed g oup , use a Mann-Whi ney es s a is ic ˆ
P o H0:F1=· · · =FT s.
H1:F1=... =F −1=F +1 =... =FT6=F . Use he K uskal-Wallis es s a is ic
KW =12
N(N+ 1)
T
X
=1
(ˆ
P −N (N−N )/2)2
N
o H0:F1=· · · =FT s. H1:F 6=F 0 o a leas one pai , 0. The al e na i e hen
implies ha P 06=1
2 o a leas one pai , 0.
4. Use a union-in e sec ion es (UIT) o compa e h ee g oups , 0, and 00. The es
s a is ic is a combina ion o s a is ics ˆ
P 00 and ˆ
P 0 00 and is mean o he al e na i e
max(P 00 , P 0 00 )>1
2. The es s a is ic can be ound in Appendix A, see also Fische
e al. (2014) o he de ails.
3. Compu a ional solu ions
3.1. Fas compu a ion o ˆ
P 0and ˆ
P 0 00
Conside he uni a ia e case and w i e he N- ec o
x= (x1, x2, . . . , xN)>= (x11, . . . , x1N1, x21, . . . , x2N2, . . . , xT1, . . . , xT NT)>
o obse a ions coming om all Tg oups. The PIs a e based on wo N×Nma ices Is =
Is (x) and Ieq =Ieq(x) wi h he elemen s
(Is (x))ij =I(xi< xj) and (Ieq(x))ij =I(xi=xj),
i, j = 1, . . . , N. The ma ices Is =Is (x) and Ieq =Ieq(x) can hen be decomposed as
Is =



Is
11 Is
12 . . . Is
1T
Is
21 Is
22 . . . Is
2T
. . . . . . . . . . . .
Is
T1Is
T2. . . Is
T T




and Ieq =



Ieq
11 Ieq
12 . . . Ieq
1T
Ieq
21 Ieq
22 . . . Ieq
2T
. . . . . . . . . . . .
Ieq
T1Ieq
T2. . . Ieq
T T




,
whe e he Ni×Njsubma ices Is
ij and Ieq
ij compa e ea men s iand j,i, j = 1, . . . , T.
Then
ˆ
P 0=1
N N 0
1>
N Is
0+1
2Ieq
01N 0,

6gMWT: Gene alized Mann-Whi ney Tes s in R
0 100 200 300 400 500
Simula ed sample size
Time in seconds
30 150 300 450 600 750 900 1050
●
●
●
●
Nai e,R
Subma ices,R
Subma ices,C++
Nai e,C++
Figu e 1: Compu a ion imes o he p alues using he pe mu a ion es e sion wi h es
s a is ic ˆ
P 0 00 . Th ee g oups wi h equal g oup sizes we e used, and he numbe o pe mu-
a ions in each case was 2000. Nai e and subma ix app oaches implemen ed in Rand C++
a e compa ed.
whe e 1kis he no a ion o a k- ec o ull o ones. Fo he iples we ge
ˆ
P 0 00 =1
N N 0N 00
1>
N Is
0Is
0 00 +1
2Ieq
0Is
0 00 +1
2Is
0Ieq
0 00 +1
6Ieq
0Ieq
0 00 1N 00 .
In case ha no ies a e p esen , he ma ix Ieq is simply a ze o ma ix.
Using a nai e implemen a ion, we would calcula e he p obabili ies ˆ
P 0 00 one by one while
going h ough all N N 0N 00 iple compa isons. In ou subma ix app oach we hus calcula e
he ma ices Is and Ieq only once and hen use he subma ices o ind he p obabili ies
ˆ
P 0 00 . This leads o imp o ed calcula ion imes especially o pe mu a ion e sions o he
es s. Fo he compu a ion ime compa isons in Rand C++ ( ia Rcpp,Eddelbue el and
F an¸cois 2011, and RcppA madillo,Eddelbue el and Sande son 2014), see Figu e 1.
3.2. Compu a ion o p alues
I he null hypo hesis H0:F1=· · · =FTis ue, hen Px ∼x o all N×Npe mu a ion
ma ices P. By Px ∼xwe mean ha he dis ibu ions o Px and xa e he same. Ma ix P
is an N×Npe mu a ion ma ix i i is ob ained om an iden i y ma ix INby pe mu ing
i s ows and/o columns. The numbe o dis inc pe mu a ion ma ices is N!.
No e ha ou es s a is ics a e unc ions o he ma ices Is and Ieq and ha
Is (Px) = PIs (x)P>and Ieq(Px) = PIeq(x)P>.
The exac p alue om a pe mu a ion es using a es s a is ic Q=Q(Is ,Ieq) is hen
PnQ(PIs P>,PIeqP>)≥Q(Is ,Ieq)o,
Jou nal o S a is ical So wa e 7
whe e he p obabili y is aken o e N! equally p obable alues o P. The p alue can in
p ac ice be es ima ed by
1
M
M
X
m=1
InQ(PmIs P>
m,PmIeqP>
m)≥Q(Is ,Ieq)o,
whe e P1,...,PMis a andom sample om a uni o m dis ibu ion o e he se o N×N
pe mu a ion ma ices. Na u ally, he la ge M, he be e is he es ima e o he exac p alue.
App oxima e p alues may also be based on he limi ing join no mali y o he es ima es
(U-s a is ics) ˆ
P ,ˆ
P 0, and ˆ
P 0 00 . I no ies a e p esen , he es s a is ics based on he PIs
a e s ic ly dis ibu ion- ee wi h limi ing a iances and co a iances ha a e easily ound.
4. The package gMWT
4.1. Gene al ea u es
The Rpackage gMWT can be used o calcula e he a iable-wise p obabilis ic indices ˆ
P ,ˆ
P 0,
and ˆ
P 0 00 , o illus a e hei join dis ibu ions and dependence wi h sca e plo ma ices,
and o pe o m a ious ank es s based on ˆ
P ,ˆ
P 0and ˆ
P 0 00 desc ibed in Sec ion 2.3. See
Figu e 2 o possible wo k lows.
A p ac ical applica ion o he es ing p ocedu es is an eQTL analysis o a combined anal-
ysis o mic oa ay and geno ype da a. In Sec ion 5.2 we illus a e he use o he packages
Gene icTools and gMWT wi h he di ec ional iple es o es ing o eQTL.
In he ollowing, he inpu ma ix Xis a da a ma ix wi h obse a ions as ows and a iables
as columns. The ec o gindica es he g oup membe ship; i s leng h is hen he numbe o
ows in X.
4.2. Compu a ion o ˆ
P ,ˆ
P 0and ˆ
P 0 00
The es ima ed PIs, ˆ
P ,ˆ
P 0and ˆ
P 0 00 , a e calcula ed using he command
es PI(X, g, ype = "pai ", goi, mc = 1, o de = TRUE)
The op ions ype = "single","pai " o " iple" speci y he PIs o be compu ed, ha is,
ˆ
P ,ˆ
P 0o ˆ
P 0 00 . The ec o goi (”g oups o in e es ”) speci ies he g oups ( alues o g) o be
used in he compa isons.
The op ion o de speci ies whe he he PIs should be calcula ed o all possible pai s and
iples (o de = FALSE) o jus o pai s and iples wi h inc easing g oup labels. In he ou
g oup case, o example, an es PI call wi h he (de aul ) op ions ( ype = "pai ", o de =
TRUE) would calcula e he es ima ed PIs ˆ
P12,ˆ
P13,ˆ
P14,ˆ
P23,ˆ
P24,ˆ
P34 and in case o using he
pa ame e s ( ype = " iple", o de = TRUE) he es ima ed PIs ˆ
P123,ˆ
P124,ˆ
P134,ˆ
P234.
Fo ma ix alued X, he op ion mc can be used o execu e he pa allel calcula ion on mc-many
co es in o de o speed up he calcula ion (a ailable only o Linux sys ems).
The esul o he unc ion es PI is a lis , con aining a ma ix p obs wi h he PIs as ows and
a iables as columns. The o he lis i ems a e he used pa ame e s.
8gMWT: Gene alized Mann-Whi ney Tes s in R
Da a NxG
G Va iables: g=1,...,G
N obs.
n=1,...,N
G oups
=1,...T
single pai s iple
Calcula e P obabilis ic Index
Func ion: es PI
Apply es
Func ion: gmw
KW
MW: 1 s. All
MW: pai s
UIT
JT
JT*
T iple
Plo he es esul s
Func ion: plo
plo P ob
plo P ob
Figu e 2: Possible calcula ion wo k lows.
Jou nal o S a is ical So wa e 9
4.3. Sca e plo s o ˆ
P ,ˆ
P 0and ˆ
P 0 00
Based on he p obabili ies calcula ed ia es PI he package c ea es diagnos ic sca e plo
ma ices o a iable-wise PIs. The command is ei he
plo PI(X, g, col, zoom = FALSE, highligh = NULL, hlCol = " ed")
i he diagnos ic plo s a e p oduced di ec ly om he da a o
pe <- es PI(X, g, ype = "pai ", goi)
plo (pe, col, zoom = FALSE, highligh , hlCol)
i he p obabili ies a e i s calcula ed by es PI. The unc ion plo PI na u ally allows also
all op ions used in he es PI call. The ype o he plo s depends on he selec ed PIs; he
pai wise sca e plo s a e hen o all possible pai s o PIs.
Addi ional plo ing op ions a e highligh ,hlCol and zoom. Using he highligh op ion,
indica ed a iables a e plo ed wi h a colo speci ied in hlCol. I he Boolean lag zoomed is
se , he plo s a e zoomed o he ac i e a ea o he PIs. Wi hou his lag, he bi a ia e plo s
a e in [0,1] ×[0,1].
4.4. Tes s based on ˆ
P ,ˆ
P 0and ˆ
P 0 00
The basic call o applying he es ing p ocedu e is
gmw(X, g, goi, es = "mw", ype = "pe mu a ion", p ob = "pai ",
npe = 2000, al e na i e = " wo.sided", mc = 1, ou pu = "min",
keepPM = FALSE, mwAkw = FALSE)
whe e only inpu a iables Xand ga e compulso y.
I Xis a ma ix hen he chosen es is applied a iable-wise o he da a and he esul s a e
epo ed as a ma ix o p alues. Speci ying he op ion ou pu = " ull" leads o a mo e
de ailed lis ou pu wi h he same leng h as he numbe o di e en al e na i es a e es ed
and each lis i em con ains hen again a lis wi h as many columns as he e a e in X. Each
en y in he encapsula ed lis is a es esul o class ‘h es ’.
The ec o ggi es he g oup numbe s in a na u al o de . The g oups used in he analysis
can be speci ied ia goi. I no goi is speci ied, all g oups a e used.
Wi h he op ion es , he es ("ui ", " iple", "mw", "kw", "j ", "j *") can be spec-
i ied. The op ion p ob may be used only in he case o he Mann-Whi ney es . Fo all pai -
wise g oup compa isons one uses (p ob = "pai ") while op ion (p ob = "single") compa es
each g oup o he es o he da a. The op ion ype speci ies whe he he pe mu a ion ype
es ("pe mu a ion") o he asymp o ical es e sion ("asymp o ical") is used. Fo some
s anda d es s he p ocedu es om base Ra e a ailable, and he Jonckhee e-Te ps a es is
implemen ed in he clin un package. The op ion ype = "ex e nal" allows he use o hese
es e sions. A pe mu a ion ype o es is a ailable o all es s bu , as he package is s ill
unde ac i e de elopmen , he asymp o ical e sions a e no ye a ailable o all cases. The
numbe o pe mu a ions is selec ed wi h he op ion npe . Di e en al e na i es a e a ail-
able whene e hey a e na u al and a e se wi h al e na i e = "smalle ","g ea e " and
" wo.sided".
16 gMWT: Gene alized Mann-Whi ney Tes s in R
Gene1 − 1
Ch 1 : 8474334 − 9574334
Ch omosomal Posi ion in MB
p− alue
8.5 8.72 8.94 9.16 9.38 9.6
0 0.2 0.4 0.6 0.8 1 Mono. NA
●
●
●
●
●
●
●
●
●●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
● ●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●●●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●
Figu e 9: eQTL-plo . The dashed line symbolizes he loca ion o he linked gene and each
do ep esen s he es esul o a SNP es . The do ed line e e s o he chosen signi icance
le el. In case ha all indi iduals ha e he same geno ype no es is pe o med and his is
ma ked as “Mono.”. I no geno ype in o ma ion was a ailable o a SNP, his is ma ked as
NA.
The exp ession ma ix is speci ied wi h he gex op ion.
The op ion xAnno is impo an o he gene anno a ions and is a lis whe e each lis i em
e e s o a gene om he columns o geneEx. The names ha e o ma ch and he eQTL is only
pe o med o ma ching pai s. In case ha no anno a ion xAnno is gi en o he unc ion no
window is used and all combina ions a e conside ed ins ead. Be awa e ha his migh lead
o a e y long las ing calcula ion. Each lis i em in geneAnno a ions is a ma ix like
R> geneAnno a ions
$Gene1
Ch S a End
1 1 8974334 9074334
$Gene2
Ch S a End
1 12 135633062 135738062
2 12 135735062 135838062

Jou nal o S a is ical So wa e 17
This akes in o accoun ha ce ain p obes ha e mul iple loca ions in he genome and ou
me hod will es o all hose loca ions. In case ha he labeling o indi iduals be ween he
exp ession da a and he geno ype da a di e s, he e is an op ion o gi e a new ec o o
labels, called genoSamples. He e can new labels o he indi iduals in he geno ype da a be
speci ied, ha ma ch wi h he ow names o geneEx.
I is impo an o no e ha he o de o he ows and columns o all lis s and ma ices does
no ha e o ma ch. The unc ion akes he smalles subse s o indi iduals and genes and akes
hen hose SNPs, which a e in a window a ound ha gene. The window size can be speci ied
wi h he op ion windowSize using he uni megabases (MB).
A e he eQTL is pe o med we can isualize he esul s wi h
R> plo (myEQTL, which, ile, sig)
The which op ion speci ies o which genes om geneEx he plo s shall be c ea ed. I no op ion
is gi en, hen all plo s a e c ea ed. Because his migh lead o a as numbe o pic u es,
he e is also an op ion ile o speci y a ile name such ha he plo s a e sa ed in a ile wi h
his name. The ou pu o a single plo can be seen in Figu e 9wi h a chosen signi icance le el
sig = 0.1.
This way we can see o in e es ing genes he beha io o he su ounding SNPs on o he gene
exp ession. Fo small da ase s i is also possible o check isually o in e es ing genes. Fo
la ge gene se s he unc ion ex ac EQTL can be used o de e mine a se o in e es ing genes.
We applied his unc ion on eal da a e.g., in Sil anen e al. (2013).
Re e ences
Benjamini Y, Hochbe g Y (1995). “Con olling he False Disco e y Ra e: A P ac ical and
Powe ul App oach o Mul iple Tes ing.” Jou nal o he Royal S a is ical Socie y B,57(1),
289–300.
Clay on D (2014). snpS a s:SnpMa ix and XSnpMa ix Classes and Me hods.Rpackage
e sion 1.16.0, URL h p://www-gene.cim .cam.ac.uk/clay on/.
Eddelbue el D, F an¸cois R (2011). “Rcpp: Seamless Rand C++ In eg a ion.” Jou nal o
S a is ical So wa e,40(8), 1–18. URL h p://www.js a so .o g/ 40/i08/.
Eddelbue el D, Sande son C (2014). “RcppA madillo: Accele a ing Rwi h High-Pe o mance
C++ Linea Algeb a.” Compu a ional S a is ics & Da a Analysis,71, 1054–1063.
Fische D (2014). Gene icTools: Collec ion o Gene ic Da a Analysis Tools.Rpackage
e sion 0.3, URL h p://CRAN.R-p ojec .o g/package=Gene icTools.
Fische D, Oja H (2015). gMWT: Gene alized Mann-Whi ney Type Tes s.Rpackage e sion
1.0, URL h p://CRAN.R-p ojec .o g/package=gMWT.
Fische D, Oja H, Sen PK, Schleu ke J, Wahl o s T (2014). “Gene alized Mann-Whi ney Type
Tes s o Mic oa ay Expe imen s.” Scandina ian Jou nal o S a is ics,41(3), 672–692.
18 gMWT: Gene alized Mann-Whi ney Tes s in R
Ho ho n T, Ho nik K, an de Wiel MA, Zeileis A (2008). “Implemen ing a Class o Pe -
mu a ion Tes s: The coin Package.” Jou nal o S a is ical So wa e,28(8), 1–23. URL
h p://www.js a so .o g/ 28/i08/.
Pe lman MD (1969). “One-Sided Tes ing P oblems in Mul i a ia e Analysis.” The Annals o
Ma hema ical S a is ics,40(2), 549–567.
RCo e Team (2014). R: A Language and En i onmen o S a is ical Compu ing.RFounda-
ion o S a is ical Compu ing, Vienna, Aus ia. URL h p://www.R-p ojec .o g/.
Se ling RJ (1980). App oxima ion Theo ems o Ma hema ical S a is ics. John Wiley & Sons.
Seshan VE (2014). clin un: Clinical T ial Design and Da a Analysis Func ions.Rpackage
e sion 1.0.6, URL h p://CRAN.R-p ojec .o g/package=clin un.
Sil anen S, Fische D, Ran ape o T, Lai inen V, Mpindi JP, Kallioniemi O, Wahl o s T,
Schleu ke J (2013). “ARLTS1 and P os a e Cance Risk – Analysis o Exp ession and
Regula ion.” PLoS ONE,8(8), e72040.
Simes RJ (1986). “An Imp o ed Bon e oni P ocedu e o Mul iple Tes s o Signi icance.”
Biome ika,73(3), 751–754.
Thas O, De Ne e J, Clemen L, O oy JP (2012). “P obabilis ic Index Models.” Jou nal o
he Royal S a is ical Socie y B,74(4), 623–671.
Wes all PH, Young SS (1993). Resampling-Based Mul iple Tes ing: Examples and Me hods
o p-Value Adjus men . John Wiley & Sons.
Jou nal o S a is ical So wa e 19
A. Union-in e sec ion es o P13 and P23
We implemen ed wo ways o calcula e p alues om he UIT, he i s one is based on a
pe mu a ion app oach and he o he one is based on asymp o ical esul s. In bo h cases
we i s need o calcula e he c i ical alue co he es s a is ic Q∗. Fo he es s a is ics
S1=ˆ
P13 and S2=ˆ
P23,S= (S1, S2)>∼N2(µ,Σ) app oxima ely wi h
Σ=1ρ
ρ1.
Ou UIT es s a is ic Q∗is hen
Q∗=I0·0 + I1·(S2−ρS1)2
1−ρ2+I2·(S1−ρS2)2
1−ρ2+I3·S>Σ−1S,
wi h
I0=I(S1≤ρS2, S2≤ρS1),I1=I(S1<0, S2> ρS1),
I2=I(S1> ρS2, S2<0),I3=I(S1≥0, S2≥0).
As I0+I1+I2+I3= 1, a mos one o he h ee es s a is ics in he sum con ibu es o Q∗.
An app oxima e p alue is hen gi en by he app oxima ion (Pe lman 1969)
P(Q∗> c) = 1
2P(χ2
1> c) + cos−1ρ
2πP(χ2
2> c).
Fo a pe mu a ion es e sion, we pe mu e he elemen s o he ec o o he g oup a iable
M imes wi h esul ing alues o es s a is ics Q∗
1, Q∗
2, . . . , Q∗
M; he app oxima e p alue is
hen
p=1
M
M
X
m=1
I(Q∗
m≥Q∗).
A ilia ion:
Daniel Fische
School o Heal h Sciences
Uni e si y o Tampe e
33014 Tampe e, Finland
E-mail: Daniel.Fische[email p o ec ed]
Hannu Oja
Depa men o Ma hema ics and S a is ics
Uni e si y o Tu ku
20014 Tu ku, Finland
Jou nal o S a is ical So wa e h p://www.js a so .o g/
published by he Ame ican S a is ical Associa ion h p://www.ams a .o g/
Volume 65, Issue 9 Submi ed: 2012-05-30
June 2015 Accep ed: 2014-08-06