Learn R Programming

MoBPS (version 1.13.1)

get.database: gen/database/cohorts conversion

Description

Function to derive a database based on gen/database/cohorts

Usage

get.database(
  population,
  gen = NULL,
  database = NULL,
  cohorts = NULL,
  avoid.merging = FALSE,
  per.individual = FALSE,
  id = NULL,
  db.names = NULL,
  id.all.copy = FALSE,
  id.last = FALSE,
  keep.order = FALSE,
  class = NULL,
  genotyped = NULL,
  npheno = NULL,
  verbose = TRUE,
  sex.filter = 0
)

Value

Matrix with combined gen/database/cohorts

Arguments

population

Population list

gen

Quick-insert for database (vector of all generations to export)

database

Groups of individuals to consider for the export

cohorts

Quick-insert for database (vector of names of cohorts to export)

avoid.merging

Set to TRUE to avoid different cohorts to be merged in a joint group when possible

per.individual

Set TRUE to obtain a database with one row per individual instead of concatenating (default: FALSE)

id

Individual IDs to search/collect in the database

db.names

MoPBS internal names (SexNr_Generation)

id.all.copy

Set to TRUE to show all copies of an individual in the database (default: FALSE)

id.last

Set to TRUE to use the last copy of an individual for the database (default: FALSE - pick first copy)

keep.order

To not change order of individuals when ids are provided (default: FALSE)

class

Only include individuals of the following classes in the database (can also be vector with multiple classes; default: ALL)

genotyped

Only include individuals that are genotyped (TRUE) or not-genotyped (FALSE); default: NULL (all individuals)

npheno

Only include individuals with the certain number of phenotypes generated (default: NULL (all individuals))

verbose

Set to FALSE to not display any prints

sex.filter

Set to 1 to only include males and set 2 to only include females in database (default: 0)

Examples

Run this code
data(ex_pop)
get.database(ex_pop, gen=2)

Run the code above in your browser using DataLab