Skip to content

Commit

Permalink
git status Renamed package back to rliger
Browse files Browse the repository at this point in the history
  • Loading branch information
mvfki committed Mar 13, 2024
1 parent d227014 commit 4e70862
Show file tree
Hide file tree
Showing 53 changed files with 305 additions and 210 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: rliger2
Package: rliger
Version: 1.99.0
Date: 2023-11-09
Type: Package
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,4 @@ importFrom(methods,show)
importFrom(rlang,"%||%")
importFrom(rlang,.data)
importFrom(utils,.DollarNames)
useDynLib(rliger2, .registration = TRUE)
useDynLib(rliger, .registration = TRUE)
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## rliger2 1.9.9
## rliger 1.9.9

- Added `ligerDataset` class for per-dataset information storage, with inheritance for specific modalities
- Added a number of plotting functions with clear function names and useful functionality
Expand All @@ -12,7 +12,7 @@
Now named by `runINMF()`, `runUINMF()` and `runOnlineINMF()` respectively, and wrapped in
`runIntegration()`.

## rliger2 1.0.1
## rliger 1.0.1

- Allow setting mito pattern in `getMitoProportion()` #271
- Fix efficiency issue when taking the log of norm.data (e.g. `runWilcoxon`)
Expand Down
10 changes: 5 additions & 5 deletions R/ATAC.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ imputeKNN <- function(
#' bmmc <- imputeKNN(bmmc, reference = "atac", queries = "rna")
#' corr <- linkGenesAndPeaks(
#' bmmc, useDataset = "rna",
#' pathToCoords = system.file("extdata/hg19_genes.bed", package = "rliger2")
#' pathToCoords = system.file("extdata/hg19_genes.bed", package = "rliger")
#' )
#' }
linkGenesAndPeaks <- function(
Expand Down Expand Up @@ -359,12 +359,12 @@ linkGenesAndPeaks <- function(
#' bmmc <- imputeKNN(bmmc, reference = "atac", queries = "rna")
#' corr <- linkGenesAndPeaks(
#' bmmc, useDataset = "rna",
#' pathToCoords = system.file("extdata/hg19_genes.bed", package = "rliger2")
#' pathToCoords = system.file("extdata/hg19_genes.bed", package = "rliger")
#' )
#' resultPath <- tempfile()
#' exportInteractTrack(
#' corrMat = corr,
#' pathToCoords = system.file("extdata/hg19_genes.bed", package = "rliger2"),
#' pathToCoords = system.file("extdata/hg19_genes.bed", package = "rliger"),
#' outputPath = resultPath
#' )
#' head(read.table(resultPath, skip = 1))
Expand Down Expand Up @@ -478,10 +478,10 @@ exportInteractTrack <- function(
#' current working directory.
#' @return No return value. A file located at \code{outputPath} will be created.
#' @name makeInteractTrack-deprecated
#' @seealso \code{\link{rliger2-deprecated}}, \code{\link{exportInteractTrack}}
#' @seealso \code{\link{rliger-deprecated}}, \code{\link{exportInteractTrack}}
NULL

#' @rdname rliger2-deprecated
#' @rdname rliger-deprecated
#' @section \code{makeInteractTrack}:
#' For \code{makeInteractTrack}, use \code{\link{exportInteractTrack}}.
#' @export
Expand Down
48 changes: 24 additions & 24 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,55 @@
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

RunModularityClusteringCpp <- function(SNN, modularityFunction, resolution, algorithm, nRandomStarts, nIterations, randomSeed, printOutput, edgefilename) {
.Call(`_rliger2_RunModularityClusteringCpp`, SNN, modularityFunction, resolution, algorithm, nRandomStarts, nIterations, randomSeed, printOutput, edgefilename)
.Call(`_rliger_RunModularityClusteringCpp`, SNN, modularityFunction, resolution, algorithm, nRandomStarts, nIterations, randomSeed, printOutput, edgefilename)
}

colNormalize_dense_cpp <- function(x, L) {
.Call(`_rliger2_colNormalize_dense_cpp`, x, L)
.Call(`_rliger_colNormalize_dense_cpp`, x, L)
}

colAggregateMedian_dense_cpp <- function(x, group, n) {
.Call(`_rliger2_colAggregateMedian_dense_cpp`, x, group, n)
.Call(`_rliger_colAggregateMedian_dense_cpp`, x, group, n)
}

scaleNotCenter_byRow_rcpp <- function(x) {
.Call(`_rliger2_scaleNotCenter_byRow_rcpp`, x)
.Call(`_rliger_scaleNotCenter_byRow_rcpp`, x)
}

scaleNotCenter_byRow_perDataset_rcpp <- function(x, ann, n) {
.Call(`_rliger2_scaleNotCenter_byRow_perDataset_rcpp`, x, ann, n)
.Call(`_rliger_scaleNotCenter_byRow_perDataset_rcpp`, x, ann, n)
}

rowVars_sparse_rcpp <- function(x, means) {
.Call(`_rliger2_rowVars_sparse_rcpp`, x, means)
.Call(`_rliger_rowVars_sparse_rcpp`, x, means)
}

rowDivide_rcpp <- function(x, v) {
.Call(`_rliger2_rowDivide_rcpp`, x, v)
.Call(`_rliger_rowDivide_rcpp`, x, v)
}

sumSquaredDeviations <- function(x, means) {
.Call(`_rliger2_sumSquaredDeviations`, x, means)
.Call(`_rliger_sumSquaredDeviations`, x, means)
}

denseZScore <- function(x, m) {
.Call(`_rliger2_denseZScore`, x, m)
.Call(`_rliger_denseZScore`, x, m)
}

rowVarsDense <- function(x, m) {
.Call(`_rliger2_rowVarsDense`, x, m)
.Call(`_rliger_rowVarsDense`, x, m)
}

SparseRowVarStd <- function(x, mu, sd, vmax) {
.Call(`_rliger2_SparseRowVarStd`, x, mu, sd, vmax)
.Call(`_rliger_SparseRowVarStd`, x, mu, sd, vmax)
}

colAggregateSums_sparse <- function(x, group, ngroups) {
.Call(`_rliger2_colAggregateSums_sparse`, x, group, ngroups)
.Call(`_rliger_colAggregateSums_sparse`, x, group, ngroups)
}

sample_cpp <- function(x, size) {
.Call(`_rliger2_sample_cpp`, x, size)
.Call(`_rliger_sample_cpp`, x, size)
}

#' Fast calculation of feature count matrix
Expand All @@ -68,46 +68,46 @@ sample_cpp <- function(x, size) {
#' samnple <- gene.counts + promoter.counts
#' }
makeFeatureMatrix <- function(bedmat, barcodes) {
.Call(`_rliger2_makeFeatureMatrix`, bedmat, barcodes)
.Call(`_rliger_makeFeatureMatrix`, bedmat, barcodes)
}

cluster_vote_rcpp <- function(nn_ranked, clusts) {
.Call(`_rliger2_cluster_vote_rcpp`, nn_ranked, clusts)
.Call(`_rliger_cluster_vote_rcpp`, nn_ranked, clusts)
}

max_factor_rcpp <- function(H, dims_use, center = FALSE) {
.Call(`_rliger2_max_factor_rcpp`, H, dims_use, center)
.Call(`_rliger_max_factor_rcpp`, H, dims_use, center)
}

ComputeSNN <- function(nn_idx, prune) {
.Call(`_rliger2_ComputeSNN`, nn_idx, prune)
.Call(`_rliger_ComputeSNN`, nn_idx, prune)
}

WriteEdgeFile <- function(snn, filename, display_progress) {
invisible(.Call(`_rliger2_WriteEdgeFile`, snn, filename, display_progress))
invisible(.Call(`_rliger_WriteEdgeFile`, snn, filename, display_progress))
}

DirectSNNToFile <- function(nn_ranked, prune, display_progress, filename) {
.Call(`_rliger2_DirectSNNToFile`, nn_ranked, prune, display_progress, filename)
.Call(`_rliger_DirectSNNToFile`, nn_ranked, prune, display_progress, filename)
}

cpp_rank_matrix_dgc <- function(x, p, nrow, ncol) {
.Call(`_rliger2_cpp_rank_matrix_dgc`, x, p, nrow, ncol)
.Call(`_rliger_cpp_rank_matrix_dgc`, x, p, nrow, ncol)
}

rowAggregateSum_sparse <- function(X, groups, ngroups) {
.Call(`_rliger2_rowAggregateSum_sparse`, X, groups, ngroups)
.Call(`_rliger_rowAggregateSum_sparse`, X, groups, ngroups)
}

colAggregateSum_sparse <- function(X, groups, ngroups) {
.Call(`_rliger2_colAggregateSum_sparse`, X, groups, ngroups)
.Call(`_rliger_colAggregateSum_sparse`, X, groups, ngroups)
}

colNNZAggr_sparse <- function(X, groups, ngroups) {
.Call(`_rliger2_colNNZAggr_sparse`, X, groups, ngroups)
.Call(`_rliger_colNNZAggr_sparse`, X, groups, ngroups)
}

rowNNZAggr_sparse <- function(X, groups, ngroups) {
.Call(`_rliger2_rowNNZAggr_sparse`, X, groups, ngroups)
.Call(`_rliger_rowNNZAggr_sparse`, X, groups, ngroups)
}

4 changes: 2 additions & 2 deletions R/aaa.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @importFrom rlang .data %||%
#' @importFrom methods new show
#' @importFrom utils .DollarNames
#' @useDynLib rliger2, .registration = TRUE
#' @useDynLib rliger, .registration = TRUE
NULL

#' @importFrom magrittr %>%
Expand Down Expand Up @@ -75,6 +75,6 @@ scPalette <- c('#E41A1C', '#377EB8', '#4DAF4A', '#FFCF00', '#aa47b9', '#e67c14',
}

.onUnload <- function(libpath) {
library.dynam.unload("rliger2", libpath)
library.dynam.unload("rliger", libpath)
return(invisible(NULL))
}
4 changes: 2 additions & 2 deletions R/cINMF.R
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ runCINMF.Seurat <- function(
Vs[[i]] <- colNormalize_dense_cpp(V, L = 1)
}
# Vs <- lapply(seq_along(object), function(i) {
# matrix(runif(nrow(W) * k, 0, 2), nrow(W), k)
# matrix(stats::runif(nrow(W) * k, 0, 2), nrow(W), k)
# })
Hs <- lapply(seq_along(object), function(i) {
matrix(runif(ncol(object[[i]]) * k, 0, 2), ncol(object[[i]]), k)
matrix(stats::runif(ncol(object[[i]]) * k, 0, 2), ncol(object[[i]]), k)
})

if (isTRUE(verbose)) cli::cli_process_done(id = cliID)
Expand Down
10 changes: 6 additions & 4 deletions R/classes.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ setValidity("ligerDataset", .valid.ligerDataset)
#' analysis. Use \code{commands} to retrieve information. See detailed section
#' accordingly.
#' @slot uns List for unstructured meta-info of analyses or presets.
#' @slot version Record of version of rliger2 package
#' @slot version Record of version of rliger package
#' @importClassesFrom S4Vectors DataFrame
#' @importFrom ggplot2 fortify
liger <- setClass(
Expand All @@ -191,7 +191,7 @@ liger <- setClass(
),
methods::prototype(
cellMeta = methods::new("DFrame"),
version = utils::packageVersion("rliger2")
version = utils::packageVersion("rliger")
)
)

Expand All @@ -207,7 +207,9 @@ liger <- setClass(
if (!is.factor(x@cellMeta$dataset)) {
return("\"dataset\" variable in cellMeta is not a factor")
}
if (!identical(x@cellMeta$dataset, names(x@datasets))) {
ds_cm <- levels(droplevels(x@cellMeta[["dataset"]]))
ds_ds <- names(x@datasets)
if (!identical(ds_cm, ds_ds)) {
return("`levels(x$dataset)` does not match `names(x)`.")
}
return(NULL)
Expand Down Expand Up @@ -307,7 +309,7 @@ setClassUnion("POSIXct_or_NULL", c("POSIXct", "NULL"))
#' @slot objSummary List of attributes of the \linkS4class{liger} object as a
#' snapshot when command is operated.
#' @slot ligerVersion Character string converted from
#' \code{packageVersion("rliger2")}.
#' \code{packageVersion("rliger")}.
#' @slot dependencyVersion Named character vector of version number, if any
#' dependency library has a chance to be included by the function. A
#' dependency might only be invoked under certain conditions, such as using
Expand Down
4 changes: 2 additions & 2 deletions R/clustering.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ runCluster <- function(
#' \code{"louvain_cluster"} variable in \code{cellMeta} slot. Can be fetched
#' with \code{object$louvain_cluster}
#' @name louvainCluster-deprecated
#' @seealso \code{\link{rliger2-deprecated}}
#' @seealso \code{\link{rliger-deprecated}}
NULL

#' @rdname rliger2-deprecated
#' @rdname rliger-deprecated
#' @section \code{louvainCluster}:
#' For \code{louvainCluster}, use \code{\link{runCluster}(method = "louvain")}
#' as the replacement, while \code{\link{runCluster}} with default
Expand Down
6 changes: 3 additions & 3 deletions R/deprecated.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#' @title Deprecated functions in package \pkg{rliger2}.
#' @title Deprecated functions in package \pkg{rliger}.
#' @description The functions listed below are deprecated and will be defunct in
#' the near future. When possible, alternative functions with similar
#' functionality or a replacement are also mentioned. Help pages for
#' deprecated functions are available at \code{help("<function>-deprecated")}.
#' @name rliger2-deprecated
#' @name rliger-deprecated
#' @keywords internal
NULL

Expand Down Expand Up @@ -237,7 +237,7 @@ SLMCluster <-
# NULL random.seed disallowed for this program.
random.seed = 0
}
liger.dir <- "."#system.file(package = "rliger2")
liger.dir <- "."#system.file(package = "rliger")
ModularityJarFile <-
paste0(liger.dir, "/java/ModularityOptimizer.jar")
command <-
Expand Down
13 changes: 5 additions & 8 deletions R/embedding.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,12 @@ runUMAP <- function(
#' By default \code{\link[Rtsne]{Rtsne}} (Barnes-Hut implementation of t-SNE)
#' method is invoked, while alternative "fftRtsne" method (FFT-accelerated
#' Interpolation-based t-SNE, using Kluger Lab implementation) is also
#' supported.
#' supported. For very large datasets, it is recommended to use
#' \code{method = "fftRtsne"} due to its efficiency and scalability.
#'
#' In order to run fftRtsne (recommended for large datasets), FIt-SNE must be
#' installed as instructed in detailed
#' \href{https://github.com/KlugerLab/FIt-SNE}{here}. Include the path to the
#' cloned FIt-SNE directory as the \code{fitsne.path} parameter, though this is
#' only necessary for the first call to run \code{runTSNE}. For more detailed
#' FIt-SNE installation instructions, see the liger repo
#' \href{https://github.com/welch-lab/liger#readme}{README}.
#' Extra external installation steps are required for using "fftRtsne" method.
#' Please consult
#' \href{https://welch-lab.github.io/liger/articles/installation.html}{detailed guide}.
#' @param object \linkS4class{liger} object with factorization results.
#' @param useRaw Whether to use un-aligned cell factor loadings (\eqn{H}
#' matrices). Default \code{NULL} search for quantile-normalized loadings first
Expand Down
2 changes: 1 addition & 1 deletion R/h5Utility.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ safeH5Create <- function(object,
#' @rdname restoreH5Liger
#' @export
#' @examples
#' h5Path <- system.file("extdata/ctrl.h5", package = "rliger2")
#' h5Path <- system.file("extdata/ctrl.h5", package = "rliger")
#' lig <- createLiger(list(ctrl = h5Path))
#' # Now it is actually an invalid object! which is equivalent to what users
#' # will get with `saveRDS(lig, "object.rds"); lig <- readRDS("object.rds")``
Expand Down
6 changes: 3 additions & 3 deletions R/import.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#' pbmc1 <- createLiger(list(ctrl = ctrl.raw, stim = stim.raw))
#'
#' # Create from H5 files
#' h5Path <- system.file("extdata/ctrl.h5", package = "rliger2")
#' h5Path <- system.file("extdata/ctrl.h5", package = "rliger")
#' print(h5Path)
#' lig <- createLiger(list(ctrl = h5Path))
#'
Expand Down Expand Up @@ -359,7 +359,7 @@ createH5LigerDataset <- function(
#' pbmc <- readLiger(tempPath)
#'
#' # Save and read H5-based liger object
#' h5Path <- system.file("extdata/ctrl.h5", package = "rliger2")
#' h5Path <- system.file("extdata/ctrl.h5", package = "rliger")
#' lig <- createLiger(list(ctrl = h5Path))
#' tempPath <- tempfile(fileext = ".rds")
#' saveRDS(lig, tempPath)
Expand All @@ -381,7 +381,7 @@ readLiger <- function(
cli::cli_alert_info("Older version ({.val {ver}}) of {.cls liger} object detected.")
if (isTRUE(update)) {
cli::cli_alert_info(
"Updating the object structure to make it compatible with current version {.val {utils::packageVersion('rliger2')}}"
"Updating the object structure to make it compatible with current version {.val {utils::packageVersion('rliger')}}"
)
return(convertOldLiger(obj, dimredName = dimredName,
clusterName = clusterName,
Expand Down
10 changes: 5 additions & 5 deletions R/integration.R
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,10 @@ runINMF.Seurat <- function(
#' @param ... Arguments passed to other methods
#' @return \code{liger} object with H, W, and V slots set.
#' @name optimizeALS-deprecated
#' @seealso \code{\link{rliger2-deprecated}}
#' @seealso \code{\link{rliger-deprecated}}
NULL

#' @rdname rliger2-deprecated
#' @rdname rliger-deprecated
#' @section \code{optimizeALS}:
#' For \code{optimizeALS}, use \code{\link{runIntegration}} or
#' \code{\link{runINMF}}. For the case of
Expand Down Expand Up @@ -981,7 +981,7 @@ runOnlineINMF.Seurat <- function(
#' @name online_iNMF-deprecated
NULL

#' @rdname rliger2-deprecated
#' @rdname rliger-deprecated
#' @section \code{online_iNMF}:
#' For \code{online_iNMF}, use \code{\link{runIntegration}} with
#' \code{method = "online"} or \code{\link{runOnlineINMF}}.
Expand Down Expand Up @@ -1540,10 +1540,10 @@ quantileNorm.Seurat <- function(
#' @param rand.seed Random seed to allow reproducible results (default 1)
#' @return \code{liger} object with 'H.norm' and 'clusters' slot set.
#' @name quantile_norm-deprecated
#' @seealso \code{\link{rliger2-deprecated}}
#' @seealso \code{\link{rliger-deprecated}}
NULL

#' @rdname rliger2-deprecated
#' @rdname rliger-deprecated
#' @section \code{quantile_norm}:
#' For \code{quantile_norm}, use \code{\link{quantileNorm}}.
#' @export
Expand Down
Loading

0 comments on commit 4e70862

Please sign in to comment.