Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

genind

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 a genind object from a valid table of alleles corresponding to the @tab slot. Note that as in other S4 classes, slots are accessed using @ instead of \$.

Slots

tab:

(accessor: tab) matrix integers containing genotypes data for individuals (in rows) for all alleles (in columns). The table differs depending on the @type slot:
- 'codom': values are numbers of alleles, summing up to the individuals' ploidies.
- 'PA': values are presence/absence of alleles.
In all cases, rows and columns are given generic names.

loc.fac:

(accessor: locFac) locus factor for the columns of tab

loc.n.all:

(accessor: nAll) integer vector giving the number of observed alleles per locus (see note)

all.names:

(accessor: alleles) list having one component per locus, each containing a character vector of allele names

ploidy:

(accessor: ploidy) an integer vector indicating the degree of ploidy of the genotypes. Beware: 2 is not an integer, but 2L or as.integer(2) is.

type:

a character string indicating the type of marker: 'codom' stands for 'codominant' (e.g. microstallites, allozymes); 'PA' stands for 'presence/absence' (e.g. AFLP).

call:

the matched call

strata:

(accessor: strata) (optional) data frame giving levels of population stratification for each individual

hierarchy:

(accessor: hier) (optional, currently unused) a hierarchical formula defining the hierarchical levels in the @@strata slot.

pop:

(accessor: pop) (optional) factor giving the population of each individual

other:

(accessor: other) (optional) a list containing other information

Note:

The loc.n.all slot will reflect the number of columns per locus that contain at least one observation. This means that the sum of the this vector will not necessarily equal the number of columns in the data unless you use drop = TRUE when subsetting.

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 or suppress printing of auxiliary information by specifying verbose = FALSE

Author(s)

Thibaut Jombart t.jombart@imperial.ac.uk

See Also

Related classes:
- genpop for storing data per populations

- genlight for an efficient storage of binary SNPs genotypes

Examples

showClass("genind")

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

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

# perform a between-class PCA
pca1 <- dudi.pca(scaleGen(obj, NA.method="mean"),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)


## End(Not run)

adegenet

Exploratory Analysis of Genetic and Genomic Data

v2.1.3
GPL (>= 2)
Authors
Thibaut Jombart [aut] (<https://orcid.org/0000-0003-2226-8692>), Zhian N. Kamvar [aut, cre] (<https://orcid.org/0000-0003-1458-7108>), Caitlin Collins [ctb], Roman Lustrik [ctb], Marie-Pauline Beugin [ctb], Brian J. Knaus [ctb], Peter Solymos [ctb], Vladimir Mikryukov [ctb], Klaus Schliep [ctb], Tiago Maié [ctb], Libor Morkovsky [ctb], Ismail Ahmed [ctb], Anne Cori [ctb], Federico Calboli [ctb], RJ Ewing [ctb], Frédéric Michaud [ctb], Rebecca DeCamp [ctb], Alexandre Courtiol [ctb] (<https://orcid.org/0000-0003-0637-2959>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.