Skip to content

Commit 1041666

Browse files
committed
adds constructors for the 3 main enrichment types used
1 parent c75b67f commit 1041666

4 files changed

Lines changed: 54 additions & 0 deletions

File tree

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export(assign_colors)
88
export(assign_communities)
99
export(binomial_basic)
1010
export(binomial_feature_enrichment)
11+
export(binomial_features)
1112
export(cc_graph)
1213
export(combine_annotation_features)
1314
export(combine_annotations)
@@ -35,9 +36,11 @@ export(get_significant_annotations_calls)
3536
export(gocats_to_annotation)
3637
export(graph_to_visnetwork)
3738
export(gsea_feature_enrichment)
39+
export(gsea_features)
3840
export(gsea_result_to_fgsea)
3941
export(hypergeometric_basic)
4042
export(hypergeometric_feature_enrichment)
43+
export(hypergeometric_features)
4144
export(hypergeometric_result)
4245
export(install_executables)
4346
export(jaccard_coefficient)

R/binomial_enrichment.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,25 @@ setClass(
1616
)
1717
)
1818

19+
#' binomial_features constructor
20+
#'
21+
#' Create the binomial_features-class object.
22+
#'
23+
#' @param positivefc the positively changed features
24+
#' @param negativefc the negatively changed features
25+
#' @param annotation the annotation object
26+
#'
27+
#' @export
28+
#' @return binomial_features-class
29+
binomial_features = function(positivefc, negativefc, annotation) {
30+
new(
31+
"binomial_features",
32+
positivefc = positivefc,
33+
negativefc = negativefc,
34+
annotation = annotation
35+
)
36+
}
37+
1938
#' do binomial testing
2039
#'
2140
#' @param binomial_features a binomial_features object

R/gsea.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ setClass(
1111
slots = list(ranks = "ANY", annotation = "annotation")
1212
)
1313

14+
#' gsea_features constructor
15+
#'
16+
#' Creates a gsea_features-class object.
17+
#'
18+
#' @param ranks a named vector of ranks
19+
#' @param annotation the annotation object
20+
#'
21+
#' @export
22+
#' @return gsea_features-class
23+
gsea_features = function(ranks, annotation) {
24+
new("gsea_features", ranks = ranks, annotation = annotation)
25+
}
26+
1427
#' do GSEA
1528
#'
1629
#' Performs gene-set enrichment analysis using the `fgsea` package.

R/hypergeometric_enrichment.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@ setClass(
1212
slots = list(significant = "ANY", universe = "ANY", annotation = "annotation")
1313
)
1414

15+
#' hypergeometric_features constructor
16+
#'
17+
#' function to easily construct a hypergeometric_features-class object.
18+
#'
19+
#' @param significant the features that are significant
20+
#' @param universe the background or universe of features measured
21+
#' @param annotation the annotation object
22+
#'
23+
#' @export
24+
#' @return hypergeometric_features-class
25+
hypergeometric_features = function(significant, universe, annotation) {
26+
new(
27+
"hypergeometric_features",
28+
significant = significant,
29+
universe = universe,
30+
annotation = annotation
31+
)
32+
}
33+
1534
#' do hypergeometric enrichment
1635
#'
1736
#' @param hypergeometric_features a hypergeometric_features object

0 commit comments

Comments
 (0)