genoSim | R Documentation |
Simulate genotypic data from a pedigree in advanced intercross lines (AIL).
genoSim(ped, gmap, ids, hap, method = c("Haldane", "Kosambi"))
ped |
A pedigree, which is a data frame (id, sex, father/sire, mother/dam, ...). In "sex", male should be "M", "Male" or 1, and female should be "F", "Female" or 2 (other than 0 and 1). If given, "generation" can be numeric 0, 1, 2, ... or non-numeric "F0", "F1", "F2", ..., which should be in an increasing order. Note that 0 is reserved for missing values. If a father/mother is an inbred founder, its ID should be tagged by character 'i' (e.g. 1i, 2i, etc.). See |
gmap |
A genetic map. Should be data frame (snp, chr, dist, ...), where "snp" is the SNP (marker) name, "chr" is the chromosome where the "snp" is, and "dist" is the genetic distance in centi-Morgan (cM) from the left of the chromosome. If |
ids |
Genotypic data are extracted only for individuals with IDs specified by |
hap |
Founders' haplotype data if not missing. Rows correspond to founders as specified by row names, and columns correspond to loci in the genetic map |
method |
Whether "Haldane" or "Kosambi" mapping function should be used. This will be ignored if the recombination rate |
The pedigree should be in the same format as an output of pedRecode
. Sex chromosome should be marked
by 'x' or 'X'. Founders mean those whose parents have 0 or negative IDs after the pedigree is recoded by
pedRecode
. In addition, it is assumed that there are not more than two founders; otherwise,
you may run hapSim
and then extract genotypes manually.
A matrix, with entry value s-1 where s is the summation of the numbers representing two alleles at a locus. For instance, 1, 2, and 3 representing genotypes "AA", "AB" and "BB" respectively if hap
is not specified. Each row represent an observation, and each column corresponds to SNP in gmap
.
Sex may be used as a covariate if significance on x-chromosome is assessed by gene dropping through this function.
pedRecode
for more information.
data(miscEx)
## Not run:
# simulate genotypes for F8 individuals
ids<- sapply(pedF8$id[pedF8$gen == "F8" & pedF8$sire != "32089"], as.character)
gdt<- genoSim(pedF8, gmapF8, ids=ids)
dim(gdt)
gdt[1:5,1:5]
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.