create.genotype.matrix: Create genotype matrix

Description Usage Arguments Examples

View source: R/create.genotype.matrix.R

Description

This function returns a matrix giving all the possible multilocus genotype. In column is given the different genotypes and in row the alleles.

Usage

1
  create.genotype.matrice(List_gene)

Arguments

List_gene

A list giving the number of loci and allele for each loci. The length of the list correspond to the number of loci, and each number indecates the number of alleles for this loci.

index

is a matrix calculated with the function genotype.index.multilocus, indicates the row of each genotype in the simulation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  List_gene<-c(2,2) # example of two loci each with two alleles 
  index<-genotype.index.multilocus(List_gene)
  create.genotype.matrix(List_gene,index)
  
            1 2 1 2
A1B1/A1B1 1 1 1 1
A1B1/A2B1 1 2 1 1
A1B1/A1B2 1 1 1 2
A1B1/A2B2 1 2 1 2
A2B1/A2B1 2 2 1 1
A2B1/A1B2 2 1 1 2
A2B1/A2B2 2 2 1 2
A1B2/A1B2 1 1 2 2
A1B2/A2B2 1 2 2 2
A2B2/A2B2 2 2 2 2

MarcoAndrello/MetaPopGen_0.0.8 documentation built on May 25, 2019, 12:23 p.m.