Specie object store specific information of one specie.
Public fields
specName
[str] Specie's name
nChr
[numeric] Number of chromosomes
ploidy
[numeric] Number of possible alleles at one locus
lchr
[numeric] length of all chromosomes in base pairs
lchrCm
[numeric] length of all chromosomes in centimorgans
chrNames
[str] Names of the chromosomes
Methods
Method new()
Create a new specie object.
Usage
specie$new(
nChr,
lchr,
lchrCm,
specName = "Undefinded",
chrNames = NA,
verbose = TRUE
)
Arguments
nChr
[numeric] Number of chromosomes
lchr
[numeric] length of all chromosomes in base pairs
lchrCm
[numeric] length of all chromosomes in centimorgans
specName
[str] Specie's name (optional) (optional)
chrNames
[str] Names of the chromosomes (optional). By default the chromosomes names will be set to "Chr01", "Chr02", "Chr03" ...
verbose
[bool] Display info (optional)
Examples
## ------------------------------------------------
## Method `specie$new`
## ------------------------------------------------
mySpec <- specie$new(nChr = 3,
lchr = c(100, 150, 200),
lchrCm = 100,
specName = "Geneticae Exempulus")
#> A new species has emerged: Geneticae Exempulus !
#>
print(mySpec)
#> Name: Geneticae Exempulus
#> Number of Chromosomes: 3
#> Ploidy: 2
#> Chromosome length:
#> chrNames chrLength chrLengthCm
#> Chr1 Chr1 100 100
#> Chr2 Chr2 150 100
#> Chr3 Chr3 200 100
## ------------------------------------------------
## Method `specie$getChrLength`
## ------------------------------------------------
mySpec$getChrLength()
#> Chr1 Chr2 Chr3
#> 100 150 200
mySpec$getChrLength(2)
#> Chr2
#> 150
mySpec$getChrLength("Chr3")
#> Chr3
#> 200
## ------------------------------------------------
## Method `specie$getChrLengthCm`
## ------------------------------------------------
mySpec$getChrLengthCm()
#> Chr1 Chr2 Chr3
#> 100 100 100
mySpec$getChrLengthCm(2)
#> Chr2
#> 100
mySpec$getChrLengthCm("Chr3")
#> Chr3
#> 100