diff --git a/.travis.yml b/.travis.yml index 2ca7ef4d0b7252b79ace810df877bbf0d1519945..639f1ef2864d8048de97c4c32a3411df313d110c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,8 @@ addons: - libgsl-dev # dependency for gsl>copula>zinbwave - libmagick++-dev # dependency for magick r_check_args: "--no-vignettes" -#install: skip + +install: skip #install: # - R -e 'install.packages("knitr")' # - R -e 'install.packages("devtools")' diff --git a/DESCRIPTION b/DESCRIPTION index b797881634787530a5b7f3259cca54a4e528dc68..cfc39edda777e607fb3d48738b5a016546699b72 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -70,7 +70,7 @@ biocViews: SingleCell, RNASeq, Transcriptomics, GeneExpression, Sequencing, Software, ImmunoOncology URL: https://github.com/Oshlack/splatter BugReports: https://github.com/Oshlack/splatter/issues -RoxygenNote: 6.1.1 +RoxygenNote: 7.0.2 Encoding: UTF-8 VignetteBuilder: knitr Language: en-GB diff --git a/man/BASiCSEstimate.Rd b/man/BASiCSEstimate.Rd index c06c7fb099186293aa733625c87e93d1660b8210..42cc7f1c44e42cdc25c282608810079abb829735 100644 --- a/man/BASiCSEstimate.Rd +++ b/man/BASiCSEstimate.Rd @@ -6,19 +6,47 @@ \alias{BASiCSEstimate.matrix} \title{Estimate BASiCS simulation parameters} \usage{ -BASiCSEstimate(counts, spike.info = NULL, batch = NULL, n = 20000, - thin = 10, burn = 5000, regression = TRUE, - params = newBASiCSParams(), verbose = TRUE, progress = TRUE, ...) +BASiCSEstimate( + counts, + spike.info = NULL, + batch = NULL, + n = 20000, + thin = 10, + burn = 5000, + regression = TRUE, + params = newBASiCSParams(), + verbose = TRUE, + progress = TRUE, + ... +) -\method{BASiCSEstimate}{SingleCellExperiment}(counts, spike.info = NULL, - batch = NULL, n = 20000, thin = 10, burn = 5000, - regression = TRUE, params = newBASiCSParams(), verbose = TRUE, - progress = TRUE, ...) +\method{BASiCSEstimate}{SingleCellExperiment}( + counts, + spike.info = NULL, + batch = NULL, + n = 20000, + thin = 10, + burn = 5000, + regression = TRUE, + params = newBASiCSParams(), + verbose = TRUE, + progress = TRUE, + ... +) -\method{BASiCSEstimate}{matrix}(counts, spike.info = NULL, - batch = NULL, n = 20000, thin = 10, burn = 5000, - regression = TRUE, params = newBASiCSParams(), verbose = TRUE, - progress = TRUE, ...) +\method{BASiCSEstimate}{matrix}( + counts, + spike.info = NULL, + batch = NULL, + n = 20000, + thin = 10, + burn = 5000, + regression = TRUE, + params = newBASiCSParams(), + verbose = TRUE, + progress = TRUE, + ... +) } \arguments{ \item{counts}{either a counts matrix or a SingleCellExperiment object diff --git a/man/addFeatureStats.Rd b/man/addFeatureStats.Rd index 2ac4f6ed52da0918568d29b0182a21694394f6b2..07b60e63dbec0e5183a7de5bb20cea757a0c417f 100644 --- a/man/addFeatureStats.Rd +++ b/man/addFeatureStats.Rd @@ -4,8 +4,13 @@ \alias{addFeatureStats} \title{Add feature statistics} \usage{ -addFeatureStats(sce, value = c("counts", "cpm", "tpm", "fpkm"), - log = FALSE, offset = 1, no.zeros = FALSE) +addFeatureStats( + sce, + value = c("counts", "cpm", "tpm", "fpkm"), + log = FALSE, + offset = 1, + no.zeros = FALSE +) } \arguments{ \item{sce}{SingleCellExperiment to add feature statistics to.} diff --git a/man/addGeneLengths.Rd b/man/addGeneLengths.Rd index 057dac7ea4cfee1baddb421c36d8bdd4b4b0ba96..afb6e868bad1a8a780a19baf3963b0f673c82474 100644 --- a/man/addGeneLengths.Rd +++ b/man/addGeneLengths.Rd @@ -4,8 +4,13 @@ \alias{addGeneLengths} \title{Add gene lengths} \usage{ -addGeneLengths(sce, method = c("generate", "sample"), loc = 7.9, - scale = 0.7, lengths = NULL) +addGeneLengths( + sce, + method = c("generate", "sample"), + loc = 7.9, + scale = 0.7, + lengths = NULL +) } \arguments{ \item{sce}{SingleCellExperiment to add gene lengths to.} diff --git a/man/compareSCEs.Rd b/man/compareSCEs.Rd index db1f4d798ee236d6e24c58b106fb38be316a9483..cb6e24712a1d6257ccce4eae490a339a33b971e0 100644 --- a/man/compareSCEs.Rd +++ b/man/compareSCEs.Rd @@ -4,8 +4,13 @@ \alias{compareSCEs} \title{Compare SingleCellExperiment objects} \usage{ -compareSCEs(sces, point.size = 0.1, point.alpha = 0.1, fits = TRUE, - colours = NULL) +compareSCEs( + sces, + point.size = 0.1, + point.alpha = 0.1, + fits = TRUE, + colours = NULL +) } \arguments{ \item{sces}{named list of SingleCellExperiment objects to combine and diff --git a/man/diffSCEs.Rd b/man/diffSCEs.Rd index 97cb53bbf1fb22d06b5fb14435f0d835fc68d903..de9cd4070de7f6992f5ba1a4d6e5e75cde2cffbe 100644 --- a/man/diffSCEs.Rd +++ b/man/diffSCEs.Rd @@ -4,8 +4,14 @@ \alias{diffSCEs} \title{Diff SingleCellExperiment objects} \usage{ -diffSCEs(sces, ref, point.size = 0.1, point.alpha = 0.1, fits = TRUE, - colours = NULL) +diffSCEs( + sces, + ref, + point.size = 0.1, + point.alpha = 0.1, + fits = TRUE, + colours = NULL +) } \arguments{ \item{sces}{named list of SingleCellExperiment objects to combine and diff --git a/man/expandParams.Rd b/man/expandParams.Rd index c6f83797cdbadf245f9e033ce8b25c4d1321a748..58a0a526877ce8f1449001d7b236567025346d1f 100644 --- a/man/expandParams.Rd +++ b/man/expandParams.Rd @@ -1,7 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/AllGenerics.R, R/BASiCSParams-methods.R, % R/LunParams-methods.R, R/SplatParams-methods.R -\docType{methods} \name{expandParams} \alias{expandParams} \alias{expandParams,BASiCSParams-method} diff --git a/man/getParam.Rd b/man/getParam.Rd index d73b72864a0d39b4b4ff967bcce6212cc1481bbc..2b01a819936c8e312dddfd3130f9b4b1af57f290 100644 --- a/man/getParam.Rd +++ b/man/getParam.Rd @@ -1,6 +1,5 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/AllGenerics.R, R/Params-methods.R -\docType{methods} \name{getParam} \alias{getParam} \alias{getParam,Params-method} diff --git a/man/kersplatEstimate.Rd b/man/kersplatEstimate.Rd index e73ebd97bcea7f4ee5780568f946156e19222743..d6090706e1360508b5436a09359310112a793f06 100644 --- a/man/kersplatEstimate.Rd +++ b/man/kersplatEstimate.Rd @@ -8,11 +8,9 @@ \usage{ kersplatEstimate(counts, params = newKersplatParams(), verbose = TRUE) -\method{kersplatEstimate}{SingleCellExperiment}(counts, - params = newKersplatParams(), verbose = TRUE) +\method{kersplatEstimate}{SingleCellExperiment}(counts, params = newKersplatParams(), verbose = TRUE) -\method{kersplatEstimate}{matrix}(counts, params = newKersplatParams(), - verbose = TRUE) +\method{kersplatEstimate}{matrix}(counts, params = newKersplatParams(), verbose = TRUE) } \arguments{ \item{counts}{either a counts matrix or a SingleCellExperiment object diff --git a/man/lun2Estimate.Rd b/man/lun2Estimate.Rd index 956aa5a11d57a12bac9e8ecaa8be21d73f5af3cd..1223b2f0791682252d401d9589923a7955f32d46 100644 --- a/man/lun2Estimate.Rd +++ b/man/lun2Estimate.Rd @@ -6,15 +6,32 @@ \alias{lun2Estimate.matrix} \title{Estimate Lun2 simulation parameters} \usage{ -lun2Estimate(counts, plates, params = newLun2Params(), min.size = 200, - verbose = TRUE, BPPARAM = SerialParam()) +lun2Estimate( + counts, + plates, + params = newLun2Params(), + min.size = 200, + verbose = TRUE, + BPPARAM = SerialParam() +) -\method{lun2Estimate}{SingleCellExperiment}(counts, plates, - params = newLun2Params(), min.size = 200, verbose = TRUE, - BPPARAM = SerialParam()) +\method{lun2Estimate}{SingleCellExperiment}( + counts, + plates, + params = newLun2Params(), + min.size = 200, + verbose = TRUE, + BPPARAM = SerialParam() +) -\method{lun2Estimate}{matrix}(counts, plates, params = newLun2Params(), - min.size = 200, verbose = TRUE, BPPARAM = SerialParam()) +\method{lun2Estimate}{matrix}( + counts, + plates, + params = newLun2Params(), + min.size = 200, + verbose = TRUE, + BPPARAM = SerialParam() +) } \arguments{ \item{counts}{either a counts matrix or a SingleCellExperiment object diff --git a/man/lun2Simulate.Rd b/man/lun2Simulate.Rd index 38c9ab3326c08ceace1ed2ce4f5613637539d5ad..b2e5082ebb92e396ea3bd39a5abd1f97a69ee21a 100644 --- a/man/lun2Simulate.Rd +++ b/man/lun2Simulate.Rd @@ -4,8 +4,7 @@ \alias{lun2Simulate} \title{Lun2 simulation} \usage{ -lun2Simulate(params = newLun2Params(), zinb = FALSE, verbose = TRUE, - ...) +lun2Simulate(params = newLun2Params(), zinb = FALSE, verbose = TRUE, ...) } \arguments{ \item{params}{Lun2Params object containing simulation parameters.} diff --git a/man/lunEstimate.Rd b/man/lunEstimate.Rd index c313ad8d9abacc62e065e19c4e49cef5b8976d31..e25744090640c25cd3663836890f530ffd42c936 100644 --- a/man/lunEstimate.Rd +++ b/man/lunEstimate.Rd @@ -8,8 +8,7 @@ \usage{ lunEstimate(counts, params = newLunParams()) -\method{lunEstimate}{SingleCellExperiment}(counts, - params = newLunParams()) +\method{lunEstimate}{SingleCellExperiment}(counts, params = newLunParams()) \method{lunEstimate}{matrix}(counts, params = newLunParams()) } diff --git a/man/makeCompPanel.Rd b/man/makeCompPanel.Rd index d9ec714e6bf85f3340582ac054b63e03f9ea667b..7120f8d90dbad8cf9d731e58bc00f490069f9acc 100644 --- a/man/makeCompPanel.Rd +++ b/man/makeCompPanel.Rd @@ -4,9 +4,12 @@ \alias{makeCompPanel} \title{Make comparison panel} \usage{ -makeCompPanel(comp, title = "Comparison", labels = c("Means", - "Variance", "Mean-variance relationship", "Library size", - "Zeros per gene", "Zeros per cell", "Mean-zeros relationship")) +makeCompPanel( + comp, + title = "Comparison", + labels = c("Means", "Variance", "Mean-variance relationship", "Library size", + "Zeros per gene", "Zeros per cell", "Mean-zeros relationship") +) } \arguments{ \item{comp}{list returned by \code{\link{compareSCEs}}.} diff --git a/man/makeDiffPanel.Rd b/man/makeDiffPanel.Rd index 4d772febf14294c50048428c5ef6784a78ed107a..3132c1604a382d848518aed63c6b97e613937018 100644 --- a/man/makeDiffPanel.Rd +++ b/man/makeDiffPanel.Rd @@ -4,10 +4,12 @@ \alias{makeDiffPanel} \title{Make difference panel} \usage{ -makeDiffPanel(diff, title = "Difference comparison", - labels = c("Means", "Variance", "Library size", "Zeros per cell", - "Zeros per gene", "Mean-variance relationship", - "Mean-zeros relationship")) +makeDiffPanel( + diff, + title = "Difference comparison", + labels = c("Means", "Variance", "Library size", "Zeros per cell", "Zeros per gene", + "Mean-variance relationship", "Mean-zeros relationship") +) } \arguments{ \item{diff}{list returned by \code{\link{diffSCEs}}.} diff --git a/man/makeOverallPanel.Rd b/man/makeOverallPanel.Rd index 4a0af661354ed4fd81b1d2b57bd3e4d9080d126f..07f292293ada6e2b726882d09a3c4bac6abbada2 100644 --- a/man/makeOverallPanel.Rd +++ b/man/makeOverallPanel.Rd @@ -4,10 +4,13 @@ \alias{makeOverallPanel} \title{Make overall panel} \usage{ -makeOverallPanel(comp, diff, title = "Overall comparison", - row.labels = c("Means", "Variance", "Mean-variance relationship", - "Library size", "Zeros per cell", "Zeros per gene", - "Mean-zeros relationship")) +makeOverallPanel( + comp, + diff, + title = "Overall comparison", + row.labels = c("Means", "Variance", "Mean-variance relationship", "Library size", + "Zeros per cell", "Zeros per gene", "Mean-zeros relationship") +) } \arguments{ \item{comp}{list returned by \code{\link{compareSCEs}}.} diff --git a/man/mfaEstimate.Rd b/man/mfaEstimate.Rd index 58a14f7d6e9e5fe5e696f3c671fe9513e92a649a..2b279274cfc19718acf7b81531570902cffb28f1 100644 --- a/man/mfaEstimate.Rd +++ b/man/mfaEstimate.Rd @@ -8,8 +8,7 @@ \usage{ mfaEstimate(counts, params = newMFAParams()) -\method{mfaEstimate}{SingleCellExperiment}(counts, - params = newMFAParams()) +\method{mfaEstimate}{SingleCellExperiment}(counts, params = newMFAParams()) \method{mfaEstimate}{matrix}(counts, params = newMFAParams()) } diff --git a/man/phenoEstimate.Rd b/man/phenoEstimate.Rd index ede408036be4bdd00e1175b9a990dcfbda1db101..545bb09dca10e21198326fbb5069b8fa3466fa2e 100644 --- a/man/phenoEstimate.Rd +++ b/man/phenoEstimate.Rd @@ -8,8 +8,7 @@ \usage{ phenoEstimate(counts, params = newPhenoParams()) -\method{phenoEstimate}{SingleCellExperiment}(counts, - params = newPhenoParams()) +\method{phenoEstimate}{SingleCellExperiment}(counts, params = newPhenoParams()) \method{phenoEstimate}{matrix}(counts, params = newPhenoParams()) } diff --git a/man/scDDEstimate.Rd b/man/scDDEstimate.Rd index 75bc1affd60790a841304e6eec7dd497a5654ce9..05c647c62b26ab8ce43018d744ab3ad02f357775 100644 --- a/man/scDDEstimate.Rd +++ b/man/scDDEstimate.Rd @@ -7,18 +7,40 @@ \alias{scDDEstimate.default} \title{Estimate scDD simulation parameters} \usage{ -scDDEstimate(counts, params = newSCDDParams(), verbose = TRUE, - BPPARAM = SerialParam(), ...) +scDDEstimate( + counts, + params = newSCDDParams(), + verbose = TRUE, + BPPARAM = SerialParam(), + ... +) -\method{scDDEstimate}{matrix}(counts, params = newSCDDParams(), - verbose = TRUE, BPPARAM = SerialParam(), conditions, ...) +\method{scDDEstimate}{matrix}( + counts, + params = newSCDDParams(), + verbose = TRUE, + BPPARAM = SerialParam(), + conditions, + ... +) -\method{scDDEstimate}{SingleCellExperiment}(counts, - params = newSCDDParams(), verbose = TRUE, BPPARAM = SerialParam(), - condition = "condition", ...) +\method{scDDEstimate}{SingleCellExperiment}( + counts, + params = newSCDDParams(), + verbose = TRUE, + BPPARAM = SerialParam(), + condition = "condition", + ... +) -\method{scDDEstimate}{default}(counts, params = newSCDDParams(), - verbose = TRUE, BPPARAM = SerialParam(), condition, ...) +\method{scDDEstimate}{default}( + counts, + params = newSCDDParams(), + verbose = TRUE, + BPPARAM = SerialParam(), + condition, + ... +) } \arguments{ \item{counts}{either a counts matrix or a SingleCellExperiment object diff --git a/man/scDDSimulate.Rd b/man/scDDSimulate.Rd index 73916f358be7edd6bde7b0565ab5e6df7b2450bf..ebe03e3a9b096244cea354c30adcc133d4b9d18d 100644 --- a/man/scDDSimulate.Rd +++ b/man/scDDSimulate.Rd @@ -4,8 +4,14 @@ \alias{scDDSimulate} \title{scDD simulation} \usage{ -scDDSimulate(params = newSCDDParams(), plots = FALSE, - plot.file = NULL, verbose = TRUE, BPPARAM = SerialParam(), ...) +scDDSimulate( + params = newSCDDParams(), + plots = FALSE, + plot.file = NULL, + verbose = TRUE, + BPPARAM = SerialParam(), + ... +) } \arguments{ \item{params}{SCDDParams object containing simulation parameters.} diff --git a/man/setParam.Rd b/man/setParam.Rd index 7f8e4ea71a13c09bc77f406fbb8646712530e378..e7dca4ccbd12972308f278339907940bf6943042 100644 --- a/man/setParam.Rd +++ b/man/setParam.Rd @@ -3,7 +3,6 @@ % R/KersplatParams-methods.R, R/Lun2Params-methods.R, R/LunParams-methods.R, % R/Params-methods.R, R/PhenoParams-methods.R, R/SCDDParams-methods.R, % R/SplatParams-methods.R, R/ZINBParams-methods.R -\docType{methods} \name{setParam} \alias{setParam} \alias{setParam,BASiCSParams-method} diff --git a/man/setParamUnchecked.Rd b/man/setParamUnchecked.Rd index 9ebd4825460616d43760857dcbc7673b7588eee7..588f6697db5c6563e85ba3ff63a53172ce9939b5 100644 --- a/man/setParamUnchecked.Rd +++ b/man/setParamUnchecked.Rd @@ -1,6 +1,5 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/AllGenerics.R, R/Params-methods.R -\docType{methods} \name{setParamUnchecked} \alias{setParamUnchecked} \alias{setParamUnchecked,Params-method} diff --git a/man/setParams.Rd b/man/setParams.Rd index 0e62af22920d3b2e02fdd886d767827fdb8e5621..18756d3ccd505de40ac127160be3d9ae952a2ae1 100644 --- a/man/setParams.Rd +++ b/man/setParams.Rd @@ -1,7 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/AllGenerics.R, R/KersplatParams-methods.R, % R/Params-methods.R, R/SplatParams-methods.R -\docType{methods} \name{setParams} \alias{setParams} \alias{setParams,KersplatParams-method} diff --git a/man/simpleEstimate.Rd b/man/simpleEstimate.Rd index d764e1eff30fef86e169d0d4da5eda83f738ddd1..49cd2daf6042cd6a397a1f4b7b6793d4e324bdeb 100644 --- a/man/simpleEstimate.Rd +++ b/man/simpleEstimate.Rd @@ -8,8 +8,7 @@ \usage{ simpleEstimate(counts, params = newSimpleParams()) -\method{simpleEstimate}{SingleCellExperiment}(counts, - params = newSimpleParams()) +\method{simpleEstimate}{SingleCellExperiment}(counts, params = newSimpleParams()) \method{simpleEstimate}{matrix}(counts, params = newSimpleParams()) } diff --git a/man/sparseDCEstimate.Rd b/man/sparseDCEstimate.Rd index ba3d010f979c5b458454851c56e37ff30f1150c8..7d970d341dec8ad61a259bbc34df669487d32401 100644 --- a/man/sparseDCEstimate.Rd +++ b/man/sparseDCEstimate.Rd @@ -6,14 +6,29 @@ \alias{sparseDCEstimate.matrix} \title{Estimate SparseDC simulation parameters} \usage{ -sparseDCEstimate(counts, conditions, nclusters, norm = TRUE, - params = newSparseDCParams()) +sparseDCEstimate( + counts, + conditions, + nclusters, + norm = TRUE, + params = newSparseDCParams() +) -\method{sparseDCEstimate}{SingleCellExperiment}(counts, conditions, - nclusters, norm = TRUE, params = newSparseDCParams()) +\method{sparseDCEstimate}{SingleCellExperiment}( + counts, + conditions, + nclusters, + norm = TRUE, + params = newSparseDCParams() +) -\method{sparseDCEstimate}{matrix}(counts, conditions, nclusters, - norm = TRUE, params = newSparseDCParams()) +\method{sparseDCEstimate}{matrix}( + counts, + conditions, + nclusters, + norm = TRUE, + params = newSparseDCParams() +) } \arguments{ \item{counts}{either a counts matrix or an SingleCellExperiment object diff --git a/man/splatEstimate.Rd b/man/splatEstimate.Rd index d0287115201d5caaeba73926827205de04717076..a08e14d6ff635888ce50c239f8c1aefeaad9a00d 100644 --- a/man/splatEstimate.Rd +++ b/man/splatEstimate.Rd @@ -8,8 +8,7 @@ \usage{ splatEstimate(counts, params = newSplatParams()) -\method{splatEstimate}{SingleCellExperiment}(counts, - params = newSplatParams()) +\method{splatEstimate}{SingleCellExperiment}(counts, params = newSplatParams()) \method{splatEstimate}{matrix}(counts, params = newSplatParams()) } @@ -25,7 +24,7 @@ SplatParams object containing the estimated parameters. \description{ Estimate simulation parameters for the Splat simulation from a real dataset. See the individual estimation functions for more details on how this -is done. +is done. I'm testing stuff now. } \examples{ # Load example data diff --git a/man/splatSimulate.Rd b/man/splatSimulate.Rd index 578477f52ecea2b7c747e9bf772bc5c0aa697f5d..b0fcdfef44da225b7653ba21b8b4a77e632e1364 100644 --- a/man/splatSimulate.Rd +++ b/man/splatSimulate.Rd @@ -7,8 +7,13 @@ \alias{splatSimulatePaths} \title{Splat simulation} \usage{ -splatSimulate(params = newSplatParams(), method = c("single", "groups", - "paths"), verbose = TRUE, ...) +splatSimulate( + params = newSplatParams(), + method = c("single", "groups", "paths", "eqtl"), + eqtl = NaN, + verbose = TRUE, + ... +) splatSimulateSingle(params = newSplatParams(), verbose = TRUE, ...) @@ -22,8 +27,13 @@ See \code{\link{SplatParams}} for details.} \item{method}{which simulation method to use. Options are "single" which produces a single population, "groups" which produces distinct groups -(eg. cell types) or "paths" which selects cells from continuous -trajectories (eg. differentiation processes).} +(eg. cell types), "paths" which selects cells from continuous +trajectories (eg. differentiation processes), or "eqtl" which produces +a single population for every sample (ie column) in the dataframe +output by splateQTL().} + +\item{eqtl}{matrix of mean gene counts across the eQTL population, output +from splateQTL().} \item{verbose}{logical. Whether to print progress messages.} @@ -128,6 +138,9 @@ sim <- splatSimulate(params, mean.rate = 0.6, out.prob = 0.2) sim <- splatSimulate(method = "groups") # Simulate paths sim <- splatSimulate(method = "paths") +# Simulate eQTL data +eqtl <- splateQTL(params=params) +sim <- splatSimulate(params=params, method = 'eqtl', eqtl = eqtl) } } \references{ diff --git a/man/splateQTL.Rd b/man/splateQTL.Rd new file mode 100644 index 0000000000000000000000000000000000000000..8d22408fdaf99925d2999d8567da3e76ce1e0b49 --- /dev/null +++ b/man/splateQTL.Rd @@ -0,0 +1,94 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/splat-eqtl.R +\name{splateQTL} +\alias{splateQTL} +\title{Splat-eQTL} +\usage{ +splateQTL( + params = newSplatParams(), + gff_file = "test_data/test.gff3", + snp_file = "test_data/test.vcf", + eqtlES_shape = 2.740558, + eqtlES_rate = 6.441281, + esnp.n = 100, + eqtl.dist = 1e+06, + eqtl.maf = 0.1, + eqtl.mafd = 0.01, + eqtl.bcv = 0.4, + eqtl.save = TRUE, + ... +) +} +\arguments{ +\item{params}{SplatParams object containing parameters for the simulation. +See \code{\link{SplatParams}} for details.} + +\item{gff_file}{Path to a GFF/GFT file containing genes to include.} + +\item{snp_file}{Path to real/simulated genotype data in .vcf format. +Where each column is a sample and each row is a SNP.} + +\item{eqtlES_shape}{Effect Size shape parameter (default estimated from +GTEx thyroid cis-eQTL data)} + +\item{eqtlES_rate}{Effect Size rate parameter (default estimated from +GTEx thyroid cis-eQTL data)} + +\item{esnp.n}{Number of eSNP-eQTL associations to include} + +\item{eqtl.dist}{Distance between eSNP and eGene (TSS).} + +\item{eqtl.maf}{Desired Minor Allele Frequency (MAF) of eSNPs to include} + +\item{eqtl.mafd}{Maximum variation from eqtl.maf to include as eSNP} + +\item{eqtl.bcv}{Biological Coefficient of Variation (default = 0.4)} + +\item{eqtl.save}{logical. Whether to save eQTL key and mean matrix.} + +\item{...}{any additional parameter settings to override what is provided in +\code{params}.} +} +\value{ +GeneMeansPop Matrix containing the simulated mean gene expression +value for each gene (row) and each sample in the population (column). +intermediate values. +} +\description{ +Simulate mean gene counts for a population of samples, such that a defined +number of associations (i.e. cis-eQTL) between markers (i.e. eSNPs) and genes +(i.e. eGenes) exist. +} +\details{ +Parameters can be set in a variety of ways. If no parameters are provided +the default parameters are used. Any parameters in \code{params} can be +overridden by supplying additional arguments through a call to +\code{\link{setParams}}. This design allows the user flexibility in +how they supply parameters and allows small adjustments without creating a +new \code{SplatParams} object. See examples for a demonstration of how this +can be used. + +The eQTL Gene Mean simulation involves the following steps: +\enumerate{ + \item Load and format gene (GFF/GTF) and SNP (genotype) data. + \item Select eGenes-eSNPs pairs and assign effect sizes. + \item Generate normalized gene mean expression matrix for the population. + \item Set a gene mean expression value (not normalized) for each gene. + \item Generate a gene mean expression matrix for the population. + \item (optional) Save eQTL key (i.e. pairs) +} +} +\examples{ +# Load example data +library(scater) +set.seed(1) +sce <- mockSCE() +params <- splatEstimate(sce) +pop.gMeans <- splateQTL(params) + +} +\seealso{ +\code{\link{splateQTLgenes}}, \code{\link{splateQTLsnps}}, +\code{\link{splateQTLpairs}}, \code{\link{splateQTLnormMeansMatrix}}, +\code{\link{splateQTLGeneMeans}}, \code{\link{splateQTLMeansMatrix}} +} diff --git a/man/splateQTLGeneMeans.Rd b/man/splateQTLGeneMeans.Rd new file mode 100644 index 0000000000000000000000000000000000000000..e3ce7ec2f9336ca7e2cea3a7cbcc28a3837a76b1 --- /dev/null +++ b/man/splateQTLGeneMeans.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/splat-eqtl.R +\name{splateQTLGeneMeans} +\alias{splateQTLGeneMeans} +\title{Set a gene mean expression value (not normalized) for each gene.} +\usage{ +splateQTLGeneMeans(params, pairs, eqtl.bcv) +} +\arguments{ +\item{params}{Output from splateQTL_DefineAssociations} + +\item{pairs}{A dataframe eSNPs-eGenes pair assignments and their effect sizes} +} +\value{ +the eSNP-eGene pairs dataframe updated to include the mean gene +expression level, BCV, and standard deviation. +} +\description{ +Assign a mean expression value to each gene, sampled from a gamma +distribution parameterized by splatEstimate, then calculate the BCV and +the standard deviation +} diff --git a/man/splateQTLMeansMatrix.Rd b/man/splateQTLMeansMatrix.Rd new file mode 100644 index 0000000000000000000000000000000000000000..dbb5d59ba5dcc27e7ed70fddd116762c7b78f597 --- /dev/null +++ b/man/splateQTLMeansMatrix.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/splat-eqtl.R +\name{splateQTLMeansMatrix} +\alias{splateQTLMeansMatrix} +\title{Un-normalize the mean gene expression matrix} +\usage{ +splateQTLMeansMatrix(pairs, nMeans) +} +\arguments{ +\item{nMeans}{The normalized gene expression means for the population} + +\item{params}{A dataframe eSNPs-eGenes pair assignments and their effect sizes} +} +\value{ +MeansMatrix: Matrix of simulated gene means for eQTL population. +} +\description{ +Un-normalize the mean gene expression matrix +} +\details{ +For each gene/sample, the normalized expression value (from rnorm) is +transformed to the cumulative density function (pnorm) between 0 and 1, this +value is then inversed (qnorm) to map the probability to a value defined by +the gene mean assigned in splateQTLGeneMeans. +} diff --git a/man/splateQTLgenes.Rd b/man/splateQTLgenes.Rd new file mode 100644 index 0000000000000000000000000000000000000000..34a94bc4b052a0c89de9ec5fbf772dc885acc7e2 --- /dev/null +++ b/man/splateQTLgenes.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/splat-eqtl.R +\name{splateQTLgenes} +\alias{splateQTLgenes} +\title{Process gene data} +\usage{ +splateQTLgenes(gff_file) +} +\arguments{ +\item{gff_file}{Path to GFF/GTF file} +} +\value{ +A dataframe containing gene IDs and locations. +} +\description{ +Read in GFF/GTF file (ignorning header) and select only sequences where the +feature is listed as a gene. Then get the Transcriptional Start Site for +each gene (depending on strand direction). +} diff --git a/man/splateQTLnormMeansMatrix.Rd b/man/splateQTLnormMeansMatrix.Rd new file mode 100644 index 0000000000000000000000000000000000000000..01970e63e54bae25f2669d8b09d8c5d43bf8e978 --- /dev/null +++ b/man/splateQTLnormMeansMatrix.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/splat-eqtl.R +\name{splateQTLnormMeansMatrix} +\alias{splateQTLnormMeansMatrix} +\title{Generate normalized mean gene expression matrix for whole eQTL population} +\usage{ +splateQTLnormMeansMatrix(snps, pairs) +} +\arguments{ +\item{snps}{The dataframe with the genetic marker info} + +\item{pairs}{A dataframe eSNPs-eGenes pair assignments and their effect sizes} +} +\value{ +normGeneMeansPop: matrix of normalized mean gene exp. levels. +} +\description{ +Use the approach outlined in Huang et. al 2018 (NAR) to assign normalized +mean expression levels for each gene for each sample. Where: +y = Effect Size * genotype + error, where error ~ Norm(0,1) +} diff --git a/man/splateQTLpairs.Rd b/man/splateQTLpairs.Rd new file mode 100644 index 0000000000000000000000000000000000000000..72dbec5cc6f562ccbfd4c2198c0db8fe85e6c4c2 --- /dev/null +++ b/man/splateQTLpairs.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/splat-eqtl.R +\name{splateQTLpairs} +\alias{splateQTLpairs} +\title{Select eGenes-eSNPs pairs and assign effect sizes.} +\usage{ +splateQTLpairs(genes, snps, esnp.n, eqtl.dist, eqtlES_shape, eqtlES_rate) +} +\arguments{ +\item{genes}{Dataframe with gene ID and location} + +\item{snps}{Dataframe with SNP ID, location, and sample genotypes} + +\item{esnp.n}{Number of eSNP-eQTL associations to include} + +\item{eqtl.dist}{Distance between eSNP and eGene (TSS).} + +\item{eqtlES_shape}{Effect Size shape parameter (default estimated from +GTEx thyroid cis-eQTL data)} + +\item{eqtlES_rate}{Effect Size rate parameter (default estimated from +GTEx thyroid cis-eQTL data)} +} +\value{ +A dataframe eSNPs-eGenes pair assignments and their effect sizes +} +\description{ +Randomly pairs N eSNPs with an eGene within the designated window size +(eqtl.dist) and assigns each pair an effect size sampled from a gamma +distribution parameterized using the effect sizes from a builk eQTL study +using the GTEx data from the thyroid tissue. +} diff --git a/man/splateQTLsnps.Rd b/man/splateQTLsnps.Rd new file mode 100644 index 0000000000000000000000000000000000000000..3f914a38f81e644a9aaaeefadf8845a46fa9f0ba --- /dev/null +++ b/man/splateQTLsnps.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/splat-eqtl.R +\name{splateQTLsnps} +\alias{splateQTLsnps} +\title{Process genotype data} +\usage{ +splateQTLsnps(snp_file, eqtl.maf, eqtl.mafd) +} +\arguments{ +\item{snp_file}{Path to real/simulated genotype data in .ped.gen format} + +\item{eqtl.maf}{Desired Minor Allele Frequency (MAF) of eSNPs to include} + +\item{eqtl.mafd}{Maximum variation from eqtl.maf to include as eSNP} +} +\value{ +A dataframe containing SNP names, locations, and sample genotypes. +} +\description{ +Read in SNP (genotype matrix) file and remove extra columns. Then calculate +the Minor Allele Frequency and filter SNPs outside of the MAF range defined. +} diff --git a/man/splatter.Rd b/man/splatter.Rd index fcb03921bb00b58af889c6f803ad3c0af1a86ca8..52e5aa0d484d832f0fbc1d2801891e4ca665262d 100644 --- a/man/splatter.Rd +++ b/man/splatter.Rd @@ -3,7 +3,6 @@ \docType{package} \name{splatter} \alias{splatter} -\alias{splatter-package} \title{splatter.} \description{ \pkg{splatter} is a package for the well-documented and reproducible diff --git a/man/summariseStats.Rd b/man/summariseStats.Rd index 72459e4a20a6eb15855f1eb923b12d3ae3429ee2..1e53f97abb2519b506d95c921eeb697353d14766 100644 --- a/man/summariseStats.Rd +++ b/man/summariseStats.Rd @@ -4,8 +4,7 @@ \alias{summariseStats} \title{Summarise statistics} \usage{ -summariseStats(data, split.col, stat.cols, measure = c("MAD", "MAE", - "RMSE")) +summariseStats(data, split.col, stat.cols, measure = c("MAD", "MAE", "RMSE")) } \arguments{ \item{data}{The data.frame to summarise} diff --git a/man/zinbEstimate.Rd b/man/zinbEstimate.Rd index 11bece29173050be618fdf8d50c84033ca8580aa..ae32dc9f9f85e551b5cb3ec437502613b6427405 100644 --- a/man/zinbEstimate.Rd +++ b/man/zinbEstimate.Rd @@ -6,21 +6,47 @@ \alias{zinbEstimate.matrix} \title{Estimate ZINB-WaVE simulation parameters} \usage{ -zinbEstimate(counts, design.samples = NULL, design.genes = NULL, - common.disp = TRUE, iter.init = 2, iter.opt = 25, - stop.opt = 1e-04, params = newZINBParams(), verbose = TRUE, - BPPARAM = SerialParam(), ...) +zinbEstimate( + counts, + design.samples = NULL, + design.genes = NULL, + common.disp = TRUE, + iter.init = 2, + iter.opt = 25, + stop.opt = 1e-04, + params = newZINBParams(), + verbose = TRUE, + BPPARAM = SerialParam(), + ... +) -\method{zinbEstimate}{SingleCellExperiment}(counts, - design.samples = NULL, design.genes = NULL, common.disp = TRUE, - iter.init = 2, iter.opt = 25, stop.opt = 1e-04, - params = newZINBParams(), verbose = TRUE, BPPARAM = SerialParam(), - ...) +\method{zinbEstimate}{SingleCellExperiment}( + counts, + design.samples = NULL, + design.genes = NULL, + common.disp = TRUE, + iter.init = 2, + iter.opt = 25, + stop.opt = 1e-04, + params = newZINBParams(), + verbose = TRUE, + BPPARAM = SerialParam(), + ... +) -\method{zinbEstimate}{matrix}(counts, design.samples = NULL, - design.genes = NULL, common.disp = TRUE, iter.init = 2, - iter.opt = 25, stop.opt = 1e-04, params = newZINBParams(), - verbose = TRUE, BPPARAM = SerialParam(), ...) +\method{zinbEstimate}{matrix}( + counts, + design.samples = NULL, + design.genes = NULL, + common.disp = TRUE, + iter.init = 2, + iter.opt = 25, + stop.opt = 1e-04, + params = newZINBParams(), + verbose = TRUE, + BPPARAM = SerialParam(), + ... +) } \arguments{ \item{counts}{either a counts matrix or a SingleCellExperiment object