From a2d02bce962f0d71570ce4ca2a96b883165f7bc3 Mon Sep 17 00:00:00 2001 From: QingfeiPan Date: Wed, 13 Nov 2024 13:03:06 -0600 Subject: [PATCH] fixed a bug in getTopFeatures() --- R/differential_analysis.R | 2 +- R/network_analysis.R | 13 +- docs/404.html | 2 +- docs/LICENSE.html | 2 +- docs/articles/index.html | 2 +- docs/articles/quick_tutorial.html | 50 ++-- docs/authors.html | 2 +- docs/index.html | 2 +- docs/pkgdown.js | 8 + docs/pkgdown.yml | 4 +- docs/reference/MICAplot.html | 2 +- docs/reference/SparseExpressionSet-class.html | 2 +- docs/reference/addMICAoutput.html | 5 +- docs/reference/cal_Activity.html | 12 +- docs/reference/combinePvalVector.html | 10 +- docs/reference/combineSparseEset.html | 6 +- docs/reference/compare2groups.html | 14 +- docs/reference/createProjectSpace.html | 2 +- docs/reference/createSparseEset.html | 4 +- docs/reference/drawNetworkQC.html | 22 +- docs/reference/drawSparseEsetQC.html | 17 +- docs/reference/draw_barplot-1.png | Bin 0 -> 42002 bytes docs/reference/draw_barplot-2.png | Bin 0 -> 41960 bytes docs/reference/draw_barplot.html | 11 +- docs/reference/draw_bubbleplot-1.png | Bin 0 -> 66002 bytes docs/reference/draw_bubbleplot-2.png | Bin 0 -> 66002 bytes docs/reference/draw_bubbleplot.html | 21 +- docs/reference/feature_boxplot.html | 9 +- docs/reference/feature_bubbleplot-1.png | Bin 71741 -> 73026 bytes docs/reference/feature_bubbleplot-2.png | Bin 71741 -> 73816 bytes docs/reference/feature_bubbleplot.html | 5 +- docs/reference/feature_heatmap-2.png | Bin 41536 -> 57294 bytes docs/reference/feature_heatmap-3.png | Bin 47391 -> 41536 bytes docs/reference/feature_heatmap-4.png | Bin 47386 -> 47391 bytes docs/reference/feature_heatmap-5.png | Bin 0 -> 47386 bytes docs/reference/feature_heatmap.html | 14 +- docs/reference/feature_scatterplot-1.png | Bin 227277 -> 227179 bytes docs/reference/feature_scatterplot-2.png | Bin 0 -> 163058 bytes docs/reference/feature_scatterplot.html | 19 +- docs/reference/feature_vlnplot.html | 9 +- docs/reference/filterSparseEset.html | 58 ++++- docs/reference/generateMICAinput.html | 9 +- docs/reference/generatePortalInputs.html | 24 +- docs/reference/generateSJARACNeInput.html | 21 +- docs/reference/getActivity_inBatch.html | 222 ++++++++++++++++-- docs/reference/getActivity_individual.html | 10 +- docs/reference/getDA.html | 10 +- docs/reference/getDE.html | 4 +- docs/reference/getDriverList.html | 2 +- docs/reference/getTopFeatures.html | 8 +- docs/reference/get_net2target_list.html | 10 +- docs/reference/get_target_list2matrix.html | 11 +- docs/reference/index.html | 2 +- docs/reference/normalizeSparseEset.html | 38 ++- docs/reference/pbmc14k_expression.eset.html | 2 +- docs/reference/pbmc14k_rawCount.html | 2 +- docs/reference/readInput_10x.dir.html | 4 +- docs/reference/readInput_10x.h5.html | 4 +- docs/reference/readInput_h5ad.html | 4 +- docs/reference/readInput_table.html | 4 +- docs/reference/updateSparseEset.html | 18 +- docs/reference/z_normalization.html | 7 +- docs/search.json | 2 +- man/drawNetworkQC.Rd | 15 +- 64 files changed, 501 insertions(+), 261 deletions(-) create mode 100644 docs/reference/draw_barplot-1.png create mode 100644 docs/reference/draw_barplot-2.png create mode 100644 docs/reference/draw_bubbleplot-1.png create mode 100644 docs/reference/draw_bubbleplot-2.png create mode 100644 docs/reference/feature_heatmap-5.png create mode 100644 docs/reference/feature_scatterplot-2.png diff --git a/R/differential_analysis.R b/R/differential_analysis.R index bef2edb..6d38582 100644 --- a/R/differential_analysis.R +++ b/R/differential_analysis.R @@ -448,7 +448,7 @@ getTopFeatures <- function(input_table, for (i in 1:length(grps)) { table.sel <- input_table.sorted[input_table.sorted[, group_by] %in% c(grps[i]), , drop = FALSE] if (nrow(table.sel) >= number) { - if (i == 1) {table_res <- table.sel[c(1:number),]} else {table_res <- rbind(table_res, table.sel[number,])} + if (i == 1) {table_res <- table.sel[c(1:number),]} else {table_res <- rbind(table_res, table.sel[c(1:number),])} } else { if (i == 1) {table_res <- table.sel} else {table_res <- rbind(table_res, table.sel)} } diff --git a/R/network_analysis.R b/R/network_analysis.R index 668f195..3c09502 100644 --- a/R/network_analysis.R +++ b/R/network_analysis.R @@ -396,15 +396,12 @@ generateSJARACNeInput <- function(input_eset, #' #' @examples #' \dontrun{ -#' ## 1. assess the quality of network from network files -#' drawNetworkQC(network_file = /project_space/SJARACNE/B/SIG/b100/consensus_network_ncol_.txt, generate_html = TRUE) -#' drawNetworkQC(network_file = /project_space/SJARACNE/B/SIG/b100/consensus_network_ncol_.txt, generate_html = TRUE, -#' outdir = "/path-to-cutomized-folder") -#' drawNetworkQC(network_file = /project_space/SJARACNE/B/SIG/b100/consensus_network_ncol_.txt, generate_html = TRUE, -#' prefix = "PBMC14") +#' ## 1. Assess the quality of network from network files +#' drawNetworkQC(network_file = "/project_space/SJARACNE/B/SIG/b100/consensus_network_ncol_.txt", generate_html = TRUE, +#' outdir = "/folder-to-save-report_file", prefix = "PBMC14") #' -#' ## 2. assess the quality of network from the directory of network files -#' drawNetworkQC(sjaracne_dir = /project_space/SJARACNE, generate_html = TRUE) +#' ## 2. Assess the quality of network from the directory of network files +#' drawNetworkQC(sjaracne_dir = "/project_space/SJARACNE", generate_html = TRUE) #' } #' drawNetworkQC <- function(network_file = NULL, diff --git a/docs/404.html b/docs/404.html index 8b0ef57..d0ee0e6 100644 --- a/docs/404.html +++ b/docs/404.html @@ -59,7 +59,7 @@

Page not found (404)

diff --git a/docs/LICENSE.html b/docs/LICENSE.html index a3183c0..0c3a29c 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -120,7 +120,7 @@

APPENDIX: How to diff --git a/docs/articles/index.html b/docs/articles/index.html index bd1270a..fba3c0d 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -45,7 +45,7 @@

All vignettes

diff --git a/docs/articles/quick_tutorial.html b/docs/articles/quick_tutorial.html index 1214485..f9b47b7 100644 --- a/docs/articles/quick_tutorial.html +++ b/docs/articles/quick_tutorial.html @@ -52,7 +52,7 @@

A quick tutorial to run scMINER

Qingfei Pan

-

2024-09-20

+

2024-11-13

quick_tutorial.Rmd
@@ -463,8 +463,8 @@

Add MICA output to SparseEset obje
 ## Add MICA output into SparseEset object
 pbmc14k_clustered.eset <- addMICAoutput(input_eset = pbmc14k_log2cpm.eset,
-                                      mica_output_file = system.file("extdata/demo_pbmc14k/MICA/clustering_UMAP_euclidean_20_2.05.txt", package = "scMINER"), 
-                                      visual_method = "umap") # use "tsne" if t-SNE was used in MICA
+                                        mica_output_file = system.file("extdata/demo_pbmc14k/MICA/clustering_UMAP_euclidean_20_2.05.txt", package = "scMINER"),
+                                        visual_method = "umap") # use "tsne" if t-SNE was used in MICA
 head(pData(pbmc14k_clustered.eset))
 #>                trueLabel_full trueLabel projectID nUMI nFeature    pctMito
 #> CACTTTGACGCAAT CD14+ Monocyte  Monocyte   PBMC14k  764      354 0.01832461
@@ -730,7 +730,7 @@ 

Unsupervised cell type annotation
 cluster_markers <- getTopFeatures(input_table = de_res1, number = 10, group_by = "g1_tag", sort_by = "log2FC", sort_decreasing = TRUE)
 dim(cluster_markers)
-#> [1] 16 11
+#> [1] 70 11
 head(cluster_markers)
 #>      feature g1_tag      g0_tag    g1_avg   g0_avg    g1_pct    g0_pct   log2FC
 #> 1251    CD3E      1 2,3,4,5,6,7  8.354660 3.874230 0.7920160 0.3819820 4.480430
@@ -1145,7 +1145,7 @@ 

Differential activity analysis
 top_drivers <- getTopFeatures(input_table = da_res1, number = 10, group_by = "g1_tag", sort_by = "log2FC", sort_decreasing = TRUE)
 dim(top_drivers)
-#> [1] 16 11
+#> [1] 70 11
 head(top_drivers)
 #>       feature g1_tag                                 g0_tag       g1_avg
 #> 4   AASDH_SIG      B CD4TCM,CD4TN,CD4Treg,CD8TN,Monocyte,NK -0.008071658
@@ -1170,18 +1170,18 @@ 

Differential activity analysis#> 3 -2.03216

Session info
-sessioninfo::session_info()
+sessioninfo::session_info()
 #> ─ Session info ───────────────────────────────────────────────────────────────
 #>  setting  value
 #>  version  R version 4.4.1 (2024-06-14)
-#>  os       macOS Sonoma 14.6.1
+#>  os       macOS 15.1
 #>  system   aarch64, darwin20
 #>  ui       X11
 #>  language en
 #>  collate  en_US.UTF-8
 #>  ctype    en_US.UTF-8
 #>  tz       America/Chicago
-#>  date     2024-09-20
+#>  date     2024-11-13
 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown)
 #> 
 #> ─ Packages ───────────────────────────────────────────────────────────────────
@@ -1190,23 +1190,23 @@ 

Differential activity analysis#> assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.4.0) #> Biobase * 2.64.0 2024-04-30 [2] Bioconductor 3.19 (R 4.4.0) #> BiocGenerics * 0.50.0 2024-04-30 [2] Bioconductor 3.19 (R 4.4.0) -#> bit 4.0.5 2022-11-15 [2] CRAN (R 4.4.0) -#> bit64 4.0.5 2020-08-30 [2] CRAN (R 4.4.0) +#> bit 4.5.0 2024-09-20 [2] CRAN (R 4.4.1) +#> bit64 4.5.2 2024-09-22 [2] CRAN (R 4.4.1) #> bslib 0.8.0 2024-07-29 [2] CRAN (R 4.4.0) #> cachem 1.1.0 2024-05-16 [2] CRAN (R 4.4.0) #> cli 3.6.3 2024-06-21 [2] CRAN (R 4.4.0) #> colorspace 2.1-1 2024-07-26 [2] CRAN (R 4.4.0) #> desc 1.4.3 2023-12-10 [2] CRAN (R 4.4.0) -#> digest 0.6.36 2024-06-23 [2] CRAN (R 4.4.0) +#> digest 0.6.37 2024-08-19 [2] CRAN (R 4.4.1) #> dplyr * 1.1.4 2023-11-17 [2] CRAN (R 4.4.0) -#> evaluate 0.24.0 2024-06-10 [2] CRAN (R 4.4.0) +#> evaluate 1.0.1 2024-10-10 [2] CRAN (R 4.4.1) #> fansi 1.0.6 2023-12-08 [2] CRAN (R 4.4.0) #> farver 2.1.2 2024-05-13 [2] CRAN (R 4.4.0) #> fastmap 1.2.0 2024-05-15 [2] CRAN (R 4.4.0) #> fs 1.6.4 2024-04-25 [2] CRAN (R 4.4.0) #> generics 0.1.3 2022-07-05 [2] CRAN (R 4.4.0) #> ggplot2 * 3.5.1 2024-04-23 [2] CRAN (R 4.4.0) -#> glue 1.7.0 2024-01-09 [2] CRAN (R 4.4.0) +#> glue 1.8.0 2024-09-30 [2] CRAN (R 4.4.1) #> gridExtra 2.3 2017-09-09 [2] CRAN (R 4.4.0) #> gtable 0.3.5 2024-04-22 [2] CRAN (R 4.4.0) #> hdf5r * 1.3.11 2024-07-07 [2] CRAN (R 4.4.0) @@ -1215,33 +1215,33 @@

Differential activity analysis#> htmlwidgets 1.6.4 2023-12-06 [2] CRAN (R 4.4.0) #> igraph 2.0.3 2024-03-13 [2] CRAN (R 4.4.0) #> jquerylib 0.1.4 2021-04-26 [2] CRAN (R 4.4.0) -#> jsonlite 1.8.8 2023-12-04 [2] CRAN (R 4.4.0) +#> jsonlite 1.8.9 2024-09-20 [2] CRAN (R 4.4.1) #> knitr 1.48 2024-07-07 [2] CRAN (R 4.4.0) #> labeling 0.4.3 2023-08-29 [2] CRAN (R 4.4.0) #> lattice 0.22-6 2024-03-20 [2] CRAN (R 4.4.1) #> lifecycle 1.0.4 2023-11-07 [2] CRAN (R 4.4.0) -#> limma 3.60.4 2024-07-17 [2] Bioconductor 3.19 (R 4.4.1) +#> limma 3.60.6 2024-10-02 [2] Bioconductor 3.19 (R 4.4.1) #> magrittr 2.0.3 2022-03-30 [2] CRAN (R 4.4.0) -#> Matrix * 1.7-0 2024-04-26 [2] CRAN (R 4.4.1) +#> Matrix * 1.7-1 2024-10-18 [2] CRAN (R 4.4.1) #> munsell 0.5.1 2024-04-01 [2] CRAN (R 4.4.0) #> pheatmap 1.0.12 2019-01-04 [2] CRAN (R 4.4.0) #> pillar 1.9.0 2023-03-22 [2] CRAN (R 4.4.0) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.4.0) -#> pkgdown 2.1.0 2024-07-06 [2] CRAN (R 4.4.0) +#> pkgdown 2.1.1 2024-09-17 [2] CRAN (R 4.4.1) #> plyr 1.8.9 2023-10-02 [2] CRAN (R 4.4.0) #> png 0.1-8 2022-11-29 [2] CRAN (R 4.4.0) #> R6 2.5.1 2021-08-19 [2] CRAN (R 4.4.0) -#> ragg 1.3.2 2024-05-15 [2] CRAN (R 4.4.0) +#> ragg 1.3.3 2024-09-11 [2] CRAN (R 4.4.1) #> RColorBrewer 1.1-3 2022-04-03 [2] CRAN (R 4.4.0) #> Rcpp 1.0.13 2024-07-17 [2] CRAN (R 4.4.0) #> reshape2 1.4.4 2020-04-09 [2] CRAN (R 4.4.0) -#> reticulate 1.38.0 2024-06-19 [2] CRAN (R 4.4.0) +#> reticulate 1.39.0 2024-09-05 [2] CRAN (R 4.4.1) #> rlang 1.1.4 2024-06-04 [2] CRAN (R 4.4.0) -#> rmarkdown 2.27 2024-05-17 [2] CRAN (R 4.4.0) -#> rstudioapi 0.16.0 2024-03-24 [2] CRAN (R 4.4.0) +#> rmarkdown 2.28 2024-08-17 [2] CRAN (R 4.4.0) +#> rstudioapi 0.17.0 2024-10-16 [2] CRAN (R 4.4.1) #> sass 0.4.9 2024-03-15 [2] CRAN (R 4.4.0) #> scales 1.3.0 2023-11-28 [2] CRAN (R 4.4.0) -#> scMINER * 1.1.0 2024-09-20 [1] local +#> scMINER * 1.1.0 2024-11-13 [1] local #> sessioninfo 1.2.2 2021-12-06 [2] CRAN (R 4.4.0) #> statmod 1.5.0 2023-01-06 [2] CRAN (R 4.4.0) #> stringi 1.8.4 2024-05-06 [2] CRAN (R 4.4.0) @@ -1253,10 +1253,10 @@

Differential activity analysis#> utf8 1.2.4 2023-10-22 [2] CRAN (R 4.4.0) #> vctrs 0.6.5 2023-12-01 [2] CRAN (R 4.4.0) #> withr 3.0.1 2024-07-31 [2] CRAN (R 4.4.0) -#> xfun 0.46 2024-07-18 [2] CRAN (R 4.4.0) +#> xfun 0.48 2024-10-03 [2] CRAN (R 4.4.1) #> yaml 2.3.10 2024-07-26 [2] CRAN (R 4.4.0) #> -#> [1] /private/var/folders/v0/njhqcmrs32xgrjgx2wz8d50r0000gp/T/RtmpmSBmO8/temp_libpathc1e57953063 +#> [1] /private/var/folders/v0/njhqcmrs32xgrjgx2wz8d50r0000gp/T/Rtmpf8JULY/temp_libpath11ae7194479 #> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #> #> ──────────────────────────────────────────────────────────────────────────────

@@ -1274,7 +1274,7 @@

Differential activity analysis -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/authors.html b/docs/authors.html index e8d2a5f..9737737 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -85,7 +85,7 @@

Citation

diff --git a/docs/index.html b/docs/index.html index fd240f6..6028439 100644 --- a/docs/index.html +++ b/docs/index.html @@ -139,7 +139,7 @@

Developers

diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 9757bf9..1a99c65 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -152,3 +152,11 @@ async function searchFuse(query, callback) { }); }); })(window.jQuery || window.$) + +document.addEventListener('keydown', function(event) { + // Check if the pressed key is '/' + if (event.key === '/') { + event.preventDefault(); // Prevent any default action associated with the '/' key + document.getElementById('search-input').focus(); // Set focus to the search input + } +}); diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 08cb72a..475270d 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,9 +1,9 @@ pandoc: 3.1.11 -pkgdown: 2.1.0 +pkgdown: 2.1.1 pkgdown_sha: ~ articles: quick_tutorial: quick_tutorial.html -last_built: 2024-09-20T19:02Z +last_built: 2024-11-13T18:54Z urls: reference: https://jyyulab.github.io/scMINER/reference article: https://jyyulab.github.io/scMINER/articles diff --git a/docs/reference/MICAplot.html b/docs/reference/MICAplot.html index b198bb1..22b4c74 100644 --- a/docs/reference/MICAplot.html +++ b/docs/reference/MICAplot.html @@ -175,7 +175,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/SparseExpressionSet-class.html b/docs/reference/SparseExpressionSet-class.html index 8bd705c..d2893a9 100644 --- a/docs/reference/SparseExpressionSet-class.html +++ b/docs/reference/SparseExpressionSet-class.html @@ -46,7 +46,7 @@

SparseExpressionSet

diff --git a/docs/reference/addMICAoutput.html b/docs/reference/addMICAoutput.html index f218b97..03e7b8a 100644 --- a/docs/reference/addMICAoutput.html +++ b/docs/reference/addMICAoutput.html @@ -75,9 +75,8 @@

Value

Examples

data(pbmc14k_expression.eset)
 pbmc14k_log2cpm.eset <- addMICAoutput(pbmc14k_expression.eset,
-                                      mica_output_file = system.file("extdata/demo_pbmc14k/MICA/clustering_UMAP_euclidean_20_2.05.txt", package = "scMINER"),
+                                      mica_output_file = system.file("extdata/demo_pbmc14k/MICA/clustering_UMAP_euclidean_20_2.05_3500.txt", package = "scMINER"),
                                       visual_method = "umap")
-#> Error in addMICAoutput(pbmc14k_expression.eset, mica_output_file = system.file("extdata/demo_pbmc14k/MICA/clustering_UMAP_euclidean_20_2.05.txt",     package = "scMINER"), visual_method = "umap"): The eset and the mica_output_file do not match. Please check and re-try.