Skip to contents

Creates a VCF object from GWAS summary statistics or fine-mapping results and writes it to disk. Supports bgzipped VCF (.vcf.gz/.vcf.bgz) and BCF (.bcf) output formats via VariantAnnotation and Rsamtools.

Usage

writeSumstatsVcf(x, outputPath, sampleName = NULL, ...)

# S4 method for class 'GwasSumStats'
writeSumstatsVcf(x, outputPath, sampleName = NULL, study = NULL, ...)

# S4 method for class 'FineMappingResultBase'
writeSumstatsVcf(
  x,
  outputPath,
  sampleName = NULL,
  study = NULL,
  context = NULL,
  trait = NULL,
  method = NULL,
  splitByContext = FALSE,
  splitByTrait = FALSE,
  ...
)

Arguments

x

Input data: a GwasSumStats object, a FineMappingResult object, or a data.frame with columns chrom, pos, ref, alt.

outputPath

File path for output. Extension determines format: .vcf.gz or .vcf.bgz for bgzipped VCF, .bcf for BCF, .vcf for uncompressed VCF.

sampleName

Name for the VCF sample column (default: trait name or method name from the S4 object).

...

Additional arguments passed to methods.

Value

Invisible path to the written file.