tools

Description

The package provides modules for working with BLUP90 utilities:

  • Software generation of configuration file template (parameter file) for f90 programs

  • Calculation of variants by Reml and AIReml methods.

  • Calculation of blup, gblup and ssgblup.

Modules

class bpf90tools.tools.AIremlf90(*, app: str, work_dir: str | Path, fn_par: str | None = None)[source]

Bases: If90, CheckMixin

A modification of REMLF90 with computing by the Average-Information Algorithm.

For most problems, it converges in far fewer rounds than EM REML as implemented in REMLF90. While typically REMLF90 takes 50-300 rounds to converge, AIREMLF90 converges in 5-15 rounds and to a higher accuracy. For selected problems, AI REML fails to converge when the covariance matrix is close to non-positive definite.

_abc_impl = <_abc._abc_data object>
run() bool[source]

Calculate variance the method aireml.

Returns:

Returns true if the program started and ran without errors else false.

Raise:

Exceptions when files do not exist.

property variance: Variance | None
class bpf90tools.tools.Blupf90(*, app: str, work_dir: str | Path, vara: float | None = None, fn_par: str | None = None)[source]

Bases: If90, CheckMixin

BLUP (Best Linear Unbiased Prediction - the best linear unbiased prediction) method for determining the genetic potential of animals.

__blup() bool

Starting the breeding value calculation.

__handler_ped() DataFrame

Ped file handler.

Parameters:

pth_file – Path to file ped.

Returns:

Return dataframe with data - [nomer, id].

__handler_sol(pth_file: Path) DataFrame

Results file handler with breeding value and estimation accuracy.

Parameters:

pth_file – Path to file solutions.

Returns:

Return dataframe with data - ebv, se or rel.

__processing_result(work_dir: Path) bool

Processing data.

Parameters:

work_dir – Directory where all programs and files are located.

Returns:

Return true if processing data successful else False.

__search_ped() Path | None

Search for a pedigree file.

Parameters:

w_d – Search directory.

Returns:

Returns either the file if found, or non if not found.

_abc_impl = <_abc._abc_data object>
property evaluation: DataFrame | None
run() bool[source]

Starts breeding value calculation.

Returns:

Returns true if the program started and ran without errors else false.

Raise:

Exceptions when files do not exist.

class bpf90tools.tools.Params(file_config: str | Path | None = None, type_model: str = 'single')[source]

Bases: object

Creates a parameter file.

_single_model(param_data: dict) bool[source]

Building a file with settings for a single-feature model.

Parameters:

param_data – Dictionary with settings.

Returns:

Returns true if the settings file was created successfully and false if it failed.

create(obj_param: dict) bool[source]

Method that forms the structure of the config and saves it to a file.

Parameters:

obj_param – An object of the dictionary type that stores the structure of the required parameters and from the value for the config.

Returns:

An object of the dictionary type that stores the structure of the required parameters and from the value for the config.

class bpf90tools.tools.Remlf90(*, app: str, work_dir: str | Path, fn_par: str | None = None)[source]

Bases: If90, CheckMixin

Restricted Maximum Likelihood (REML) approach for estimating covariance matrices in linear stochastic models.

_abc_impl = <_abc._abc_data object>
run() bool[source]

Calculate variance the method reml.

Returns:

Returns true if the program started and ran without errors else false.

Raise:

Exceptions when files do not exist.

property variance: Variance | None
class bpf90tools.tools.Renumf90(*, app: str, work_dir: str | Path, fn_par: str | None = None)[source]

Bases: If90, CheckMixin

Renumbering and quality control be done by RENUMF90, which is also driven by a parameter file.

_abc_impl = <_abc._abc_data object>
run() bool[source]

RENUM is a renumbering program to create input (data, pedigree, and parameter) files for BLUPF90 programs and provide basic statistics.

Returns:

Returns true if the program started and ran without errors else false.

Raise:

Exceptions when files do not exist.