Learn R Programming

ICAMS (version 2.0.10)

CheckAndFixChrNames: Check and, if possible, correct the chromosome names in a VCF data.frame.

Description

Check and, if possible, correct the chromosome names in a VCF data.frame.

Usage

CheckAndFixChrNames(vcf.df, ref.genome)

Arguments

vcf.df

A VCF as a data.frame. Check the names in column CHROM.

ref.genome

The reference genome with the chromosome names to check vcf.df$CHROM against; must be a Bioconductor BSgenome, e.g. BSgenome.Hsapiens.UCSC.hg38.

Value

If the vcf.df$CHROM values are correct or can be corrected, then a vector of chromosome names that can be used as a replacement for vcf.df$CHROM. If the names in vcf.df$CHROM cannot be made to be consistent with the chromosome names in ref.genome, then stop.