Skip to content

Commit

Permalink
Merge pull request #45 from R-Computing-Lab/readgedcom
Browse files Browse the repository at this point in the history
Readgedcom
  • Loading branch information
smasongarrison authored Aug 20, 2024
2 parents d8ec569 + eae55b2 commit 099e118
Show file tree
Hide file tree
Showing 14 changed files with 341 additions and 327 deletions.
4 changes: 2 additions & 2 deletions R/buildPedigree.R
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ ped2graph <- function(ped,
#' @export
#'
ped2maternal <- function(ped, personID = "ID",
momID = "momID", dadID = "dadID", matID = "matID",...) {
momID = "momID", dadID = "dadID", matID = "matID", ...) {
# Call to wrapper function
.ped2id(ped = ped, personID = personID, momID = momID, dadID = dadID, famID = matID, type = "mothers")
}
Expand All @@ -197,7 +197,7 @@ ped2maternal <- function(ped, personID = "ID",
#'
ped2paternal <- function(ped, personID = "ID",
momID = "momID", dadID = "dadID",
patID = "patID",...) {
patID = "patID", ...) {
# Call to wrapper function
.ped2id(ped = ped, personID = personID, momID = momID, dadID = dadID, famID = patID, type = "fathers")
}
12 changes: 6 additions & 6 deletions R/checkIDs.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,26 @@ checkIDs <- function(ped, verbose = FALSE, repair = FALSE) {
))
}
validation_results$within_row_duplicates <- TRUE
if(validation_results$total_own_father > 0){
validation_results$is_own_father_ids <- unique(is_own_father)
if (validation_results$total_own_father > 0) {
validation_results$is_own_father_ids <- unique(is_own_father)
if (verbose) {
cat(paste0(
validation_results$total_own_father,
" individuals are their own fathers.\n"
))
}
}
if(validation_results$total_own_mother > 0){
validation_results$is_own_mother_ids <- unique(is_own_mother)
if (validation_results$total_own_mother > 0) {
validation_results$is_own_mother_ids <- unique(is_own_mother)
if (verbose) {
cat(paste0(
validation_results$total_own_mother,
" individuals are their own mothers.\n"
))
}
}
if(validation_results$total_duplicated_parents > 0){
validation_results$duplicated_parents_ids <- unique(duplicated_parents)
if (validation_results$total_duplicated_parents > 0) {
validation_results$duplicated_parents_ids <- unique(duplicated_parents)
if (verbose) {
cat(paste0(
validation_results$total_duplicated_parents,
Expand Down
2 changes: 1 addition & 1 deletion R/computeRelatedness.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ calculateRelatedness <- function(
denom_emp <- denom_m * total_m * weight_m + total_a * weight_a
if (denom_emp == 0) stop("Denominator in empirical adjustment is zero.")

coef <- (coef * total_a * weight_a + maternal * total_m * weight_m)/denom_emp
coef <- (coef * total_a * weight_a + maternal * total_m * weight_m) / denom_emp
}
return(coef)
}
Expand Down
Loading

0 comments on commit 099e118

Please sign in to comment.