make_clustering_matrix {seqsetvis} | R Documentation

## make_clustering_matrix

### Description

Create a wide matrix from a tidy data.table more suitable for clustering methods

### Usage

    make_clustering_matrix(
      tidy_dt,
      row_ = "id",
      column_ = "x",
      fill_ = "y",
      facet_ = "sample",
      max_rows = 500,
      max_cols = 100,
      clustering_col_min = -Inf,
      clustering_col_max = Inf,
      dcast_fill = NA
    )

### Arguments

`tidy_dt` | the tidy data.table to covert to a wide matrix. Must have entries for variables specified by row_, column_, fill_, and facet_.
`row_` | variable name mapped to row, likely peak id or gene name for ngs data
`column_` | varaible mapped to column, likely bp position for ngs data
`fill_` | numeric variable to map to fill
`facet_` | variable name to facet horizontally by
`max_rows` | for speed rows are sampled to 500 by default, use Inf to plot full data
`max_cols` | for speed columns are sampled to 100 by default, use Inf to plot full data
`clustering_col_min` | numeric minimum for col range considered when clustering, default in -Inf
`clustering_col_max` | numeric maximum for col range considered when clustering, default in Inf
`dcast_fill` | value to supply to dcast fill argument. default is NA.

### Value

A wide matrix version of input tidy data.table

### Examples

    mat = make_clustering_matrix(CTCF_in_10a_profiles_dt)
    mat[1:5, 1:5]

[Package seqsetvis version 1.12.0 Index]