View source: R/GenerateSyntheticTumorsFromSigParams.R
GenerateSyntheticTumorsFromSigParams | R Documentation |
Generate synthetic tumors based on signature parameters in one or more cancer types
GenerateSyntheticTumorsFromSigParams( seed, dir, cancer.types, samples.per.cancer.type, input.sigs, sig.params, distribution = NULL, sample.prefix.name = "SP.Syn.", tumor.marker.name = NULL, overwrite = TRUE, verbose = 0 )
seed |
A random seed to use. |
dir |
The directory in which to put the output; will be created if necessary. |
cancer.types |
A vector of character strings denoting different cancer
types. See |
samples.per.cancer.type |
Number of synthetic tumors to create for each
cancer type. If it is one number, then generate the same
number of synthetic tumors for each |
input.sigs |
A matrix of signatures. |
sig.params |
A list of empirical signature parameters generated using
real exposures for each |
distribution |
Probability distribution used to generate synthetic
exposures due to active mutational signatures. Can be |
sample.prefix.name |
Prefix name to add to the synthetic tumors. |
tumor.marker.name |
Tumor marker name to add to the synthetic tumors. E.g. "MSI", "POLE". |
overwrite |
If TRUE, overwrite existing directories and files. |
verbose |
If > 0 cat various messages. |
A list of three elements that comprise the synthetic data:
ground.truth.catalog
: Spectra catalog with rows denoting mutation
types and columns denoting sample names.
ground.truth.signatures
: Signatures active
in ground.truth.catalog
.
ground.truth.exposures
: Exposures of ground.truth.signatures
in ground.truth.catalog
.
See also GenerateSyntheticTumors
which uses real exposure matrix
instead of list of signature parameters to generate synthetic tumor.
# Generate synthetic tumors for DBS78 using log normal distribution input.sigs.DBS78 <- cosmicsig::COSMIC_v3.2$signature$GRCh37$DBS78 real.exposures.DBS78 <- PCAWG7::exposure$PCAWG$DBS78 cancer.types <- PCAWG7::CancerTypes()[1:5] sig.params <- SynSigGen::signature.params$DBS78 DBS78.sig.params <- GenerateListOfSigParams(real.exposures = real.exposures.DBS78, cancer.types = cancer.types, sig.params = sig.params) DBS78.synthetic.tumors <- GenerateSyntheticTumorsFromSigParams(seed = 191906, dir = file.path(tempdir(), "DBS78.synthetic.tumors"), cancer.types = cancer.types, samples.per.cancer.type = 30, input.sigs = input.sigs.DBS78, sig.params = DBS78.sig.params, sample.prefix.name = "SP.Syn.") # Generate synthetic tumors for Indel (ID) using negative binomial distribution input.sigs.ID <- cosmicsig::COSMIC_v3.2$signature$GRCh37$ID real.exposures.ID <- PCAWG7::exposure$PCAWG$ID cancer.types <- PCAWG7::CancerTypes()[1:5] sig.params <- SynSigGen::signature.params$ID ID.sig.params <- GenerateListOfSigParams(real.exposures = real.exposures.ID, cancer.types = cancer.types, distribution = "neg.binom", sig.params = sig.params) ID.synthetic.tumors <- GenerateSyntheticTumorsFromSigParams(seed = 191906, dir = file.path(tempdir(), "ID.synthetic.tumors"), cancer.types = cancer.types, samples.per.cancer.type = 30, input.sigs = input.sigs.ID, sig.params = ID.sig.params, distribution = "neg.binom", sample.prefix.name = "SP.Syn.") # Plot the synthetic catalog and exposures ICAMS::PlotCatalogToPdf(catalog = DBS78.synthetic.tumors$ground.truth.catalog, file = file.path(tempdir(), "DBS78.synthetic.catalog.pdf")) mSigAct::PlotExposureToPdf(exposure = DBS78.synthetic.tumors$ground.truth.exposures, file = file.path(tempdir(), "DBS78.synthetic.exposures.pdf"), cex.xaxis = 0.7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.