Skip to content

Commit

Permalink
Optimize manual; fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
mvfki committed Sep 16, 2024
1 parent 287d7ac commit 0c95e47
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 62 deletions.
9 changes: 3 additions & 6 deletions R/DEG_marker.R
Original file line number Diff line number Diff line change
Expand Up @@ -1011,9 +1011,8 @@ computePval <- function(ustat, ties, N, n1n2) {
#' @param groupSize Maximum number of cells in each group to be downsampled for
#' plotting. Default \code{50}.
#' @param column_title Title on the column. Default \code{NULL}.
#' @param ... Parameter passed to wrapped functions in the inheritance order:
#' \code{\link{plotGeneHeatmap}}, \code{\link{.plotHeatmap}},
#' \code{ComplexHeatmap::\link[ComplexHeatmap]{Heatmap}}
#' @inheritDotParams plotGeneHeatmap cellAnnotation
#' @inheritDotParams .plotHeatmap transpose showCellLabel showCellLegend showFeatureLabel cellAnnColList featureAnnColList scale trim baseSize cellTextSize featureTextSize cellTitleSize featureTitleSize legendTextSize legendTitleSize viridisOption viridisDirection RColorBrewerOption
#' @return A \linkS4class{HeatmapList} object.
#' @examples
#' defaultCluster(pbmc) <- pbmcPlot$leiden_cluster
Expand Down Expand Up @@ -1116,9 +1115,7 @@ plotMarkerHeatmap <- function(
#' \code{NULL} includes dataset source and the default cluster.
#' @param column_title Title on the column. Default \code{NULL}.
#' @param seed Random seed for reproducibility. Default \code{1}.
#' @param ... Parameter passed to wrapped functions in the inheritance order:
#' \code{\link{plotGeneHeatmap}}, \code{\link{.plotHeatmap}},
#' \code{ComplexHeatmap::\link[ComplexHeatmap]{Heatmap}}
#' @inheritDotParams .plotHeatmap transpose showCellLabel showCellLegend showFeatureLabel cellAnnColList featureAnnColList scale trim baseSize cellTextSize featureTextSize cellTitleSize featureTitleSize legendTextSize legendTitleSize viridisOption viridisDirection RColorBrewerOption
#' @return A \linkS4class{HeatmapList} object.
#' @examples
#' defaultCluster(pbmc) <- pbmcPlot$leiden_cluster
Expand Down
51 changes: 29 additions & 22 deletions R/classes.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,29 @@ NULL
#' higher level \linkS4class{liger} object
#' @docType class
#' @rdname ligerDataset-class
#' @slot rawData Raw data.
#' @slot normData Normalized data
#' @slot scaleData Scaled data, usually with subset variable features
#' @slot scaleUnsharedData Scaled data of features not shared with other
#' datasets
#' @slot varUnsharedFeatures Variable features not shared with other datasets
#' @slot V matrix
#' @slot A matrix
#' @slot B matrix
#' @slot H matrix
#' @slot U matrix
#' @slot h5fileInfo list
#' @slot featureMeta Feature metadata, DataFrame
#' @slot colnames character
#' @slot rownames character
#' @slot rawData Raw data. Feature by cell matrix. Most of the time, sparse
#' matrix of integer numbers for RNA and ATAC data.
#' @slot normData Normalized data. Feature by cell matrix. Sparse if the
#' \code{rawData} it is normalized from is sparse.
#' @slot scaleData Scaled data, usually with subset shared variable features, by
#' cells. Most of the time sparse matrix of float numbers. This is the data used
#' for iNMF factorization.
#' @slot scaleUnsharedData Scaled data of variable features not shared with
#' other datasets. This is the data used for UINMF factorization.
#' @slot varUnsharedFeatures Variable features not shared with other datasets.
#' @slot V iNMF output matrix holding the dataset specific gene loading of each
#' factor. Feature by factor matrix.
#' @slot A Online iNMF intermediate product matrix.
#' @slot B Online iNMF intermediate product matrix.
#' @slot H iNMF output matrix holding the factor loading of each cell. Factor by
#' cell matrix.
#' @slot U UINMF output matrix holding the unshared variable gene loading of
#' each factor. Feature by factor matrix.
#' @slot h5fileInfo list of meta information of HDF5 file used for constructing
#' the object.
#' @slot featureMeta Feature metadata, DataFrame object.
#' @slot colnames Character vector of unique cell identifiers.
#' @slot rownames Character vector of unique feature names.
#' @importClassesFrom S4Vectors DataFrame
#' @exportClass ligerDataset
ligerDataset <- setClass(
Expand Down Expand Up @@ -147,7 +155,7 @@ setValidity("ligerDataset", .valid.ligerDataset)
#' be a \linkS4class{ligerDataset} object containing dataset specific
#' information, such as the expression matrices. The other parts of liger object
#' stores information that can be shared across the analysis, such as the cell
#' metadata and factorization result matrices.
#' metadata.
#'
#' This manual provides explanation to the \code{liger} object structure as well
#' as usage of class-specific methods. Please see detail sections for more
Expand All @@ -160,14 +168,13 @@ setValidity("ligerDataset", .valid.ligerDataset)
#' \code{dataset}, \code{dataset<-}, \code{datasets} or \code{datasets<-} to
#' interact with. See detailed section accordingly.
#' @slot cellMeta \linkS4class{DFrame} object for cell metadata. Pre-existing
#' metadata, QC metrics, cluster labeling, low-dimensional embedding and etc.
#' are all stored here. Use generic \code{cellMeta}, \code{cellMeta<-},
#' \code{$}, \code{[[]]} or \code{[[]]<-} to interact with. See detailed section
#' accordingly.
#' @slot varFeatures Character vector of feature names. Use generic
#' metadata, QC metrics, cluster labeling and etc. are all stored here. Use
#' generic \code{cellMeta}, \code{cellMeta<-}, \code{$}, \code{[[]]} or
#' \code{[[]]<-} to interact with. See detailed section accordingly.
#' @slot varFeatures Character vector of names of variable features. Use generic
#' \code{varFeatures} or \code{varFeatures<-} to interact with. See detailed
#' section accordingly.
#' @slot W Matrix of gene loading for each factor. See
#' @slot W iNMF output matrix of shared gene loadings for each factor. See
#' \code{\link{runIntegration}}.
#' @slot H.norm Matrix of aligned factor loading for each cell. See
#' \code{\link{quantileNorm}} and \code{\link{runIntegration}}.
Expand Down
3 changes: 1 addition & 2 deletions R/heatmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
#' @param viridisOption See \code{option} argument of
#' \code{\link[viridisLite]{viridis}}. Default \code{"C"} (plasma) for
#' \code{plotGeneHeatmap} and \code{"D"} (viridis) for \code{plotFactorHeatmap}.
#' @param ... Additional arguments passed to general function
#' \code{\link{.plotHeatmap}} and \code{\link[ComplexHeatmap]{Heatmap}}.
#' @inheritDotParams .plotHeatmap transpose showCellLabel showCellLegend showFeatureLabel showFeatureLegend cellAnnColList featureAnnColList scale baseSize cellTextSize featureTextSize cellTitleSize featureTitleSize legendTextSize legendTitleSize viridisDirection RColorBrewerOption
#' @return \code{\link[ComplexHeatmap]{HeatmapList-class}} object
#' @export
#' @rdname plotHeatmap
Expand Down
2 changes: 1 addition & 1 deletion R/import.R
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ createH5LigerDataset <- function(
#' tempPath <- tempfile(fileext = ".rds")
#' saveRDS(lig, tempPath)
#'
#' lig <- readLiger(tempPath, h5FilePath = c(ctrl = h5tempPath))
#' lig <- readLiger(tempPath, h5FilePath = list(ctrl = h5tempPath))
#'
#' \dontrun{
#' # Read a old liger object <= 1.0.1
Expand Down
13 changes: 6 additions & 7 deletions man/liger-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 23 additions & 15 deletions man/ligerDataset-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 29 additions & 2 deletions man/plotHeatmap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 35 additions & 3 deletions man/plotMarkerHeatmap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 31 additions & 3 deletions man/plotPairwiseDEGHeatmap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/readLiger.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0c95e47

Please sign in to comment.