binstats.Rd
Given GRanges of binned eg read depth data with field $cn, crosses nodes in graph and annotates graph nodes with 'cn' and 'weight'. Done upstream of balance.
If "by" field(s) specified and these fields exist in both bins and graph nodes, then will use these in the overlaps query
If field, purity, and ploidy provided then will also transform read depth data in bin column "field" using purity and ploidy to generate
binstats(
gg,
bins,
by = NULL,
field = NULL,
purity = gg$meta$purity,
ploidy = gg$meta$ploidy,
loess = TRUE,
min.bins = 3,
verbose = TRUE,
min.var = 0.1,
lp = FALSE
)
gGraph
GRanges with field $cn or field field
optional character vector specifying metadata field(s) shared by gg$nodes and bins to which bin / node overlaps will be limited to
character vector field of bins to convert to (NULL)
purity parameter either specified together with field or embedded in gg$meta, must be specified if field is not NULL
ploidy parameter either specified together with field or embedded in gg$meta, must be specified if field is not NULL
logical flag whether to smooth / fit variance using loess (FALSE)
minimum number of bins to use for intra segment variance computation (3)
minimal allowable per segment bin variance, which will ignore segments with very low variance due to all 0 or other reasons (0.1)
(logical) return weights consistent with LP optimization
gGraph whose nodes are annotated with $cn and $weight field