renameVcfSamples: Rename VCF samples

renameVcfSamplesR Documentation

Rename VCF samples

Description

Rename samples in a VCF file with bcftools reheader. Variants can also be sorted.

Usage

renameVcfSamples(
  in.vcf.file,
  samples,
  out.vcf.file,
  skip.check = FALSE,
  sort.variants = TRUE
)

Arguments

in.vcf.file

path to the input VCF file (will be automatically indexed if necessary)

samples

data frame with (at least) two columns, the first corresponding to the old names (same order as in the VCF file) and the second to the new names; spaces inside names are forbidden

out.vcf.file

path to the output VCF file

skip.check

if TRUE, no comparison is done to check that samples is coherent with the data in the VCF file

sort.variants

if TRUE, variants are also sorted, with bcftools sort (requires bcftools >= 1.6)

Value

invisible out.vcf.file

Author(s)

Timothee Flutre


timflutre/rutilstimflutre documentation built on Aug. 18, 2024, 7:43 p.m.