From 9e757df39f2f77ff8ab46cd7898946df5e0eafa3 Mon Sep 17 00:00:00 2001 From: rmflight Date: Wed, 30 Oct 2024 15:05:53 -0400 Subject: [PATCH] updated testing and passing checks --- .Rbuildignore | 6 +- DESCRIPTION | 4 +- R/gsea.R | 4 + docs/404.html | 2 +- docs/LICENSE-text.html | 2 +- docs/articles/command_line_interface.html | 6 +- docs/articles/index.html | 2 +- docs/articles/v2_guide.html | 4 +- docs/articles/v2_visnetwork_guide.html | 4 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/pkgdown.yml | 2 +- docs/reference/add_data_to_graph.html | 2 +- docs/reference/add_tooltip.html | 2 +- docs/reference/annotation.html | 2 +- docs/reference/annotation_2_json.html | 2 +- docs/reference/annotation_combinations.html | 2 +- docs/reference/annotation_gene_table.html | 2 +- docs/reference/assign_colors.html | 2 +- docs/reference/assign_communities.html | 2 +- docs/reference/binomial_basic.html | 2 +- .../binomial_feature_enrichment.html | 2 +- docs/reference/binomial_features-class.html | 2 +- docs/reference/binomial_result-class.html | 2 +- docs/reference/categoryCompare2.html | 2 +- docs/reference/cc_graph.html | 2 +- .../combine_annotation_features.html | 2 +- docs/reference/combine_annotations.html | 2 +- docs/reference/combine_enrichments.html | 2 +- docs/reference/combine_text.html | 2 +- docs/reference/combined_coefficient.html | 2 +- docs/reference/combined_enrichment.html | 2 +- .../reference/combined_significant_calls.html | 2 +- docs/reference/combined_statistics.html | 2 +- docs/reference/csv_annotation_table.html | 2 +- docs/reference/enriched_result.html | 2 +- docs/reference/enriched_to_fgsea.html | 2 +- docs/reference/executable_path.html | 2 +- docs/reference/extract_enrich_stats.html | 2 +- ...statistics-combined_enrichment-method.html | 2 +- docs/reference/extract_statistics.html | 2 +- docs/reference/filter_annotation_graph.html | 2 +- docs/reference/generate_annotation_graph.html | 2 +- .../generate_annotation_similarity_graph.html | 2 +- docs/reference/generate_colors.html | 2 +- docs/reference/generate_legend.html | 2 +- docs/reference/generate_link.html | 2 +- docs/reference/generate_piecharts.html | 2 +- docs/reference/generate_table.html | 2 +- docs/reference/get_db_annotation.html | 2 +- .../get_significant_annotations.html | 2 +- .../get_significant_annotations_calls.html | 2 +- docs/reference/gocats_to_annotation.html | 2 +- docs/reference/graph_to_visnetwork.html | 2 +- docs/reference/gsea_feature_enrichment.html | 6 +- docs/reference/gsea_features-class.html | 2 +- docs/reference/hypergeom_features-class.html | 2 +- docs/reference/hypergeometric_basic.html | 2 +- .../hypergeometric_feature_enrichment.html | 2 +- docs/reference/index.html | 2 +- docs/reference/install_executables.html | 2 +- docs/reference/jaccard_coefficient.html | 2 +- docs/reference/json_2_annotation.html | 2 +- docs/reference/json_annotation_reversal.html | 2 +- docs/reference/kable_annotation_table.html | 2 +- docs/reference/label_communities.html | 2 +- docs/reference/multi_query_list.html | 2 +- docs/reference/node_assign-class.html | 2 +- docs/reference/overlap_coefficient.html | 2 +- docs/reference/remove_edges.html | 2 +- .../show-binomial_result-method.html | 2 +- .../show-combined_statistics-method.html | 2 +- .../show-enriched_result-method.html | 2 +- docs/reference/show-node_assign-method.html | 2 +- .../show-significant_annotations-method.html | 2 +- docs/reference/significant_annotations.html | 2 +- docs/reference/statistical_results-class.html | 2 +- docs/reference/table_from_graph.html | 2 +- docs/reference/vis_in_cytoscape.html | 2 +- docs/reference/vis_visnetwork.html | 2 +- docs/search.json | 2 +- man/gsea_feature_enrichment.Rd | 2 + test_data_gen.R | 99 ------------------- test_data_gen2.R | 76 -------------- tests.R | 78 --------------- tests/testthat/test-fgsea.R | 2 +- 86 files changed, 96 insertions(+), 343 deletions(-) delete mode 100644 test_data_gen.R delete mode 100644 test_data_gen2.R delete mode 100644 tests.R diff --git a/.Rbuildignore b/.Rbuildignore index e970224..01eb7ca 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,11 +4,6 @@ ^\.Rproj\.user$ ^\.travis\.yml$ ^\.push_gh_pages\.sh$ -tests.R -test_data_gen.R -test_data.RData -test_table_data.rds -test_combine_filter.rda ^\.github\workflows\.yml$ ^\.github$ ^executable_related$ @@ -27,3 +22,4 @@ test_combine_filter.rda ^doc$ ^docs$ ^_pkgdown\.yml$ +^examples_test_data$ \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 430f65c..5c8046f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: categoryCompare2 -Version: 0.100.25 +Version: 0.100.26 Title: Meta-Analysis of High-Throughput Experiments Using Feature Annotations Authors@R: c( @@ -18,7 +18,7 @@ Depends: R (>= 3.5.0) Suggests: knitr, markdown, estrogen, org.Hs.eg.db, hgu95av2.db, limma, affy, genefilter, testthat (>= 3.0.0), visNetwork, Cairo, DiagrammeR, KEGGREST, docopt (>= 0.7.0), RCy3, hgu95av2cdf, - rmarkdown, fgsea + rmarkdown, fgsea, data.table, withr Imports: Biobase, methods, AnnotationDbi, colorspace, graph, igraph, jsonlite, base64enc, dplyr, purrr, rlang, GO.db, stats LazyLoad: yes diff --git a/R/gsea.R b/R/gsea.R index 7f437dc..9c7c01b 100644 --- a/R/gsea.R +++ b/R/gsea.R @@ -18,6 +18,7 @@ setClass("gsea_features", #' @param min_features the minimum number of features for an annotation (default = 15) #' @param max_features the maximum number of features for an annotation (default = 500) #' @param return_type what type of object should be returned? ("cc2" or "fgsea") +#' @param ... other `fgsea` options #' #' @details The runtime is dependent on the maximum size of the provided annotation, #' so the authors of `fgsea` recommend a maximum size of 500. In addition, to calculate @@ -82,6 +83,9 @@ gsea_feature_enrichment = function(gsea_features, #' @return data.table enriched_to_fgsea = function(in_enriched) { + if (!requireNamespace("data.table", quietly = TRUE)) { + stop("data.table must be installed!") + } ranks = in_enriched@ranks results = data.table::as.data.table(in_enriched@statistics@statistic_data) rename_list = c(pval = "p", padj = "padjust", log2err = "log2err", ES = "es", NES = "nes", size = "size", leadingEdge = "leading_edge") diff --git a/docs/404.html b/docs/404.html index 140898b..6ab9528 100644 --- a/docs/404.html +++ b/docs/404.html @@ -20,7 +20,7 @@ categoryCompare2 - 0.100.25 + 0.100.26