get_snp_matrices: Get SNP data matrices from VCF object(s)

View source: R/read_data.R

get_snp_matricesR Documentation

Get SNP data matrices from VCF object(s)

Description

Get SNP data matrices from VCF object(s)

Usage

get_snp_matrices(vcf_cell, vcf_donor = NULL, verbose = TRUE, donors = NULL)

Arguments

vcf_cell

a CollapsedVCF object containing variant data for cells

vcf_donor

an optional CollapsedVCF object containing genotype data for donors

verbose

logical(1), should the function output verbose information as it runs?

donors

optional character vector providing a set of donors to use, by subsetting the donors present in the donor_vcf_file; if NULL (default) then all donors present in VCF will be used.

Value

a list containing A, a matrix of integers. Number of alteration reads in SNP i cell j. D, a matrix of integers. Number of reads depth in SNP i cell j. R, a matrix of integers. Number of reference reads in SNP i cell j. GT_cells, a matrix of integers for genotypes. The cell-SNP configuration. GT_donors, a matrix of integers for genotypes. The donor-SNP configuration.

Examples

vcf_cell <- read_vcf(system.file("extdata", "cells.donorid.vcf.gz",
                     package = "cardelino"))
vcf_donor <-  read_vcf(system.file("extdata", "donors.donorid.vcf.gz",
                       package = "cardelino"))
snp_data <- get_snp_matrices(vcf_cell, vcf_donor)


davismcc/cardelino documentation built on Nov. 19, 2022, 2:44 a.m.