This utility function divides a sequence of sample indices into num segments
ensuring that each segment meets a specified minimum size. It optionally
extracts a subset of each segment based on predefined selection logic:
For a single group (num = 1): selects a random contiguous sub-vector
comprising between 10% and 55% of the total samples.
For multiple groups (num > 1): selects a contiguous sub-vector
comprising approximately 75% of each segment.
Usage
divide_samples(n_samples, num, min_size)
divide_samples(n_samples, num, min_size)
Value
A list of integer vectors. Each vector contains a sequence of indices
representing a subsample of the corresponding segment.
Arguments
n_samples
Integer. Total number of samples to divide.
num
Integer. Number of desired segments or latent factors.
min_size
Integer. Minimum size (length) allowed for each segment.
Details
This function is primarily used for randomized simulation of sample blocks,
useful in bootstrapping, subsampling, or simulating latent factor scores
across multi-omics datasets.