Description Usage Arguments Details Value Author(s) See Also Examples
Update phenotypes and covariates in a cross qtl object. New phenotypes (for ex. tangent coordinates) are merged to an existing cross object obtained from read.cross
1 2 3 |
cross |
A cross object containing genotypes and some phenotypes |
new.pheno |
An optional data.frame containing new phenotypes |
phen2keep |
An optional vector with names of the original phenotypes to keep |
phen2update |
An optional vector with names of the subset of new phenotypes to keep |
id.geno |
An optional vector with the matching id in the genotypes |
na.rm |
An optional logical if individuals with missing phenotypes should be removed from the cross |
Function takes a cross object and a dataframe with new phenotypes (tangent coordinates, PC scores,...), matches cross$pheno$ID to the id column of the new phenotypes. Matching id.geno may be provide as an optional input parameter. Additional covariates may be provided as supplementary arguments but their ordering must match to the new phenotypes.
Function returns the cross object with updated phenotypes.
Nicolas Navarro
1 2 3 4 | data(fake.bc)
tgCoords <- data.frame(1:nind(fake.bc), rnorm(nind(fake.bc)), rnorm(nind(fake.bc)))
colnames(tgCoords) <- c('Id', 'ProcCoord1','ProcCoord2')
fake.bc <- update.cross(fake.bc, new.pheno=tgCoords, phen2keep=c("sex","age"), phen2update=colnames(tgCoords)[grep("ProcCoord",colnames(tgCoords))])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.