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

interpret_peaky_fs(rjmcmclist, index, baits_dir, output_dir, omega_power)

Arguments

rjmcmclist

Path to the list of RJMCMC results to be interpreted.

index

Which RJMCMC result on the list to process, with 1 corresponding to the first one on the list.

output_dir

Directory where the merged RJMCMC results and bait information will be stored, one file per bait. Will be created if it does not exist.

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

The output directory.

Details

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

Examples

base = system.file("extdata",package="peaky") interactions_file = paste0(base,"/counts.tsv") bins_dir = paste0(base,"/bins") fragments_file = paste0(base,"/fragments.bed") if (FALSE) { bin_interactions_fs(interactions_file, fragments_file, output_dir=bins_dir) fits_dir = paste0(base,"/fits") for(bin_index in 1:5){ model_bin_fs(bins_dir,bin_index,output_dir=fits_dir,subsample_size=1000) } baits_dir = paste0(base,"/baits") split_baits_fs(bins_dir,residuals_dir = fits_dir, indices=1:5, output_dir = baits_dir) baitlist = paste0(baits_dir,"/baitlist.txt") rjmcmc_dir = paste0(base,"/rjmcmc") omega_power = 4.7 for(i in 1:3){ peaky_fs(baitlist,i,output_dir=rjmcmc_dir,omega_power=omega_power) } rjmcmc_list(rjmcmc_dir) rjmcmclist = paste0(rjmcmc_dir,"/rjmcmclist.txt") baits_rjmcmc_dir = paste0(base,"/baits_rjmcmc") interpret_peaky_fs(rjmcmclist,1,baits_dir,baits_rjmcmc_dir,omega_power) }