StrelkaSBSVCFFilesToZipFile {ICAMS} | R Documentation |
Create a zip file which contains catalogs and plot PDFs from Strelka SBS VCF files
Description
Create 3 SBS catalogs (96, 192, 1536), 3 DBS catalogs (78, 136, 144) from the
Strelka SBS VCFs specified by dir
, save the catalogs as CSV files,
plot them to PDF and generate a zip archive of all the output files. The
function will find and merge adjacent SBS pairs into DBS if their VAFs are
very similar. The default threshold value for VAF is 0.02.
Usage
StrelkaSBSVCFFilesToZipFile(
dir,
zipfile,
ref.genome,
trans.ranges = NULL,
region = "unknown",
names.of.VCFs = NULL,
base.filename = "",
return.annotated.vcfs = FALSE,
suppress.discarded.variants.warnings = TRUE
)
Arguments
dir |
Pathname of the directory which contains only the Strelka
SBS VCF files. Each Strelka SBS VCF must have a file extension
".vcf" (case insensitive) and share the same |
zipfile |
Pathname of the zip file to be created. |
ref.genome |
A |
trans.ranges |
Optional. If
then the function will infer |
region |
A character string designating a genomic region;
see |
names.of.VCFs |
Optional. Character vector of names of the VCF files.
The order of names in |
base.filename |
Optional. The base name of the CSV and PDF files to be
produced; multiple files will be generated, each ending in
|
return.annotated.vcfs |
Logical. Whether to return the annotated VCFs with additional columns showing mutation class for each variant. Default is FALSE. |
suppress.discarded.variants.warnings |
Logical. Whether to suppress warning messages showing information about the discarded variants. Default is TRUE. |
Details
This function calls StrelkaSBSVCFFilesToCatalog
,
PlotCatalogToPdf
, WriteCatalog
and
zip::zipr
.
Value
A list containing the following objects:
-
catSBS96
,catSBS192
,catSBS1536
: Matrix of 3 SBS catalogs (one each for 96, 192, and 1536). -
catDBS78
,catDBS136
,catDBS144
: Matrix of 3 DBS catalogs (one each for 78, 136, and 144). -
discarded.variants
: Non-NULL only if there are variants that were excluded from the analysis. See the added extra columndiscarded.reason
for more details. -
annotated.vcfs
: Non-NULL only ifreturn.annotated.vcfs
= TRUE. A list of elements:-
SBS
: SBS VCF annotated byAnnotateSBSVCF
with three new columnsSBS96.class
,SBS192.class
andSBS1536.class
showing the mutation class for each SBS variant. -
DBS
: DBS VCF annotated byAnnotateDBSVCF
with three new columnsDBS78.class
,DBS136.class
andDBS144.class
showing the mutation class for each DBS variant.
-
If trans.ranges
is not provided by user and cannot be inferred by
ICAMS, SBS 192 and DBS 144 catalog will not be generated. Each catalog has
attributes added. See as.catalog
for more details.
Note
SBS 192 and DBS 144 catalogs include only mutations in transcribed regions.
Comments
To add or change attributes of the catalog, you can use function
attr
.
For example, attr(catalog, "abundance")
<- custom.abundance
.
Examples
dir <- c(system.file("extdata/Strelka-SBS-vcf",
package = "ICAMS"))
if (requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5", quietly = TRUE)) {
catalogs <-
StrelkaSBSVCFFilesToZipFile(dir,
zipfile = file.path(tempdir(), "test.zip"),
ref.genome = "hg19",
trans.ranges = trans.ranges.GRCh37,
region = "genome",
base.filename = "Strelka-SBS")
unlink(file.path(tempdir(), "test.zip"))}