ReadVCFAsMutationRecord: Convert a Simple VCF File to a SATS Mutation Record Table

View source: R/input_conversion.R

ReadVCFAsMutationRecordR Documentation

Convert a Simple VCF File to a SATS Mutation Record Table

Description

Convert a simple single-sample Variant Call Format (VCF) file into the MAF-like mutation record table used by GenerateVMatrix.

Usage

ReadVCFAsMutationRecord(vcf_file, sample_id = NULL,
                        keep_filter = c("PASS", "."))

Arguments

vcf_file

Path to a VCF file. Files ending in .gz are read with gzfile.

sample_id

Optional sample identifier for the returned Tumor_Sample_Barcode column. If NULL, SATS uses the single VCF sample column when exactly one is present, or derives a sample identifier from the file name when the VCF has no sample column. Multi-sample VCF genotype parsing is not supported by this lightweight converter.

keep_filter

Character vector of FILTER values to retain. Use NULL to retain all records.

Details

The returned data frame contains the columns required by GenerateVMatrix: Chromosome, Start_Position, End_Position, Variant_Type, Reference_Allele, Tumor_Seq_Allele2 and Tumor_Sample_Barcode.

This function is a lightweight input-preparation utility for standard single-sample targeted-panel VCF files. It does not replace a full clinical variant-normalization pipeline. Multiallelic records are split by ALT allele, but complex normalization, multi-sample genotype parsing, tumor-normal interpretation, phasing and decomposition of complex events should be performed upstream when needed. GenerateVMatrix uses Variant_Type == "SNP" for SBS analyses and Variant_Type == "DNP" for DBS analyses.

Value

A MAF-like data frame suitable for GenerateVMatrix.

Author(s)

Donghyuk Lee <dhyuklee@pusan.ac.kr> and Bin Zhu <bin.zhu@nih.gov>

See Also

GenerateVMatrix, ReadBEDAsPanelInfo

Examples

dir <- system.file("extdata", "refitting_examples", package = "SATS")
vcf_file <- file.path(dir, "SBS_two_variants.vcf")

mutation_record <- ReadVCFAsMutationRecord(vcf_file)
V <- GenerateVMatrix(mutation_record, Class = "SBS", ref.genome = "hg19")
dim(V)

SATS documentation built on Sept. 16, 2026, 1:06 a.m.