Learn R Programming

ICAMS (version 2.1.2)

StrelkaIDVCFFilesToZipFile: Create a zip file which contains ID (small insertion and deletion) catalog and plot PDF from Strelka ID VCF files

Description

Create ID (small insertion and deletion) catalog from the Strelka ID VCFs specified by dir, save the catalog as CSV file, plot it to PDF and generate a zip archive of all the output files.

Usage

StrelkaIDVCFFilesToZipFile(
  dir,
  zipfile,
  ref.genome,
  region = "unknown",
  names.of.VCFs = NULL,
  base.filename = "",
  flag.mismatches = 0
)

Arguments

dir

Pathname of the directory which contains the Strelka ID VCF files. Each Strelka ID VCF must have a file extension ".vcf" (case insensitive) and share the same ref.genome and region.

zipfile

Pathname of the zip file to be created.

ref.genome

A ref.genome argument as described in ICAMS.

region

A character string designating a genomic region; see as.catalog and ICAMS.

names.of.VCFs

Optional. Character vector of names of the VCF files. The order of names in names.of.VCFs should match the order of VCFs listed in dir. If NULL(default), this function will remove all of the path up to and including the last path separator (if any) in dir and file paths without extensions (and the leading dot) will be used as the names of the VCF files.

base.filename

Optional. The base name of the CSV and PDF file to be produced; the file is ending in catID.csv and catID.pdf respectively.

flag.mismatches

Optional. If > 0, then if there are mismatches to references in the ID (insertion/deletion) VCF, generate messages showing the mismatched rows and continue. Otherwise stop if there are mismatched rows. See AnnotateIDVCF for more details.

Value

A list of two elements. 1st element is an S3 object containing an ID (small insertion and deletion) catalog with class "IndelCatalog". See as.catalog for more details. 2nd element is a list of further annotated VCFs.

Details

This function calls StrelkaIDVCFFilesToCatalog, PlotCatalogToPdf, WriteCatalog and zipr.

Examples

Run this code
# NOT RUN {
 
dir <- c(system.file("extdata/Strelka-ID-vcf",
                     package = "ICAMS"))
if (requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5", quietly = TRUE)) {
  catalogs <- 
    StrelkaIDVCFFilesToZipFile(dir, 
                               zipfile = file.path(tempdir(), "test.zip"),
                               ref.genome = "hg19", 
                               region = "genome",
                               base.filename = "Strelka-ID")
  unlink(file.path(tempdir(), "test.zip"))}
# }

Run the code above in your browser using DataLab