sample_partitions_by_cells_by_half: Generate Random, Non-Overlapping Two-Set Partition of Cells...

Description Usage Arguments Value References

View source: R/sample_partitions_by_cells.R

Description

Generate Random, Non-Overlapping Two-Set Partition of Cells By Half

Usage

1
2
3
4
5
6
7
8
sample_partitions_by_cells_by_half(
  reads,
  fraction,
  w_tolerance = 0.01,
  max_rejections = 100L,
  warn = TRUE,
  ...
)

Arguments

reads

A data.frame with n reads from C cells.

fraction

A numeric of length two in (0,1/2] specifying the size of each partition relative to n, where the first element specifies the "reference" partition and the second the "test" partition. For backward compatible reasons, if of length one, then it's equivalent to specifying fraction = c(reference = 1/2, test = fraction).

w_tolerance

Maximum allowed difference between target weight of each part (e.g. fraction * 1) and the actual total weight of the part (i.e. sum(w[part]). There is a one-to-one relationship between weight tolerance and read-count tolerance. The effective read-count tolerance can be calculated as fraction * n. If all parts are within the tolerance, the sampled partition is accepted, otherwise it is rejected.

max_rejections

The maximum number of rejections before giving up.

warn

If TRUE, a warning is produced if the parts produced are not of equal size.

...

Additional argument passed to sample_partitions_similar_weights_by_half.

Value

A list of two disjoint random non-overlapping partitions where each element holds indices in {1, 2, ..., n}. The first element holds the 'reference' partition and the second the 'test' partition.

References

https://github.com/HenrikBengtsson/SegalM_2017-FISH/issues/16


HenrikBengtsson/TopDomStudy documentation built on May 14, 2021, 1:49 p.m.