Skip to contents

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)

Returns

A new `specie` object.

Examples

mySpec <- specie$new(nChr = 3,
                     lchr = c(100, 150, 200),
                     lchrCm = 100,
                     specName = "Geneticae Exempulus")
print(mySpec)


Method print()

Display information about the object

Usage

specie$print()


Method getChrLength()

Get the chromosomes length

Usage

specie$getChrLength(chr = NA)

Arguments

chr

[str or numeric] chromosome ids

Examples

mySpec$getChrLength()
mySpec$getChrLength(2)
mySpec$getChrLength("Chr3")


Method getChrLengthCm()

Get the chromosomes length in centimorgans

Usage

specie$getChrLengthCm(chr = NA)

Arguments

chr

[str or numeric] chromosome ids

Examples

mySpec$getChrLengthCm()
mySpec$getChrLengthCm(2)
mySpec$getChrLengthCm("Chr3")


Method clone()

The objects of this class are cloneable with this method.

Usage

specie$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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