classifSNPs {scoreInvHap}R Documentation

Get similarity scores and probability

Description

This function computes the similarity scores between the sample SNPs and the haplotype's reference.

Usage

classifSNPs(genos, R2, refs, BPPARAM = BiocParallel::bpparam())

classifSNPsImpute(genos, R2, refs, BPPARAM = BiocParallel::bpparam())

Arguments

genos

Matrix with the samples genotypes. It is the result of getGenotypesTable

R2

Vector with the R2 between the SNPs and the inversion status

refs

List of matrices. Each matrix has, for an SNP, the frequencies of each genotype in the different haplotypes.

BPPARAM

A BiocParallelParam instance. Used to parallelize computation

Details

classifSNPs computes, for each individual, similarity scores for all the present haplotypes. For each SNP, we compute as many similarity scores as haplotypes present in the reference. We have defined the similarity score as the frequency of this genotype in the different haplotype population. To compute the global similarity score, we have computed a mean of the scores by SNP weighted by the R2 between the SNP and the haplotype classification.

classifSNPsImpute is a version of classifSNPs that works with posterior probabilities of imputed genotypes.

Value

List with the results:

Examples

## Simulate a table of genotypes from ROIno.8.3
geno <- matrix(c("CC", "GG", "AA", "CG", "NN", "AC", "GG", "AA", "CC"),
    nrow = 3, dimnames = list(letters[1:3],
    c("rs141039449", "rs138092889", "rs138217047")))

## Run function using reference of inv8p23.1
classifSNPs(geno, SNPsR2$inv8p23.1, Refs$inv8p23.1)

[Package scoreInvHap version 1.8.0 Index]