Skip to content

Commit

Permalink
exporting recodeSex for use in ggBGmisc
Browse files Browse the repository at this point in the history
  • Loading branch information
smasongarrison committed Jun 10, 2024
1 parent aa8e66e commit b5b19bb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export(ped2maternal)
export(ped2mit)
export(ped2paternal)
export(plotPedigree)
export(recodeSex)
export(related_coef)
export(relatedness)
export(repairSex)
Expand Down
14 changes: 7 additions & 7 deletions R/checkSex.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#' 1. Optionally recodes the 'sex' variable based on given codes for males and females.
#' 2. Optionally repairs the sex coding based on specified logic, facilitating the accurate construction of genetic pedigrees.
#'
#' @details This function uses the terms 'male' and 'female' in a biological context, based on chromosomes and other biologically-based characteristics relevant to genetic studies.
#' @details This function uses the terms 'male' and 'female' in a biological context, based on chromosomes and other biologically-based characteristics relevant to genetic studies.
#' This usage is not intended to negate the personal gender identity of any individual.
#'
#' We recognize the importance of using language and methodologies that affirm and respect all gender identities. While this function focuses on chromosomal information necessary for constructing genetic pedigrees, we affirm that gender is a spectrum, encompassing a wide range of identities beyond the binary.
#' The developers of this package express unequivocal support for folx in the transgender and LGBTQ+ communities. We respect the complexity of gender identity and acknowledge the distinction between the biological aspect of sex used for genetic analysis (genotype) and the broader, richer concept of gender identity (phenotype).
#'
#' We recognize the importance of using language and methodologies that affirm and respect all gender identities. While this function focuses on chromosomal information necessary for constructing genetic pedigrees, we affirm that gender is a spectrum, encompassing a wide range of identities beyond the binary.
#' The developers of this package express unequivocal support for folx in the transgender and LGBTQ+ communities. We respect the complexity of gender identity and acknowledge the distinction between the biological aspect of sex used for genetic analysis (genotype) and the broader, richer concept of gender identity (phenotype).
#'
#'
#' @param ped A dataframe representing the pedigree data with a 'sex' column.
Expand Down Expand Up @@ -38,7 +38,7 @@ checkSex <- function(ped, code_male = NULL, code_female = NULL, verbose = FALSE,
if (verbose) {
cat("Step 1: Checking how many sexes/genders...\n")
}

# Check unique values in 'sex'
validation_results$sex_unique <- unique(ped$sex)
validation_results$sex_length <- length(unique(ped$sex))
Expand Down Expand Up @@ -135,14 +135,14 @@ repairSex <- function(ped, verbose = FALSE, code_male = NULL) {
#' Recodes Sex Variable in a Pedigree Dataframe
#'
#' This function serves as a wrapper around `checkSex` to specifically handle
#' the repair of the sex coding in a pedigree dataframe.
#' the repair of the sex coding in a pedigree dataframe.
#' It sets the `repair` flag to TRUE automatically and forwards any additional parameters to `checkSex`.
#'
#' @inheritParams checkSex
#' @inheritParams plotPedigree
#' @inherit checkSex details
#' @return A modified version of the input data.frame \code{ped}, containing an additional or modified 'sex_recode' column where the 'sex' values are recoded according to \code{code_male}. NA values in the 'sex' column are preserved.
#' @keywords internal
#' @export
#' @seealso \code{\link{plotPedigree}}
recodeSex <- function(
ped, verbose = FALSE, code_male = NULL, code_na = NULL, code_female = NULL,
Expand Down
4 changes: 2 additions & 2 deletions man/checkSex.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/recodeSex.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/repairSex.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b5b19bb

Please sign in to comment.