PedigreeCycleCheck: R6 Class To Find Loops in Pedigrees

Description Private Fields Private Methods Methods Examples

Description

The check for loops runs on repeated depth-first-traversals of all vertices in the directed graph that represents a pedigree.

Private Fields

tbl_pedigree

node-list representation of pedigree as tibble

n_ani_col

column index for animal ids

n_sire_col

column index for sire ids

n_dam_col

column index for dam ids

l_set_wgb

list of white, grey and black set

b_report_cycle

Flag indicating whether vertices in a cycle must be reported

tbl_cycle

Tibble storing pairs of parent and offspring in the cycle

b_debug

Flag for debugging mode

qprp_logger

Logger object from log4r

Private Methods

dfs(p_current_vertex)

Depth-first-search starting at vertex p_current_vertex

move_grey_black(p_current_vertex)

Move vertex p_current_vertex from grey set to black set

move_white_grey(p_current_vertex)

Move vertex p_current_vertex from white set to grey set

get_neighbors(p_current_vertex)

Find vector of neighbor vertices of current vertex p_current_vertex

Methods

Public methods


Method new()

Initialise fields in object at creation.

Usage
PedigreeCycleCheck$new()

Method read_pedigree()

read pedigree from file given by ps_pedigree_path

Usage
PedigreeCycleCheck$read_pedigree(
  ps_pedigree_path,
  ps_delim = "|",
  pn_ani_col = 1,
  pn_sire_col = 2,
  pn_dam_col = 3,
  ...
)
Arguments
ps_pedigree_path

path to pedigree input file

ps_delim

delimiting character between columns

pn_ani_col

animal id column

pn_sire_col

sire id column

pn_dam_col

dam id column

...

additional arguments passed to readr::read_delim

Returns

tbl_pedigree pedigree as tibble


Method has_cycle()

Run a depth-first traversal with all vertices (animals in the pedigree) until a cycle has been found.

Usage
PedigreeCycleCheck$has_cycle()

Method set_tbl_pedigree()

Setter method for the field tbl_pedigree

Usage
PedigreeCycleCheck$set_tbl_pedigree(ptbl_pedigree)
Arguments
ptbl_pedigree

current tibble with pedigree


Method set_n_ani_col()

Setter method for n_ani_col

Usage
PedigreeCycleCheck$set_n_ani_col(pn_ani_col)
Arguments
pn_ani_col

current value for index of animal column


Method set_n_sire_col()

Setter method for n_sire_col

Usage
PedigreeCycleCheck$set_n_sire_col(pn_sire_col)
Arguments
pn_sire_col

current value for index of sire column


Method set_n_dam_col()

Setter method for n_dam_col

Usage
PedigreeCycleCheck$set_n_dam_col(pn_dam_col)
Arguments
pn_dam_col

current value for index of dam column


Method set_b_report_cycle()

Setter method for b_report_cycle

Usage
PedigreeCycleCheck$set_b_report_cycle(pb_report_cycle)
Arguments
pb_report_cycle

current value for b_report_cycle


Method set_b_debug()

Setter method for b_debug

Usage
PedigreeCycleCheck$set_b_debug(pb_debug)
Arguments
pb_debug

current value of b_debug to be set


Method get_tbl_cycle()

Getter method for tbl_cycle

Usage
PedigreeCycleCheck$get_tbl_cycle()
Returns

tbl_cycle tibble with parent offspring pairs in cycle


Method clone()

The objects of this class are cloneable with this method.

Usage
PedigreeCycleCheck$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

1
2
3
4
5
6
## Not run: 
pcc <- PedigreeCycleCheck$new()
pcc$read_pedigree(ps_pedigree_path = system.file('extdata','data_sample2.csv', package = 'qprppedigree'))
pcc$has_cycle()

## End(Not run)

pvrqualitasag/qprppedigree documentation built on March 18, 2021, 7:34 a.m.