make_cicero_cds: Create cicero input CDS

View source: R/runCicero.R

make_cicero_cdsR Documentation

Create cicero input CDS

Description

Function to generate an aggregated input CDS for cicero. run_cicero takes as input an aggregated cicero CDS object. This function will generate the CDS given an input CDS (perhaps generated by make_atac_cds) and a value for k, which is the number of cells to be aggregated per bin. The default value for k is 50.

Usage

make_cicero_cds(
  cds,
  reduced_coordinates,
  k = 50,
  summary_stats = NULL,
  size_factor_normalize = TRUE,
  silent = FALSE,
  return_agg_info = FALSE
)

Arguments

cds

Input CDS object.

reduced_coordinates

A data frame with columns representing the coordinates of each cell in reduced dimension space (generally 2-3 dimensions). row.names(reduced_coordinates) should match the cell names in the CDS object. If dimension reduction was done using monocle, tSNE coordinates can be accessed by t(reducedDimA(cds)), and DDRTree coordinates can be accessed by t(reducedDimS(cds)).

k

Number of cells to aggregate per bin.

summary_stats

Which numeric pData(cds) columns you would like summarized (mean) by bin in the resulting CDS object.

size_factor_normalize

Logical, should accessibility values be normalized by size factor?

silent

Logical, should warning and info messages be printed?

return_agg_info

Logical, should a list of the assignments of cells to aggregated bins be output? When TRUE, this function returns a list of two items, first, the aggregated CDS object and second, a data.frame with the binning information.

Details

Aggregation of similar cells is done using a k-nearest-neighbors graph and a randomized "bagging" procedure. Details are available in the publication that accompanies this package. Run citation("cicero") for publication details. KNN is calculated using knn.index

Value

Aggregated CDS object. If return_agg_info is TRUE, a list of the aggregated CDS object and a data.frame of aggregation info.

Examples

## Not run: 
  data("cicero_data")

  input_cds <- make_atac_cds(cicero_data, binarize = TRUE)
  input_cds <- reduceDimension(input_cds, max_components = 2, num_dim=6,
                               reduction_method = 'tSNE',
                               norm_method = "none")
  tsne_coords <- t(reducedDimA(input_cds))
  row.names(tsne_coords) <- row.names(pData(input_cds))
  cicero_cds <- make_cicero_cds(input_cds, reduced_coordinates = tsne_coords)

## End(Not run)


cole-trapnell-lab/cicero documentation built on March 13, 2023, 6:02 p.m.