genind {adegenet}R Documentation

adegenet formal class (S4) for individual genotypes

Description

The S4 class genind is used to store individual genotypes.
It contains several components described in the 'slots' section).
The summary of a genind object invisibly returns a list of component. The function .valid.genind is for internal use. The function genind creates an empty valid genind object. Note that as in other S4 classes, slots are accessed using @ instead of $.

Slots

tab:
matrix of genotypes -in rows- for all alleles -in columns-. Values are frequency: '0' if the genotype does not have the corresponding allele, '1' for an homozygote and 0.5 for an heterozygte.Rows and columns are given generic names.
loc.names:
character vector containing the real names of the loci
loc.fac:
locus factor for the columns of tab
loc.nall:
integer vector giving the number of alleles per locus
all.names:
list having one component per locus, each containing a character vector of alleles names
call:
the matched call
ind.names:
character vector containing the real names of the individuals. Note that as Fstat does not store these names, objects converted from .dat files will contain empty ind.names.
ploidy:
an integer indicating the degree of ploidy of the genotypes. Beware: 2 is not an integer, but as.integer(2) is.
pop:
(optional) factor giving the population of each individual
pop.names:
(optional) vector giving the real names of the populations
other:
(optional) a list containing other information

Extends

Class "gen", directly. Class "indInfo", directly.

Methods

names
signature(x = "genind"): give the names of the components of a genind object
print
signature(x = "genind"): prints a genind object
show
signature(object = "genind"): shows a genind object (same as print)
summary
signature(object = "genind"): summarizes a genind object, invisibly returning its content
nLoc
signature(object = "genind"): returns the number of loci of the object

Author(s)

Thibaut Jombart jombart@biomserv.univ-lyon1.fr

See Also

as.genind, is.genind, genind2genpop, genpop, import2genind, read.genetix, read.genepop, read.fstat, na.replace

Examples

showClass("genind")

obj <- read.genetix(system.file("files/nancycats.gtx",package="adegenet"),missing="mean")
obj
validObject(obj)
summary(obj)

# test inter-colonies structuration
if(require(hierfstat)){
gtest <- gstat.randtest(obj,nsim=99)
gtest
plot(gtest)
}

# perform an inter-class PCA
if(require(ade4)){
pca1 <- dudi.pca(obj@tab,scannf=FALSE,scale=FALSE)
pcabet1 <- between(pca1,obj@pop,scannf=FALSE)
pcabet1

s.class(pcabet1$ls,obj@pop,sub="Inter-class PCA",possub="topleft",csub=2)
add.scatter.eig(pcabet1$eig,2,xax=1,yax=2)
}

[Package adegenet version 1.2-2 Index]