Learn R Programming

chicane (version 0.1.8)

add.covariates: add.covariates

Description

Add model covariates (trans counts and distance) to an interactions data table.

Usage

add.covariates(interaction.data)

Arguments

interaction.data

data.table with interaction data. Must contain columns bait.id, target.id, bait.chr, bait.start, bait.end, target.chr, target.start, target.end and count.

Value

Updated data table with new columns

bait.trans.count

number of trans interactions of bait fragment

target.trans.count

number of trans interactions of target fragment

distance

distance between bait and target fragment, or NA if trans

Examples

Run this code
# NOT RUN {
	data(bre80);
input.cols <- c('bait.id', 'target.id', 'bait.chr', 'bait.start', 
	'bait.end', 'target.chr', 'target.start', 'target.end', 'count');
output <- add.covariates(bre80[, input.cols, with = FALSE]);

# }

Run the code above in your browser using DataLab