conversion: Conversion of decimal and binary states

Description Usage Arguments Details Value Functions Author(s) Examples

Description

Convert combinatorial states in decimal representation to combinatorial states in binary representation and vice versa.

Usage

1
2
3
dec2bin(dec, colnames = NULL, ndigits = NULL)

bin2dec(bin)

Arguments

dec

A vector with whole numbers.

colnames

The column names for the returned matrix. If specified, ndigits will be the length of colnames.

ndigits

The number of digits that the binary representation should have. If unspecified, the shortest possible representation will be chosen.

bin

A matrix with only 0 and 1 (or TRUE and FALSE) as entries. One combinatorial state per row.

Details

chromstaR uses decimal numbers to represent combinatorial states of peaks. These functions serve as a convenient way to get from the efficient decimal representation to a more human-readable binary representation.

Value

A vector of integers for bin2dec and a matrix of logicals with one state per row for dec2bin.

Functions

Author(s)

Aaron Taudt

Examples

1
2
3
decimal.states <- c(0:31)
binary.states <- dec2bin(decimal.states, colnames=paste0('mark',1:5))
control.decimal.states <- bin2dec(binary.states)

chromstaR documentation built on Nov. 8, 2020, 8:29 p.m.