Skip to content

Commit

Permalink
spell checking etc
Browse files Browse the repository at this point in the history
  • Loading branch information
smasongarrison committed Feb 25, 2024
1 parent 378ad9d commit 00b4775
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 43 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
^LICENSE\.md$
^R/\.Rhistory$
^R/paper$
CITATION.cff$
^doc$
^data-raw$
^Meta$
Expand Down
57 changes: 35 additions & 22 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
Package: BGmisc
Title: An R Package for Extended Behavior Genetics Analysis
Version: 1.2.0
URL: https://github.com/R-Computing-Lab/BGmisc/, https://r-computing-lab.github.io/BGmisc/
BugReports: https://github.com/R-Computing-Lab/BGmisc/issues
Authors@R:
c(person("S. Mason", "Garrison", email = "[email protected]", role = c("aut", "cre"), comment=c(ORCID = "0000-0002-4804-6003")),
person(c("Michael", "D."), "Hunter", role = "aut", comment=c(ORCID = "0000-0002-3651-6709")),
person("Xuanyu", "Lyu", role = "aut", comment=c(ORCID = "0000-0002-2841-5529")),
person(c("Rachel", "N."), "Good", role = "aut", comment=c(ORCID = "0000-0000-0000-0000")),
person(c("Jonathan", "D."), "Trattner", role = "aut", comment=c(ORCID = "0000-0002-1097-7603")),
person(c("S.", "Alexandra"), "Burt", role = "aut", comment=c(ORCID = "0000-0001-5538-7431"))
Authors@R: c(
person("S. Mason", "Garrison", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4804-6003")),
person(c("Michael", "D."), "Hunter", role = "aut",
comment = c(ORCID = "0000-0002-3651-6709")),
person("Xuanyu", "Lyu", role = "aut",
comment = c(ORCID = "0000-0002-2841-5529")),
person(c("Rachel", "N."), "Good", role = "aut",
comment = c(ORCID = "0000-0000-0000-0000")),
person(c("Jonathan", "D."), "Trattner", role = "aut",
comment = c(ORCID = "0000-0002-1097-7603")),
person(c("S.", "Alexandra"), "Burt", role = "aut",
comment = c(ORCID = "0000-0001-5538-7431"))
)
Description: The BGmisc R package offers a comprehensive suite of functions tailored for extended behavior genetics analysis, including model identification, calculating relatedness, pedigree conversion, pedigree simulation, and more.
Description: The BGmisc R package offers a comprehensive suite of
functions tailored for extended behavior genetics analysis, including
model identification, calculating relatedness, pedigree conversion,
pedigree simulation, and more.
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
URL: https://github.com/R-Computing-Lab/BGmisc/,
https://r-computing-lab.github.io/BGmisc/
BugReports: https://github.com/R-Computing-Lab/BGmisc/issues
Depends:
R (>= 3.5.0)
Imports:
Matrix,
stats,
igraph,
kinship2,
igraph
Matrix,
stats
Suggests:
knitr,
rmarkdown,
dplyr,
EasyMx,
knitr,
OpenMx,
dplyr,
rmarkdown,
rticles,
testthat (>= 3.0.0)
VignetteBuilder: knitr
VignetteBuilder:
knitr
Config/testthat/edition: 3
Depends:
R (>= 3.5.0)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
Language: en-US
2 changes: 1 addition & 1 deletion R/checkIDs.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' 1. Checks for the uniqueness of individual IDs.
#' 2. Optionally repairs non-unique IDs based on a specified logic.
#'
#' @param ped A dataframe representing the pedigree data with columns 'ID', 'dadID', and 'momID'.
#' @param ped A dataframe representing the pedigree data with columns `ID`, `dadID`, and `momID`.
#' @param verbose A logical flag indicating whether to print progress and validation messages to the console.
#' @param repair A logical flag indicating whether to attempt repairs on non-unique IDs.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/dataDoc.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ NULL
##' \item DA2. Binary variable signifying the fundamental unknowability of existence
##' \item birthYr. Birth year for person
##' \item onsetYr. Year of onset for person
##' \item deathYr. Death year for person
##' \item \code{deathYr}. Death year for person
##' \item available. logical. Whether
##' \item Gen. Generation of the person
##' \item proband. logical. Whether the person is a proband or not
Expand Down
10 changes: 5 additions & 5 deletions R/tweakPedigree.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param ID_twin2 A vector of \code{ID} of the second twin.
#' @param verbose logical. If TRUE, print progress through stages of algorithm
#' @param gen_twin A vector of \code{generation} of the twin to be imputed.
#' @return Returns a \code{data.frame} with MZ twins infomration added as a new column.
#' @return Returns a \code{data.frame} with MZ twins information added as a new column.
#' @export

# A function to impute twins in the simulated pedigree \code{data.frame}.
Expand Down Expand Up @@ -226,15 +226,15 @@ makeInbreeding <- function(ped,

#' dropLink
#' A function to drop a person from his/her parents in the simulated pedigree \code{data.frame}.
#' The person can be dropped by specifying his/her ID or by specifying the generation which the randomly to be dropeed person is in.
#' The function can separate one pedigree into two pedigrees. Seperating into small pieces should be done by running the function multiple times.
#' The person can be dropped by specifying his/her ID or by specifying the generation which the randomly to-be-dropped person is in.
#' The function can separate one pedigree into two pedigrees. Separating into small pieces should be done by running the function multiple times.
#' This is a supplementary function for \code{simulatePedigree}.
#' @param ped a pedigree simulated from simulatePedigree function or the same format
#' @param ID_drop the ID of the person to be dropped from his/her parents.
#' @param gen_drop the generation in which the randomly dropped person is. Will work if ID_drop is not specified.
#' @param gen_drop the generation in which the randomly dropped person is. Will work if `ID_drop` is not specified.
#' @param sex_drop the biological sex of the randomly dropped person.
#' @param n_drop the number of times the mutation happens.
#' @return a pedigree with the dropped person's dadID and momID set to NA.
#' @return a pedigree with the dropped person's `dadID` and `momID` set to NA.
#' @export
dropLink <- function(ped,
ID_drop = NA_integer_,
Expand Down
12 changes: 12 additions & 0 deletions dev/config_attachment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
path.n: NAMESPACE
path.d: DESCRIPTION
dir.r: R
dir.v: vignettes
dir.t: tests
extra.suggests: ~
pkg_ignore: ~
document: yes
normalize: yes
inside_rmd: no
must.exist: yes
check_if_suggests_is_installed: yes
2 changes: 1 addition & 1 deletion man/hazard.Rd

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

2 changes: 1 addition & 1 deletion man/makeTwins.Rd

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

2 changes: 1 addition & 1 deletion vignettes/modelingrelatedness.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ run1 <- emxTwinModel(
summary(run1)
```

As you can see the model was unsucessful because it was not identified. But when we add another group, so that the model is identified, the model now fits.
As you can see the model was unsuccessful because it was not identified. But when we add another group, so that the model is identified, the model now fits.

```{r}
run2 <- emxTwinModel(
Expand Down
12 changes: 6 additions & 6 deletions vignettes/modelingrelatedness.html
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,10 @@ <h2>Using <code>identifyComponentModel</code> Function</h2>
<span id="cb6-38"><a href="#cb6-38" tabindex="-1"></a><span class="co">#&gt; AIC: -5917.148 -3685.148 -3685.078</span></span>
<span id="cb6-39"><a href="#cb6-39" tabindex="-1"></a><span class="co">#&gt; BIC: -10747.543 -3667.773 -3680.471</span></span>
<span id="cb6-40"><a href="#cb6-40" tabindex="-1"></a><span class="co">#&gt; To get additional fit indices, see help(mxRefModels)</span></span>
<span id="cb6-41"><a href="#cb6-41" tabindex="-1"></a><span class="co">#&gt; timestamp: 2023-09-07 10:37:41 </span></span>
<span id="cb6-42"><a href="#cb6-42" tabindex="-1"></a><span class="co">#&gt; Wall clock time: 0.07050681 secs </span></span>
<span id="cb6-41"><a href="#cb6-41" tabindex="-1"></a><span class="co">#&gt; timestamp: 2024-02-25 14:31:03 </span></span>
<span id="cb6-42"><a href="#cb6-42" tabindex="-1"></a><span class="co">#&gt; Wall clock time: 0.06564403 secs </span></span>
<span id="cb6-43"><a href="#cb6-43" tabindex="-1"></a><span class="co">#&gt; optimizer: SLSQP </span></span>
<span id="cb6-44"><a href="#cb6-44" tabindex="-1"></a><span class="co">#&gt; OpenMx version number: 2.21.8 </span></span>
<span id="cb6-44"><a href="#cb6-44" tabindex="-1"></a><span class="co">#&gt; OpenMx version number: 2.21.11 </span></span>
<span id="cb6-45"><a href="#cb6-45" tabindex="-1"></a><span class="co">#&gt; Need help? See help(mxSummary)</span></span></code></pre></div>
<p>As you can see the model was unsucessful because it was not
identified. But when we add another group, so that the model is
Expand Down Expand Up @@ -524,10 +524,10 @@ <h2>Using <code>identifyComponentModel</code> Function</h2>
<span id="cb7-29"><a href="#cb7-29" tabindex="-1"></a><span class="co">#&gt; AIC: -9113.092 -5499.092 -5499.048</span></span>
<span id="cb7-30"><a href="#cb7-30" tabindex="-1"></a><span class="co">#&gt; BIC: -17811.437 -5479.794 -5492.498</span></span>
<span id="cb7-31"><a href="#cb7-31" tabindex="-1"></a><span class="co">#&gt; To get additional fit indices, see help(mxRefModels)</span></span>
<span id="cb7-32"><a href="#cb7-32" tabindex="-1"></a><span class="co">#&gt; timestamp: 2023-09-07 10:37:41 </span></span>
<span id="cb7-33"><a href="#cb7-33" tabindex="-1"></a><span class="co">#&gt; Wall clock time: 0.04858994 secs </span></span>
<span id="cb7-32"><a href="#cb7-32" tabindex="-1"></a><span class="co">#&gt; timestamp: 2024-02-25 14:31:03 </span></span>
<span id="cb7-33"><a href="#cb7-33" tabindex="-1"></a><span class="co">#&gt; Wall clock time: 0.05463982 secs </span></span>
<span id="cb7-34"><a href="#cb7-34" tabindex="-1"></a><span class="co">#&gt; optimizer: SLSQP </span></span>
<span id="cb7-35"><a href="#cb7-35" tabindex="-1"></a><span class="co">#&gt; OpenMx version number: 2.21.8 </span></span>
<span id="cb7-35"><a href="#cb7-35" tabindex="-1"></a><span class="co">#&gt; OpenMx version number: 2.21.11 </span></span>
<span id="cb7-36"><a href="#cb7-36" tabindex="-1"></a><span class="co">#&gt; Need help? See help(mxSummary)</span></span></code></pre></div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions vignettes/network.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ table(extendedFamilyEnvironment)

# Subsetting Pedigrees

Subsetting a pedigree allows researchers to focus on specific family lines or individuals within a larger dataset. This can be particularly useful for data validation as well as simplifying complex pedigrees for visualization. However, subsetting a pedigree can result in the underestimation of relatedness between individuals. This is because the subsetted pedigree may not contain all the individuals that connect two people together. For example if we were to remove Arthur Weasley (person 9) and Molly Prewett (person 10) from the `potter` dataset, we would lose the connections amoungst their children.
Subsetting a pedigree allows researchers to focus on specific family lines or individuals within a larger dataset. This can be particularly useful for data validation as well as simplifying complex pedigrees for visualization. However, subsetting a pedigree can result in the underestimation of relatedness between individuals. This is because the subsetted pedigree may not contain all the individuals that connect two people together. For example if we were to remove Arthur Weasley (person 9) and Molly Prewett (person 10) from the `potter` dataset, we would lose the connections amongst their children.


```{r, echo=FALSE, results='hide', out.width='50%', fig.cap="Potter Subset Pedigree"}
Expand All @@ -173,9 +173,9 @@ plotPedigree(subset_potter, code_male = 1, verbose = TRUE)

In the plot above, we have removed Arthur Weasley (person 9) and Molly Prewett (person 10) from the `potter` dataset. As a result, the connections between their children are lost.

Similarly, if we remove the children of Vernon Dursey (1) and Petunia Evans(3) from the `potter` dataset, we would lose the connections between the two individuals.
Similarly, if we remove the children of Vernon Dursey (1) and Petunia Evans (3) from the `potter` dataset, we would lose the connections between the two individuals.

However, this subset does not plot the relationship between spouses (such as the marriage between ), as there are not children to connect the two individuals together yet.
However, this subset does not plot the relationship between spouses (such as the marriage between Vernon Dursey and Petunia Evans), as there are not children to connect the two individuals together yet.

```{r}
subset_rows <- c(1:5, 31:36)
Expand Down
Loading

0 comments on commit 00b4775

Please sign in to comment.