Skip to content

Commit 099e118

Browse files
Merge pull request #45 from R-Computing-Lab/readgedcom
Readgedcom
2 parents d8ec569 + eae55b2 commit 099e118

14 files changed

Lines changed: 341 additions & 327 deletions

R/buildPedigree.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ ped2graph <- function(ped,
177177
#' @export
178178
#'
179179
ped2maternal <- function(ped, personID = "ID",
180-
momID = "momID", dadID = "dadID", matID = "matID",...) {
180+
momID = "momID", dadID = "dadID", matID = "matID", ...) {
181181
# Call to wrapper function
182182
.ped2id(ped = ped, personID = personID, momID = momID, dadID = dadID, famID = matID, type = "mothers")
183183
}
@@ -197,7 +197,7 @@ ped2maternal <- function(ped, personID = "ID",
197197
#'
198198
ped2paternal <- function(ped, personID = "ID",
199199
momID = "momID", dadID = "dadID",
200-
patID = "patID",...) {
200+
patID = "patID", ...) {
201201
# Call to wrapper function
202202
.ped2id(ped = ped, personID = personID, momID = momID, dadID = dadID, famID = patID, type = "fathers")
203203
}

R/checkIDs.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,26 @@ checkIDs <- function(ped, verbose = FALSE, repair = FALSE) {
7676
))
7777
}
7878
validation_results$within_row_duplicates <- TRUE
79-
if(validation_results$total_own_father > 0){
80-
validation_results$is_own_father_ids <- unique(is_own_father)
79+
if (validation_results$total_own_father > 0) {
80+
validation_results$is_own_father_ids <- unique(is_own_father)
8181
if (verbose) {
8282
cat(paste0(
8383
validation_results$total_own_father,
8484
" individuals are their own fathers.\n"
8585
))
8686
}
8787
}
88-
if(validation_results$total_own_mother > 0){
89-
validation_results$is_own_mother_ids <- unique(is_own_mother)
88+
if (validation_results$total_own_mother > 0) {
89+
validation_results$is_own_mother_ids <- unique(is_own_mother)
9090
if (verbose) {
9191
cat(paste0(
9292
validation_results$total_own_mother,
9393
" individuals are their own mothers.\n"
9494
))
9595
}
9696
}
97-
if(validation_results$total_duplicated_parents > 0){
98-
validation_results$duplicated_parents_ids <- unique(duplicated_parents)
97+
if (validation_results$total_duplicated_parents > 0) {
98+
validation_results$duplicated_parents_ids <- unique(duplicated_parents)
9999
if (verbose) {
100100
cat(paste0(
101101
validation_results$total_duplicated_parents,

R/computeRelatedness.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ calculateRelatedness <- function(
5959
denom_emp <- denom_m * total_m * weight_m + total_a * weight_a
6060
if (denom_emp == 0) stop("Denominator in empirical adjustment is zero.")
6161

62-
coef <- (coef * total_a * weight_a + maternal * total_m * weight_m)/denom_emp
62+
coef <- (coef * total_a * weight_a + maternal * total_m * weight_m) / denom_emp
6363
}
6464
return(coef)
6565
}

0 commit comments

Comments
 (0)