R/shaman.R
shaman_score_hic_points.Rdshaman_score_hic_points
shaman_score_hic_points(
obs_track_nms,
exp_track_nms,
points,
regional_interval,
min_dist = 1024,
k = 100,
k_exp = 2 * k
)Names of observed 2D genomic tracks for the hic data. Pooling of multiple observed tracks is supported.
Names of expected (shuffled) 2D genomic tracks. Pooling of multiple expected tracks is supported.
A score will be computed for each of the points.
An expansion of the focus interval, including points outside the focus 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 lower resolution maps, decrease k.
The number of neighbor distances used for the score on the expected tracks (see
shaman_score_hic_mat).
NULL if insufficient observed data, otherwise a list with one element: points - the given points with their score (column score).
This function extracts observed data and expected data in an expanded matrix and computes the score for each observed point. The score for a point is the KS D-statistic of the distances to its k nearest neighbors in the observed data compared to the expected data.
# Set misha db to test
library(misha)
gsetroot(shaman_get_test_track_db())
focus <- gintervals.2d(2, 176.7e06, 176.8e06, 2, 176.7e06, 176.8e06)
points <- gextract("hic_obs", focus, band = c(-5e05, -1024))
mat_score <- shaman_score_hic_points(
obs_track_nms = "hic_obs", exp_track_nms = "hic_exp",
points = points, regional_interval = gintervals.2d(2, 176.5e06, 177e06, 2, 176.5e06, 177e06)
)
#> obs = hic_obs
#> n_obs = 97618, n_exp = 200292, k_exp = 200
shaman_gplot_map_score(mat_score$points)