Compute the usefulness of individuals
Usage
# S4 method for class 'character'
useful_inds(
obj,
dadid,
momid,
avail,
affected,
num_child_tot,
id_inf,
keep_infos = FALSE
)
# S4 method for class 'Pedigree'
useful_inds(
obj,
informative = "AvAf",
keep_infos = FALSE,
reset = FALSE,
max_dist = NULL
)
# S4 method for class 'Ped'
useful_inds(
obj,
informative = "AvAf",
keep_infos = FALSE,
reset = FALSE,
max_dist = NULL
)
Arguments
- obj
A character vector with the id of the individuals or a
data.frame
with all the informations in corresponding columns.- dadid
A vector containing for each subject, the identifiers of the biologicals fathers.
- momid
A vector containing for each subject, the identifiers of the biologicals mothers.
- avail
A logical vector with the availability status of the individuals (i.e.
FALSE
= not available,TRUE
= available,NA
= unknown).- affected
A logical vector with the affection status of the individuals (i.e.
FALSE
= unaffected,TRUE
= affected,NA
= unknown).- num_child_tot
A numeric vector of the number of children of each individuals
- id_inf
An identifiers vector of informative individuals.
- keep_infos
Boolean to indicate if parents with unknown status but available or reverse should be kept
- informative
Informative individuals selection can take 5 values:
'AvAf' (available and affected),
'AvOrAf' (available or affected),
'Av' (available only),
'Af' (affected only),
'All' (all individuals)
A numeric/character vector of individuals id
A boolean
- reset
Boolean to indicate if the
useful
column should be reset- max_dist
The maximum distance to informative individuals
Details
Check for the informativeness of the individuals based on the
informative parameter given, the number of children and the usefulness
of their parents. A useful
slot is added to the Ped object with the
usefulness of the individual.
Examples
data(sampleped)
ped1 <- Pedigree(sampleped[sampleped$famid == "1",])
ped(useful_inds(ped1, informative = "AvAf"))
#> Ped object with 41 individuals and 13 metadata columns:
#> id dadid momid sex famid steril
#> col_class <character> <character> <character> <ordered> <character> <logical>
#> 1_101 1_101 <NA> <NA> male 1 <NA>
#> 1_102 1_102 <NA> <NA> female 1 <NA>
#> 1_103 1_103 1_135 1_136 male 1 <NA>
#> 1_104 1_104 <NA> <NA> female 1 <NA>
#> 1_105 1_105 <NA> <NA> male 1 <NA>
#> ... ... ... ... ... ... ...
#> 1_137 1_137 <NA> <NA> male 1 <NA>
#> 1_138 1_138 1_135 1_136 female 1 <NA>
#> 1_139 1_139 1_137 1_138 male 1 <NA>
#> 1_140 1_140 1_137 1_138 female 1 <NA>
#> 1_141 1_141 1_137 1_138 female 1 <NA>
#> status avail affected useful kin isinf
#> col_class <logical> <logical> <logical> <logical> <numeric> <logical>
#> 1_101 <NA> FALSE FALSE TRUE 3 FALSE
#> 1_102 <NA> FALSE TRUE TRUE 3 FALSE
#> 1_103 <NA> FALSE TRUE TRUE 2 FALSE
#> 1_104 <NA> FALSE FALSE TRUE 2 FALSE
#> 1_105 <NA> FALSE <NA> TRUE 2 FALSE
#> ... ... ... ... ... ... ...
#> 1_137 <NA> FALSE <NA> TRUE Inf FALSE
#> 1_138 <NA> FALSE <NA> TRUE 3 FALSE
#> 1_139 <NA> FALSE TRUE TRUE 4 FALSE
#> 1_140 <NA> TRUE FALSE TRUE 4 FALSE
#> 1_141 <NA> TRUE FALSE TRUE 4 FALSE
#> num_child_tot num_child_dir num_child_ind | family indId
#> col_class <numeric> <numeric> <numeric> <character> <character>
#> 1_101 1 1 0 1 101
#> 1_102 1 1 0 1 102
#> 1_103 4 4 0 1 103
#> 1_104 4 4 0 1 104
#> 1_105 4 4 0 1 105
#> ... ... ... ... ... ...
#> 1_137 3 3 0 1 137
#> 1_138 3 3 0 1 138
#> 1_139 0 0 0 1 139
#> 1_140 0 0 0 1 140
#> 1_141 0 0 0 1 141
#> fatherId motherId gender affection available
#> col_class <character> <character> <character> <character> <character>
#> 1_101 <NA> <NA> 1 0 0
#> 1_102 <NA> <NA> 2 1 0
#> 1_103 135 136 1 1 0
#> 1_104 <NA> <NA> 2 0 0
#> 1_105 <NA> <NA> 1 <NA> 0
#> ... ... ... ... ... ...
#> 1_137 <NA> <NA> 1 <NA> 0
#> 1_138 135 136 2 <NA> 0
#> 1_139 137 138 1 1 0
#> 1_140 137 138 2 0 1
#> 1_141 137 138 2 0 1
#> num error sterilisation vitalStatus affection_mods
#> col_class <character> <character> <character> <character> <character>
#> 1_101 2 <NA> <NA> <NA> 0
#> 1_102 3 <NA> <NA> <NA> 1
#> 1_103 2 <NA> <NA> <NA> 1
#> 1_104 4 <NA> <NA> <NA> 0
#> 1_105 6 <NA> <NA> <NA> NA
#> ... ... ... ... ... ...
#> 1_137 3 <NA> <NA> <NA> NA
#> 1_138 2 <NA> <NA> <NA> NA
#> 1_139 3 <NA> <NA> <NA> 1
#> 1_140 1 <NA> <NA> <NA> 0
#> 1_141 0 <NA> <NA> <NA> 0
#> avail_mods
#> col_class <character>
#> 1_101 0
#> 1_102 0
#> 1_103 0
#> 1_104 0
#> 1_105 0
#> ... ...
#> 1_137 0
#> 1_138 0
#> 1_139 0
#> 1_140 1
#> 1_141 1