hlpr_summarize_trajectory_df | R Documentation |
Joins a compiled trajectory data.frame with the desired information and summarizes those.
hlpr_summarize_trajectory_df(
object,
ctdf,
binwidth = 5,
variables,
whole_sample = FALSE,
method_gs = "mean",
verbose = TRUE,
summarize_with = c("mean"),
with_sd = TRUE,
drop_all_na = TRUE,
normalize = FALSE
)
object |
An object of class |
ctdf |
A compiled trajectory data.frame containing the variables 'barcodes', 'sample', 'x', 'y', 'projection_length', 'trajectory_part'. |
binwidth |
Numeric value. Denotes the binwidth with which to sort all relevant barcode spots into groups that are then aligned with respect to the chosen trajectory's direction.#' |
variables |
Character vector. The variables of interest:
|
whole_sample |
Logical. If TRUE, normalization of the values used takes place in the light of the complete sample. |
method_gs |
Character value. The method according to which gene sets will be handled specified as a character of length one. This can be either 'mean or one of 'gsva', 'ssgsea', 'zscore', or 'plage'. The latter four will be given to gsva::GSVA(). |
verbose |
Logical. If set to TRUE informative messages regarding the computational progress will be printed. (Warning messages will always be printed.) |
summarize_with |
Character value. Name of the function with which to summarize. |
normalize |
Logical. If set to TRUE values will be scaled to 0-1. Hint: Variables that are uniformly expressed can not be scaled and are discarded. |
Initially the compiled trajectory data.frame of the specified trajectory
is joined with the respective input of variables via joinWithVariables()
.
The argument binwidth
refers to the amount of which the barcode-spots of the
given trajectory will be summarized with regards to the trajectory's direction:
The amount of binwidth
and the previously specified 'trajectory width' in createTrajectories()
determine the length and width of the sub-rectangles in which the rectangle the
trajectory embraces are splitted and in which all barcode-spots are binned.
Via dplyr::summarize()
the variable-means of every sub-rectangle are calculated.
These mean-values are then arranged according to the trajectory's direction.
Eventually the data.frame is shifted via tidyr::pivot_longer()
to a data.frame in which
every observation refers to the mean-value of one of the specified variable-elements (e.g. a specified
gene set) of the particular sub-rectangle. The returned data.frame contains the following variables:
trajectory_part: Character. Specifies the trajectory's sub-part of the observation. (Negligible if there is only one trajectory part.)
trajectory_part_order: Numeric. Indicates the order within the trajectory-part. (Negligible if there is only one trajectory part.)
trajectory_order: Numeric. Indicates the order within the whole trajectory.
gene_sets, genes or features: Character. The respective gene sets, gene or feature the value refers to.
values: Numeric. The actual summarized values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.