as_sparse_matrix: Converts tidy integration matrices in the original sparse...

View source: R/utility-functions.R

as_sparse_matrixR Documentation

Converts tidy integration matrices in the original sparse matrix form.

Description

[Stable] This function is particularly useful when a sparse matrix structure is needed by a specific function (mainly from other packages).

Usage

as_sparse_matrix(
  x,
  single_value_col = "Value",
  fragmentEstimate = "fragmentEstimate",
  seqCount = "seqCount",
  barcodeCount = "barcodeCount",
  cellCount = "cellCount",
  ShsCount = "ShsCount",
  key = pcr_id_column()
)

Arguments

x

A single tidy integration matrix or a list of integration matrices. Supports also multi-quantification matrices obtained via comparison_matrix

single_value_col

Name of the column containing the values when providing a single-quantification matrix

fragmentEstimate

For multi-quantification matrix support: the name of the fragment estimate values column

seqCount

For multi-quantification matrix support: the name of the sequence count values column

barcodeCount

For multi-quantification matrix support: the name of the barcode count values column

cellCount

For multi-quantification matrix support: the name of the cell count values column

ShsCount

For multi-quantification matrix support: the name of the Shs Count values column

key

The name of the sample identifier fields (for aggregated matrices can be a vector with more than 1 element)

Value

Depending on input, 2 possible outputs:

  • A single sparse matrix (data frame) if input is a single quantification matrix

  • A list of sparse matrices divided by quantification if input is a single multi-quantification matrix or a list of matrices

See Also

Other Utilities: comparison_matrix(), enable_progress_bars(), export_ISA_settings(), generate_Vispa2_launch_AF(), generate_blank_association_file(), generate_default_folder_structure(), import_ISA_settings(), separate_quant_matrices(), transform_columns()

Examples

data("integration_matrices", package = "ISAnalytics")
sparse <- as_sparse_matrix(integration_matrices)

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