sample_reference_data: Sample genes from reference dataset

Description Usage Arguments Value Note Examples

View source: R/reference.R

Description

Sample genes from reference dataset

Usage

1
sample_reference_data(reference_data, p, percent_ZI = NULL, threshold_ZI = 0.2)

Arguments

reference_data

The reference data.frame to use.

p

The number of genes (columns) to sample.

percent_ZI

The desired percentage of zero-inflated genes. This percentage of zero-inflated genes will be sampled from the reference dataset, and the remaining will be non-zero-inflated. If NULL, then genes are sampled at random from the reference dataset.

threshold_ZI

The minimum proportion of zero counts for a gene to be considered as zero inflated. This is used to identify which genes in the reference dataset are zero-inflated.

Value

The modified reference dataset.

Note

If p is greater than the number of columns in the reference dataset, then sampling with replacement will be used (with a warning message).

Examples

1
2
3
data(reference)
rnaseq <- reference$rnaseq
rnaseq_subset <- sample_reference_data(rnaseq, 10)

SeqNet documentation built on July 9, 2021, 9:08 a.m.