split_baits_fs: Wrapper for split_baits() that interacts with the filesystem

Description Usage Arguments Value Examples

Description

Calculates p-values under the negative binomial model. Subsequently regroups putative interactions by bait, rather than by distance, to prepare them for parallel RJMCMC processing. Generates a separate file for each bait. Paths are stored in baitlist.txt, which serves as a to-do list for peaky().

Usage

1
split_baits_fs(bins_dir, residuals_dir, indices, output_dir, plots = TRUE)

Arguments

bins_dir

Directory containing putative interactions that are binned by distance.

residuals_dir

Directory where the adjusted read counts from each distance bin are stored.

indices

Indices of distance bins whose baits are processed. These must all have had null models fitted.

output_dir

Directory where all putative interactive will be stored, one file per bait. Will be created if it does not exist.

plots

Whether adjusted readcounts are to be plotted aganst distance and stored for each bait.

Value

The output directory.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
base = system.file("extdata",package="peaky")
interactions_file = paste0(base,"/counts.tsv")
bins_dir = paste0(base,"/bins")
fragments_file = paste0(base,"/fragments.bed")

bin_interactions_fs(interactions_file, fragments_file, output_dir=bins_dir)

fits_dir = paste0(base,"/fits")

for(bin_index in 1:5){
  ## Not run: model_bin_fs(bins_dir,bin_index,output_dir=fits_dir,subsample_size=1000)
}

baits_dir = paste0(base,"/baits")

## Not run: split_baits_fs(bins_dir,residuals_dir = fits_dir, indices=1:5, output_dir = baits_dir)

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