Learn R Programming

adegenet (version 1.0-0)

genind: adegenet class for individual genotypes

Description

The objects of class genind contain individual genotypes. It consists in a list with several components (see value section). The function genind2genpop converts individuals genotypes of known population into a genpop object. The summary of a genind object invisibly returns a list of components (see value section). The function as.genind is called by import functions (see import2genind).

Usage

is.genind(x)
as.genind(tab=NULL,pop=NULL,prevcall=NULL)
print.genind(x,...)
summary.genind(object,...)
genind2genpop(x,pop=NULL,missing=NA,quiet=FALSE)

Arguments

x
an object of class genind.
tab
a individuals x alleles matrix of genotypes coded as allelic frequencies.
pop
a factor giving the population of each genotype in 'x'. If note provided, seeked in x$pop, but if given, the argument prevails on x$pop.
prevcall
call of an object, for internal use.
...
other -unused- arguments
object
an object of class genind.
missing
can be NA, 0, or "replace". See details for more information.
quiet
logical stating whether a conversion message must be printed (TRUE,default) or not (FALSE).

Value

  • tabmatrix 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.
  • ind.namescharacter 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.
  • loc.namescharacter vector containing the real names of the loci
  • loc.nallinteger vector giving the number of alleles per locus
  • loc.faclocus factor for the columns of tab
  • all.nameslist having one component per locus, each containing a character vector of alleles names
  • callthe matched call
  • pop(optional) factor giving the population of each individual
  • pop.names(optional) vector giving the real names of the populations
  • N(summary) total number of genotypes.
  • pop.eff(summary) populations sample size.
  • loc.nall(summary) number of alleles per locus.
  • pop.nall(summary) number of alleles per population.
  • NA.perc(summary) percentage of - appearing - missing data.
  • Hobs(summary) observed heterozygosity.
  • Hexp(summary) expected heterozygosity.

Details

The values of the 'missing' argument in genind2genpop have the following effects: - NA: if all genotypes of a population for a given allele are missing, count value will be NA - 0: if all genotypes of a population for a given allele are missing, count value will be 0 - "replace": when an allele is not typed in a population, it is assigned an allele count so that the allelic frequency in this populations is the same as the frequency in the whole dataset. If allele 'j' of locus 'k' in pop 'i' is missing, the count value is number 'x' so that the frequency 'x/s' ('s' being the number of observations in 'k' ) equals the frequency 'f' computed on the whole data (i.e. considering all pop as one) Then x verifies: $$x/s = f(1-f) => x=f(1-f)s$$

See Also

genpop, import2genind, genetix2genind, genepop2genind, fstat2genind

Examples

Run this code
obj <- genetix2genind(system.file("files/nancycats.gtx",package="adegenet"),missing="mean")
is.genind(obj)
summary(obj)
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)
}

Run the code above in your browser using DataLab