View source: R/analysis-functions.R
sample_statistics | R Documentation |
The function operates on a data frame by grouping the content by
the sample key and computing every function specified on every
column in the value_columns
parameter. After that the metadata
data frame is updated by including the computed results as columns
for the corresponding key.
For this reason it's required that both x
and metadata
have the
same sample key, and it's particularly important if the user is
working with previously aggregated data.
For example:
data("integration_matrices", package = "ISAnalytics") data("association_file", package = "ISAnalytics") aggreg <- aggregate_values_by_key( x = integration_matrices, association_file = association_file, value_cols = c("seqCount", "fragmentEstimate") ) aggreg_meta <- aggregate_metadata(association_file = association_file) sample_stats <- sample_statistics(x = aggreg, metadata = aggreg_meta, value_columns = c("seqCount", "fragmentEstimate"), sample_key = c("SubjectID", "CellMarker","Tissue", "TimePoint"))
sample_statistics(
x,
metadata,
sample_key = "CompleteAmplificationID",
value_columns = "Value",
functions = default_stats(),
add_integrations_count = TRUE
)
x |
A data frame |
metadata |
The metadata data frame |
sample_key |
Character vector representing the key for identifying a sample |
value_columns |
The name of the columns to be computed, must be numeric or integer |
functions |
A named list of function or purrr-style lambdas |
add_integrations_count |
Add the count of distinct integration sites
for each group? Can be computed only if |
A list with modified x and metadata data frames
The function will explicitly check for the presence of these tags:
All columns declared in mandatory_IS_vars()
These are checked only if add_integrations_count = TRUE
.
Other Analysis functions:
CIS_grubbs()
,
HSC_population_size_estimate()
,
compute_abundance()
,
cumulative_is()
,
gene_frequency_fisher()
,
is_sharing()
,
iss_source()
,
top_integrations()
,
top_targeted_genes()
data("integration_matrices", package = "ISAnalytics")
data("association_file", package = "ISAnalytics")
stats <- sample_statistics(
x = integration_matrices,
metadata = association_file,
value_columns = c("seqCount", "fragmentEstimate")
)
stats
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.