S4 class for storing the result of an association
test for a single genomic region
Objects
Objects of this class are created by calling assocTest
for a single genomic region.
Slots
The following slots are defined for AssocTestResult objects:
type:
type of null model on which the association test
was based
samples:
character vector with sample names (if
available, otherwise empty)
kernel:
kernel that was used for the association test
dim:
dimensions of genotype matrix that was tested
weights:
weight vector that was used; empty if no
weighting was performed
width:
tolerance radius parameter that was used for
position-dependent kernels
method:
method(s) used to compute p-values; a single
character string if no resampling was done, otherwise a list with
two components specifying the p-value computation method for the
test's p-value and the resampled p-values separately.
correction:
a logical vector indicating whether the
small sample correction was carried out (first component
exact is TRUE) and/or higher moment correction was carried
out (second component resampling is TRUE).
Q:
test statistic
p.value:
the test's p-value
Q.resampling:
test statistics for sampled null model
residuals
p.value.resampling:
p-values for sampled null model
residuals
p.value.resampled:
estimated p-value computed as
the relative frequency of p-values of sampled residuals that
are at least as significant as the test's p-value
call:
the matched call with which the object was created
Methods
show
signature(object="AssocTestResult"):
displays the test statistic and the p-value along with the type of
the null model, the number of samples, the number of SNVs, and the
kernel that was used to carry out the test.
## load genome description
data(hgA)
## load genotype data from VCF file
vcfFile <- system.file("examples/example1.vcf.gz", package="podkat")
Z <- readGenotypeMatrix(vcfFile)
## read phenotype data from CSV file (continuous trait + covariates)
phenoFile <- system.file("examples/example1lin.csv", package="podkat")
pheno <-read.table(phenoFile, header=TRUE, sep=",")
## train null model with all covariates in data frame 'pheno'
nm.lin <- nullModel(y ~ ., pheno)
## perform association test for entire genotype matrix
res <- assocTest(Z, nm.lin)
show(res)
## perform association test for subset of genotype matrix
res <- assocTest(Z[, 50:100], nm.lin)
show(res)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(podkat)
Loading required package: Rsamtools
Loading required package: GenomeInfoDb
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Loading required package: S4Vectors
Attaching package: 'S4Vectors'
The following objects are masked from 'package:base':
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: Biostrings
Loading required package: XVector
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/podkat/AssocTestResult-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: AssocTestResult-class
> ### Title: Class 'AssocTestResult'
> ### Aliases: AssocTestResult-class class:AssocTestResult AssocTestResult
> ### show,AssocTestResult-method
> ### Keywords: classes
>
> ### ** Examples
>
> ## load genome description
> data(hgA)
>
> ## load genotype data from VCF file
> vcfFile <- system.file("examples/example1.vcf.gz", package="podkat")
> Z <- readGenotypeMatrix(vcfFile)
>
> ## read phenotype data from CSV file (continuous trait + covariates)
> phenoFile <- system.file("examples/example1lin.csv", package="podkat")
> pheno <-read.table(phenoFile, header=TRUE, sep=",")
>
> ## train null model with all covariates in data frame 'pheno'
> nm.lin <- nullModel(y ~ ., pheno)
>
> ## perform association test for entire genotype matrix
> res <- assocTest(Z, nm.lin)
> show(res)
Association test results:
Null model: linear
Number of samples: 200
Number of variants: 962
Kernel: linear.podkat
Test statistic: 3034597
p-value: 0.05875229
>
> ## perform association test for subset of genotype matrix
> res <- assocTest(Z[, 50:100], nm.lin)
> show(res)
Association test results:
Null model: linear
Number of samples: 200
Number of variants: 51
Kernel: linear.podkat
Test statistic: 838847.5
p-value: 3.521569e-06
>
>
>
>
>
> dev.off()
null device
1
>