VariantExperiment-methods: Statistical functions for 'VariantExperiment' objects.

Description Usage Arguments Value Examples

Description

Statistical functions for VariantExperiment objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
## S4 method for signature 'VariantExperiment'
seqAlleleFreq(
  gdsfile,
  ref.allele = 0L,
  minor = FALSE,
  .progress = FALSE,
  parallel = seqGetParallel(),
  verbose = FALSE
)

## S4 method for signature 'VariantExperiment'
seqAlleleCount(
  gdsfile,
  ref.allele = 0L,
  minor = FALSE,
  .progress = FALSE,
  parallel = seqGetParallel(),
  verbose = FALSE
)

## S4 method for signature 'VariantExperiment'
seqMissing(
  gdsfile,
  per.variant = TRUE,
  .progress = FALSE,
  parallel = seqGetParallel(),
  verbose = FALSE
)

## S4 method for signature 'VariantExperiment'
seqNumAllele(gdsfile)

## S4 method for signature 'VariantExperiment'
hwe(gdsobj, permute = FALSE)

## S4 method for signature 'VariantExperiment'
inbreedCoeff(gdsobj, margin = c("by.variant", "by.sample"), use.names = FALSE)

## S4 method for signature 'VariantExperiment'
pca(gdsobj, eigen.cnt = 32)

## S4 method for signature 'VariantExperiment'
titv(gdsobj, by.sample = FALSE, use.names = FALSE)

## S4 method for signature 'VariantExperiment'
refDosage(gdsobj, use.names = TRUE)

## S4 method for signature 'VariantExperiment'
altDosage(gdsobj, use.names = TRUE, sparse = FALSE)

## S4 method for signature 'VariantExperiment'
countSingletons(gdsobj, use.names = FALSE)

## S4 method for signature 'VariantExperiment'
heterozygosity(
  gdsobj,
  margin = c("by.variant", "by.sample"),
  use.names = FALSE
)

## S4 method for signature 'VariantExperiment'
homozygosity(
  gdsobj,
  allele = c("any", "ref", "alt"),
  margin = c("by.variant", "by.sample"),
  use.names = FALSE
)

## S4 method for signature 'VariantExperiment'
meanBySample(gdsobj, var.name, use.names = FALSE)

## S4 method for signature 'VariantExperiment'
isSNV(gdsobj, biallelic = TRUE)

## S4 method for signature 'VariantExperiment'
isVariant(gdsobj, use.names = FALSE)

Arguments

gdsfile

an VariantExperiment object that with synchronized gds file.

ref.allele

a single numeric value, a numeric vector or a character vector; see ?SeqArray::seqAlleleFreq for more details.

minor

if ‘TRUE’, return minor allele frequency/count

.progress

Logical, show process information if TRUE.

parallel

A logical value to indicate serial processing (FALSE) or multicore processing (TRUE). Takes numeric value or other value; see ?SeqArray::seqParallel for more details.

verbose

if ‘TRUE’, show progress information

per.variant

A logical value to indicate whether to calculate missing rate for variant (TRUE), or samples (FALSE).

gdsobj

same as above gdsfile argument.

permute

A logical value indicating whether to permute the genotypes. See ?SeqVarTools::hwe for more details.

margin

"by.variant" OR "by.sample" to indicate whether the calculation should be done over all samples for each variant, or over all variants for each sample. See ?SeqVarTools::inbreedCoeff for more details.

use.names

A logical value indicating whether to assign variant or sample IDs as names of the output vector.

eigen.cnt

An integer value indicating how many eigenvalues and eignvectors to return. The default is 32.

by.sample

A logical value indicating whether TiTv should be calculated by sample or overall for the entire VariantExperiment object. See ?SeqVarTools::titv for more details.

sparse

A Logical value indicating whether or not to return the alterate allele dosage as a sparse matrix. In most cases, it will dramatically reduce the size of the returned object. See ?SeqVarTools::altDosage for more details.

allele

Choose from "any", "ref," or "alt," to indicate which alleles to consider when calculating homozygosity. See ?SeqVarTools::homozygosity for more details.

var.name

Character string with name of the variable. Choose from names(assays(VE_Object)). See ?SeqVarTools::meanBySample for more details.

biallelic

A logical indicating whether to only consider biallelic SNVs. See ?SeqVarTools::isSNV for more details.

Value

Statistical results in vector or data.frame format.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
gds <- SeqArray::seqExampleFileName("gds")
## ve <- makeVariantExperimentFromGDS(gds)
## ve

## sample missing rate
## mr.samp <- seqMissing(ve, per.variant = FALSE)
## ead(mr.samp)

## hwe
## hwe <- hwe(ve)
## head(hwe)

## titv ratio by sample / overall
## titv <- titv(ve, by.sample=TRUE)
## head(titv)
## titv(ve, by.sample=FALSE)

## countSingletons
## countSingletons(ve)

VariantExperiment documentation built on April 10, 2021, 6 p.m.