Specimen: Class providing object with methods to mimic in silico...

SpecimenR Documentation

Class providing object with methods to mimic in silico Specimens

Description

Mean to mimic a in silico Specimens. It is the working instances of the simulator.

Details

Object of R6 class that points to C++ objetcs.

Value

Objects of R6 class with methods to mimic in silico Specimens.

Public fields

.ptr

External pointer to the instance of the C++ class Specie.

Methods

Public methods


Method new()

Create an instance of a Specimen.

Usage
.R_Specimen_ctor$new(ptr)
Arguments
ptr

an Smart pointer to an instance of a Specimen C++ class.

Returns

A new 'Specimen' object.


Method print()

Print/Show an instance of the Specimen class.

Usage
.R_Specimen_ctor$print(...)
Arguments
...

further arguments to be passed to print.


Method alpha()

Evaluates the breeding value.

Usage
.R_Specimen_ctor$alpha(trait)
Arguments
trait

an instance of the class Trait.

Returns

the breeding value of the specimen for the given trait.


Method genotype()

Codify Specimen's Genotypes.

Usage
.R_Specimen_ctor$genotype(phase = FALSE)
Arguments
phase

logical should the codes keep the phase.

Returns

A numeric or character vector with the codified Specimen's genotypes.


Method cross()

Performs the simple bi-parental cross.

Usage
.R_Specimen_ctor$cross(n = 1, gid)
Arguments
n

a length-one integer vector with the size of the progeny.

gid

instance of the class specimen which will be used to mate.

Returns

a size n list with instances of the class Specimen that represent new individuals belonging to the progeny of the respective mating scheme.


Method selfcross()

Performs the selfcross.

Usage
.R_Specimen_ctor$selfcross(n = 1, replace = FALSE)
Arguments
n

a length-one integer vector with the size of the progeny.

replace

logical scalar indicating if the outcome of the function will replace the current instance of the Specimen

Returns

a size n list with instances of the class Specimen that represent new individuals belonging to the progeny of the respective mating scheme.


Method dh()

Performs the double-haploid duplication

Usage
.R_Specimen_ctor$dh(n = 1, replace = FALSE)
Arguments
n

a length-one integer vector with the size of the progeny.

replace

logical scalar indicating if the outcome of the function will replace the current instance of the Specimen

Returns

a size n list with instances of the class Specimen that represent new individuals belonging to the progeny of the respective mating scheme.


Method mirror()

Generates a 'mirrored' specimen.

Usage
.R_Specimen_ctor$mirror()
Returns

an instance of the Specimen class with all loci mirrored.


Method look()

Acess specific locus' value from specimen.

Usage
.R_Specimen_ctor$look(snp, phase = FALSE)
Arguments
snp

an character string with the name of the locus to lookup.

phase

logical should the codes keep the phase.

Returns

the genotype of the given locus.


Method clone()

The objects of this class are cloneable with this method.

Usage
.R_Specimen_ctor$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


isqg documentation built on Oct. 18, 2022, 9:07 a.m.

Related to Specimen in isqg...