HyperGResult-accessors {Category} | R Documentation |
This manual page documents generic functions for extracting data
from the result object returned from a call to hyperGTest
.
The result object will be a subclass of HyperGResultBase
.
Methods apply to all result object classes unless otherwise noted.
pvalues(r) oddsRatios(r) expectedCounts(r) geneCounts(r) universeCounts(r) universeMappedCount(r) geneMappedCount(r) geneIds(object, ...) geneIdUniverse(r, cond = TRUE) condGeneIdUniverse(r) geneIdsByCategory(r, catids = NULL) sigCategories(r, p) ## R CMD check doesn't like these ## annotation(r) ## description(r) testName(r) pvalueCutoff(r) testDirection(r) chrGraph(r)
r, object |
An instance of a subclass of
HyperGResultBase . |
catids |
A character vector of category identifiers. |
p |
Numeric p-value used as a cutoff for selecting a subset of the result. |
cond |
A logical value indicating whether to return conditional
results for a conditional test. The default is TRUE . For
non-conditional results, this argument is ignored. |
... |
Additional arguments that may be used by specializing methods. |
"integer"
vector: for each category term tested, the number of genes from
the gene set that are annotated at the term."numeric"
vector: the ordered p-values for each category term tested."integer"
vector: for each category term tested, the number of genes from
the gene universe that are annotated at the term."integer"
vector of length one giving the size of the gene universe set."numeric"
vector
giving the expected number of genes in the selected gene list to
be found at each tested category term. These values may surprise
you if you forget that your gene list and gene universe might have
had to undergo further filtering to ensure that each gene has been
labeled by at least one GO term."numeric"
vector giving
the odds ratio for each category term tested.geneIdUniverse
, but each vector of gene IDs is
intersected with the list of selected gene IDs from
geneIds
. The result is the selected gene IDs annotated at
each category.p
is
missing, then the cutoff obtained from pvalueCutoff(r)
will
be used.length(geneIds(obj))
.pvalueCutoff
slot.testDirection
slot. Contains a string indicating
whether the test was for "over"
or "under"
representation of the categories.TRUE
if the
result was obtained using a conditional algorithm.data.frame
summarizing the test result. Optional
arguments pvalue
and categorySize
allow
specification of maximum p-value and minimum categorySize,
respectively.GOID
,
Pvalue
, OddsRatio
, ExpCount
, Count
,
and Size
. ExpCount
is the expected count and
the Count
is how many instances of that term were actually
oberved in your gene list while the Size
is the number that
could have been found in your gene list if every instance had
turned up. Values like the ExpCount
and the Size
are going to be affected by what is included in the gene universe
as well as by whether or not it was a conditional test.
summary
method. The first argument should be a HyperGResult
instance (or subclass). The path of a file to write the report to
can be specified using the file
argument. The default is
file=""
which will cause the report to be printed to the
screen. If you wish to create a single report comprising multiple
results you can set append=TRUE
. The default is
FALSE
(overwrite pre-existing report file). You can
specify a string to use as an identifier for each table by
providing a value for the label
argument. The number of
digits displayed in numerical columns can be controlled using
digits
(defaults to 3). The summary
method is
called on the HyperGResult
instance to generate a data
frame that is transformed to HTML. You can pass additional
arguments to the summary
method which is used to generate
the data frame that is transformed to HTML by specifying a named
list using summary.args
.
Seth Falcon
hyperGTest
HyperGResult-class
HyperGParams-class
GOHyperGParams-class
KEGGHyperGParams-class
## Note that more in-depth examples can be found in the GOstats ## vignette (Hypergeometric tests using GOstats). library("hgu95av2.db") library("annotate") probids <- ls(hgu95av2GENENAME)[1:300] ## Select for probeids that have PFAM ids hasPFAM <- sapply(mget(probids, hgu95av2PFAM), function(ids) if(!is.na(ids) && length(ids) > 1) TRUE else FALSE) probids <- probids[hasPFAM] ## get unique Entrez Gene IDs probids <- unique(getLL(probids, "hgu95av2")) ## Now do the same for the universe univ <- ls(hgu95av2GENENAME) univHasPFAM <- sapply(mget(univ, hgu95av2PFAM), function(ids) if(!is.na(ids) && length(ids) > 1) TRUE else FALSE) univ <- univ[univHasPFAM] univ <- unique(getLL(univ, "hgu95av2")) p <- new("PFAMHyperGParams", geneIds=probids, universeGeneIds=univ, annotation="hgu95av2") ## this takes a while... if(interactive()){ hypt <- hyperGTest(p) summary(hypt) htmlReport(hypt, file="temp.html", summary.args=list("htmlLinks"=TRUE)) }