get_input: Extract input data.

View source: R/get_input.R

get_inputR Documentation

Extract input data.

Description

General data accessing getter function to return any of:

  • data,

  • segmentation,

  • normalisation factors.

The function uses the what parameter to return the appropriate type of information

Since the input formats are different, the outputs are also different based on the value of what, but they are always in tibble format.

Besides obvious columns, these information will also be available in the returned tibbles.

  • what = "data": modality and value_type, the latter reporting the likelihood code associated to the modality.

  • what = "segmentation":

    • ATAC_nonzerovals and ATAC_peaks, reporting the number of ATAC entries mapped to a segment, and the number of peaks these come from. Note that one non-zero entry is given by a cell that reported a ATAC count in a peak mapping within the segment.

    • RNA_nonzerovals and RNA_genes, reporting the number of RNA entries mapped to a segment, and the number of genes these come from. For RNA, one non-zero entry is given by a cell that reported an RNA count in a gene mapping within the segment.

  • what = "normalisation": just modality.

Usage

get_input(x, what = "data")

Arguments

x

An object of class rcongasplus.

what

Any of "data", "segmentation" or "normalisation".

Value

A tibble; its format depends on what. See the examples.

Examples

data(example_object)

# Extract the input data, after mapping to segments
get_input(example_object, what = 'data') 

# e.g., in this way you can get input ATAC values
get_input(example_object, what = 'data') %>% dplyr::filter(modality == 'ATAC')
 
# Extract the input segmentation. 
get_input(example_object, what = 'segmentation')
 
# Extract the input normalisation factors
get_input(example_object, what = 'normalisation')

Militeee/rcongas documentation built on Nov. 1, 2024, 2:38 a.m.