print-methods: Print Association Test Results

print-methodsR Documentation

Print Association Test Results


Display method for S4 class AssocTestResultRanges


## S4 method for signature 'AssocTestResultRanges'
print(x, cutoff=0.05,
        sortBy=c("p.value", "p.value.adj", "p.value.resampled",
                 "p.value.resampled.adj", "genome", "none"),



an object of class AssocTestResultRanges


a numerical vector with one or more p-value thresholds; if present (otherwise NA or an empty vector must be passed), print displays the number of tested regions with a p-value below each threshold. If the AssocTestResultRanges object also contains adjusted p-values, the numbers of tested regions with p-values below each of the thresholds are printed too. If is greater than 0, the most significant regions up to an (adjusted) p-value (depending on the sortBy argument) up to the largest threshold are shown.


a character string that determines (1) how regions are sorted and (2) according to which p-value the cutoff threshold is applied when printing regions; if sortBy is “p.value” (default), regions are sorted according to raw p-values and only the most significant regions are printed - as long as the raw p-value is not larger than the largest value in the cutoff argument. For “p.value.adj”, regions are sorted and filtered according to adjusted p-values, analogously for choices “p.value.resampled” and “p.value.resampled.adj”. In case that sortBy is “genome”, the p-values are ignored and the first regions in the genome are displayed. In case that sortBy is “none”, the p-values are also ignored and the first regions are displayed in the order as they appear in the AssocTestResultRanges object.

maximum number of regions to display; if 0, no regions are displayed at all.


print displays the most important information stored in an AssocTestResultRanges object x. That includes the type of null model, the numbers of samples and tested regions, the kernel that was used for testing, etc. Depending on the cutoff argument, a certain number of significant tests is printed. If is larger than 0, then some regions are shown along with association test results. Which regions are selected and how they are sorted, depends on the arguments sortBy and cutoff (see above).


print returns its argument x invisibly.


Ulrich Bodenhofer


See Also

GenotypeMatrix, NullModel, AssocTestResult, AssocTestResultRanges


## load genome description

## partition genome into overlapping windows
windows <- partitionRegions(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 multiple regions
res <- assocTest(Z, nm.lin, windows)

## perform multiple testing correction
res.adj <- p.adjust(res)

## print 'AssocTestResultRanges' object
print(res.adj, cutoff=c(0.005, 0.01, 0.05))
print(res.adj, cutoff=0.05, sortBy="p.value.adj")
print(res.adj, cutoff=NA, sortBy="none",

UBod/podkat documentation built on Nov. 17, 2022, 6:45 p.m.