bed.matrix-class | R Documentation |
"bed.matrix"
S4 class for SNP genotype matrices
Objects can be created by calls of the form new("bed.matrix", ...)
.
ped
:data.frame
containing information for each individual: famid
= Family ID,
id
= Individual ID, father
= Father ID, mother
= Mother ID, sex
= Sex and pheno
= Phenotype.
Can also contain individuals statistic, for example: N0
, N1
and N2
= Number of genotypes equal to 0, 1 and 2 respectively,
NAs
= Number of missing genotypes, callrate
= Individual callrate.
snps
:data.frame
containing information for each SNP: chr
= Chromosome, id
= SNP ID,
dist
= Genetic Distance, pos
= Physical position, A1
= Reference Allele, A2
= Alternative Allele.
Can also contain SNPs statistic, for example: N0
, N1
and N2
= Number of genotypes equal to 0, 1 and 2 repectively,
NAs
= Number of missing genotypes, callrate
= SNP callrate, maf
= Minor allele frequency), hz
= heterozygosity
bed
:externalptr
(pointing to the genotype matrix).
p
:vector
or NULL
for allelic frequencies (allèle A2
).
mu
:vector
or NULL
for genotype means (usually mu = 2*p
).
sigma
:vector
or NULL
for genotypic standard deviation
standardize_p
:logical
. If TRUE
, the genotype matrix is standardized using means 2*p
and genotypic standard deviation sqrt(2*p*(1-p))
standardize_mu_sigma
:logical
. If TRUE
, the genotype matrix is standardize using means
mu
and genotypic standard deviation sigma
.
For more details please check the vignette.
signature(x = "bed.matrix", i = "numeric" or "logical" or "missing",
j = "numeric" or "logical" or "missing", drop = "missing")
:
Extract a sub-matrix (a new bed.matrix
).
signature(x = "bed.matrix", y = "matrix" or "vector")
:
Right matrix multiplication of the genotype matrix (possibly centered and reduced) with a matrix
or a vector
.
signature(x = "matrix" or "vector", y = "bed.matrix")
:
Left matrix multiplication of the genotype matrix with a matrix
or a vector
.
signature(x = "bed.matrix")
:
Convert a bed.matrix
into a matrix
.
The resulting matrix can be huge, use this method only for a small bed.matrix!
signature(x = "bed.matrix")
:
Get the standardize parameter of bed.matrix
. Can be "none", "p" or "mu_sigma".
signature(x = "bed.matrix")
:
Set the standardize parameter of a bed.matrix
.
signature(x = "bed.matrix")
:
Get the number of individuals (rows) and the number of SNPs (columns).
signature(x = "bed.matrix")
:
Print the head of the genotype matrix of a bed.matrix
object.
signature(x = "bed.matrix")
:
Get the mu
slot of a bed.matrix
.
signature(x = "bed.matrix")
:
Set the mu
slot of a bed.matrix
.
signature(x = "bed.matrix")
:
Get the p
slot of a bed.matrix
.
signature(x = "bed.matrix")
:
Set the p
slot of a bed.matrix
.
signature(object = "bed.matrix")
:
Displays basic information about a bed.matrix
.
signature(x = "bed.matrix")
:
Get the sigma
slot of a bed.matrix
.
signature(x = "bed.matrix")
:
Set the sigma
slot of a bed.matrix
.
signature(... = "bed.matrix")
:
Combine a sequence of bed.matrix
by columns.
signature(... = "bed.matrix")
:
Combine a sequence of bed.matrix
by rows.
Hervé Perdry and Claire Dandine-Roulland
read.bed.matrix
, write.bed.matrix
,
set.stats
, select.snps
, select.inds
, GRM
showClass("bed.matrix")
# Conversion example
data(LCT)
x1 <- as(LCT.gen, "bed.matrix")
x1
head(x1@ped)
head(x1@snps)
# the function as.bed.matrix is an alternative
x2 <- as.bed.matrix(LCT.gen, LCT.fam, LCT.bim)
x2
head(x2@ped)
head(x2@snps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.