Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: scaffold
Type: Package
Title: Simulation framework that models each step of a single-cell RNA-seq experiment
Version: 0.5.0
Version: 0.6.0
Author: Rhonda Bacher
Maintainer: Rhonda Bacher <rbacher@ufl.edu>
Description: This package implements Scaffold — a method to simulate scRNA-seq data.
Expand All @@ -10,12 +10,9 @@ LazyData: true
Encoding: UTF-8
Imports:
wrswoR,
parallel,
MASS,
SingleCellExperiment,
yarrr,
methods,
Rcpp,
splines,
Rfast,
data.table,
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Generated by roxygen2: do not edit by hand

export(captureStep)
export(estimateScaffoldParameters)
export(generateDynamicGeneCounts)
export(makePlots)
export(sequenceStep10X)
export(sequenceStepC1)
export(simulateScaffold)
exportClasses(ScaffoldParams)
import(data.table)
Expand Down
12 changes: 12 additions & 0 deletions R/amplification.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#' Pre-amplification step
#' @param capturedMolecules A truncated lists of genes.
#' @param genes A vector of names for each gene. If left NULL, the gene names from the \code{sce} object are used.
#' @param efficiencyPCR A numeric vector representing the efficiency of PCR for each sample.
#' @param rounds An integer specifying the number of PCR or IVT amplification rounds to perform.
#' @param typeAMP The amplification method used in the simulation, defaults to "PCR", "IVT" is another accepted value.
#' @param useUMI A TRUE/FALSE indicating whether the protocol should use UMIs (Unique Molecular Identifiers). Droplet or 10X protocols have this set as TRUE for the default, otherwise FALSE.
#'
#' @importFrom Rfast Table rep_col
preamplifyStep <- function(capturedMolecules, genes, efficiencyPCR, rounds, typeAMP, useUMI){

Expand All @@ -24,6 +31,11 @@ preamplifyStep <- function(capturedMolecules, genes, efficiencyPCR, rounds, type
}

#' The second amplification step
#' @param capturedMolecules A truncated lists of genes.
#' @param genes A vector of names for each gene. If left NULL, the gene names from the \code{sce} object are used.
#' @param efficiencyPCR A numeric vector representing the efficiency of PCR for each sample.
#' @param rounds An integer specifying the number of PCR or IVT amplification rounds to perform.
#' @param protocol The protocol to model in the simulation (accepted input is: C1, droplet, 10X).
amplifyStep <- function(capturedMolecules, genes, efficiencyPCR, rounds, protocol){

if (protocol == "C1")
Expand Down
8 changes: 8 additions & 0 deletions R/capture.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#' Capture cDNA from cell (cell lysis and conversion of mRNA to cDNA)
#' @param Data A rounded numeric matrix of gene expression counts.
#' @param captureEffCell A vector of values between 0 and 1 to indicate the proportion of mRNA molecules successfully captured for the genes in each cell.
#' @param captureEffGene A vector of values between 0 and 1. If left NULL, all genes are assumed to have equal capture efficiency, and the vector is normalized to sum to 1.
#' @param rtEffCell A vector of values between 0 and 1 to indicate the proportion of mRNA succesfully converted to cDNA.
#' @param rtEffGene A vector with values normalized to sum to 1.
#' @param useUMI A TRUE/FALSE indicating whether the protocol should use UMIs (Unique Molecular Identifiers). Droplet or 10X protocols have this set as TRUE for the default, otherwise FALSE.
#'
#' @importFrom wrswoR sample_int_rej
#' @export
captureStep <- function(Data, captureEffCell = NULL, captureEffGene = NULL,
rtEffCell = NULL, rtEffGene = NULL, useUMI = FALSE){

Expand Down
2 changes: 2 additions & 0 deletions R/initialCounts.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ generateGeneCounts <- function(numCells, mu, popHet) {
## The motivation for this code is from the simstudy package
#' @inheritParams generateGeneCounts
#' @inheritParams estimateScaffoldParameters
#' @param dynamicParams This should be a named list with elements: propGenes, dynGenes, degree, knots, and theta. propGenes indicates the proportion of genes that should be simulated dynamic. dynGenes is an optional parameter detailing an exact list of genes that will be generated as dynamic. degree, knots, and theta control the spline parameters to generate dynamic trends.
#' @importFrom splines bs
#' @importFrom data.table data.table
#' @export
generateDynamicGeneCounts <- function(numCells, mu, dynamicParams) {

if (is.null(dynamicParams$dynGenes)) {
Expand Down
Loading