1. 1. Introduction
2. 2. Details
1. 2.1 Command interface
2. 2.2 Application

## 1.  Introduction

The method proposed by Madsen and Browning 20091 first introduced the idea of assigning "weights" to rare variants within a genetic region before they are collapsed. In this case the variants having higher weights will have more substantial contribution to the collapsed variant score. In the Madsen & Browning paper the "weights" are defined as {$\sqrt{n_iq_i(1-q_i)}$} with the assumption that the "rarer" the variant, the larger the risk effect it is to a phenotype. The {$q_i$} in the original paper was based on observed control sample, which might result in inflated type I error2. Implementation of the WSS statistic in the WSSRankTest method uses the same definition for {$q_i$} but the Mann-Whitney U test (definition and C++ implementation for this program) now relies on a full permutation procedure rather than normal approximation, such that the bias is correctly accounted for.

As with the Varible Thresholds strategy, the idea of weighting can be applied to many other rare variant methods. The WeightedBurdenBt and WeightedBurdenQt methods implements the Madsen & Browning weighting based on controls (or samples with low quantitative phenotypic values) or the entire population, and tests for association for both case control and quantitative traits with/without presence of phenotype co-variates.

## 2.  Details

### 2.1  Command interface

vtools show test WSSRankTest
Name:          WSSRankTest
Description:   Weighted sum method using rank test statistic, Madsen & Browning 2009
usage: vtools associate --method WSSRankTest [-h] [--name NAME] [-q1 MAFUPPER]
[-q2 MAFLOWER]
[--alternative TAILED] [-p N]

Weighted sum method using rank test statistic, Madsen & Browning 2009. p-value
is based on the significance level of the Wilcoxon rank-sum test. Two methods
are available for evaluating p-value: a semi-asymptotic p-value based on
normal distribution, or permutation based p-value. Variants will be weighted
by 1/sqrt(nP*(1-P)) and the weighted codings will be summed up for rank test.
Two-sided test is available for the asymptotic version, which will calculate
two p-values based on weights from controls and cases respectively, and use
the smaller of them with multiple testing adjustment. For two-sided
permutation based p-value please refer to "vtools show test WeightedBurdenBt"

optional arguments:
-h, --help            show this help message and exit
--name NAME           Name of the test that will be appended to names of
output fields, usually used to differentiate output of
different tests, or the same test with different
parameters.
-q1 MAFUPPER, --mafupper MAFUPPER
Minor allele frequency upper limit. All variants
having sample MAF<=m1 will be included in analysis.
Default set to 0.01
-q2 MAFLOWER, --maflower MAFLOWER
Minor allele frequency lower limit. All variants
having sample MAF>m2 will be included in analysis.
Default set to 0.0
--alternative TAILED  Alternative hypothesis is one-sided ("1") or two-sided
("2"). Note that two-sided test is only available for
asymptotic version of the test. Default set to 1
-p N, --permutations N
Number of permutations. Set it to zero to use the
asymptotic version. Default is zero
confidence interval for binomial distribution. The
program will compute a p-value every 1000 permutations
and compare the lower bound of the 95 percent CI of
p-value against "C", and quit permutations with the
p-value if it is larger than "C". It is recommended to
specify a "C" that is slightly larger than the
significance level for the study. To disable the
adaptive procedure, set C=1. Default is C=0.1
Mode of inheritance. Will code genotypes as 0/1/2/NA
for additive mode, 0/1/NA for dominant or recessive