findMinIncClade: Determine the minimal inclusive clades and calculate its...

View source: R/func__findMinIncClade.R

findMinIncCladeR Documentation

Determine the minimal inclusive clades and calculate its frequency of co-occurrence events of every pair of alleles.

Description

This function finds out the minimal clade that contains all samples having a pair of patterns (representatives of alleles) co-occurring. It also computes the frequency of co-occurrence events and the maximal sample distance in each minimal clade. This function can be used for determining whether the distributions of a pair of identically distributed alleles are identical-by-descent (IBD). An NA vlaue appears when the patterns do not overlap (when min.co = 0).

By design, this function takes as input the outputs of the lmm or findPhysLink function when it is applied independently. It however serves as a subordinate function of lmm/findPhysLink as well.

Usage

findMinIncClade(
  lmms,
  allele.pam,
  clade.pam,
  clade.sizes = NULL,
  sample.dists,
  n.cores = -1
)

Arguments

lmms

Allele-level results from linear mixed models, generated by the function lmm or findPhysLink.

allele.pam

An allele-level presence-absence matrix. It is the element [["alleles"]][["A"]] in the output list of lmm or findPhysLink.

clade.pam

A matrix for the presence-absence of samples in each clade of an input tree. It can be obtained using the function tree2Clades of GeneMates.

clade.sizes

A named vector of integers for the number of samples in each clade. It can be obtained from the element "sizes" in the outputs of the function tree2Clades. Optional.

sample.dists

A square matrix for distances between samples. It can be acquired through the function projectSamples.

n.cores

An integer determining the number of cores used for parallel computing. Valid values are the same as those for the findPhysLink function.

Author(s)

Yu Wan (wanyuac@126.com)

Examples

assoc <- findPhysLink(...)  # Although this command calls the findMinIncClade
function, however, a user wants to regenerate the clade inforamtion for some
reasons.
C <- projectSamples(...)
clades <- tree2Clades(...)
clonality <- findMinIncClade(lmms = assoc[["lmms"]],
    allele.pam = assoc[["alleles"]][["A"]], clade.pam = clades[["pam"]],
    clade.sizes = clades[["sizes"]], sample.dists = C[["d"]], n.cores = 16)

Dependency: parallel


wanyuac/GeneMates documentation built on Aug. 12, 2022, 7:37 a.m.