getSampleSimilarity: Generates a similarity matrix

Description Usage Arguments Value

View source: R/getSampleSimilarity.R

Description

Takes a path to a directory that contains the [CHR]_filt.snps files and processes each to generate a similarity matrix using a given similarityFun. If no similarityFun is given, it generates one using the default Jaccard metric.

Usage

1
2
3
4
5
6
7
8
getSampleSimilarity(
  sample_matrix,
  samples = NULL,
  matchmode = "autosome",
  similarityFun = NULL,
  rm_nocov = FALSE,
  rem_ref = TRUE
)

Arguments

sample_matrix

character: path to csv or vcf file to run similarity match on

samples

character: Comma-separated list of ordered samples for the matrix

matchmode

character: Either 'autosome' or 'chrM' (Default=autosome)

similarityFun

Similarity function with two parameters, 'i' and 'j'.

rm_nocov

If no filtering process took place prior, setting this to TRUE will remove all SNPs where no sample have any coverage (Default=FALSE)

rem_ref

boolean: Removes reference matches in chrM sample matching (0/0 and 0/0) (Default=TRUE)

Value

Returns a list of similarity matrices, matrix of number of SNPs found between two samples, and a matrix of number of heterozygous SNPs between two samples


quevedor2/WadingPool documentation built on Dec. 22, 2021, 10:59 a.m.