R/shaman.R
shaman_shuffle_and_score_hic_mat.Rd
shaman_shuffle_and_score_hic_mat
shaman_shuffle_and_score_hic_mat(
obs_track_nms,
interval,
work_dir,
expand = 1000000,
min_dist = 1024,
k = 100,
dist_resolution = NA,
decay_smooth = NA,
hic_mcmc_max_resolution = 400,
shuffle = 80,
grid_small = 500000,
grid_high = 1000000,
grid_increase = 500000,
grid_step_iter = 40
)
Name of observed 2D genomic tracks for the hic data.
2D interval on which to compute the scores.
Centralized directory to store temporary files.
Size of expansion, points to include outside the matrix for accurate computing of the score. Note that for each observed point, its k-nearest neighbors must be included in the expanded matrix.
The minimum distance between points.
The number of neighbor distances used for the score. For higher resolution maps, increase k. For
Number of bins in each log2 distance unit. If NA, value is determined based on observed data (recommended).
Number of bins to use for smoothing the MCMC target function: the decay curve. If NA, value is determined based on observed data (recommended).
Maximum number of bins for each log2 unit.
Number of shuffling rounds for each observed point.
Initial size of maximum distance between contact pairs consdered for switching
Final size of maximum distance between contact pairs consdered for switching
Grid increase size
Number of iterations in each grid size
NULL if insufficient observed data, otherwise resturns a list containing 3 elements: 1) points - start1, start2 and score for all observed points. 2) obs - the observed points. 3) exp - the expected points. 4) exp_fn - the name of the expected (shuffled) data file
This function generates an expected 2D hic matrix based on observed hic data, and computes its score.
# Set misha db to test
gsetroot(shaman_get_test_track_db())
#> Error in setwd(groot): cannot change working directory
mat_score <- shaman_shuffle_and_score_hic_mat(
obs_track_nms = "hic_obs",
interval = gintervals.2d(2, 175.5e06, 177.5e06, 2, 175.5e06, 177.5e06),
expand = 5e05,
work_dir = tempdir()
)
#> Error: Invalid interval (chr2, 1.755e+08, 1.775e+08): end coordinate exceeds chromosome boundaries
shaman_gplot_map_score(mat_score$points)
#> Error in is.data.frame(x): object 'mat_score' not found