X.snp.matrix-class {chopsticks} | R Documentation

## Class "X.snp.matrix"

### Description

This class extends the `snp.matrix-class` to deal with SNPs on the X chromosome.

### Objects from the Class

Objects can be created by calls of the form `new("X.snp.matrix", x, Female)`. Such objects have an additional `slot` to objects of class `"snp.matrix"` consisting of a logical array of the same length as the number of rows. This array indicates whether the sample corresponding to that row came from a female (`TRUE`) or a male (`FALSE`).

### Slots

`.Data`:

  Object of class `"matrix"` and storage mode `"raw"`

`Female`:

  Object of class `"logical"` indicating sex of samples

### Extends

Class `"snp.matrix"`, directly, with explicit coerce. Class `"matrix"`, by class `"snp.matrix"`. Class `"structure"`, by class `"snp.matrix"`. Class `"array"`, by class `"snp.matrix"`. Class `"vector"`, by class "snp.matrix", with explicit coerce. Class `"vector"`, by class "snp.matrix", with explicit coerce.

### Methods

[]

  `signature(x = "X.snp.matrix")`: subset operations. Currently rather slow owing to excessive copying

[<-

  `signature(x = "X.snp.matrix")`: subset assignment operation to replace part of an object

coerce

  `signature(from = "X.snp.matrix", to = "character")`: map to codes 0, 1, 2, or NA

coerce

  `signature(from = "snp.matrix", to = "X.snp.matrix")`: maps a snp.matrix to an X.snp.matrix. Sex is inferred from the genotype data since males should not be heterozygous at any locus. After inferring sex, heterozygous calls for males are set to `NA`

show

  `signature(object = "X.snp.matrix")`: map to codes "A/A", "A/B", "B/B", "A/Y", "B/Y" or ""

summary

  `signature(object = "X.snp.matrix")`: calculate call rates, allele frequencies, genotype frequencies, and chi-square tests for Hardy-Weinberg equilibrium. Genotype frequencies are calculated for males and females separately and Hardy-Weinberg equilibrium tests use only the female data. Allele frequencies are calculated using data from both males and females. Results are returned as a dataframe with column names `Calls`, `Call.rate`, `MAF`, `P.AA`, `P.AB`, `P.BB`, `P.AY`, `P.BY`, and `z.HWE`

### Author(s)

David Clayton david.clayton@cimr.cam.ac.uk

### References

http://www-gene.cimr.cam.ac.uk/clayton

### See Also

`X.snp-class`, `snp.matrix-class`, `snp-class`

### Examples

    data(testdata)
    summary(summary(Xchromosome))

[Package chopsticks version 1.46.0 Index]