interpret_peaky: Interprets models fitted with peaky

Description Usage Arguments Value Details Examples

Description

Extracts the marginal posterior probabilities of contact and other relevant statistics from the RJMCMC results and merges these with bait-associated information.

Usage

1
interpret_peaky(bait, peaks, omega_power, log_file = NA)

Arguments

bait

Data table containing the putative interactions of a bait, having the columns 'baitID', 'dist', and 'residual'. These report the bait ID, its distance to putative preys, and the adjusted readcounts for its interactions with them, respectively.

peaks

The models fitted by peaky.

omega_power

The same value as used when running peaky, i.e. the expected decay of adjusted read counts around a truly interacting prey. See details.

Value

A data table containing bait-associated information, posterior probabilities of contact and other statistics.

Details

The steepness of the function to be fitted to putative peaks is determined by ω according to β \exp{- \abs{ω * d}}, where β represents peak height and d the distance from the center of the peak in bp.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
base = system.file("extdata",package="peaky")
interactions_file = paste0(base,"/counts.tsv")
fragments_file = paste0(base,"/fragments.bed")
interactions = data.table::fread(interactions_file)
fragments = data.table::fread(fragments_file)
## Not run: 
BI = bin_interactions(interactions, fragments, bins=5)
models = by(BI$interactions, BI$interactions$dist.bin, model_bin, subsample_size=1000)
residuals = lapply(models, "[[", "residuals")
bins = split(BI$interactions, BI$interactions$dist.bin)

BTS = split_baits(bins, residuals)

relevant_bait = BTS[baitID==618421]
omega_power=4.7
PKS = peaky(relevant_bait, omega_power, iterations=1e6)

interpret_peaky(relevant_bait, PKS, omega_power)

## End(Not run)

cqgd/pky documentation built on Dec. 13, 2020, 3:32 a.m.