makeBinary: Convert the count matrix to binary matrix

View source: R/makeBinary.R

makeBinaryR Documentation

Convert the count matrix to binary matrix

Description

This function takes a snap obj as input, then convert count matrix to a binary matrix.

Usage

makeBinary(obj, mat, outlier.filter)

Arguments

obj

A snap obj.

mat

A character class indicates what matrix slot to use c("bmat", "pmat", "gmat").

outlier.filter

A numeric class within the range between 0 and 1. The non-zero elememnts in the count matrix are identified annd filtered as outliers (default 1e-3)

Details

It has been observed that some entries in the count matrix have exceedingly high value, which we suspect are due to alingnment or other type of errors. This function first identifies the top outlier.filter ( non-zero values in the count matrix as cutoff and then remove any values above this cutoff as outliers.

Value

Returns a Snap obj with the binary matrix stored in obj@bmat

Examples

data(demo.sp);
demo.sp = makeBinary(demo.sp, mat="bmat");


r3fang/SnapATAC documentation built on March 29, 2022, 4:33 p.m.