Learn R Programming

pheno2geno (version 1.4.0)

add.to.population: Add additional data to a population object

Description

Add additional data to an existing population object. When adding data already present in the population objects the function will issue a warning.

Usage

add.to.population(population, dataObject, dataType=c("founders",
  "offspring$phenotypes",  "founders$group", "offspring$genotypes",
  "maps$genetic","maps$physical","annotations"), verbose=FALSE,debugMode=0)

Arguments

population

An object of class population. See create.population for details.

dataObject

A matrix of data to be put into the population objects, or a list of matrices.

dataType

Specifies what kind of data dataObject contains, if dataObject is a list of matrices to add, dataType should be a list of the same length:

  • founders - Founders phenotype.

  • offspring$phenotypes - Offspring phenotype.

  • founders$group - Specifying groups in founders phenotypes.

  • offspring$genotypes - Offspring genotype.

  • maps$genetic - Genetic map.

  • maps$physical - Physical map.

  • annotations - Annotations file.

verbose

Be verbose.

debugMode

Either use 1 or 2, this will modify the amount of information returned to the user. 1) Print out checks, 2) Print additional time information.

Value

An object of class population. See create.population for details.

Details

This function inputs data into existing population object. It can input single matrix or list of matrices.

See Also

  • read.population - Loads genotype, phenotype, genetic map data files into R environment into a population object.

  • create.population - Create object of class population from data already in R environment.

  • fake.population - Simulate basic population object for use in examples.

Examples

Run this code
# NOT RUN {
  population <- fake.population()
  offspring <- population$offspring$phenotypes
  founders <- population$founders$phenotypes
  founders_groups <- population$founders$groups
  maps_genetic <- population$maps$genetic
  population <- create.population(offspring,founders,founders_groups)
  population <- add.to.population(population,maps_genetic,"maps$genetic")
# }

Run the code above in your browser using DataLab