joinMap2designMatrix | R Documentation |
Convert genotypes encoded in the JoinMap format into a design matrix. Genotypes are assumed to come from a bi-parental family with heterozygous parents (population type CP in JoinMap). * When phase information is not used, see equation 3 of Wang (2011) for the parameterization, as well as Chiquet et al (2016) for the constraints. Additive and dominance effects are handled, but epistasis is ignored. * When phase information is used, each marker is coded with four columns, one per parental haplotype. Only additive effects are handled.
joinMap2designMatrix(
jm,
use.phase = FALSE,
parameterization = "allele",
constraints = NULL,
rm.col.zeros = TRUE,
rm.dom = FALSE,
verbose = 1
)
jm |
data frame in the JoinMap format, for instance from |
use.phase |
if TRUE, phase information will be used |
parameterization |
parameterization (allele/F_infinity/allele-count); ignored if |
constraints |
constraints (NULL/mu-zero/last-zero); ignored if |
rm.col.zeros |
if TRUE, the columns full of zeros will be removed |
rm.dom |
if TRUE, the columns corresponding to dominance effects will be removed; ignored if |
verbose |
verbosity level (0/1) |
matrix, with genotypes in rows and markers in columns
Timothee Flutre
genoClasses2JoinMap
, writeSegregJoinMap
, updateJoinMap
## Not run: nb.snps <- 6
x <- data.frame(par1=c("AA", "GC", "CG", "AT", NA, "AA"),
par2=c("AT", "GC", "GG", "AT", "AT", "AT"),
off1=c("AA", "GG", "CG", "AA", "AA", "AT"),
off2=c("AT", "GG", "CG", "AT", "AT", "AA"),
off3=c("AT", "GG", "GG", "TT", "TT", NA),
off4=c(NA, NA, NA, NA, NA, NA),
row.names=paste0("snp", 1:nb.snps),
stringsAsFactors=FALSE)
jm <- genoClasses2JoinMap(x=x, reformat.input=TRUE, thresh.na=2, verbose=1)
jm <- jm[! is.na(jm$seg),
c("seg", grep("^off", colnames(jm), value=TRUE))]
jm <- cbind(locus=rownames(jm), jm)
any.na <- apply(jm, 2, function(x) any(is.na(x)))
jm <- jm[, - which(any.na)]
joinMap2designMatrix(jm)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.