subsamplefunction is recommended).
It is also useful for reproducing the results of an earlier run (see Details).
generateSubsampledMatrix(counts, proportion, seed, replication = 1)
ssby retrieving the seed with
getSeed(ss). When given along with the original counts, the proportion, and the replication number (if more than one subsampling was done at each proportion) this produces the same matrix as was used in the analysis.
The seed is calculated deterministically using an md5 hash of three combined values: the global seed used for the subsampling object, the subsampling proportion, and the replication # for that proportion.
data(hammer) hammer.counts = Biobase::exprs(hammer)[, 1:4] hammer.design = Biobase::pData(hammer)[1:4, ] hammer.counts = hammer.counts[rowSums(hammer.counts) >= 5, ] ss = subsample(hammer.counts, c(.01, .1, 1), treatment=hammer.design$protocol, method=c("edgeR", "DESeq2", "voomLimma")) seed = getSeed(ss) # generate the matrices used at each subsample subm.01 = generateSubsampledMatrix(hammer.counts, .01, seed) subm.1 = generateSubsampledMatrix(hammer.counts, .1, seed)