polarise_ancestral_vcf: Polarise a VCF File setting the (supplied) Ancestral Allele...

View source: R/polarise_ancestral_vcf.R

polarise_ancestral_vcfR Documentation

Polarise a VCF File setting the (supplied) Ancestral Allele as REF

Description

This function reads a VCF file, reorders the REF and ALT alleles based on the ancestral allele specified in the INFO field (ID=AA) (the AA INFO field must be present in the vcf), adjusts the REF, ALT and genotype (GT) fields accordingly, and writes the modified VCF to a new file.

Usage

polarise_ancestral_vcf(
  input_vcf,
  output_vcf = "output.vcf.gz",
  compress = NULL
)

Arguments

input_vcf

Path to the input VCF file.

output_vcf

Path to the output VCF file. If not provided, defaults to "output.vcf.gz".

compress

Optional boolean indicating whether to compress the output file. If not provided, it will automatically detect based on the input file.

Value

The function writes the modified VCF file to the specified output path and returns a modified vcfR object to the environment

Examples

polarise_ancestral_vcf("input.vcf")


pygmyperch/melfuR documentation built on Aug. 26, 2024, 12:48 a.m.