Description Usage Arguments Details Value Examples
View source: R/stochastic_simulation.R
Samples the expected library size of each individual/sample, accounting for potential lane size effects (i.e. the impact of samples being processed on different lanes).
1 2 3 4 5 6 7 8 | sampleLibrarySize(
samples_list,
meanLogLibSize_lane = 7,
sdLogLibSize_lane = 0.5,
sdLogLibSize_samples = 0.2,
laneEffect = F,
nLanes = 2
)
|
samples_list |
List of sample/individual names. |
meanLogLibSize_lane |
Numeric. The mean of the log10 mean library size normal distribution (see Details). Default value of 7. |
sdLogLibSize_lane |
Numeric. The sd of the log10 mean library size normal distribution (see Details). Default value of 0.5. |
sdLogLibSize_samples |
Numeric. The sd of the log10 samples library size normal distribution (see Details). Default value of 0.2. |
laneEffect |
Boolean. Are the samples processed on different lanes/batches? Default value is FALSE. |
nLanes |
Numeric. How many lanes are there in the experiment? Automatically set to 1 if |
The expected library size of each individual is sampled from a log-normal distribution. The mean of this distribution
depends on the lane on which the individual/sample is processed. By default, when laneEffect = FALSE
, all samples
are assumed to be processed in a single batch. Thus their library size is sampled from a log-normal distribution with
identical mean (equal to meanLogLibSize_lane
) and sd sdLogLibSize_samples
. If laneEffect = TRUE
, the
samples are assumed to be processed in nLanes
batches, that each have a different mean log-library size. In this
case, the mean of the log-normal distribution for each lane is sampled from a normal distribution with mean
meanLogLibSize_lane
and sd sdLogLibSize_lane
. In turn, the expected library size of each individual/sample
is sampled form a log-normal distribution with the corresponding lane-dependent mean, and sd sdLogLibSize_samples
.
A list:
lane
: the lane on which each sample is processed.
expected_library_size
: the expected library size of each sample.
lane_mean_library_size
: the mean library size of each lane.
1 2 3 | samples_list = sapply(1:10, function(x){paste0("Ind", x)})
libsize = sampleLibrarySize(samples_list)
libsize = sampleLibrarySize(samples_list, laneEffect = TRUE, nLanes = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.