genoDoses2Vcf: Convert genotypes

View source: R/quantgen.R

genoDoses2VcfR Documentation

Convert genotypes

Description

Convert SNP genotypes from "allele doses" into the VCF format.

Usage

genoDoses2Vcf(
  X,
  snp.coords,
  alleles,
  file.date = format(Sys.Date(), "%Y%m%d"),
  si = NULL,
  verbose = 1
)

Arguments

X

matrix of bi-allelic SNP genotypes encoded, for each SNP, in number of copies of its second allele, i.e. as allele doses in 0,1,2, with genotypes in rows and SNPs in columns; the "second" allele corresponds to the second column of alleles and will be interpreted as 'alt'

snp.coords

data.frame with SNP identifiers as row names, and two columns, "chr" and "pos" (or "coord"); columns as factors will be converted into characters

alleles

data.frame (or matrix) with SNPs in rows (names as row names) and alleles in columns (exactly 2 columns are required); the first column will be interpreted as 'ref' and the second column, which should correspond to the allele which number of copies is counted at each SNP in X, will be interpreted as 'alt'; columns as factors will be converted into characters

file.date

date to indicate into the object

si

output from the "seqinfo" function from the GenomeInfoDb package

verbose

verbosity level (0/1)

Value

CollapsedVCF (see pkg VariantAnnotation)

Author(s)

Timothee Flutre


timflutre/rutilstimflutre documentation built on Feb. 12, 2025, 11:35 p.m.