Browse code

Updated documentation

Dharmesh Bhuva authored on 20/09/2024 03:50:12
Showing 3 changed files

... ...
@@ -3,6 +3,9 @@
3 3
 export(SpaNorm)
4 4
 export(fastSizeFactors)
5 5
 export(filterGenes)
6
+exportClasses(SpaNormFit)
7
+exportMethods("$")
8
+import(methods)
6 9
 importFrom(methods,is)
7 10
 importFrom(stats,dnbinom)
8 11
 importFrom(stats,mad)
... ...
@@ -1,3 +1,29 @@
1
+#' @name SpaNormFit
2
+#'
3
+#' @title An S4 class to store a SpaNorm model fit
4
+#' @slot ngenes a numeric, specifying the number of genes in the dataset.
5
+#' @slot ncells a numeric, specifying the number of cells/spots in the dataset.
6
+#' @slot gene.model a character, specifying the gene-specific model to used (see `getGeneModels()`).
7
+#' @slot df.tps an integer, specifying the degrees of freedom to used for the thin plate spline.
8
+#' @slot sample.p a numeric, specifying the proportion of samples used to approximated the model.
9
+#' @slot lambda.a a numeric, specifying the shinkage parameter used.
10
+#' @slot batch a vector or matrix, specifying the batch design used (if any). 
11
+#' @slot W a matrix, specifying the covariate matrix of the linear model.
12
+#' @slot alpha a matrix, specifying the coefficients of the linear model.
13
+#' @slot gmean a numeric, specifying the mean estimate for each gene in the linear model.
14
+#' @slot psi a numeric, specifying the over-dispersion parameter for each geneif a negative binomial model was used (or a vector of NAs if another gene model is used).
15
+#' @slot isbio a logical, specifying the columns of the covariate matrix that represent biology.
16
+#' @slot loglik a numeric, specifying the log-likelihood of the model at each external iteration.
17
+#' 
18
+#' @param x an object of class SpaNormFit.
19
+#' @param name a character, specifying the name of the slot to retrieve.
20
+#' @return Return value varies depending on method.
21
+#' @examples
22
+#' example(SpaNorm)
23
+NULL
24
+
25
+#' @export
26
+#' @import methods
1 27
 setClass(
2 28
   Class = "SpaNormFit",
3 29
   slots = c(
... ...
@@ -17,6 +43,8 @@ setClass(
17 43
   )
18 44
 )
19 45
 
46
+#' @rdname SpaNormFit
47
+#' @export
20 48
 setMethod(
21 49
   f = "$",
22 50
   signature = "SpaNormFit",
23 51
new file mode 100644
... ...
@@ -0,0 +1,53 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/AllClasses.R
3
+\name{SpaNormFit}
4
+\alias{SpaNormFit}
5
+\alias{$,SpaNormFit-method}
6
+\title{An S4 class to store a SpaNorm model fit}
7
+\usage{
8
+\S4method{$}{SpaNormFit}(x, name)
9
+}
10
+\arguments{
11
+\item{x}{an object of class SpaNormFit.}
12
+
13
+\item{name}{a character, specifying the name of the slot to retrieve.}
14
+}
15
+\value{
16
+Return value varies depending on method.
17
+}
18
+\description{
19
+An S4 class to store a SpaNorm model fit
20
+}
21
+\section{Slots}{
22
+
23
+\describe{
24
+\item{\code{ngenes}}{a numeric, specifying the number of genes in the dataset.}
25
+
26
+\item{\code{ncells}}{a numeric, specifying the number of cells/spots in the dataset.}
27
+
28
+\item{\code{gene.model}}{a character, specifying the gene-specific model to used (see \code{getGeneModels()}).}
29
+
30
+\item{\code{df.tps}}{an integer, specifying the degrees of freedom to used for the thin plate spline.}
31
+
32
+\item{\code{sample.p}}{a numeric, specifying the proportion of samples used to approximated the model.}
33
+
34
+\item{\code{lambda.a}}{a numeric, specifying the shinkage parameter used.}
35
+
36
+\item{\code{batch}}{a vector or matrix, specifying the batch design used (if any).}
37
+
38
+\item{\code{W}}{a matrix, specifying the covariate matrix of the linear model.}
39
+
40
+\item{\code{alpha}}{a matrix, specifying the coefficients of the linear model.}
41
+
42
+\item{\code{gmean}}{a numeric, specifying the mean estimate for each gene in the linear model.}
43
+
44
+\item{\code{psi}}{a numeric, specifying the over-dispersion parameter for each geneif a negative binomial model was used (or a vector of NAs if another gene model is used).}
45
+
46
+\item{\code{isbio}}{a logical, specifying the columns of the covariate matrix that represent biology.}
47
+
48
+\item{\code{loglik}}{a numeric, specifying the log-likelihood of the model at each external iteration.}
49
+}}
50
+
51
+\examples{
52
+example(SpaNorm)
53
+}