Skip to content

Commit

Permalink
version 0.99.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Meng Xu authored and cran-robot committed Jan 11, 2024
1 parent e5d69cc commit dc73515
Show file tree
Hide file tree
Showing 38 changed files with 1,294 additions and 1,008 deletions.
15 changes: 7 additions & 8 deletions DESCRIPTION
@@ -1,20 +1,19 @@
Type: Package
Package: inferCSN
Title: Inferring Cell-Specific Gene Regulatory Network
Version: 0.99.8
Date: 2023-12-1
Version: 0.99.9
Date: 2024-1-10
Authors@R:
person("Meng", "Xu", email = "mengxu98@qq.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-8300-1054"))
Maintainer: Meng Xu <mengxu98@qq.com>
Description: A method for inferring cell-specific gene regulatory network from single-cell sequencing data.
biocViews: CellBiology, GeneExpression
License: MIT + file LICENSE
URL: https://mengxu98.github.io/inferCSN/
BugReports: https://github.com/mengxu98/inferCSN/issues
Depends: R (>= 3.3.0)
Imports: ComplexHeatmap, data.table, doParallel, dplyr, foreach,
ggnetwork, ggplot2, ggraph, Matrix, methods, parallel,
patchwork, progress, purrr, Rcpp, stats, utils
Imports: ComplexHeatmap, doParallel, dplyr, foreach, ggnetwork,
ggplot2, ggraph, Matrix, methods, parallel, patchwork,
progress, purrr, Rcpp, stats, utils
Suggests: circlize, gtools, igraph, precrec, pROC, testthat (>= 3.0.0),
tidygraph
LinkingTo: Rcpp, RcppArmadillo
Expand All @@ -25,7 +24,7 @@ LazyData: true
RoxygenNote: 7.2.3
Language: en-US
NeedsCompilation: yes
Packaged: 2023-12-04 02:41:10 UTC; mengxu
Packaged: 2024-01-10 03:14:13 UTC; mx
Author: Meng Xu [aut, cre] (<https://orcid.org/0000-0002-8300-1054>)
Repository: CRAN
Date/Publication: 2023-12-04 05:00:02 UTC
Date/Publication: 2024-01-10 05:53:10 UTC
63 changes: 33 additions & 30 deletions MD5
@@ -1,51 +1,53 @@
e9bea6121365dec1ed085943ed12981a *DESCRIPTION
93b1f68fb8202a9fb1b40fb3cc3ff633 *DESCRIPTION
5d82e9946ace180a66d2fe6db26780f1 *LICENSE
124aaee3aef57777f96706e560b173c6 *NAMESPACE
df19d72c89d1f4c97aa240c0c2f458fd *R/RcppExports.R
54e11d92ae6cabc9166bbd9ec5d2dd7f *R/auc.calculate.R
bb9f0c7101b24f890345630e49642827 *R/compute.gene.rank.R
100ad72ff6ed9c5a5136905f3b3c5593 *R/data.R
ce91741adaec246e3a08675ecd864536 *NAMESPACE
f8f910c143e3cdcea61b3224a40f3216 *R/RcppExports.R
5e41df3ff904376d50222e6c471c9c98 *R/compute.gene.rank.R
93c096d91e635d0760fc07548343853c *R/data.R
847eb92cfddda3dbda03b7c5c67a09a8 *R/inferCSN-package.R
edf02e7164985afe9c59cf79913086b9 *R/inferCSN.R
3dcaa4b9000a4cb5285477ba35988fc5 *R/network.visualization.R
81a0533e9aa50e506b2f54da19da71f4 *R/sparse.regression.R
ac13512fc40c4ff2a58763b008c504b0 *R/utils.R
fc83289257f8a1e14e18e8e913d254c2 *README.md
191a298ed75823937c77adad132f746b *data/exampleGroundTruth.rda
975775272629b1e1438f9c89883e7728 *data/exampleMatrix.rda
9b9c13ac9a7e999c4e4cdb362fc26e8e *man/acc.calculate.Rd
5006924bd51bacb79492faac184edc4b *man/auc.calculate.Rd
755d9e5cd7a14309d094b88dc7913baf *man/check.parameters.Rd
bd356ca90db4160311bd8963b0d55532 *R/inferCSN.R
bb5a978ef9f098b4893bf2f673e1ae51 *R/network.visualization.R
6c4f3705ee09709f4934d5f05b934f1f *R/performance.calculate.R
7f692382f1ac8296293957f68e993221 *R/sparse.regression.R
150874fc891245d3acb82266dfe6ccae *R/utils.R
743e3c10dc7cbf16821bc50a44d808db *README.md
2b55dc47c2059b70a2bd23c2d432c750 *data/example_ground_truth.rda
24c5cd3136af4400250e4f1ff753532b *data/example_matrix.rda
2578bd710b697ac23ad192dae42fb6bb *man/acc.calculate.Rd
f4cdcc8e17f628c413d1fa359e8ad538 *man/auc.calculate.Rd
2ec53a0f4a4b6070a92e031b5076fa5e *man/check.parameters.Rd
cd8c767751171c96e056e3d80893d6e8 *man/coef.inferCSN.Rd
32c4e754a970b62575f8b7f62f562a18 *man/compute.gene.rank.Rd
0e2acac6074c6d1148f7157f2166271e *man/contrast.networks.Rd
6f547c7e004ad4c6636b56e991b66a7e *man/dynamic.networks.Rd
6fc6a36a0f6dedfd857d9eb59febf847 *man/exampleGroundTruth.Rd
2087072cadfb91949bc87db28efb0284 *man/exampleMatrix.Rd
f9066972df9d0e7510c9d8d59b8c2288 *man/compute.gene.rank.Rd
aa55b3102fb091d227253f9f6999fde8 *man/contrast.networks.Rd
8fb2b3dfc9d1ca445cf584ec558cef6d *man/dynamic.networks.Rd
bea92ebfc3cc63a4375cd260d58a1e42 *man/example_ground_truth.Rd
369f179d33e62b3546d42b46591e907d *man/example_matrix.Rd
4cde6e83b2d3b96a27c12cd1ba8e0091 *man/figures/inferCSN.svg
34c2dd574f80faa89edea7cebdbb042c *man/inferCSN-package.Rd
aa7762806e060cba0da53b0b41aa24a2 *man/inferCSN.Rd
814dd419ee7301a4e93848a20890ad01 *man/inferCSN.fit.Rd
e1a36c9c789891594d7e361553d8fa61 *man/inferCSN.Rd
2d869befa13c49375ec0998047e2cda5 *man/inferCSN.fit.Rd
af3a9d9f4bbf39e214377b9920d4d3b0 *man/is.scalar.Rd
f4863762ccc5a9b3ea765395905d20e0 *man/net.format.Rd
447aa592fb38dba8e88937ed73204801 *man/network.heatmap.Rd
5193697e5a6966f2fbaabbe010781d96 *man/net.format.Rd
d83d1dcf1b41088228dfdf32d025d232 *man/network.heatmap.Rd
e9d98b090265e8645318543f37e8bf24 *man/predict.inferCSN.Rd
323bf94a8a8c9b21ca80695bc7a3b7c5 *man/prepare.performance.data.Rd
1b4a2a6e2c1eed3ca4a3a0003c5c97f6 *man/print.inferCSN.Rd
9196eb6d5076b59da50ade72aadf75c3 *man/sparse.regression.Rd
9b11dcc00cdcf5b4962435dd1e6463b0 *man/sub.inferCSN.Rd
b4102c76b725683df7ea3cfcb204739c *man/sparse.regression.Rd
2a28f10fbc7f2820349d22c6db346343 *man/sub.inferCSN.Rd
f6e652deb45ec115003e4b5b8519eda7 *man/table.to.matrix.Rd
0347ffda63bae663f9354d1e0b948d57 *src/BetaVector.cpp
dadb1987bfb2f80d199a2e25b02a051d *src/CDL012LogisticSwaps.cpp
64737baec03e2641f58d5681381874d6 *src/CDL012SquaredHingeSwaps.cpp
6a4f677eff1881a88c670cf19c77773c *src/CDL012Swaps.cpp
2e4e9b0639d3f1afc4cf99411a293b67 *src/DT2Matrix.cpp
d4f2e65104193ad8b04b23281a39cd8c *src/Grid.cpp
2ebc2a8b814581ce38dd0a53cf275ce5 *src/Grid1D.cpp
8748c274ffef69c8dc7f2c0f88228b22 *src/Grid2D.cpp
09837ef4410ca3aa193eb60b7a8f681b *src/Interface.cpp
c2fbbe606dbc01e99513a08efa77bb27 *src/Makevars
c2fbbe606dbc01e99513a08efa77bb27 *src/Makevars.win
41bc93afdbfbce896558b943b882d7e7 *src/Normalize.cpp
bcd102094770a2e20628f6cb0dfc4684 *src/RcppExports.cpp
fb4ab9386a76250a1012fc799738465f *src/README.cpp
84dc9a9a029bfcd496c38c752eb58cf4 *src/RcppExports.cpp
b8da420687f2f9943625f9c8cddda799 *src/Test_Interface.cpp
e447698f0493b967abd0e0aaf2eca2c2 *src/include/BetaVector.h
e9aab72b23846ad7db4b0fa1e2597d09 *src/include/CD.h
Expand All @@ -69,6 +71,7 @@ aea94cb863ab3243b5c681f9d905c175 *src/include/Model.h
cdde68a3cfff76e8a18c34209800bea5 *src/include/Params.h
0816e979947d47e1e91c6327a62d641c *src/include/Test_Interface.h
f3a3cce4a45a5306180127b28e5aa66c *src/include/utils.h
8417052f3624d0c6f09b9c0d70cf8349 *src/table_to_matrix.cpp
82ebc8c76e0a000e5bf6e391edd49ff3 *src/utils.cpp
df29c8d17f04b962a3e708bf14894528 *tests/testthat.R
f5308b3a8977a0ede564b85be6086740 *tests/testthat/test-inferCSN.R
bcc163d15e0ca1aa9b55d2b4de9e03f1 *tests/testthat/test-inferCSN.R
6 changes: 6 additions & 0 deletions NAMESPACE
Expand Up @@ -17,14 +17,20 @@ export(inferCSN.fit)
export(is.scalar)
export(net.format)
export(network.heatmap)
export(prepare.performance.data)
export(sparse.regression)
export(sub.inferCSN)
export(table.to.matrix)
exportMethods(inferCSN)
import(Matrix)
import(doParallel)
import(foreach)
import(ggnetwork)
import(ggplot2)
import(ggraph)
import(parallel)
import(patchwork)
import(progress)
importFrom(Rcpp,evalCpp)
importFrom(methods,as)
importFrom(methods,is)
Expand Down
8 changes: 4 additions & 4 deletions R/RcppExports.R
@@ -1,10 +1,6 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

DT2Matrix <- function(weightDT) {
.Call('_inferCSN_DT2Matrix', PACKAGE = 'inferCSN', weightDT)
}

inferCSNFit_sparse <- function(X, y, Loss, Penalty, Algorithm, NnzStopNum, G_ncols, G_nrows, Lambda2Max, Lambda2Min, PartialSort, MaxIters, rtol, atol, ActiveSet, ActiveSetNum, MaxNumSwaps, ScaleDownFactor, ScreenSize, LambdaU, Lambdas, ExcludeFirstK, Intercept, withBounds, Lows, Highs) {
.Call('_inferCSN_inferCSNFit_sparse', PACKAGE = 'inferCSN', X, y, Loss, Penalty, Algorithm, NnzStopNum, G_ncols, G_nrows, Lambda2Max, Lambda2Min, PartialSort, MaxIters, rtol, atol, ActiveSet, ActiveSetNum, MaxNumSwaps, ScaleDownFactor, ScreenSize, LambdaU, Lambdas, ExcludeFirstK, Intercept, withBounds, Lows, Highs)
}
Expand Down Expand Up @@ -97,3 +93,7 @@ R_matrix_center_sparse <- function(mat, X_normalized, intercept) {
.Call('_inferCSN_R_matrix_center_sparse', PACKAGE = 'inferCSN', mat, X_normalized, intercept)
}

table_to_matrix <- function(weight_table) {
.Call('_inferCSN_table_to_matrix', PACKAGE = 'inferCSN', weight_table)
}

128 changes: 0 additions & 128 deletions R/auc.calculate.R

This file was deleted.

50 changes: 31 additions & 19 deletions R/compute.gene.rank.R
@@ -1,29 +1,41 @@
#' @title Compute and rank TFs in network
#'
#' @param weightDT The weight data table of network
#' @param directedGraph If GRN is directed or not
#' @param weight_table The weight data table of network
#' @param directed If GRN is directed or not
#'
#' @return A data.table with three columns
#' @export
#'
#' @examples
#' library(inferCSN)
#' data("exampleMatrix")
#' weightDT <- inferCSN(exampleMatrix)
#' ranks <- compute.gene.rank(weightDT)
#' data("example_matrix")
#' weight_table <- inferCSN(example_matrix)
#' ranks <- compute.gene.rank(weight_table)
#' head(ranks)
#'
compute.gene.rank <- function(weightDT,
directedGraph = FALSE) {
colnames(weightDT) <- c("regulatory", "target", "weight")
weightDT$weight <- abs(weightDT$weight)
tfnet <- igraph::graph_from_data_frame(weightDT, directed = directedGraph)
pageRank <- data.frame(igraph::page_rank(tfnet, directed = directedGraph)$vector)
colnames(pageRank) <- c("pageRank")
pageRank$gene <- rownames(pageRank)
pageRank <- pageRank[, c("gene", "pageRank")]
pageRank <- pageRank[order(pageRank$pageRank, decreasing = TRUE), ]
pageRank$isRegulator <- FALSE
pageRank$isRegulator[pageRank$gene %in% unique(weightDT$regulatory)] <- TRUE
return(pageRank)
compute.gene.rank <- function(
weight_table,
directed = FALSE) {
colnames(weight_table) <- c("regulatory", "target", "weight")
weight_table$weight <- abs(weight_table$weight)
tfnet <- igraph::graph_from_data_frame(
weight_table,
directed = directed
)
page_rank_res <- data.frame(
igraph::page_rank(tfnet, directed = directed)$vector
)
colnames(page_rank_res) <- c("pageRank")
page_rank_res$gene <- rownames(page_rank_res)
page_rank_res <- page_rank_res[, c("gene", "pageRank")]
page_rank_res <- page_rank_res[order(
page_rank_res$pageRank,
decreasing = TRUE
), ]
page_rank_res$isRegulator <- FALSE
page_rank_res$isRegulator[
page_rank_res$gene %in% unique(
weight_table$regulatory
)
] <- TRUE
return(page_rank_res)
}
4 changes: 2 additions & 2 deletions R/data.R
@@ -1,13 +1,13 @@
#' @docType data
#' @name exampleMatrix
#' @name example_matrix
#'
#' @title Example matrix data
#' @description The matrix used for reconstruct gene regulatory network.
#'
NULL

#' @docType data
#' @name exampleGroundTruth
#' @name example_ground_truth
#'
#' @title Example ground truth data
#' @description The data used for calculate the evaluating indicator.
Expand Down

0 comments on commit dc73515

Please sign in to comment.