Skip to content

Commit

Permalink
markdownified roxygen blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
federicomarini committed Sep 12, 2024
1 parent 6b1c78f commit e63fe6d
Show file tree
Hide file tree
Showing 26 changed files with 244 additions and 241 deletions.
12 changes: 6 additions & 6 deletions R/correlatePCs.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#'
#' Computes the significance of (cor)relations between PCA scores and the sample
#' experimental covariates, using Kruskal-Wallis test for categorial variables
#' and the \code{cor.test} based on Spearman's correlation for continuous
#' and the `cor.test` based on Spearman's correlation for continuous
#' variables
#'
#' @param pcaobj A \code{prcomp} object
#' @param coldata A \code{data.frame} object containing the experimental
#' @param pcaobj A `prcomp` object
#' @param coldata A `data.frame` object containing the experimental
#' covariates
#' @param pcs A numeric vector, containing the corresponding PC number
#'
#' @return A \code{data.frame} object with computed p values for each covariate
#' @return A `data.frame` object with computed p values for each covariate
#' and for each principal component
#'
#' @examples
Expand Down Expand Up @@ -53,10 +53,10 @@ correlatePCs <- function(pcaobj, coldata, pcs = 1:4) {
#'
#' Plots the significance of the (cor)relation of each covariate vs a principal component
#'
#' @param pccorrs A \code{data.frame} object generated by \link{correlatePCs}
#' @param pccorrs A `data.frame` object generated by [correlatePCs]
#' @param pc An integer number, corresponding to the principal component of
#' interest
#' @param logp Logical, defaults to \code{TRUE}, displays the -\code{log10} of
#' @param logp Logical, defaults to `TRUE`, displays the -`log10` of
#' the pvalue instead of the p value itself
#'
#' @return A base plot object
Expand Down
2 changes: 1 addition & 1 deletion R/deprecated.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#'
#' @section Transitioning to the mosdef framework:
#'
#' * [topGOtable()] is now being replaced by the more flexible
#' - [topGOtable()] is now being replaced by the more flexible
#' [mosdef::run_topGO()] function
#'
#' @author Federico Marini
Expand Down
6 changes: 3 additions & 3 deletions R/distro_expr.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Plot distribution of expression values
#'
#' @param rld A \code{\link{DESeqTransform}} object.
#' @param plot_type Character, choose one of \code{boxplot}, \code{violin} or
#' \code{density}. Defaults to \code{density}
#' @param rld A [DESeqTransform()] object.
#' @param plot_type Character, choose one of `boxplot`, `violin` or
#' `density`. Defaults to `density`
#'
#' @return A plot with the distribution of the expression values
#' @export
Expand Down
16 changes: 8 additions & 8 deletions R/genespca.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
#' Computes and plots the principal components of the genes, eventually displaying
#' the samples as in a typical biplot visualization.
#'
#' The implementation of this function is based on the beautiful \code{ggbiplot}
#' The implementation of this function is based on the beautiful `ggbiplot`
#' package developed by Vince Vu, available at https://github.com/vqv/ggbiplot.
#' The adaptation and additional parameters are tailored to display typical genomics data
#' such as the transformed counts of RNA-seq experiments
#'
#' @param x A \code{\link{DESeqTransform}} object, with data in \code{assay(x)},
#' produced for example by either \code{\link{rlog}} or
#' \code{\link{varianceStabilizingTransformation}}
#' @param x A [DESeqTransform()] object, with data in `assay(x)`,
#' produced for example by either [rlog()] or
#' [varianceStabilizingTransformation()]
#' @param ntop Number of top genes to use for principal components,
#' selected by highest row variance
#' @param choices Vector of two numeric values, to select on which principal components to plot
Expand All @@ -37,7 +37,7 @@
#' @param circle.prob Size of the correlation circle in Normal probability
#' @param varname.size Size of the text for variable names
#' @param varname.adjust Adjustment factor the placement of the variable names,
#' >= 1 means farther from the arrow
#' '>= 1' means farther from the arrow
#' @param varname.abbrev Logical, whether or not to abbreviate the variable names
#' @param returnData Logical, if TRUE returns a data.frame for further use, containing the
#' selected principal components for custom plotting
Expand All @@ -47,10 +47,10 @@
#' to allow for distinguishing where the variables are plotted
#' @param useRownamesAsLabels Logical, if TRUE uses the row names as labels for plotting
#' @param point_size Size of the points to be plotted for the observations (genes)
#' @param annotation A \code{data.frame} object, with row.names as gene identifiers (e.g. ENSEMBL ids)
#' and a column, \code{gene_name}, containing e.g. HGNC-based gene symbols
#' @param annotation A `data.frame` object, with row.names as gene identifiers (e.g. ENSEMBL ids)
#' and a column, `gene_name`, containing e.g. HGNC-based gene symbols
#'
#' @return An object created by \code{ggplot}, which can be assigned and further customized.
#' @return An object created by `ggplot`, which can be assigned and further customized.
#'
#' @examples
#'
Expand Down
18 changes: 9 additions & 9 deletions R/get_annotation.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' Get an annotation data frame from biomaRt
#'
#' @param dds A \code{\link{DESeqDataSet}} object
#' @param dds A [DESeqDataSet()] object
#' @param biomart_dataset A biomaRt dataset to use. To see the list, type
#' \code{mart = useMart('ensembl')}, followed by \code{listDatasets(mart)}.
#' `mart = useMart('ensembl')`, followed by `listDatasets(mart)`.
#' @param idtype Character, the ID type of the genes as in the row names of
#' \code{dds}, to be used for the call to \code{\link{getBM}}
#' `dds`, to be used for the call to [getBM()]
#'
#' @return A data frame for ready use in \code{pcaExplorer}, retrieved from biomaRt.
#' @return A data frame for ready use in `pcaExplorer`, retrieved from biomaRt.
#' @export
#'
#' @examples
Expand Down Expand Up @@ -44,18 +44,18 @@ To obtain a list, type mart = useMart('ensembl'), followed by listDatasets(mart)

#' Get an annotation data frame from org db packages
#'
#' @param dds A \code{\link{DESeqDataSet}} object
#' @param orgdb_species Character string, named as the \code{org.XX.eg.db}
#' @param dds A [DESeqDataSet()] object
#' @param orgdb_species Character string, named as the `org.XX.eg.db`
#' package which should be available in Bioconductor
#' @param idtype Character, the ID type of the genes as in the row names of
#' \code{dds}, to be used for the call to \code{\link{mapIds}}
#' `dds`, to be used for the call to [mapIds()]
#' @param key_for_genenames Character, corresponding to the column name for the
#' key in the orgDb package containing the official gene name (often called
#' gene symbol).
#' This parameter defaults to "SYMBOL", but can be adjusted in case the key is not
#' found in the annotation package (e.g. for \code{org.Sc.sgd.db}).
#' found in the annotation package (e.g. for `org.Sc.sgd.db`).
#'
#' @return A data frame for ready use in \code{pcaExplorer}, retrieved from the
#' @return A data frame for ready use in `pcaExplorer`, retrieved from the
#' org db packages
#' @export
#'
Expand Down
10 changes: 5 additions & 5 deletions R/hi_loadings.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#' Extract genes with highest loadings
#'
#' @param pcaobj A \code{prcomp} object
#' @param pcaobj A `prcomp` object
#' @param whichpc An integer number, corresponding to the principal component of
#' interest
#' @param topN Integer, number of genes with top and bottom loadings
#' @param exprTable A \code{matrix} object, e.g. the counts of a \code{\link{DESeqDataSet}}.
#' @param exprTable A `matrix` object, e.g. the counts of a [DESeqDataSet()].
#' If not NULL, returns the counts matrix for the selected genes
#' @param annotation A \code{data.frame} object, with row.names as gene identifiers (e.g. ENSEMBL ids)
#' and a column, \code{gene_name}, containing e.g. HGNC-based gene symbols
#' @param annotation A `data.frame` object, with row.names as gene identifiers (e.g. ENSEMBL ids)
#' and a column, `gene_name`, containing e.g. HGNC-based gene symbols
#' @param title The title of the plot
#'
#' @return A ggplot2 object, or a \code{matrix}, if \code{exprTable} is not null
#' @return A ggplot2 object, or a `matrix`, if `exprTable` is not null
#'
#' @examples
#' dds <- makeExampleDESeqDataSet_multifac(betaSD = 3, betaSD_tissue = 1)
Expand Down
10 changes: 5 additions & 5 deletions R/makeds.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#' Make a simulated DESeqDataSet for two or more experimental factors
#'
#' Constructs a simulated dataset of Negative Binomial data from different conditions.
#' The fold changes between the conditions can be adjusted with the \code{betaSD_condition}
#' and the \code{betaSD_tissue} arguments.
#' The fold changes between the conditions can be adjusted with the `betaSD_condition`
#' and the `betaSD_tissue` arguments.
#'
#' This function is designed and inspired following the proposal of
#' \code{\link{makeExampleDESeqDataSet}} from the \code{DESeq2} package. Credits are given
#' [makeExampleDESeqDataSet()] from the `DESeq2` package. Credits are given
#' to Mike Love for the nice initial implementation
#'
#' @param n number of rows (genes)
Expand All @@ -15,10 +15,10 @@
#' @param interceptMean the mean of the intercept betas (log2 scale)
#' @param interceptSD the standard deviation of the intercept betas (log2 scale)
#' @param dispMeanRel a function specifying the relationship of the dispersions on
#' \code{2^trueIntercept}
#' `2^trueIntercept`
#' @param sizeFactors multiplicative factors for each sample
#'
#' @return a \code{\link{DESeqDataSet}} with true dispersion,
#' @return a [DESeqDataSet()] with true dispersion,
#' intercept for two factors (condition and tissue) and beta values in the
#' metadata columns. Note that the true betas are provided on the log2 scale.
#'
Expand Down
4 changes: 2 additions & 2 deletions R/pair_corr.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#' @param df A data frame, containing the (raw/normalized/transformed) counts
#' @param log Logical, whether to convert the input values to log2 (with addition
#' of a pseudocount). Defaults to FALSE.
#' @param method Character string, one of \code{pearson} (default), \code{kendall}, or
#' \code{spearman} as in \code{cor}
#' @param method Character string, one of `pearson` (default), `kendall`, or
#' `spearman` as in `cor`
#' @param use_subset Logical value. If TRUE, only 1000 values per sample will be used
#' to speed up the plotting operations.
#'
Expand Down
Loading

0 comments on commit e63fe6d

Please sign in to comment.