Skip to content

Commit 28b376d

Browse files
documentation
1 parent 1e9dbdd commit 28b376d

8 files changed

Lines changed: 49 additions & 38 deletions

R/buildmxPedigrees.R

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ buildPedigreeModelCovariance <- function(
177177
#' \code{full_df_row} and the rows/columns of the relatedness matrices. Must be in the
178178
#' same order as the relatedness matrix rows.
179179
#' @param condenseMatrixSlots Logical. If TRUE, use the mxCondenseMatrixSlots wrapper to optimize memory usage for large matrices. Default is TRUE.
180+
#' @param clean_ids Logical. If TRUE, clean the \code{obs_ids} using \code{\link{make_clean_personids}}. Default is FALSE.
181+
#' @param symmetrize Logical. If TRUE, symmetrize the relatedness matrices before use. Default is FALSE.
180182
#' @return An OpenMx model for the specified family group.
181183
#' @export
182184

@@ -203,7 +205,7 @@ buildOneFamilyGroup <- function(
203205
# Determine family size from first available matrix. Shared by both branches below.
204206
if ( # not any of the matrices are provided
205207
is.null(Addmat) && is.null(Dmgmat) && is.null(Nucmat) &&
206-
is.null(Extmat) && is.null(Mtdmat) && is.null(Amimat)
208+
is.null(Extmat) && is.null(Mtdmat) && is.null(Amimat)
207209
) {
208210
warning("At least one relatedness matrix should be provided. Using the number of columns in 'full_df_row' as family size.")
209211
fsize <- ncol(full_df_row)
@@ -293,7 +295,7 @@ buildOneFamilyGroup <- function(
293295
OpenMx::mxData(observed = full_df_row, type = "raw", sort = FALSE),
294296
.pedigreeMeanMatrix(fsize, obs_ids, "meanLI"),
295297
OpenMx::mxAlgebraFromString(algebra_str,
296-
name = "V", dimnames = list(obs_ids, obs_ids)
298+
name = "V", dimnames = list(obs_ids, obs_ids)
297299
),
298300
OpenMx::mxExpectationNormal(covariance = "V", means = "M"),
299301
OpenMx::mxFitFunctionML()
@@ -322,17 +324,17 @@ buildOneFamilyGroup <- function(
322324
#' @return An OpenMx model containing all static family observations.
323325
#' @keywords internal
324326
.buildGroupedStaticFamily <- function(
325-
group_name,
326-
dat,
327-
obs_ids,
328-
Addmat = NULL,
329-
Nucmat = NULL,
330-
Extmat = NULL,
331-
Mtdmat = NULL,
332-
Amimat = NULL,
333-
Dmgmat = NULL,
334-
condenseMatrixSlots = TRUE,
335-
clean_ids = FALSE
327+
group_name,
328+
dat,
329+
obs_ids,
330+
Addmat = NULL,
331+
Nucmat = NULL,
332+
Extmat = NULL,
333+
Mtdmat = NULL,
334+
Amimat = NULL,
335+
Dmgmat = NULL,
336+
condenseMatrixSlots = TRUE,
337+
clean_ids = FALSE
336338
) {
337339
.require_openmx(".buildGroupedStaticFamily")
338340

@@ -563,17 +565,17 @@ buildFamilyGroups <- function(
563565
#' @export
564566

565567
buildFamilyGroups_list <- function(
566-
dat_list,
567-
obs_ids_list,
568-
Addmat_list = NULL,
569-
Nucmat_list = NULL,
570-
Extmat_list = NULL,
571-
Mtdmat_list = NULL,
572-
Amimat_list = NULL,
573-
Dmgmat_list = NULL,
574-
prefix = "fam",
575-
condenseMatrixSlots = TRUE,
576-
clean_ids = TRUE
568+
dat_list,
569+
obs_ids_list,
570+
Addmat_list = NULL,
571+
Nucmat_list = NULL,
572+
Extmat_list = NULL,
573+
Mtdmat_list = NULL,
574+
Amimat_list = NULL,
575+
Dmgmat_list = NULL,
576+
prefix = "fam",
577+
condenseMatrixSlots = TRUE,
578+
clean_ids = TRUE
577579
) {
578580
.require_openmx("buildFamilyGroups_list")
579581

@@ -675,7 +677,7 @@ buildPedigreeMx <- function(model_name, vars, group_models,
675677
Ver = isTRUE(flags$Ver)
676678
)
677679

678-
ci_obj <- if (ci & any(flags$Vad, flags$Vdd, flags$Vcn, flags$Vce, flags$Vmt, flags$Vam, flags$Ver)) {
680+
ci_obj <- if (ci && any(flags$Vad, flags$Vdd, flags$Vcn, flags$Vce, flags$Vmt, flags$Vam, flags$Ver)) {
679681
OpenMx::mxCI(c("vad", "vdd", "vcn", "vce", "vmt", "vam", "ver")[c(flags$Vad, flags$Vdd, flags$Vcn, flags$Vce, flags$Vmt, flags$Vam, flags$Ver)])
680682
} else {
681683
NULL
@@ -850,4 +852,3 @@ make_clean_personids <- function(ids) {
850852
.require_openmx("make_clean_personids")
851853
OpenMx::mxMakeNames(as.character(ids))
852854
}
853-

R/checkParents.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,17 @@ checkParentIDs <- function(ped, verbose = FALSE, repair = FALSE,
111111
# Are any parents in both momID and dadID?
112112
momdad <- intersect(ped$dadID, ped$momID)
113113
momdad <- momdad[!is.na(momdad)]
114-
if (length(momdad) > 0) {
115-
validation_results$parents_in_both <- momdad
116-
if (verbose == TRUE) {
117-
cat(
118-
"Some individuals appear in both momID and dadID roles.\n",
119-
"These individuals are:\n",
120-
sep = ""
121-
)
122-
message(paste(momdad, collapse = ", "))
114+
if (length(momdad) > 0) {
115+
validation_results$parents_in_both <- momdad
116+
if (verbose == TRUE) {
117+
cat(
118+
"Some individuals appear in both momID and dadID roles.\n",
119+
"These individuals are:\n",
120+
sep = ""
121+
)
122+
message(paste(momdad, collapse = ", "))
123+
}
123124
}
124-
}
125125

126126

127127
if (!repair) {

R/helpGeneric.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ as_numeric_matrix <- function(x) {
129129
#' @return A numeric matrix, symmetrized if needed.
130130
#'
131131
make_symmetric <- function(x, tol = 1e-10) {
132-
if (inherits(x, "sparseMatrix")) {
132+
if (inherits(x, "sparseMatrix")) {
133133
if (!Matrix::isSymmetric(x, tol = tol)) {
134134
x <- (x + Matrix::t(x)) / 2
135135
}

data-raw/benchmark_rowlessParents.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ df_plot <- benchmark_results %>% mutate(
130130
) ~ "big"
131131
),
132132
method = case_when(
133-
expr %in% c("base_small", "base_big") ~ "base",
133+
expr %in% c("base_small", "base_big") ~ "base",
134134
expr %in% c("rows_small", "rows_big") ~ "rows",
135135
expr %in% c("schur_small", "schur_big") ~ "schur"
136136
) # make base the reference level for the linear model, so that the intercept is the mean of the base method

man/buildFamilyGroups.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/buildFamilyGroups_list.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/buildOneFamilyGroup.Rd

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/dot-buildGroupedStaticFamily.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)