Objects from the Class
Objects can be created by calls of the form new("snp.matrix", x)
where x
is a matrix with storage mode "raw"
.
Chips (usually corresponding to samples or
subjects) define rows of the matrix while polymorphisms (loci) define
columns. Rows and columns will usually have names which can be
used to link the data to further data concerning samples and SNPsSlots
.Data
:- Object of class
"matrix"
and storage
mode raw
Internally, missing data are coded 00 and SNP genotypes are coded
01, 02 or 03.
Extends
Class "matrix"
, from data part.
Class "structure"
, by class "matrix"
.
Class "array"
, by class "matrix"
.
Class "vector"
, by class "matrix", with explicit coerce.
Class "vector"
, by class "matrix", with explicit coerce.Methods
- []
signature(x = "snp.matrix")
: subset
operations. Currently rather slow owing to excessive copying. - cbind2
signature(x = "snp.matrix", y = "snp.matrix")
:
S4 generic function to provide cbind() for two or
more matrices together by column. Row names must match and column
names must not coincide. If the matrices are of the derived class
X.snp.matrix-class
, the Female
slot values must also
agree - coerce
signature(from = "snp.matrix", to = "numeric")
:
map to codes 0, 1, 2, or NA - coerce
signature(from = "snp.matrix", to =
"character")
: map to codes "A/A", "A/B", "B/B", "" - coerce
signature(from = "matrix", to = "snp.matrix")
:
maps numeric matrix (coded 0, 1, 2 or NA) to a snp.matrix - 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
- is.na
signature(x = "snp.matrix")
: returns a logical
matrix indicating whether each element is NA
- rbind2
signature(x = "snp.matrix", y = "snp.matrix")
:
S4 generic function to provide rbind() for two or
more matrices by row. Column names must match and duplicated row
names prompt warnings - show
signature(object = "snp.matrix")
: shows the size
of the matrix (since most objects will be too large to show in full) - summary
signature(object = "snp.matrix")
: calculate
call rates, allele frequencies, genotype frequencies, and z-tests for
Hardy-Weinberg equilibrium. Results are returned as a dataframe with
column names Calls
, Call.rate
, MAF
, P.AA
,
P.AB
, P.BB
, and z.HWE
- is.na
signature(x = "snp.matrix")
: returns a logical
matrix of missing call indicators - show
signature(object = "snp.matrix")
: ... - summary
signature(object = "snp.matrix")
: ...