cumulative_is: Expands integration matrix with the cumulative IS union over...

View source: R/analysis-functions.R

cumulative_isR Documentation

Expands integration matrix with the cumulative IS union over time.

Description

[Experimental] Given an input integration matrix that can be grouped over time, this function adds integrations in groups assuming that if an integration is observed at time point "t" then it is also observed in time point "t+1".

Usage

cumulative_is(
  x,
  key = c("SubjectID", "CellMarker", "Tissue", "TimePoint"),
  timepoint_col = "TimePoint",
  include_tp_zero = FALSE,
  counts = TRUE,
  keep_og_is = FALSE,
  expand = TRUE
)

Arguments

x

An integration matrix, ideally aggregated via aggregate_values_by_key()

key

The aggregation key used

timepoint_col

The name of the time point column

include_tp_zero

Should time point 0 be included?

counts

Add cumulative counts? Logical

keep_og_is

Keep original set of integrations as a separate column?

expand

If FALSE, for each group, the set of integration sites is returned in a separate column as a nested table, otherwise the resulting column is unnested.

Value

A data frame

Required tags

The function will explicitly check for the presence of these tags:

  • All columns declared in mandatory_IS_vars()

  • Checks if the matrix is annotated by assessing presence of annotation_IS_vars()

See Also

Other Analysis functions: CIS_grubbs(), HSC_population_size_estimate(), compute_abundance(), gene_frequency_fisher(), is_sharing(), iss_source(), sample_statistics(), top_integrations(), top_targeted_genes()

Examples

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")
)
cumulated_is <- cumulative_is(aggreg)
cumulated_is

calabrialab/ISAnalytics documentation built on Nov. 2, 2023, 8:57 p.m.