Skip to content

Commit c1c1574

Browse files
Squashed commit of the following:
copy edit sex coding section
1 parent 099e118 commit c1c1574

2 files changed

Lines changed: 117 additions & 105 deletions

File tree

vignettes/validation.Rmd

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,30 +143,45 @@ In this example, we have created a within-row duplicate by setting the momID of
143143

144144
## Verifying Sex Coding
145145

146-
Another common issue in pedigree data is incorrect coding of biological sex. In genetic studies, ensuring accurate recording of biological sex in pedigree data is crucial for analyses that rely on this information. The `checkSex` function in `BGmisc` helps identify and repair errors related to biological sex coding, such as inconsistencies where an individual's sex is incorrectly recorded. An example of this would be a parent who is biologically male, but listed as a mother. The `checkSex` function can help identify and correct such errors.
146+
Inconsistent coding of biological sex is a common issue in pedigree data. The `checkSex` function in `BGmisc` is designed to identify and address these errors, particularly inconsistencies where an individual's sex is incorrectly recorded. For instance, it can detect cases where a parent listed as biologically male is erroneously recorded as a mother.
147147

148-
It is essential to distinguish between biological sex (genotype) and gender identity (phenotype). Biological sex is based on chromosomes and other biological characteristics, while gender identity is a broader, richer, personal, deeply-held sense of being male, female, a blend of both, neither, or another gender entirely. While `checkSex` focuses on biological sex necessary for genetic analysis, we respect and recognize the full spectrum of gender identities beyond the binary. The developers of this package affirm their support for folx in the LGBTQ+ community.
148+
In genetic studies, we distinguish between biological sex (genotype) and gender identity (phenotype):
149149

150+
- Biological sex (genotype) refers to an individual's chromosomal configuration, typically XX for female and XY for male in humans, though variations exist.
151+
- Gender identity (phenotype) encompasses a broader, richer, personal, deeply-held sense of being male, female, a blend of both, neither, or another gender entirely.
150152

151-
The `checkSex` function in `BGmisc` performs two main tasks: identifying possible errors and inconsistencies for variables related to biological sex. The function is capable of validating the sex coding in a pedigree and optionally repairing the sex coding based on specified logic. Here’s how you can use the `checkSex` function to validate and optionally repair sex coding in a pedigree dataset:
153+
The `checkSex` function focuses on validating biological sex because it corresponds with the inheritance patterns of sex chromosomes and mitochondrial DNA. While the `checkSex` function centers on the genetic aspect of biological sex, we respect and celebrate the full spectrum of gender identities beyond the binary. The developers of this package affirm their support for folx in the LGBTQ+ community.
154+
155+
156+
157+
### Using the checkSex Function
158+
159+
The `checkSex` function identifies inconsistencies in sex coding within a pedigree and can optionally repair them based on predefined logic. Below is an example of how to use this function to validate and, if necessary, repair sex coding in a pedigree:
152160

153161
```{r}
154162
# Validate sex coding
155-
results <- checkSex(potter, code_male = 1, code_female = 0, verbose = TRUE, repair = FALSE)
163+
164+
results <- checkSex(potter,
165+
code_male = 1,
166+
code_female = 0,
167+
verbose = TRUE, repair = FALSE)
156168
print(results)
157169
```
158170

159171
In this example, the `checkSex` function checks the unique values in the sex column and identifies any inconsistencies in the sex coding of parents. The function returns a list containing validation results, such as the unique values found in the sex column and any inconsistencies in the sex coding of parents.
160172

161-
If incorrect sex codes are found, you can attempt to repair them automatically using the repair argument:
173+
If the function identifies inconsistent sex codes, you can attempt to repair them automatically:
162174

163175
```{r}
164176
# Repair sex coding
165-
df_fix <- checkSex(potter, code_male = 1, code_female = 0, verbose = TRUE, repair = TRUE)
177+
df_fix <- checkSex(potter,
178+
code_male = 1,
179+
code_female = 0,
180+
verbose = TRUE, repair = TRUE)
166181
print(df_fix)
167182
```
168183

169-
When the repair argument is set to TRUE, the function attempts to repair the sex coding based on specified logic. It recodes the sex variable based on the most frequent sex values found among parents. This ensures that the sex coding is consistent and accurate, which is essential for constructing valid genetic pedigrees.
184+
When the repair argument is set to `TRUE`, the function attempts to repair the sex coding based on repair sex coding based on the most frequent sex values found among parents. This approach helps ensure that the sex coding in your dataset is consistent and accurate.
170185

171186
<!--
172187
## Practical Example: Cleaning a Pedigree

0 commit comments

Comments
 (0)