model_bin_fs.Rd
Parametrizes a negative binomial null model for the readcounts in a given distance bin. Covariates are the distance between an interaction's bait and prey fragments, their lengths, and transchromosomal bait activity. Randomized quantile residuals computed from this model are taken as noise-adjusted readcounts and stored on disk.
model_bin_fs( bins_dir, bin_index, output_dir, subsample_size = NA, gamlss_cycles = 200, gamlss_crit = 0.1, formula_add = NA, formula_replace = NA )
bins_dir | Directory containing putative interactions that are binned by distance. |
---|---|
bin_index | Index of the bin to be processed. |
output_dir | Directory where the parametrized model and adjusted readcounts will be stored. Will be created if it does not exist. |
subsample_size | Number of interactions based on which the null-model is parametrized. By default, all are used. |
gamlss_cycles | GAMLSS maximum number of cycles for convergence (see gamlss::gamlss.control). |
gamlss_crit | GAMLSS convergence criterion (see gamlss::gamlss.control). |
formula_add | Additional covariates for the default model formula. To add covariates A and B when modelling counts, supply "A + B". |
formula_replace | Replaces the default model formula entirely. Suppled in the form "N ~ A + B". Takes precedence over formula_add. |
List containing the path to the output directory, the null model, and the adjusted read counts.
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:8){ if (FALSE) model_bin_fs(bins_dir,bin_index,output_dir=fits_dir) }