From 8cbd1870d609e0366ee14f064e9662a6f9604581 Mon Sep 17 00:00:00 2001 From: smasongarrison Date: Thu, 13 Jun 2024 17:58:55 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20R-Comput?= =?UTF-8?q?ing-Lab/BGmisc@a06f423cdc5640fa4179a7c3410d175fc7cd7c91=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/modelingrelatedness.html | 8 ++++---- pkgdown.yml | 2 +- reference/recodeSex.html | 16 ++++++++++++++++ search.json | 2 +- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/articles/modelingrelatedness.html b/articles/modelingrelatedness.html index ed82eeb..7e9bce4 100644 --- a/articles/modelingrelatedness.html +++ b/articles/modelingrelatedness.html @@ -242,8 +242,8 @@

Using identifyComponentMode #> AIC: -5917.148 -3685.148 -3685.078 #> BIC: -10747.543 -3667.773 -3680.471 #> To get additional fit indices, see help(mxRefModels) -#> timestamp: 2024-06-10 16:19:42 -#> Wall clock time: 0.2356341 secs +#> timestamp: 2024-06-13 17:58:40 +#> Wall clock time: 0.2066751 secs #> optimizer: SLSQP #> OpenMx version number: 2.21.11 #> Need help? See help(mxSummary) @@ -283,8 +283,8 @@

Using identifyComponentMode #> AIC: -9113.092 -5499.092 -5499.048 #> BIC: -17811.437 -5479.794 -5492.498 #> To get additional fit indices, see help(mxRefModels) -#> timestamp: 2024-06-10 16:19:43 -#> Wall clock time: 0.06019664 secs +#> timestamp: 2024-06-13 17:58:41 +#> Wall clock time: 0.05611944 secs #> optimizer: SLSQP #> OpenMx version number: 2.21.11 #> Need help? See help(mxSummary) diff --git a/pkgdown.yml b/pkgdown.yml index 8c03282..0330748 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -7,7 +7,7 @@ articles: network: network.html pedigree: pedigree.html validation: validation.html -last_built: 2024-06-10T16:19Z +last_built: 2024-06-13T17:58Z urls: reference: https://r-computing-lab.github.io/BGmisc/reference article: https://r-computing-lab.github.io/BGmisc/articles diff --git a/reference/recodeSex.html b/reference/recodeSex.html index 3d906e7..e794671 100644 --- a/reference/recodeSex.html +++ b/reference/recodeSex.html @@ -93,9 +93,25 @@

Arguments + + +
recode_female
+

The value to use for females. Default is "F"

+ + +
recode_na
+

The value to use for missing values. Default is NA_character_

+

Value

diff --git a/search.json b/search.json index 58240de..031dda3 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement garrissm@wfu.edu. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing Guidelines for BGmisc","title":"Contributing Guidelines for BGmisc","text":"Thank considering contributing BGmisc. document outlines process best practices contributing R package hosted GitHub R Computing Lab. ## Table Contents Code Conduct Getting Started Bug Reports Feature Requests Pull Requests Code Style Testing Documentation Communication","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing Guidelines for BGmisc","text":"contributors expected adhere project’s Code Conduct. Please read carefully contributing.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting Started","title":"Contributing Guidelines for BGmisc","text":"Fork BGmisc repository GitHub account. Clone forked repository local machine. Install required packages set development environment.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"bug-reports","dir":"","previous_headings":"","what":"Bug Reports","title":"Contributing Guidelines for BGmisc","text":"reporting bugs, please create issue GitHub repository. Make sure : Provide clear title description. Include minimal reproducible example. Tag issue “bug” label.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"feature-requests","dir":"","previous_headings":"","what":"Feature Requests","title":"Contributing Guidelines for BGmisc","text":"New features welcome. request new feature: Open issue GitHub repository. Clearly describe feature potential benefits. Tag issue “feature request” label.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"pull-requests","dir":"","previous_headings":"","what":"Pull Requests","title":"Contributing Guidelines for BGmisc","text":"Fork repository create new branch work. Commit changes logical chunks. Open pull request clear title description. Make sure existing tests pass. Add new tests changes.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"","what":"Code Style","title":"Contributing Guidelines for BGmisc","text":"Follow Tidyverse Style Guide R programming maintain code consistency.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"testing","dir":"","previous_headings":"","what":"Testing","title":"Contributing Guidelines for BGmisc","text":"Tests implemented using testthat package. Make sure add new tests added functionality. Run tests ensure pass submitting pull request.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"Contributing Guidelines for BGmisc","text":"Update README.Rmd relevant documentation. Use roxygen2 documenting functions. Include examples documentation possible.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"communication","dir":"","previous_headings":"","what":"Communication","title":"Contributing Guidelines for BGmisc","text":"Use GitHub issues communication. direct communication, can contact maintainers. contributing, agree abide guidelines project’s Code Conduct. Thank contributing BGmisc!","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 3, 29 June 2007Copyright © 2007 Free Software Foundation, Inc.  Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"GNU General Public License free, copyleft license software kinds works. licenses software practical works designed take away freedom share change works. contrast, GNU General Public License intended guarantee freedom share change versions program–make sure remains free software users. , Free Software Foundation, use GNU General Public License software; applies also work released way authors. can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. protect rights, need prevent others denying rights asking surrender rights. Therefore, certain responsibilities distribute copies software, modify : responsibilities respect freedom others. example, distribute copies program, whether gratis fee, must pass recipients freedoms received. must make sure , , receive can get source code. must show terms know rights. Developers use GNU GPL protect rights two steps: (1) assert copyright software, (2) offer License giving legal permission copy, distribute /modify . developers’ authors’ protection, GPL clearly explains warranty free software. users’ authors’ sake, GPL requires modified versions marked changed, problems attributed erroneously authors previous versions. devices designed deny users access install run modified versions software inside , although manufacturer can . fundamentally incompatible aim protecting users’ freedom change software. systematic pattern abuse occurs area products individuals use, precisely unacceptable. Therefore, designed version GPL prohibit practice products. problems arise substantially domains, stand ready extend provision domains future versions GPL, needed protect freedom users. Finally, every program threatened constantly software patents. States allow patents restrict development use software general-purpose computers, , wish avoid special danger patents applied free program make effectively proprietary. prevent , GPL assures patents used render program non-free. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions","title":"GNU General Public License","text":"“License” refers version 3 GNU General Public License. “Copyright” also means copyright-like laws apply kinds works, semiconductor masks. “Program” refers copyrightable work licensed License. licensee addressed “”. “Licensees” “recipients” may individuals organizations. “modify” work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called “modified version” earlier work work “based ” earlier work. “covered work” means either unmodified Program work based Program. “propagate” work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. “convey” work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays “Appropriate Legal Notices” extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code","title":"GNU General Public License","text":"“source code” work means preferred form work making modifications . “Object code” means non-source form work. “Standard Interface” means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. “System Libraries” executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. “Major Component”, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . “Corresponding Source” work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions","title":"GNU General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law","title":"GNU General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies","title":"GNU General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions","title":"GNU General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: ) work must carry prominent notices stating modified , giving relevant date. b) work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 “keep intact notices”. c) must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . d) work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called “aggregate” compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms","title":"GNU General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: ) Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. b) Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. c) Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. d) Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. e) Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. “User Product” either (1) “consumer product”, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, “normally used” refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. “Installation Information” User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms","title":"GNU General Public License","text":"“Additional permissions” terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: ) Disclaiming warranty limiting liability differently terms sections 15 16 License; b) Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; c) Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; d) Limiting use publicity purposes names licensors authors material; e) Declining grant rights trademark law use trade names, trademarks, service marks; f) Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered “restrictions” within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination","title":"GNU General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies","title":"GNU General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients","title":"GNU General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. “entity transaction” transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents","title":"GNU General Public License","text":"“contributor” copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s “contributor version”. contributor’s “essential patent claims” patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, “control” includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, “patent license” express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). “grant” patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. “Knowingly relying” means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license “discriminatory” include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom","title":"GNU General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_13-use-with-the-gnu-affero-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Use with the GNU Affero General Public License","title":"GNU General Public License","text":"Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU Affero General Public License single combined work, convey resulting work. terms License continue apply part covered work, special requirements GNU Affero General Public License, section 13, concerning interaction network apply combination .","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License","title":"GNU General Public License","text":"Free Software Foundation may publish revised /new versions GNU General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU General Public License “later version” applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty","title":"GNU General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability","title":"GNU General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16","title":"GNU General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"how-to-apply-these-terms-to-your-new-programs","dir":"","previous_headings":"","what":"How to Apply These Terms to Your New Programs","title":"GNU General Public License","text":"develop new program, want greatest possible use public, best way achieve make free software everyone can redistribute change terms. , attach following notices program. safest attach start source file effectively state exclusion warranty; file least “copyright” line pointer full notice found. Also add information contact electronic paper mail. program terminal interaction, make output short notice like starts interactive mode: hypothetical commands show w show c show appropriate parts General Public License. course, program’s commands might different; GUI interface, use “box”. also get employer (work programmer) school, , sign “copyright disclaimer” program, necessary. information , apply follow GNU GPL, see . GNU General Public License permit incorporating program proprietary programs. program subroutine library, may consider useful permit linking proprietary applications library. want , use GNU Lesser General Public License instead License. first, please read .","code":" Copyright (C) 2020 Jonathan D. Trattner This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . BGmisc Copyright (C) 2020 Jonathan D. Trattner This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details."},{"path":"https://r-computing-lab.github.io/BGmisc/articles/analyticrelatedness.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Calculating and Inferring Relatedness Coefficients with BGmisc","text":"vignette demonstrates analytic methods determining relatedness pedigree. relatedness coefficient measure genetic overlap two individuals. simplest terms, quantifies genetic overlap two individuals. relatedness coefficient ranges 0 1, 1 indicating perfect genetic match (occurs comparing individual , identical twin, clone), whereas 0 indicates genetic overlap. introduce two functions: calculateRelatedness inferRelatedness, allow users compute infer relatedness coefficient, respectively.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/analyticrelatedness.html","id":"loading-required-libraries","dir":"Articles","previous_headings":"Introduction","what":"Loading Required Libraries","title":"Calculating and Inferring Relatedness Coefficients with BGmisc","text":"","code":"library(BGmisc)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/analyticrelatedness.html","id":"calculating-relatedness-coefficient","dir":"Articles","previous_headings":"Introduction","what":"Calculating Relatedness Coefficient","title":"Calculating and Inferring Relatedness Coefficients with BGmisc","text":"calculateRelatedness function offers method compute relatedness coefficient based shared ancestry, described Wright (1922). function utilizes formula: \\[ r_{bc} = \\sum \\left(\\frac{1}{2}\\right)^{n+n'+1} (1+f_a) \\] \\(n\\) \\(n'\\) represent number generations back common ancestors pair share.","code":"# Example usage: # For full siblings, the relatedness coefficient is expected to be 0.5: calculateRelatedness(generations = 1, full = TRUE) #> [1] 0.5 # For half siblings, the relatedness coefficient is expected to be 0.25: calculateRelatedness(generations = 1, full = FALSE) #> [1] 0.25"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/analyticrelatedness.html","id":"inferring-relatedness-coefficient","dir":"Articles","previous_headings":"","what":"Inferring Relatedness Coefficient","title":"Calculating and Inferring Relatedness Coefficients with BGmisc","text":"inferRelatedness function designed infer relatedness coefficient two groups based observed correlation additive genetic variance shared environmental variance. function leverages ACE framework.","code":"# Example usage: # Infer the relatedness coefficient: inferRelatedness(obsR = 0.5, aceA = 0.9, aceC = 0, sharedC = 0) #> [1] 0.5555556"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/modelingrelatedness.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Modeling and Relatedness","text":"vignette provides detailed guide specific functions within BGmisc package aid identification fitting variance component models common behavior genetics. explore key functions identifyComponentModel, providing practical examples theoretical background. Identification ensures unique set parameters define model-implied covariance matrix, preventing free parameters trading one another.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/modelingrelatedness.html","id":"loading-required-libraries","dir":"Articles","previous_headings":"Introduction","what":"Loading Required Libraries","title":"Modeling and Relatedness","text":"Ensure BGmisc package installed loaded. Ensure following dependencies installed proceeding provide us behavior genetic data models: EasyMx OpenMx Note: libraries installed, can install using install.packages(“package_name”).","code":"library(BGmisc) library(EasyMx) library(OpenMx)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/modelingrelatedness.html","id":"working-with-variance-component-models","dir":"Articles","previous_headings":"","what":"Working with Variance Component Models","title":"Modeling and Relatedness","text":"section, demonstrate core functions related identification fitting variance component models.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/modelingrelatedness.html","id":"using-comp2vech-function","dir":"Articles","previous_headings":"Working with Variance Component Models","what":"Using comp2vech Function","title":"Modeling and Relatedness","text":"comp2vech function used vectorize components model. function often used conjunction identification process. example, apply list matrices: result showcases matrices transformed, reflecting role subsequent variance component analysis.","code":"comp2vech(list( matrix(c(1, .5, .5, 1), 2, 2), matrix(1, 2, 2) )) #> [1] 1.0 0.5 1.0 1.0 1.0 1.0"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/modelingrelatedness.html","id":"using-identifycomponentmodel-function","dir":"Articles","previous_headings":"Working with Variance Component Models","what":"Using identifyComponentModel Function","title":"Modeling and Relatedness","text":"identifyComponentModel function helps determine variance components model identified. accepts relatedness component matrices returns information identified non-identified parameters. ’s example using classical twin model MZ twins: can see, model identified. need add additional group sufficient information. Let us add rest classical twin model, case DZ twins. can see model identified, now ’ve added another group. Let us confirm fitting model. First prepare data. Let us fit data MZ twins . can see model unsuccessful identified. add another group, model identified, model now fits.","code":"identifyComponentModel( A = list(matrix(1, 2, 2)), C = list(matrix(1, 2, 2)), E = diag(1, 2) ) #> Component model is not identified. #> Non-identified parameters are A, C #> $identified #> [1] FALSE #> #> $nidp #> [1] \"A\" \"C\" identifyComponentModel( A = list(matrix(c(1, .5, .5, 1), 2, 2), matrix(1, 2, 2)), C = list(matrix(1, 2, 2), matrix(1, 2, 2)), E = diag(1, 4) ) #> Component model is identified. #> $identified #> [1] TRUE #> #> $nidp #> character(0) require(dplyr) #> Loading required package: dplyr #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union # require(purrr) data(twinData, package = \"OpenMx\") selVars <- c(\"ht1\", \"ht2\") mzdzData <- subset( twinData, zyg %in% c(1, 3), c(selVars, \"zyg\") ) mzdzData$RCoef <- c(1, NA, .5)[mzdzData$zyg] mzData <- mzdzData %>% filter(zyg == 1) run1 <- emxTwinModel( model = \"Cholesky\", relatedness = \"RCoef\", data = mzData, use = selVars, run = TRUE, name = \"TwCh\" ) #> Running TwCh with 4 parameters #> Warning: In model 'TwCh' Optimizer returned a non-zero status code 5. The #> Hessian at the solution does not appear to be convex. See #> ?mxCheckIdentification for possible diagnosis (Mx status RED). summary(run1) #> Summary of TwCh #> #> The Hessian at the solution does not appear to be convex. See ?mxCheckIdentification for possible diagnosis (Mx status RED). #> #> free parameters: #> name matrix row col Estimate Std.Error A lbound ubound #> 1 sqrtA11 sqrtA 1 1 0.05090090 NA 1e-06 #> 2 sqrtC11 sqrtC 1 1 0.03565565 NA ! 0! #> 3 sqrtE11 sqrtE 1 1 0.02325722 0.0007017955 ! 0! #> 4 Mht1 Means ht1 1 1.62974907 0.0027023908 #> #> Model Statistics: #> | Parameters | Degrees of Freedom | Fit (-2lnL units) #> Model: 4 1112 -3693.148 #> Saturated: 5 1111 NA #> Independence: 4 1112 NA #> Number of observations/statistics: 569/1116 #> #> #> ** Information matrix is not positive definite (not at a candidate optimum). #> Be suspicious of these results. At minimum, do not trust the standard errors. #> #> Information Criteria: #> | df Penalty | Parameters Penalty | Sample-Size Adjusted #> AIC: -5917.148 -3685.148 -3685.078 #> BIC: -10747.543 -3667.773 -3680.471 #> To get additional fit indices, see help(mxRefModels) #> timestamp: 2024-06-10 16:19:42 #> Wall clock time: 0.2356341 secs #> optimizer: SLSQP #> OpenMx version number: 2.21.11 #> Need help? See help(mxSummary) run2 <- emxTwinModel( model = \"Cholesky\", relatedness = \"RCoef\", data = mzdzData, use = selVars, run = TRUE, name = \"TwCh\" ) #> Running TwCh with 4 parameters summary(run2) #> Summary of TwCh #> #> free parameters: #> name matrix row col Estimate Std.Error A lbound ubound #> 1 sqrtA11 sqrtA 1 1 0.06339271 0.0014377690 1e-06 #> 2 sqrtC11 sqrtC 1 1 0.00000100 0.0250258713 ! 0! #> 3 sqrtE11 sqrtE 1 1 0.02330040 0.0007015267 0! #> 4 Mht1 Means ht1 1 1.63295540 0.0020511844 #> #> Model Statistics: #> | Parameters | Degrees of Freedom | Fit (-2lnL units) #> Model: 4 1803 -5507.092 #> Saturated: 5 1802 NA #> Independence: 4 1803 NA #> Number of observations/statistics: 920/1807 #> #> Information Criteria: #> | df Penalty | Parameters Penalty | Sample-Size Adjusted #> AIC: -9113.092 -5499.092 -5499.048 #> BIC: -17811.437 -5479.794 -5492.498 #> To get additional fit indices, see help(mxRefModels) #> timestamp: 2024-06-10 16:19:43 #> Wall clock time: 0.06019664 secs #> optimizer: SLSQP #> OpenMx version number: 2.21.11 #> Need help? See help(mxSummary)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Network tools for finding extended pedigrees and path tracing","text":"vignette showcases two key features capitalize network structure inherent pedigrees: Finding extended families connecting relationships members. feature strictly uses person’s ID, mother’s ID, father’s ID find people dataset remotely related path, effectively finding separable extended families dataset. Using path tracing rules quantify amount relatedness pairs individuals dataset. amount relatedness can characterized additive nuclear DNA, shared mitochondrial DNA, sharing parents, part extended pedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"loading-required-libraries-and-data","dir":"Articles","previous_headings":"Introduction","what":"Loading Required Libraries and Data","title":"Network tools for finding extended pedigrees and path tracing","text":"","code":"library(BGmisc) data(potter)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"finding-extended-families","dir":"Articles","previous_headings":"","what":"Finding Extended Families","title":"Network tools for finding extended pedigrees and path tracing","text":"Many pedigree datasets contain information person, mother, father, often without nuclear extended family IDs. Recognizing sets people unrelated simplifies many pedigree-related tasks. function facilitates tasks finding extended families. People within extended family least form relation, however distant, different extended families relations. Potter Family Pedigree use potter pedigree data example. convenience, ’ve renamed family ID variable oldfam avoid confusion new family ID variable create. potter data already family ID variable, compare newly created variable pre-existing one. match!","code":"df_potter <- potter names(df_potter)[names(df_potter) == \"famID\"] <- \"oldfam\" ds <- ped2fam(df_potter, famID = \"famID\", personID = \"personID\") table(ds$famID, ds$oldfam) #> #> 1 #> 1 36"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"computing-relatedness","dir":"Articles","previous_headings":"","what":"Computing Relatedness","title":"Network tools for finding extended pedigrees and path tracing","text":"know sets people related one another, ’ll likely want know much. additive genetic relatedness, can use ped2add() function. computes additive genetic relatedness everyone data. returns square, symmetric matrix many rows columns IDs. entry ith row jth column gives relatedness person person j. example, person 1 (Vernon Dursley) shares 0.5 nuclear DNA person 6 (Dudley Dursley), shares 0.5 nuclear DNA person 2 (Marjorie Dursley). ’s probably fine whole dataset data fewer 10,000 people. data get large, however, ’s much efficient compute relatedness separately extended family.","code":"add <- ped2add(potter) add[1:7, 1:7] #> 1 2 3 4 5 6 7 #> 1 1.0 0.50 0.00 0.00 0.0 0.500 0.000 #> 2 0.5 1.00 0.00 0.00 0.0 0.250 0.000 #> 3 0.0 0.00 1.00 0.50 0.0 0.500 0.250 #> 4 0.0 0.00 0.50 1.00 0.0 0.250 0.500 #> 5 0.0 0.00 0.00 0.00 1.0 0.000 0.500 #> 6 0.5 0.25 0.50 0.25 0.0 1.000 0.125 #> 7 0.0 0.00 0.25 0.50 0.5 0.125 1.000 table(add) #> add #> 0 0.0625 0.125 0.25 0.5 1 #> 788 6 94 208 164 36 add_list <- lapply( unique(potter$famID), function(d) { tmp <- potter[potter$famID %in% d, ] ped2add(tmp) } )"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"other-relatedness-measures","dir":"Articles","previous_headings":"Computing Relatedness","what":"Other relatedness measures","title":"Network tools for finding extended pedigrees and path tracing","text":"function works similarly mitochondrial (ped2mit), common nuclear environment sharing parents (ped2cn), common extended family environment (ped2ce).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"computing-mitochondrial-relatedness","dir":"Articles","previous_headings":"Computing Relatedness > Other relatedness measures","what":"Computing mitochondrial relatedness","title":"Network tools for finding extended pedigrees and path tracing","text":"calculate mitochondrial relatedness pairs individuals potter dataset. can see, family members share mitochondrial DNA, person 2 person 3 0, whereas person 1 person 3 .","code":"mit <- ped2mit(potter) mit[1:7, 1:7] #> 1 2 3 4 5 6 7 #> 1 1 1 0 0 0 0 0 #> 2 1 1 0 0 0 0 0 #> 3 0 0 1 1 0 1 1 #> 4 0 0 1 1 0 1 1 #> 5 0 0 0 0 1 0 0 #> 6 0 0 1 1 0 1 1 #> 7 0 0 1 1 0 1 1 table(mit) #> mit #> 0 1 #> 1082 214"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"computing-relatedness-through-common-nuclear-environment","dir":"Articles","previous_headings":"Computing Relatedness > Other relatedness measures","what":"Computing relatedness through common nuclear environment","title":"Network tools for finding extended pedigrees and path tracing","text":"calculate relatedness pairs individuals potter dataset sharing parents.","code":"commonNuclear <- ped2cn(potter) commonNuclear[1:7, 1:7] #> 1 2 3 4 5 6 7 #> 1 1 1 0 0 0 0 0 #> 2 1 1 0 0 0 0 0 #> 3 0 0 1 1 0 0 0 #> 4 0 0 1 1 0 0 0 #> 5 0 0 0 0 1 0 0 #> 6 0 0 0 0 0 1 0 #> 7 0 0 0 0 0 0 1 table(commonNuclear) #> commonNuclear #> 0 1 #> 1196 100"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"computing-relatedness-through-common-extended-family-environment","dir":"Articles","previous_headings":"Computing Relatedness > Other relatedness measures","what":"Computing relatedness through common extended family environment","title":"Network tools for finding extended pedigrees and path tracing","text":"calculate relatedness pairs individuals potter dataset sharing extended family.","code":"extendedFamilyEnvironment <- ped2ce(potter) extendedFamilyEnvironment[1:7, 1:7] #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] 1 1 1 1 1 1 1 #> [2,] 1 1 1 1 1 1 1 #> [3,] 1 1 1 1 1 1 1 #> [4,] 1 1 1 1 1 1 1 #> [5,] 1 1 1 1 1 1 1 #> [6,] 1 1 1 1 1 1 1 #> [7,] 1 1 1 1 1 1 1 table(extendedFamilyEnvironment) #> extendedFamilyEnvironment #> 1 #> 1296"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"subsetting-pedigrees","dir":"Articles","previous_headings":"","what":"Subsetting Pedigrees","title":"Network tools for finding extended pedigrees and path tracing","text":"Subsetting pedigree allows researchers focus specific family lines individuals within larger dataset. can particularly useful data validation well simplifying complex pedigrees visualization. However, subsetting pedigree can result underestimation relatedness individuals. subsetted pedigree may contain individuals connect two people together. example remove Arthur Weasley (person 9) Molly Prewett (person 10) potter dataset, lose connections amongst children. Potter Subset Pedigree plot , removed Arthur Weasley (person 9) Molly Prewett (person 10) potter dataset. result, connections children lost. Similarly, remove children Vernon Dursley (1) Petunia Evans (3) potter dataset, lose connections two individuals. However, subset plot relationship spouses (marriage Vernon Dursley Petunia Evans), children connect two individuals together yet.","code":"subset_rows <- c(1:5, 31:36) subset_potter <- potter[subset_rows, ]"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/pedigree.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Pedigree Simulation and Visualization with BGmisc","text":"Unlike Tolstoy, happy families alike, pedigrees alike – least, simulated pedigrees alike. simulatePedigree function generates pedigree user-specified number generations individuals per generation. function provides users opportunity test family models pedigrees customized pedigree length width. pedigrees can simulated function several parameters, including number children per mate, generations, sex ratio newborns, mating rate. Given large family pedigrees difficult collect access, simulated pedigrees serve efficient tool researchers. simulated pedigrees useful building family-based statistical models, evaluating statistical properties, power, bias, computational efficiency. illustrate functionality, let us generate pedigree. pedigree total four generations (Ngen), person “mates”, grows family four offspring (kpc). scenario, number male female newborns equal, can adjusted via (sexR). illustration 70% individuals mate bear offspring (marR). pedigree structure can simulated running following code: simulation output data.frame 57 rows 7 columns. row corresponds simulated individual. columns represents individual’s family ID, individual’s personal ID, generation individual , IDs father mother, ID spouse, biological sex individual, respectively.","code":"## Loading Required Libraries library(BGmisc) set.seed(5) df_ped <- simulatePedigree( kpc = 4, Ngen = 4, sexR = .5, marR = .7 ) summary(df_ped) #> fam ID gen dadID #> Length:57 Min. : 10011 Min. :1.000 Min. : 10012 #> Class :character 1st Qu.: 10036 1st Qu.:3.000 1st Qu.: 10024 #> Mode :character Median :100312 Median :3.000 Median : 10037 #> Mean : 59171 Mean :3.298 Mean : 42859 #> 3rd Qu.:100416 3rd Qu.:4.000 3rd Qu.:100311 #> Max. :100432 Max. :4.000 Max. :100320 #> NA's :13 #> momID spt sex #> Min. : 10011 Min. : 10011 Length:57 #> 1st Qu.: 10022 1st Qu.: 10025 Class :character #> Median : 10036 Median : 10036 Mode :character #> Mean : 42859 Mean : 40124 #> 3rd Qu.:100316 3rd Qu.:100311 #> Max. :100318 Max. :100320 #> NA's :13 NA's :33 df_ped[21, ] #> fam ID gen dadID momID spt sex #> 21 fam 1 100312 3 10024 10022 100317 M"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/pedigree.html","id":"summarizing-pedigrees","dir":"Articles","previous_headings":"Introduction","what":"Summarizing Pedigrees","title":"Pedigree Simulation and Visualization with BGmisc","text":"","code":"summarizeFamilies(df_ped, famID = \"fam\")$family_summary #> fam count gen_mean gen_median gen_min gen_max gen_sd spt_mean #> #> 1: fam 1 57 3.298246 3 1 4 0.8229935 40123.5 #> spt_median spt_min spt_max spt_sd #> #> 1: 10035.5 10011 100320 43476.96"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/pedigree.html","id":"plotting-pedigree","dir":"Articles","previous_headings":"Introduction","what":"Plotting Pedigree","title":"Pedigree Simulation and Visualization with BGmisc","text":"Pedigrees visual diagrams represent family relationships across generations. commonly used genetics trace inheritance specific traits conditions. vignette guide visualizing simulated pedigrees using plotPedigree function. function wrapper function Kinship2’s base R plotting.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/pedigree.html","id":"single-pedigree-visualization","dir":"Articles","previous_headings":"Introduction > Plotting Pedigree","what":"Single Pedigree Visualization","title":"Pedigree Simulation and Visualization with BGmisc","text":"visualize single simulated pedigree, use plotPedigree() function. resulting plot, biological males represented squares, biological females represented circles, following standard pedigree conventions.","code":"# Plot the simulated pedigree plotPedigree(df_ped) #> Did not plot the following people: 10032 #> $plist #> $plist$n #> [1] 2 7 19 28 #> #> $plist$nid #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] #> [1,] 2 1 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 6 4 5 3 9 7 8 0 0 0 0 0 0 0 #> [3,] 18 17 19 22 21 26 23 10 12 13 14 16 15 24 #> [4,] 38 39 40 42 41 43 45 48 47 50 52 53 30 31 #> [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] #> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [3,] 20 25 28 29 27 0 0 0 0 0 0 0 #> [4,] 32 33 34 35 36 37 44 46 49 51 54 55 #> [,27] [,28] #> [1,] 0 0 #> [2,] 0 0 #> [3,] 0 0 #> [4,] 56 57 #> #> $plist$pos #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] 1.550317e+01 16.503171 0.000000 0.000000 0.000000 0.000000 0.00000 #> [2,] 8.255043e+00 9.255043 14.147242 15.147242 18.805200 19.805200 20.80520 #> [3,] 2.351008e+00 3.351008 5.751008 6.751008 8.585014 9.585014 10.58501 #> [4,] -1.257081e-13 1.000000 2.000000 3.000000 4.000000 5.000000 6.00000 #> [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] #> [1,] 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 #> [2,] 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 #> [3,] 12.13453 13.13453 14.13453 15.13453 16.32945 17.32945 18.98794 19.98794 #> [4,] 7.00000 8.00000 9.00000 10.00000 11.00000 12.00000 13.00000 14.00000 #> [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] #> [1,] 0.00000 0.00000 0.00000 0.00000 0 0 0 0 0 0 #> [2,] 0.00000 0.00000 0.00000 0.00000 0 0 0 0 0 0 #> [3,] 20.98794 21.98794 23.86104 24.86104 0 0 0 0 0 0 #> [4,] 15.00000 16.00000 17.00000 18.00000 19 20 21 22 23 24 #> [,26] [,27] [,28] #> [1,] 0 0 0 #> [2,] 0 0 0 #> [3,] 0 0 0 #> [4,] 25 26 27 #> #> $plist$fam #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] #> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 0 1 1 0 0 1 1 0 0 0 0 0 0 0 #> [3,] 0 1 1 0 1 0 1 3 3 3 0 0 3 5 #> [4,] 1 1 1 1 3 3 3 3 5 5 5 5 10 10 #> [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] #> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [3,] 0 5 5 5 0 0 0 0 0 0 0 0 #> [4,] 10 10 12 12 12 12 15 15 15 15 18 18 #> [,27] [,28] #> [1,] 0 0 #> [2,] 0 0 #> [3,] 0 0 #> [4,] 18 18 #> #> $plist$spouse #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] #> [1,] 1 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 1 0 1 0 1 0 0 0 0 0 0 0 0 0 #> [3,] 1 0 1 0 1 0 0 0 0 1 0 1 0 0 #> [4,] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] #> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [3,] 1 0 0 1 0 0 0 0 0 0 0 0 #> [4,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [,27] [,28] #> [1,] 0 0 #> [2,] 0 0 #> [3,] 0 0 #> [4,] 0 0 #> #> #> $x #> [1] 1.650317e+01 1.550317e+01 1.514724e+01 9.255043e+00 1.414724e+01 #> [6] 8.255043e+00 1.980520e+01 2.080520e+01 1.880520e+01 1.213453e+01 #> [11] NA 1.313453e+01 1.413453e+01 1.513453e+01 1.732945e+01 #> [16] 1.632945e+01 3.351008e+00 2.351008e+00 5.751008e+00 1.998794e+01 #> [21] 8.585014e+00 6.751008e+00 1.058501e+01 1.898794e+01 2.098794e+01 #> [26] 9.585014e+00 2.486104e+01 2.198794e+01 2.386104e+01 1.200000e+01 #> [31] 1.300000e+01 1.400000e+01 1.500000e+01 1.600000e+01 1.700000e+01 #> [36] 1.800000e+01 1.900000e+01 -1.257081e-13 1.000000e+00 2.000000e+00 #> [41] 4.000000e+00 3.000000e+00 5.000000e+00 2.000000e+01 6.000000e+00 #> [46] 2.100000e+01 8.000000e+00 7.000000e+00 2.200000e+01 9.000000e+00 #> [51] 2.300000e+01 1.000000e+01 1.100000e+01 2.400000e+01 2.500000e+01 #> [56] 2.600000e+01 2.700000e+01 #> #> $y #> [1] 1 1 2 2 2 2 2 2 2 3 NA 3 3 3 3 3 3 3 3 3 3 3 3 3 3 #> [26] 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 #> [51] 4 4 4 4 4 4 4 #> #> $boxw #> [1] 0.5158615 #> #> $boxh #> [1] 0.08681352 #> #> $call #> kinship2::plot.pedigree(x = p3, cex = cex, col = col, symbolsize = symbolsize, #> branch = branch, packed = packed, align = align, width = width, #> density = density, angle = angle, keep.par = keep.par, pconnect = pconnect, #> mar = mar)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/pedigree.html","id":"visualizing-multiple-pedigrees-side-by-side","dir":"Articles","previous_headings":"Introduction > Plotting Pedigree","what":"Visualizing Multiple Pedigrees Side-by-Side","title":"Pedigree Simulation and Visualization with BGmisc","text":"wish compare different pedigrees side side, can plot together. instance, let’s visualize pedigrees families spanning three four generations, respectively. examining side--side plots, can contrast analyze structures different families, tracing inheritance specific traits conditions needed.","code":"set.seed(8) # Simulate a family with 3 generations df_ped_3 <- simulatePedigree(Ngen = 3) # Simulate a family with 4 generations df_ped_4 <- simulatePedigree(Ngen = 4) # Set up plotting parameters for side-by-side display par(mfrow = c(1, 2)) # Plot the 3-generation pedigree plotPedigree(df_ped_3, width = 3) #> $plist #> $plist$n #> [1] 2 5 6 #> #> $plist$nid #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 2 1 0 0 0 0 #> [2,] 3 5 4 6 7 0 #> [3,] 8 10 11 9 12 13 #> #> $plist$pos #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 1.166667e+00 2.166667 0 0 0 0 #> [2,] 2.047042e-09 1.000000 2 3 4 0 #> [3,] 0.000000e+00 1.000000 2 3 4 5 #> #> $plist$fam #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 0 0 0 0 0 0 #> [2,] 1 1 0 0 1 0 #> [3,] 2 2 2 4 4 4 #> #> $plist$spouse #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 1 0 0 0 0 0 #> [2,] 0 1 0 1 0 0 #> [3,] 0 0 0 0 0 0 #> #> #> $x #> [1] 2.166667e+00 1.166667e+00 2.047042e-09 2.000000e+00 1.000000e+00 #> [6] 3.000000e+00 4.000000e+00 0.000000e+00 3.000000e+00 1.000000e+00 #> [11] 2.000000e+00 4.000000e+00 5.000000e+00 #> #> $y #> [1] 1 1 2 2 2 2 2 3 3 3 3 3 3 #> #> $boxw #> [1] 0.2060484 #> #> $boxh #> [1] 0.05787568 #> #> $call #> kinship2::plot.pedigree(x = p3, cex = cex, col = col, symbolsize = symbolsize, #> branch = branch, packed = packed, align = align, width = width, #> density = density, angle = angle, keep.par = keep.par, pconnect = pconnect, #> mar = mar) # Plot the 4-generation pedigree plotPedigree(df_ped_4, width = 1) #> $plist #> $plist$n #> [1] 2 5 10 12 #> #> $plist$nid #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] #> [1,] 2 1 0 0 0 0 0 0 0 0 0 0 #> [2,] 3 5 4 6 7 0 0 0 0 0 0 0 #> [3,] 8 9 11 15 14 13 10 12 17 16 0 0 #> [4,] 18 21 23 22 25 26 19 20 24 27 28 29 #> #> $plist$pos #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] 6.399999e+00 7.399999 0.000000 0.000000 0.000000 0.000000 0.000000 #> [2,] 3.299999e+00 4.299999 6.699999 7.699999 8.699999 0.000000 0.000000 #> [3,] 9.333331e-01 1.933333 2.933333 3.933333 4.933333 6.066666 7.066666 #> [4,] 1.854016e-14 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 #> [,8] [,9] [,10] [,11] [,12] #> [1,] 0.000000 0.000000 0.00000 0 0 #> [2,] 0.000000 0.000000 0.00000 0 0 #> [3,] 8.066666 9.066666 10.06667 0 0 #> [4,] 7.000000 8.000000 9.00000 10 11 #> #> $plist$fam #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] #> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 0 1 0 1 1 0 0 0 0 0 0 0 #> [3,] 0 1 1 1 0 0 3 3 3 0 0 0 #> [4,] 1 1 1 4 4 4 6 6 6 9 9 9 #> #> $plist$spouse #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] #> [1,] 1 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 1 0 1 0 0 0 0 0 0 0 0 0 #> [3,] 1 0 0 1 0 1 0 0 1 0 0 0 #> [4,] 0 0 0 0 0 0 0 0 0 0 0 0 #> #> #> $x #> [1] 7.399999e+00 6.399999e+00 3.299999e+00 6.699999e+00 4.299999e+00 #> [6] 7.699999e+00 8.699999e+00 9.333331e-01 1.933333e+00 7.066666e+00 #> [11] 2.933333e+00 8.066666e+00 6.066666e+00 4.933333e+00 3.933333e+00 #> [16] 1.006667e+01 9.066666e+00 1.854016e-14 6.000000e+00 7.000000e+00 #> [21] 1.000000e+00 3.000000e+00 2.000000e+00 8.000000e+00 4.000000e+00 #> [26] 5.000000e+00 9.000000e+00 1.000000e+01 1.100000e+01 #> #> $y #> [1] 1 1 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 #> #> $boxw #> [1] 0.4533065 #> #> $boxh #> [1] 0.08681352 #> #> $call #> kinship2::plot.pedigree(x = p3, cex = cex, col = col, symbolsize = symbolsize, #> branch = branch, packed = packed, align = align, width = width, #> density = density, angle = angle, keep.par = keep.par, pconnect = pconnect, #> mar = mar)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Validation tools for identifying and repairing errors in pedigrees","text":"BGmisc R package offers comprehensive suite functions tailored extended behavior genetics analysis, including model identification, calculating relatedness, pedigree conversion, pedigree simulation. vignette provides overview validation tools available package, designed identify repair errors pedigrees. ideal world, perfect pedigrees errors. However, real world, pedigrees often incomplete, contain errors, missing data. BGmisc package provides tools identify errors, particularly useful large pedigrees manual inspection feasible. errors package can automatically repaired, vast majority require manual inspection. often possible automatically repair errors pedigrees, correct solution may obvious, may depend additional information universally available.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"id-validation","dir":"Articles","previous_headings":"Identifying and Repairing Errors in Pedigrees","what":"ID Validation","title":"Validation tools for identifying and repairing errors in pedigrees","text":"One common issue pedigree data presence duplicate IDs. two main types ID duplication: within-row duplication across-row duplication. Within-row duplication occurs individual’s parents’ IDs incorrectly listed ID. Across-row duplication occurs two individuals share ID. checkIDs function BGmisc helps identify kinds duplicates. ’s use : example, checkIDs function returns list several elements. all_unique_ids element indicates whether IDs dataset unique. total_non_unique_ids element indicates total number non-unique IDs. total_own_father total_own_mother elements indicate total number individuals whose father’s mother’s IDs match ID, respectively. total_duplicated_parents element indicates total number individuals duplicated parent IDs. total_within_row_duplicates element indicates total number within-row duplicates. within_row_duplicates element indicates whether within-row duplicates dataset. output shows, duplicates sample dataset.","code":"library(BGmisc) # Create a sample dataset df <- ped2fam(potter, famID = \"newFamID\", personID = \"personID\") # Call the checkIDs function result <- checkIDs(df, repair = FALSE) print(result) #> $all_unique_ids #> [1] TRUE #> #> $total_non_unique_ids #> [1] 0 #> #> $total_own_father #> [1] 0 #> #> $total_own_mother #> [1] 0 #> #> $total_duplicated_parents #> [1] 0 #> #> $total_within_row_duplicates #> [1] 0 #> #> $within_row_duplicates #> [1] FALSE #> $all_unique_ids #> [1] TRUE #> #> $total_non_unique_ids #> [1] 0 #> #> $total_own_father #> [1] 0 #> #> $total_own_mother #> [1] 0 #> #> $total_duplicated_parents #> [1] 0 #> #> $total_within_row_duplicates #> [1] 0 #> #> $within_row_duplicates #> [1] FALSE"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"between-person-duplicates","dir":"Articles","previous_headings":"Identifying and Repairing Errors in Pedigrees > ID Validation","what":"Between-Person Duplicates","title":"Validation tools for identifying and repairing errors in pedigrees","text":"Let us now consider scenario -person duplicates dataset. checkIDs function can identify duplicates , repair argument set TRUE, attempt repair . example , created two -person duplicates. First, overwritten personID one person sibling’s ID. Second, added copy Dudley Dursley dataset. Now, let’s call sumarizeFamilies function see dataset looks like. didn’t know look duplicates, might notice issue. Indeed, duplicates selected founder member. However, checkIDs function can help us identify repair errors: can see output, 4 non-unique IDs dataset, specifically 2, 6. Let’s take peek duplicates: Yep, definitely duplicates. Great! function able repair full duplicate, without manual intervention. still leaves us sibling overwrite, ’s complex issue require manual intervention. ’ll leave now.","code":"# Create a sample dataset with duplicates df <- ped2fam(potter, famID = \"newFamID\", personID = \"personID\") # Sibling overwrite df$personID[df$name == \"Vernon Dursley\"] <- df$personID[df$name == \"Marjorie Dursley\"] # Add a copy of Dudley Dursley df <- rbind(df, df[df$name == \"Dudley Dursley\",]) library(tidyverse) #> ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── #> ✔ dplyr 1.1.4 ✔ readr 2.1.5 #> ✔ forcats 1.0.0 ✔ stringr 1.5.1 #> ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 #> ✔ lubridate 1.9.3 ✔ tidyr 1.3.1 #> ✔ purrr 1.0.2 #> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ── #> ✖ dplyr::filter() masks stats::filter() #> ✖ dplyr::lag() masks stats::lag() #> ℹ Use the conflicted package () to force all conflicts to become errors summarizeFamilies(df, famID = \"newFamID\", personID = \"personID\")$family_summary %>% glimpse() #> Rows: 1 #> Columns: 17 #> $ newFamID 1 #> $ count 37 #> $ gen_mean 1.756757 #> $ gen_median 2 #> $ gen_min 0 #> $ gen_max 3 #> $ gen_sd 1.038305 #> $ spouseID_mean 38.2 #> $ spouseID_median 15 #> $ spouseID_min 1 #> $ spouseID_max 106 #> $ spouseID_sd 44.15118 #> $ sex_mean 0.5135135 #> $ sex_median 1 #> $ sex_min 0 #> $ sex_max 1 #> $ sex_sd 0.5067117 # Call the checkIDs result <- checkIDs(df) print(result) #> $all_unique_ids #> [1] FALSE #> #> $total_non_unique_ids #> [1] 4 #> #> $non_unique_ids #> [1] 2 6 #> #> $total_own_father #> [1] 0 #> #> $total_own_mother #> [1] 0 #> #> $total_duplicated_parents #> [1] 0 #> #> $total_within_row_duplicates #> [1] 0 #> #> $within_row_duplicates #> [1] FALSE df %>% filter(personID %in% result$non_unique_ids) %>% arrange(personID) #> personID newFamID famID name gen momID dadID spouseID sex #> 1 2 1 1 Vernon Dursley 1 101 102 3 1 #> 2 2 1 1 Marjorie Dursley 1 101 102 NA 0 #> 6 6 1 1 Dudley Dursley 2 3 1 NA 1 #> 61 6 1 1 Dudley Dursley 2 3 1 NA 1 df_repair <- checkIDs(df, repair = TRUE) df_repair %>% filter(ID %in% result$non_unique_ids) %>% arrange(ID) #> ID newFamID fam name gen momID dadID spt sex #> 1 2 1 1 Vernon Dursley 1 101 102 3 1 #> 2 2 1 1 Marjorie Dursley 1 101 102 NA 0 #> 6 6 1 1 Dudley Dursley 2 3 1 NA 1 result <- checkIDs(df_repair) print(result) #> $all_unique_ids #> [1] FALSE #> #> $total_non_unique_ids #> [1] 2 #> #> $non_unique_ids #> [1] 2 #> #> $total_own_father #> [1] 0 #> #> $total_own_mother #> [1] 0 #> #> $total_duplicated_parents #> [1] 0 #> #> $total_within_row_duplicates #> [1] 0 #> #> $within_row_duplicates #> [1] FALSE"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"handling-within-row-duplicates","dir":"Articles","previous_headings":"Identifying and Repairing Errors in Pedigrees > ID Validation","what":"Handling Within-Row Duplicates","title":"Validation tools for identifying and repairing errors in pedigrees","text":"Sometimes, individual’s parents’ IDs may incorrectly listed ID, leading within-row duplicates. checkIDs function can also identify errors: example, created within-row duplicate setting momID Vernon Dursley ID. checkIDs function correctly identifies error.","code":"# Create a sample dataset with within-person duplicate parent IDs df <- ped2fam(potter, famID = \"newFamID\", personID = \"personID\") df$momID[df$name == \"Vernon Dursley\"] <- df$personID[df$name == \"Vernon Dursley\"] # Check for within-row duplicates result <- checkIDs(df, repair = FALSE) print(result) #> $all_unique_ids #> [1] TRUE #> #> $total_non_unique_ids #> [1] 0 #> #> $total_own_father #> [1] 0 #> #> $total_own_mother #> [1] 1 #> #> $total_duplicated_parents #> [1] 0 #> #> $total_within_row_duplicates #> [1] 1 #> #> $within_row_duplicates #> [1] TRUE #> #> $is_own_mother_ids #> [1] 1"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"verifying-sex-coding","dir":"Articles","previous_headings":"Identifying and Repairing Errors in Pedigrees","what":"Verifying Sex Coding","title":"Validation tools for identifying and repairing errors in pedigrees","text":"Another common issue pedigree data incorrect coding biological sex. genetic studies, ensuring accurate recording biological sex pedigree data crucial analyses rely information. checkSex function BGmisc helps identify repair errors related biological sex coding, inconsistencies individual’s sex incorrectly recorded. example parent biologically male, listed mother. checkSex function can help identify correct errors. essential distinguish biological sex (genotype) gender identity (phenotype). Biological sex based chromosomes biological characteristics, gender identity broader, richer, personal, deeply-held sense male, female, blend , neither, another gender entirely. checkSex focuses biological sex necessary genetic analysis, respect recognize full spectrum gender identities beyond binary. developers package affirm support folx LGBTQ+ community. checkSex function BGmisc performs two main tasks: identifying possible errors inconsistencies variables related biological sex. function capable validating sex coding pedigree optionally repairing sex coding based specified logic. ’s can use checkSex function validate optionally repair sex coding pedigree dataset: example, checkSex function checks unique values sex column identifies inconsistencies sex coding parents. function returns list containing validation results, unique values found sex column inconsistencies sex coding parents. incorrect sex codes found, can attempt repair automatically using repair argument: repair argument set TRUE, function attempts repair sex coding based specified logic. recodes sex variable based frequent sex values found among parents. ensures sex coding consistent accurate, essential constructing valid genetic pedigrees.","code":"# Validate sex coding results <- checkSex(potter, code_male = 1, code_female = 0, verbose = TRUE, repair = FALSE) #> Step 1: Checking how many sexes/genders... #> 2 unique values found. #> 1 2 unique values found. #> 0Checks Made: #> $sex_unique #> [1] 1 0 #> #> $sex_length #> [1] 2 #> #> $all_sex_dad #> [1] \"1\" #> #> $all_sex_mom #> [1] \"0\" #> #> $most_frequent_sex_dad #> [1] \"1\" #> #> $most_frequent_sex_mom #> [1] \"0\" print(results) #> $sex_unique #> [1] 1 0 #> #> $sex_length #> [1] 2 #> #> $all_sex_dad #> [1] \"1\" #> #> $all_sex_mom #> [1] \"0\" #> #> $most_frequent_sex_dad #> [1] \"1\" #> #> $most_frequent_sex_mom #> [1] \"0\" # Repair sex coding df_fix <- checkSex(potter, code_male = 1, code_female = 0, verbose = TRUE, repair = TRUE) #> Step 1: Checking how many sexes/genders... #> 2 unique values found. #> 1 2 unique values found. #> 0Step 2: Attempting to repair sex coding... #> Changes Made: #> [[1]] #> [1] \"Recode sex based on most frequent sex in dads: 1. Total gender changes made: 36\" print(df_fix) #> ID fam name gen momID dadID spt sex #> 1 1 1 Vernon Dursley 1 101 102 3 M #> 2 2 1 Marjorie Dursley 1 101 102 NA F #> 3 3 1 Petunia Evans 1 103 104 1 F #> 4 4 1 Lily Evans 1 103 104 5 F #> 5 5 1 James Potter 1 NA NA 4 M #> 6 6 1 Dudley Dursley 2 3 1 NA M #> 7 7 1 Harry Potter 2 4 5 8 M #> 8 8 1 Ginny Weasley 2 10 9 7 F #> 9 9 1 Arthur Weasley 1 NA NA 10 M #> 10 10 1 Molly Prewett 1 NA NA 9 F #> 11 11 1 Ron Weasley 2 10 9 17 M #> 12 12 1 Fred Weasley 2 10 9 NA M #> 13 13 1 George Weasley 2 10 9 NA M #> 14 14 1 Percy Weasley 2 10 9 20 M #> 15 15 1 Charlie Weasley 2 10 9 NA M #> 16 16 1 Bill Weasley 2 10 9 18 M #> 17 17 1 Hermione Granger 2 NA NA 11 F #> 18 18 1 Fleur Delacour 2 105 106 16 F #> 19 19 1 Gabrielle Delacour 2 105 106 NA F #> 20 20 1 Audrey UNKNOWN 2 NA NA 14 F #> 21 21 1 James Potter II 3 8 7 NA M #> 22 22 1 Albus Potter 3 8 7 NA M #> 23 23 1 Lily Potter 3 8 7 NA F #> 24 24 1 Rose Weasley 3 17 11 NA F #> 25 25 1 Hugo Weasley 3 17 11 NA M #> 26 26 1 Victoire Weasley 3 18 16 NA F #> 27 27 1 Dominique Weasley 3 18 16 NA F #> 28 28 1 Louis Weasley 3 18 16 NA M #> 29 29 1 Molly Weasley 3 20 14 NA F #> 30 30 1 Lucy Weasley 3 20 14 NA F #> 31 101 1 Mother Dursley 0 NA NA 102 F #> 32 102 1 Father Dursley 0 NA NA 101 M #> 33 104 1 Father Evans 0 NA NA 103 M #> 34 103 1 Mother Evans 0 NA NA 104 F #> 35 106 1 Father Delacour 0 NA NA 105 M #> 36 105 1 Mother Delacour 0 NA NA 106 F"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"conclusion","dir":"Articles","previous_headings":"","what":"Conclusion","title":"Validation tools for identifying and repairing errors in pedigrees","text":"vignette demonstrates use BGmisc package identify repair errors pedigrees. leveraging functions like checkIDs, checkSex, recodeSex, can ensure integrity pedigree data, facilitating accurate analysis research.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"S. Mason Garrison. Author, maintainer. Michael D. Hunter. Author. Xuanyu Lyu. Author. Rachel N. Good. Contributor. Jonathan D. Trattner. Author. https://www.jdtrat.com/ S. Alexandra Burt. Author.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Garrison, S. Mason, Hunter, Michael D., Lyu, Xuanyu, Trattner, Jonathan D., Burt, S. Alexandra (2024). “BGmisc: R Package Extended Behavior Genetics Analysis.” Journal Open Source Software, 9(94). doi:10.21105/joss.06203.","code":"@Article{bgmisc, title = {BGmisc: An R Package for Extended Behavior Genetics Analysis}, author = {{Garrison, S. Mason} and {Hunter, Michael D.} and {Lyu, Xuanyu} and {Trattner, Jonathan D.} and {Burt, S. Alexandra}}, journal = {Journal of Open Source Software}, year = {2024}, volume = {9}, number = {94}, doi = {10.21105/joss.06203}, }"},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"bgmisc","dir":"","previous_headings":"","what":"An R Package for Extended Behavior Genetics Analysis","title":"An R Package for Extended Behavior Genetics Analysis","text":"BGmisc R package offers comprehensive suite functions tailored extended behavior genetics analysis, including model identification, calculating relatedness, pedigree conversion, pedigree simulation, .","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"An R Package for Extended Behavior Genetics Analysis","text":"can install released version BGmisc CRAN : install development version BGmisc GitHub use:","code":"install.packages(\"BGmisc\") # install.packages(\"devtools\") devtools::install_github(\"R-Computing-Lab/BGmisc\")"},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"An R Package for Extended Behavior Genetics Analysis","text":"use BGmisc research wish refer , please cite following paper: Garrison, S. Mason, Hunter, Michael D., Lyu, Xuanyu, Trattner, Jonathan D., Burt, S. Alexandra (2024). “BGmisc: R Package Extended Behavior Genetics Analysis.” Journal Open Source Software, 9(94). doi:10.21105/joss.06203 https://doi.org/10.21105/joss.06203. BibTeX entry LaTeX users ","code":"citation(package = \"BGmisc\") @Article{bgmisc, title = {BGmisc: An R Package for Extended Behavior Genetics Analysis}, author = {{Garrison, S. Mason} and {Hunter, Michael D.} and {Lyu, Xuanyu} and {Trattner, Jonathan D.} and {Burt, S. Alexandra}}, journal = {Journal of Open Source Software}, year = {2024}, volume = {9}, number = {94}, doi = {10.21105/joss.06203}, }"},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"An R Package for Extended Behavior Genetics Analysis","text":"Contributions BGmisc project welcome. guidelines contribute, please refer Contributing Guidelines. Issues pull requests submitted GitHub repository. support, please use GitHub issues page.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"branching-and-versioning-system","dir":"","previous_headings":"Contributing","what":"Branching and Versioning System","title":"An R Package for Extended Behavior Genetics Analysis","text":"development BGmisc follows GitFlow branching strategy: Feature Branches: major changes new features developed separate branches created dev_main branch. Name branches according feature change meant address. dev_main: branch final integration stage changes merged main branch. considered stable, well-tested features updates ready next release cycle merged . dev: branch serves less stable, active development environment. Feature branches merged . Changes fluid branch higher risk breaking. Main Branch (main): main branch mirrors stable state project seen CRAN. fully tested approved changes dev_main branch merged main prepare new release.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"An R Package for Extended Behavior Genetics Analysis","text":"BGmisc licensed GNU General Public License v3.0. details, see LICENSE.md file.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/BGmisc-package.html","id":null,"dir":"Reference","previous_headings":"","what":"BGmisc: An R Package for Extended Behavior Genetics Analysis — BGmisc-package","title":"BGmisc: An R Package for Extended Behavior Genetics Analysis — BGmisc-package","text":"BGmisc R package offers comprehensive suite functions tailored extended behavior genetics analysis, including model identification, calculating relatedness, pedigree conversion, pedigree simulation, .","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/BGmisc-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"BGmisc: An R Package for Extended Behavior Genetics Analysis — BGmisc-package","text":"Maintainer: S. Mason Garrison garrissm@wfu.edu (ORCID) Authors: Michael D. Hunter (ORCID) Xuanyu Lyu (ORCID) Jonathan D. Trattner code@jdtrat.com (ORCID) (https://www.jdtrat.com/) S. Alexandra Burt (ORCID) contributors: Rachel N. Good [contributor]","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/Null.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute the null space of a matrix — Null","title":"Compute the null space of a matrix — Null","text":"Compute null space matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/Null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute the null space of a matrix — Null","text":"","code":"Null(M)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/Null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute the null space of a matrix — Null","text":"M matrix null space desired","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/Null.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute the null space of a matrix — Null","text":"method uses QR factorization determine basis null space matrix. sometimes also called orthogonal complement matrix. implemented, function identical function name MASS package.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":null,"dir":"Reference","previous_headings":"","what":"SimPed (Deprecated) — SimPed","title":"SimPed (Deprecated) — SimPed","text":"calling function, warning issued deprecation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"SimPed (Deprecated) — SimPed","text":"","code":"SimPed(...)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"SimPed (Deprecated) — SimPed","text":"... Arguments passed `simulatePedigree`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"SimPed (Deprecated) — SimPed","text":"result calling `simulatePedigree`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"SimPed (Deprecated) — SimPed","text":"function wrapper around new `simulatePedigree` function. `SimPed` deprecated, advised use `simulatePedigree` directly.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"SimPed (Deprecated) — SimPed","text":"","code":"if (FALSE) { # This is an example of the deprecated function: SimPed(...) # It is recommended to use: simulatePedigree(...) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/adjustKidsPerCouple.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate or Adjust Number of Kids per Couple Based on Mating Rate — adjustKidsPerCouple","title":"Generate or Adjust Number of Kids per Couple Based on Mating Rate — adjustKidsPerCouple","text":"function generates adjusts number kids per couple generation based specified average whether count randomly determined.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/adjustKidsPerCouple.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate or Adjust Number of Kids per Couple Based on Mating Rate — adjustKidsPerCouple","text":"","code":"adjustKidsPerCouple(nMates, kpc, rd_kpc)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/adjustKidsPerCouple.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate or Adjust Number of Kids per Couple Based on Mating Rate — adjustKidsPerCouple","text":"nMates Integer, number mated pairs generation. kpc Number kids per couple. integer >= 2 determines many kids fertilized mated couple pedigree. Default value 3. Returns error kpc equals 1. rd_kpc logical. TRUE, number kids per mate randomly generated poisson distribution mean kpc. FALSE, number kids per mate fixed kpc.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/adjustKidsPerCouple.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate or Adjust Number of Kids per Couple Based on Mating Rate — adjustKidsPerCouple","text":"numeric vector generated adjusted number kids per couple.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/allGens.html","id":null,"dir":"Reference","previous_headings":"","what":"allGens A function to calculate the number of individuals in each generation. This is a supporting function for simulatePedigree. — allGens","title":"allGens A function to calculate the number of individuals in each generation. This is a supporting function for simulatePedigree. — allGens","text":"allGens function calculate number individuals generation. supporting function simulatePedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/allGens.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"allGens A function to calculate the number of individuals in each generation. This is a supporting function for simulatePedigree. — allGens","text":"","code":"allGens(kpc, Ngen, marR)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/allGens.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"allGens A function to calculate the number of individuals in each generation. This is a supporting function for simulatePedigree. — allGens","text":"kpc Number kids per couple (integer >= 2). Ngen Number generations (integer >= 1). marR Mating rate (numeric value ranging 0 1).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/allGens.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"allGens A function to calculate the number of individuals in each generation. This is a supporting function for simulatePedigree. — allGens","text":"Returns vector containing number individuals every generation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/assignCoupleIds.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign Couple IDs — assignCoupleIds","title":"Assign Couple IDs — assignCoupleIds","text":"subfunction assigns unique couple ID mated pair generation. Unmated individuals assigned NA couple ID.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/assignCoupleIds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign Couple IDs — assignCoupleIds","text":"","code":"assignCoupleIds(df_Ngen)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/assignCoupleIds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign Couple IDs — assignCoupleIds","text":"df_Ngen dataframe current generation, including columns individual IDs spouse IDs.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/assignCoupleIds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign Couple IDs — assignCoupleIds","text":"input dataframe augmented 'coupleId' column, mated pair unique identifier.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildBetweenGenerations.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Generation Connections — buildBetweenGenerations","title":"Process Generation Connections — buildBetweenGenerations","text":"function processes connections two generations pedigree simulation. marks individuals parents, sons, daughters based generational position relationships. function also handles assignment couple IDs, manages single coupled individuals, establishes parent-offspring links across generations.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildBetweenGenerations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Generation Connections — buildBetweenGenerations","text":"","code":"buildBetweenGenerations( df_Fam, Ngen, sizeGens, verbose, marR, sexR, kpc, rd_kpc )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildBetweenGenerations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Generation Connections — buildBetweenGenerations","text":"df_Fam data frame containing simulated pedigree information current generation. Must include columns family ID, individual ID, generation number, spouse ID (spt), sex. data frame updated place include flags parental status (ifparent), son status (ifson), daughter status (ifdau), well couple IDs. Ngen Number generations. integer >= 2 determines many generations simulated pedigree . first generation always fertilized couple. last generation mated individuals. sizeGens numeric vector containing sizes generation within pedigree. verbose logical TRUE, print progress stages algorithm marR Mating rate. numeric value ranging 0 1 determines proportion mated (fertilized) couples pedigree within generation. instance, marR = 0.5 suggests 50 percent offspring specific generation mated offspring. sexR Sex ratio offspring. numeric value ranging 0 1 determines proportion males offspring pedigree. instance, 0.4 means 40 percent offspring male. kpc Number kids per couple. integer >= 2 determines many kids fertilized mated couple pedigree. Default value 3. Returns error kpc equals 1. rd_kpc logical. TRUE, number kids per mate randomly generated poisson distribution mean kpc. FALSE, number kids per mate fixed kpc.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildBetweenGenerations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Generation Connections — buildBetweenGenerations","text":"function updates `df_Fam` data frame place, adding modifying columns related parental offspring status, well assigning unique couple IDs. return value explicitly.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildBetweenGenerations.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Process Generation Connections — buildBetweenGenerations","text":"function iterates generation, starting second, establish connections based mating parentage. first generation, sets parental status directly. subsequent generations, calculates number couples, expected number offspring, assigns offspring parents. handles gender-based assignments sons daughters, deals nuances single individuals couple formation. function relies external functions `assignCoupleIds` `adjustKidsPerCouple` handle specific tasks related couple ID assignment offspring number adjustments, respectively.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildWithinGenerations.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Generations for Pedigree Simulation — buildWithinGenerations","title":"Process Generations for Pedigree Simulation — buildWithinGenerations","text":"function iterates generations pedigree simulation, assigning IDs, creating data frames, determining sexes, managing pairing within generation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildWithinGenerations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Generations for Pedigree Simulation — buildWithinGenerations","text":"","code":"buildWithinGenerations(sizeGens, marR, sexR, Ngen)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildWithinGenerations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Generations for Pedigree Simulation — buildWithinGenerations","text":"sizeGens numeric vector containing sizes generation within pedigree. marR Mating rate. numeric value ranging 0 1 determines proportion mated (fertilized) couples pedigree within generation. instance, marR = 0.5 suggests 50 percent offspring specific generation mated offspring. sexR Sex ratio offspring. numeric value ranging 0 1 determines proportion males offspring pedigree. instance, 0.4 means 40 percent offspring male. Ngen Number generations. integer >= 2 determines many generations simulated pedigree . first generation always fertilized couple. last generation mated individuals.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildWithinGenerations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Generations for Pedigree Simulation — buildWithinGenerations","text":"data frame representing simulated pedigree, including columns family ID (`fam`),","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateH.html","id":null,"dir":"Reference","previous_headings":"","what":"Falconer's Formula — calculateH","title":"Falconer's Formula — calculateH","text":"Use Falconer's formula solve H using observed correlations two groups two levels relatednesses.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateH.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Falconer's Formula — calculateH","text":"","code":"calculateH(r1, r2, obsR1, obsR2)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateH.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Falconer's Formula — calculateH","text":"r1 Relatedness coefficient first group. r2 Relatedness coefficient second group. obsR1 Observed correlation members first group. obsR2 Observed correlation members second group.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateH.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Falconer's Formula — calculateH","text":"Heritability estimates (`heritability_estimates`).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateH.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Falconer's Formula — calculateH","text":"generalization Falconer's formula provides method calculate heritability using observed correlations two groups two relatednesses. function solves H using formula: $$H^2 = \\frac{obsR1 - obsR2}{r1 - r2}$$ r1 r2 relatedness coefficients first second group, respectively, obsR1 obsR2 observed correlations.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Relatedness Coefficient — calculateRelatedness","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"function calculates relatedness coefficient two individuals based shared ancestry, described Wright (1922).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"","code":"calculateRelatedness( generations = 2, path = NULL, full = TRUE, maternal = FALSE, empirical = FALSE, segregating = TRUE, total_a = 6800 * 1e+06, total_m = 16500, weight_a = 1, weight_m = 1, denom_m = FALSE, ... )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"generations Number generations back common ancestors pair share. path Traditional method count common ancestry, twice number generations removed common ancestors. provided, calculated 2*generations. full Logical. Indicates kin share parents common ancestor's generation. Default TRUE. maternal Logical. Indicates maternal lineage considered calculation. empirical Logical. Adjusts coefficient based empirical data, using total number nucleotides parameters. segregating Logical. Adjusts segregating genes. total_a Numeric. Represents total size autosomal genome terms nucleotides, used empirical adjustment. Default 6800*1000000. total_m Numeric. Represents total size mitochondrial genome terms nucleotides, used empirical adjustment. Default 16500. weight_a Numeric. Represents weight phenotypic influence additive genetic variance, used empirical adjustment. weight_m Numeric. Represents weight phenotypic influence mitochondrial effects, used empirical adjustment. denom_m Logical. Indicates `total_m` `weight_m` included denominator empirical adjustment calculation. ... named arguments may passed another function.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"Relatedness Coefficient (`coef`): measure genetic relationship two individuals.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"relatedness coefficient two people (b & c) defined relation common ancestors: \\(r_{bc} = \\sum \\left(\\frac{1}{2}\\right)^{n+n'+1} (1+f_a)\\)","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"","code":"if (FALSE) { # For full siblings, the relatedness coefficient is expected to be 0.5: calculateRelatedness(generations = 1, full = TRUE) # For half siblings, the relatedness coefficient is expected to be 0.25: calculateRelatedness(generations = 1, full = FALSE) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkIDs.html","id":null,"dir":"Reference","previous_headings":"","what":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","title":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","text":"function takes pedigree object performs two main tasks: 1. Checks uniqueness individual IDs. 2. Optionally repairs non-unique IDs based specified logic.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkIDs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","text":"","code":"checkIDs(ped, verbose = FALSE, repair = FALSE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkIDs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","text":"ped dataframe representing pedigree data columns `ID`, `dadID`, `momID`. verbose logical flag indicating whether print progress validation messages console. repair logical flag indicating whether attempt repairs non-unique IDs.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkIDs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","text":"Depending `repair` value, either returns list containing validation results repaired dataframe","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkIDs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","text":"","code":"if (FALSE) { ped <- data.frame(ID = c(1, 2, 2, 3), dadID = c(NA, 1, 1, 2), momID = c(NA, NA, 2, 2)) checkIDs(ped, verbose = TRUE, repair = FALSE) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":null,"dir":"Reference","previous_headings":"","what":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"function performs two main tasks: 1. Optionally recodes 'sex' variable based given codes males females. 2. Optionally repairs sex coding based specified logic, facilitating accurate construction genetic pedigrees.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"","code":"checkSex( ped, code_male = NULL, code_female = NULL, verbose = FALSE, repair = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"ped dataframe representing pedigree data 'sex' column. code_male current code used represent males 'sex' column. code_female current code used represent females 'sex' column. NULL, recoding performed. verbose logical flag indicating whether print progress validation messages console. repair logical flag indicating whether attempt repairs sex coding.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"Depending value `repair`, either list containing validation results repaired dataframe returned.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"function uses terms 'male' 'female' biological context, based chromosomes biologically-based characteristics relevant genetic studies. usage intended negate personal gender identity individual. recognize importance using language methodologies affirm respect gender identities. function focuses chromosomal information necessary constructing genetic pedigrees, affirm gender spectrum, encompassing wide range identities beyond binary. developers package express unequivocal support folx transgender LGBTQ+ communities. respect complexity gender identity acknowledge distinction biological aspect sex used genetic analysis (genotype) broader, richer concept gender identity (phenotype).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"","code":"if (FALSE) { ped <- data.frame(ID = c(1, 2, 3), sex = c(\"M\", \"F\", \"M\")) checkSex(ped, code_male = \"M\", verbose = TRUE, repair = FALSE) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":null,"dir":"Reference","previous_headings":"","what":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"comp2vech Turn variance component relatedness matrix half-vectorization","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"","code":"comp2vech(x, include.zeros = FALSE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"x Relatedness component matrix (can matrix, list, object inherits 'Matrix'). include.zeros logical. Whether include -zero rows. Default FALSE.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"half-vectorization relatedness component matrix.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"function wrapper around vech function, extending allow blockwise matrices specific classes. facilitates conversion variance component relatedness matrix half-vectorized form.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"","code":"comp2vech(list(matrix(c(1, .5, .5, 1), 2, 2), matrix(1, 2, 2))) #> [1] 1.0 0.5 1.0 1.0 1.0 1.0"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/createGenDataFrame.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Data Frame for Generation — createGenDataFrame","title":"Create Data Frame for Generation — createGenDataFrame","text":"function creates data frame specific generation within simulated pedigree. initializes data frame default values family ID, individual ID, generation number, paternal ID, maternal ID, spouse ID, sex. individuals initially set NA paternal, maternal, spouse IDs, sex, awaiting assignment.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/createGenDataFrame.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Data Frame for Generation — createGenDataFrame","text":"","code":"createGenDataFrame(sizeGens, genIndex, idGen)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/createGenDataFrame.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Data Frame for Generation — createGenDataFrame","text":"sizeGens numeric vector containing sizes generation within pedigree. genIndex integer representing current generation index data frame created. idGen numeric vector containing ID numbers assigned individuals current generation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/createGenDataFrame.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Data Frame for Generation — createGenDataFrame","text":"data frame representing initial structure individuals specified generation relationships (parental, spousal) defined. columns include family ID (`fam`), individual ID (`id`), generation number (`gen`), father's ID (`pat`), mother's ID (`mat`), spouse's ID (`spt`), sex (`sex`), NA values paternal, maternal, spouse IDs, sex.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/createGenDataFrame.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Data Frame for Generation — createGenDataFrame","text":"","code":"sizeGens <- c(3, 5, 4) # Example sizes for 3 generations genIndex <- 2 # Creating data frame for the 2nd generation idGen <- 101:105 # Example IDs for the 2nd generation df_Ngen <- createGenDataFrame(sizeGens, genIndex, idGen) print(df_Ngen) #> fam id gen pat mat spt sex #> 1 fam 1 101 2 NA NA NA NA #> 2 fam 1 102 2 NA NA NA NA #> 3 fam 1 103 2 NA NA NA NA #> 4 fam 1 104 2 NA NA NA NA #> 5 fam 1 105 2 NA NA NA NA"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/determineSex.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine Sex of Offspring — determineSex","title":"Determine Sex of Offspring — determineSex","text":"function assigns sexes offspring generation based specified sex ratio.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/determineSex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine Sex of Offspring — determineSex","text":"","code":"determineSex(idGen, sexR)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/determineSex.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine Sex of Offspring — determineSex","text":"idGen Vector IDs generation. sexR Numeric value indicating sex ratio (proportion males).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/determineSex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine Sex of Offspring — determineSex","text":"Vector sexes (\"M\" male, \"F\" female) offspring.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/dropLink.html","id":null,"dir":"Reference","previous_headings":"","what":"dropLink A function to drop a person from his/her parents in the simulated pedigree data.frame. 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 simulatePedigree. — dropLink","title":"dropLink A function to drop a person from his/her parents in the simulated pedigree data.frame. 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 simulatePedigree. — dropLink","text":"dropLink function drop person /parents simulated pedigree data.frame. person can dropped specifying /ID specifying generation randomly --dropped person . function can separate one pedigree two pedigrees. Separating small pieces done running function multiple times. supplementary function simulatePedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/dropLink.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"dropLink A function to drop a person from his/her parents in the simulated pedigree data.frame. 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 simulatePedigree. — dropLink","text":"","code":"dropLink( ped, ID_drop = NA_integer_, gen_drop = 2, sex_drop = NA_character_, n_drop = 1 )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/dropLink.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"dropLink A function to drop a person from his/her parents in the simulated pedigree data.frame. 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 simulatePedigree. — dropLink","text":"ped pedigree simulated simulatePedigree function format ID_drop ID person dropped /parents. gen_drop generation randomly dropped person . work `ID_drop` specified. sex_drop biological sex randomly dropped person. n_drop number times mutation happens.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/dropLink.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"dropLink A function to drop a person from his/her parents in the simulated pedigree data.frame. 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 simulatePedigree. — dropLink","text":"pedigree dropped person's `dadID` `momID` set NA.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/efunc.html","id":null,"dir":"Reference","previous_headings":"","what":"Error Function — efunc","title":"Error Function — efunc","text":"Error Function","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/efunc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Error Function — efunc","text":"","code":"efunc(error)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/efunc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Error Function — efunc","text":"error error output","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/efunc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Error Function — efunc","text":"Replaces error message (error) NA","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/evenInsert.html","id":null,"dir":"Reference","previous_headings":"","what":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","title":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","text":"evenInsert function insert m elements evenly length n vector.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/evenInsert.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","text":"","code":"evenInsert(m, n, verbose = FALSE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/evenInsert.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","text":"m numeric vector length less equal n. elements inserted. n numeric vector. vector elements m inserted. verbose logical TRUE, prints additional information. Default FALSE.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/evenInsert.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","text":"Returns numeric vector elements m evenly inserted n.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/evenInsert.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","text":"function takes two vectors, m n, inserts elements m evenly n. length m greater length n, vectors swapped, insertion proceeds. resulting vector combination m n, elements m evenly distributed within n.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/famSizeCal.html","id":null,"dir":"Reference","previous_headings":"","what":"famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function simulatePedigree — famSizeCal","title":"famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function simulatePedigree — famSizeCal","text":"famSizeCal function calculate total number individuals pedigree given parameters. supporting function function simulatePedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/famSizeCal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function simulatePedigree — famSizeCal","text":"","code":"famSizeCal(kpc, Ngen, marR)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/famSizeCal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function simulatePedigree — famSizeCal","text":"kpc Number kids per couple (integer >= 2). Ngen Number generations (integer >= 1). marR Mating rate (numeric value ranging 0 1).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/famSizeCal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function simulatePedigree — famSizeCal","text":"Returns numeric value indicating total pedigree size.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":null,"dir":"Reference","previous_headings":"","what":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"fitComponentModel Fit estimated variance components model covariance data","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"","code":"fitComponentModel(covmat, ...)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"covmat covariance matrix raw data, may blockwise. ... Comma-separated relatedness component matrices representing variance components model.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"regression (linear model fitted lm). coefficients regression represent estimated variance components.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"function fits estimated variance components model given covariance data. rank component matrices checked ensure variance components identified. Warnings issued inconsistencies.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"","code":"if (FALSE) { # install.packages(\"OpenMX\") data(twinData, package = \"OpenMx\") sellVars <- c(\"ht1\", \"ht2\") mzData <- subset(twinData, zyg %in% c(1), c(selVars, \"zyg\")) dzData <- subset(twinData, zyg %in% c(3), c(selVars, \"zyg\")) fitComponentModel( covmat = list(cov(mzData[, selVars], use = \"pair\"), cov(dzData[, selVars], use = \"pair\")), A = list(matrix(1, nrow = 2, ncol = 2), matrix(c(1, 0.5, 0.5, 1), nrow = 2, ncol = 2)), C = list(matrix(1, nrow = 2, ncol = 2), matrix(1, nrow = 2, ncol = 2)), E = list(diag(1, nrow = 2), diag(1, nrow = 2)) ) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/hazard.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulated pedigree with two extended families and an age-related hazard — hazard","title":"Simulated pedigree with two extended families and an age-related hazard — hazard","text":"dataset simulated age-related hazard. two extended families sampled population.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/hazard.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulated pedigree with two extended families and an age-related hazard — hazard","text":"","code":"data(hazard)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/hazard.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simulated pedigree with two extended families and an age-related hazard — hazard","text":"data frame 43 rows 14 variables","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/hazard.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simulated pedigree with two extended families and an age-related hazard — hazard","text":"variables follows: FamID: ID extended family ID: Person identification variable sex: Sex ID: 1 female; 0 male dadID: ID father momID: ID mother affected: logical. Whether person affected DA1: Binary variable signifying meaninglessness life DA2: Binary variable signifying fundamental unknowability existence birthYr: Birth year person onsetYr: Year onset person deathYr: Death year person available: logical. Whether Gen: Generation person proband: logical. Whether person proband ","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":null,"dir":"Reference","previous_headings":"","what":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"identifyComponentModel Determine variance components model identified","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"","code":"identifyComponentModel(..., verbose = TRUE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"... Comma-separated relatedness component matrices representing variance components model. verbose logical. FALSE, suppresses messages identification; TRUE default.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"list length 2 containing: identified: TRUE model identified, FALSE otherwise. nidp: vector non-identified parameters, specifying names components simultaneously identified.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"function checks identification status given variance components model examining rank concatenated matrices components. components identified, names returned output.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"","code":"identifyComponentModel(A = list(matrix(1, 2, 2)), C = list(matrix(1, 2, 2)), E = diag(1, 2)) #> Component model is not identified. #> Non-identified parameters are A, C #> $identified #> [1] FALSE #> #> $nidp #> [1] \"A\" \"C\" #>"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inbreeding.html","id":null,"dir":"Reference","previous_headings":"","what":"Artificial pedigree data on eight families with inbreeding — inbreeding","title":"Artificial pedigree data on eight families with inbreeding — inbreeding","text":"dataset created purely imagination includes several types inbreeding. Different kinds inbreeding occur extended family.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inbreeding.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Artificial pedigree data on eight families with inbreeding — inbreeding","text":"","code":"data(inbreeding)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inbreeding.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Artificial pedigree data on eight families with inbreeding — inbreeding","text":"data frame (ped object) 134 rows 7 variables","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inbreeding.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Artificial pedigree data on eight families with inbreeding — inbreeding","text":"types inbreeding follows: Extended Family 1: Sister wives - Children father different mothers sisters. Extended Family 2: Full siblings children. Extended Family 3: Half siblings children. Extended Family 4: First cousins children. Extended Family 5: Father child daughter. Extended Family 6: Half sister wives - Children father different mothers half sisters. Extended Family 7: Uncle-niece Aunt-nephew children. Extended Family 8: father-son pairs children corresponding mother-daughter pair. Although structures technically inbreeding, aim test pedigree diagramming path tracing algorithms. variables follows: ID: Person identification variable sex: Sex ID: 1 female; 0 male dadID: ID father momID: ID mother FamID: ID extended family Gen: Generation person proband: Always FALSE","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":null,"dir":"Reference","previous_headings":"","what":"Infer Relatedness Coefficient — inferRelatedness","title":"Infer Relatedness Coefficient — inferRelatedness","text":"function infers relatedness coefficient two groups based observed correlation additive genetic variance shared environmental variance.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Infer Relatedness Coefficient — inferRelatedness","text":"","code":"inferRelatedness(obsR, aceA = 0.9, aceC = 0, sharedC = 0)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Infer Relatedness Coefficient — inferRelatedness","text":"obsR Numeric. Observed correlation two groups. Must -1 1. aceA Numeric. Proportion variance attributable additive genetic variance. Must 0 1. Default 0.9. aceC Numeric. Proportion variance attributable shared environmental variance. Must 0 1. Default 0. sharedC Numeric. Proportion shared environment shared two individuals. Must 0 1. Default 0.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Infer Relatedness Coefficient — inferRelatedness","text":"Numeric. calculated relatedness coefficient (`est_r`).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Infer Relatedness Coefficient — inferRelatedness","text":"function uses ACE (Additive genetic, Common environmental, Unique environmental) model infer relatedness two individuals groups. considering observed correlation (`obsR`), proportion variance attributable additive genetic variance (`aceA`), proportion shared environmental variance (`aceC`), calculates relatedness coefficient.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Infer Relatedness Coefficient — inferRelatedness","text":"","code":"if (FALSE) { # Infer the relatedness coefficient: inferRelatedness(obsR = 0.5, aceA = 0.9, aceC = 0, sharedC = 0) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeInbreeding.html","id":null,"dir":"Reference","previous_headings":"","what":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","title":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","text":"makeInbreeding function create inbred mates simulated pedigree data.frame. Inbred mates can created specifying IDs generation inbred mate created. specifying generation, inbreeding siblings 1st cousin needs specified. supplementary function simulatePedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeInbreeding.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","text":"","code":"makeInbreeding( ped, ID_mate1 = NA_integer_, ID_mate2 = NA_integer_, verbose = FALSE, gen_inbred = 2, type_inbred = \"sib\" )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeInbreeding.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","text":"ped data.frame format output simulatePedigree. ID_mate1 vector ID first mate. provided, function randomly select two individuals second generation. ID_mate2 vector ID second mate. verbose logical. TRUE, print progress stages algorithm gen_inbred vector generation twin imputed. type_inbred character vector indicating type inbreeding. \"sib\" sibling inbreeding \"cousin\" cousin inbreeding.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeInbreeding.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","text":"Returns data.frame inbred mates.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeInbreeding.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","text":"function creates inbred mates simulated pedigree data.frame. function's purpose evaluate effect inbreeding model fitting parameter estimation. case needs said, condone inbreeding real life. recognize common practice fields create inbred strains research purposes.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeTwins.html","id":null,"dir":"Reference","previous_headings":"","what":"makeTwins A function to impute twins in the simulated pedigree data.frame. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for simulatePedigree. — makeTwins","title":"makeTwins A function to impute twins in the simulated pedigree data.frame. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for simulatePedigree. — makeTwins","text":"makeTwins function impute twins simulated pedigree data.frame. Twins can imputed specifying IDs specifying generation twin imputed. supplementary function simulatePedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeTwins.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"makeTwins A function to impute twins in the simulated pedigree data.frame. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for simulatePedigree. — makeTwins","text":"","code":"makeTwins( ped, ID_twin1 = NA_integer_, ID_twin2 = NA_integer_, gen_twin = 2, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeTwins.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"makeTwins A function to impute twins in the simulated pedigree data.frame. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for simulatePedigree. — makeTwins","text":"ped data.frame format output simulatePedigree. ID_twin1 vector ID first twin. ID_twin2 vector ID second twin. gen_twin vector generation twin imputed. verbose logical. TRUE, print progress stages algorithm","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeTwins.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"makeTwins A function to impute twins in the simulated pedigree data.frame. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for simulatePedigree. — makeTwins","text":"Returns data.frame MZ twins information added new column.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/markPotentialChildren.html","id":null,"dir":"Reference","previous_headings":"","what":"Mark and Assign children — markPotentialChildren","title":"Mark and Assign children — markPotentialChildren","text":"subfunction marks individuals generation potential sons, daughters, parents based relationships assigns unique couple IDs. processes assignment roles relationships within generations pedigree simulation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/markPotentialChildren.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mark and Assign children — markPotentialChildren","text":"","code":"markPotentialChildren(df_Ngen, i, Ngen, sizeGens, CoupleF)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/markPotentialChildren.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mark and Assign children — markPotentialChildren","text":"df_Ngen data frame current generation processed. must include columns individual IDs (`id`), spouse IDs (`spt`), sex (`sex`), previously assigned roles (`ifparent`, `ifson`, `ifdau`). Integer, index current generation processed. Ngen Integer, total number generations simulation. sizeGens Numeric vector, containing size (number individuals) generation. CoupleF Integer, MIGHT number couples current generation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/markPotentialChildren.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Mark and Assign children — markPotentialChildren","text":"Modifies `df_Ngen` place updating adding columns related individual roles (`ifparent`, `ifson`, `ifdau`) couple IDs (`coupleId`). updated data frame also returned integration larger pedigree data frame (`df_Fam`).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/nullToNA.html","id":null,"dir":"Reference","previous_headings":"","what":"nullToNA — nullToNA","title":"nullToNA — nullToNA","text":"nullToNA","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/nullToNA.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"nullToNA — nullToNA","text":"","code":"nullToNA(x)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/nullToNA.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"nullToNA — nullToNA","text":"x vector length","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/nullToNA.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"nullToNA — nullToNA","text":"replaces null values vector NA","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2add.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a pedigree and turn it into an additive genetics relatedness matrix — ped2add","title":"Take a pedigree and turn it into an additive genetics relatedness matrix — ped2add","text":"Take pedigree turn additive genetics relatedness matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2add.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a pedigree and turn it into an additive genetics relatedness matrix — ped2add","text":"","code":"ped2add( ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2add.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a pedigree and turn it into an additive genetics relatedness matrix — ped2add","text":"ped pedigree dataset. Needs ID, momID, dadID columns max.gen maximum number generations compute (e.g., 4th degree relatives). default 25. However can set infinity. `Inf` uses many generations data. sparse logical. TRUE, use return sparse matrices Matrix package verbose logical. TRUE, print progress stages algorithm gc logical. TRUE, frequent garbage collection via gc save memory flatten.diag logical. TRUE, overwrite diagonal final relatedness matrix ones standardize.colnames logical. TRUE, standardize column names pedigree dataset tcross.alt.crossprod logical. TRUE, use alternative method using Crossprod function computing transpose tcross.alt.star logical. TRUE, use alternative method using %\\*% computing transpose","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2add.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a pedigree and turn it into an additive genetics relatedness matrix — ped2add","text":"algorithms methodologies used function discussed exemplified vignette titled \"examplePedigreeFunctions\". advanced scenarios detailed explanations, consult vignette.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2ce.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a pedigree and turn it into an extended environmental relatedness matrix — ped2ce","title":"Take a pedigree and turn it into an extended environmental relatedness matrix — ped2ce","text":"Take pedigree turn extended environmental relatedness matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2ce.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a pedigree and turn it into an extended environmental relatedness matrix — ped2ce","text":"","code":"ped2ce(ped)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2ce.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a pedigree and turn it into an extended environmental relatedness matrix — ped2ce","text":"ped pedigree dataset. Needs ID, momID, dadID columns","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2ce.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a pedigree and turn it into an extended environmental relatedness matrix — ped2ce","text":"algorithms methodologies used function discussed exemplified vignette titled \"examplePedigreeFunctions\". advanced scenarios detailed explanations, consult vignette.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2cn.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a pedigree and turn it into a common nuclear environmental relatedness matrix — ped2cn","title":"Take a pedigree and turn it into a common nuclear environmental relatedness matrix — ped2cn","text":"Take pedigree turn common nuclear environmental relatedness matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2cn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a pedigree and turn it into a common nuclear environmental relatedness matrix — ped2cn","text":"","code":"ped2cn( ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2cn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a pedigree and turn it into a common nuclear environmental relatedness matrix — ped2cn","text":"ped pedigree dataset. Needs ID, momID, dadID columns max.gen maximum number generations compute (e.g., 4th degree relatives). default 25. However can set infinity. `Inf` uses many generations data. sparse logical. TRUE, use return sparse matrices Matrix package verbose logical. TRUE, print progress stages algorithm gc logical. TRUE, frequent garbage collection via gc save memory flatten.diag logical. TRUE, overwrite diagonal final relatedness matrix ones standardize.colnames logical. TRUE, standardize column names pedigree dataset tcross.alt.crossprod logical. TRUE, use alternative method using Crossprod function computing transpose tcross.alt.star logical. TRUE, use alternative method using %\\*% computing transpose","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2cn.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a pedigree and turn it into a common nuclear environmental relatedness matrix — ped2cn","text":"algorithms methodologies used function discussed exemplified vignette titled \"examplePedigreeFunctions\". advanced scenarios detailed explanations, consult vignette.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2com.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a pedigree and turn it into a relatedness matrix — ped2com","title":"Take a pedigree and turn it into a relatedness matrix — ped2com","text":"Take pedigree turn relatedness matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2com.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a pedigree and turn it into a relatedness matrix — ped2com","text":"","code":"ped2com( ped, component, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE, ... )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2com.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a pedigree and turn it into a relatedness matrix — ped2com","text":"ped pedigree dataset. Needs ID, momID, dadID columns component character. component pedigree return. See Details. max.gen maximum number generations compute (e.g., 4th degree relatives). default 25. However can set infinity. `Inf` uses many generations data. sparse logical. TRUE, use return sparse matrices Matrix package verbose logical. TRUE, print progress stages algorithm gc logical. TRUE, frequent garbage collection via gc save memory flatten.diag logical. TRUE, overwrite diagonal final relatedness matrix ones standardize.colnames logical. TRUE, standardize column names pedigree dataset tcross.alt.crossprod logical. TRUE, use alternative method using Crossprod function computing transpose tcross.alt.star logical. TRUE, use alternative method using %\\*% computing transpose ... additional arguments passed ped2com","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2com.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a pedigree and turn it into a relatedness matrix — ped2com","text":"algorithms methodologies used function discussed exemplified vignette titled \"examplePedigreeFunctions\". advanced scenarios detailed explanations, consult vignette.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2fam.html","id":null,"dir":"Reference","previous_headings":"","what":"Segment Pedigree into Extended Families — ped2fam","title":"Segment Pedigree into Extended Families — ped2fam","text":"function adds extended family ID variable pedigree segmenting dataset independent extended families using weakly connected components algorithm.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2fam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Segment Pedigree into Extended Families — ped2fam","text":"","code":"ped2fam( ped, personID = \"ID\", momID = \"momID\", dadID = \"dadID\", famID = \"famID\" )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2fam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Segment Pedigree into Extended Families — ped2fam","text":"ped pedigree dataset. Needs ID, momID, dadID columns personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable famID character. Name column created ped family ID variable","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2fam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Segment Pedigree into Extended Families — ped2fam","text":"pedigree dataset one additional column newly created extended family ID","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2fam.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Segment Pedigree into Extended Families — ped2fam","text":"general idea function use person ID, mother ID, father ID create extended family ID everyone family ID (perhaps extended) pedigree. , pair people family ID least one traceable relation length one another. function works turning pedigree mathematical graph using igraph package. graph form, function uses weakly connected components search possible relationship paths connect anyone data anyone else data.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2graph.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn a pedigree into a graph — ped2graph","title":"Turn a pedigree into a graph — ped2graph","text":"Turn pedigree graph","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn a pedigree into a graph — ped2graph","text":"","code":"ped2graph( ped, personID = \"ID\", momID = \"momID\", dadID = \"dadID\", directed = TRUE, adjacent = c(\"parents\", \"mothers\", \"fathers\") )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Turn a pedigree into a graph — ped2graph","text":"ped pedigree dataset. Needs ID, momID, dadID columns personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable directed Logical scalar. Default TRUE. Indicates whether create directed graph. adjacent Character. Relationship defines adjacency graph: parents, mothers, fathers","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Turn a pedigree into a graph — ped2graph","text":"graph","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2graph.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Turn a pedigree into a graph — ped2graph","text":"general idea function represent pedigree graph using igraph package. graph form, several common pedigree tasks become much simpler. adjacent argument allows different kinds graph structures. using parents adjacency, graph shows parent-child relationships. using mother adjacency, graph shows mother-child relationships. Similarly using father adjacency, father-child relationships appear graph. Construct extended families parent graph, maternal lines mothers graph, paternal lines fathers graph.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2maternal.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a maternal line ID variable to a pedigree — ped2maternal","title":"Add a maternal line ID variable to a pedigree — ped2maternal","text":"Add maternal line ID variable pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2maternal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a maternal line ID variable to a pedigree — ped2maternal","text":"","code":"ped2maternal( ped, personID = \"ID\", momID = \"momID\", dadID = \"dadID\", matID = \"matID\" )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2maternal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a maternal line ID variable to a pedigree — ped2maternal","text":"ped pedigree dataset. Needs ID, momID, dadID columns personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable matID Character. Maternal line ID variable created added pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2maternal.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a maternal line ID variable to a pedigree — ped2maternal","text":"various scenarios useful know people pedigree belong maternal lines. function first turns pedigree graph adjacency defined mother-child relationships. Subsequently, weakly connected components algorithm finds separate maternal lines gives ID variable.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2mit.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a pedigree and turn it into a mitochondrial relatedness matrix — ped2mit","title":"Take a pedigree and turn it into a mitochondrial relatedness matrix — ped2mit","text":"Take pedigree turn mitochondrial relatedness matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2mit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a pedigree and turn it into a mitochondrial relatedness matrix — ped2mit","text":"","code":"ped2mit( ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2mit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a pedigree and turn it into a mitochondrial relatedness matrix — ped2mit","text":"ped pedigree dataset. Needs ID, momID, dadID columns max.gen maximum number generations compute (e.g., 4th degree relatives). default 25. However can set infinity. `Inf` uses many generations data. sparse logical. TRUE, use return sparse matrices Matrix package verbose logical. TRUE, print progress stages algorithm gc logical. TRUE, frequent garbage collection via gc save memory flatten.diag logical. TRUE, overwrite diagonal final relatedness matrix ones standardize.colnames logical. TRUE, standardize column names pedigree dataset tcross.alt.crossprod logical. TRUE, use alternative method using Crossprod function computing transpose tcross.alt.star logical. TRUE, use alternative method using %\\*% computing transpose","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2mit.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a pedigree and turn it into a mitochondrial relatedness matrix — ped2mit","text":"algorithms methodologies used function discussed exemplified vignette titled \"examplePedigreeFunctions\". advanced scenarios detailed explanations, consult vignette.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2paternal.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a paternal line ID variable to a pedigree — ped2paternal","title":"Add a paternal line ID variable to a pedigree — ped2paternal","text":"Add paternal line ID variable pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2paternal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a paternal line ID variable to a pedigree — ped2paternal","text":"","code":"ped2paternal( ped, personID = \"ID\", momID = \"momID\", dadID = \"dadID\", patID = \"patID\" )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2paternal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a paternal line ID variable to a pedigree — ped2paternal","text":"ped pedigree dataset. Needs ID, momID, dadID columns personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable patID Character. Paternal line ID variable created added pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2paternal.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a paternal line ID variable to a pedigree — ped2paternal","text":"various scenarios useful know people pedigree belong paternal lines. function first turns pedigree graph adjacency defined father-child relationships. Subsequently, weakly connected components algorithm finds separate paternal lines gives ID variable.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/plotPedigree.html","id":null,"dir":"Reference","previous_headings":"","what":"plotPedigree A wrapped function to plot simulated pedigree from function simulatePedigree. This function require the installation of package kinship2. — plotPedigree","title":"plotPedigree A wrapped function to plot simulated pedigree from function simulatePedigree. This function require the installation of package kinship2. — plotPedigree","text":"plotPedigree wrapped function plot simulated pedigree function simulatePedigree. function require installation package kinship2.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/plotPedigree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"plotPedigree A wrapped function to plot simulated pedigree from function simulatePedigree. This function require the installation of package kinship2. — plotPedigree","text":"","code":"plotPedigree( ped, code_male = NULL, verbose = FALSE, affected = NULL, cex = 0.5, col = 1, symbolsize = 1, branch = 0.6, packed = TRUE, align = c(1.5, 2), width = 8, density = c(-1, 35, 65, 20), mar = c(2.1, 1, 2.1, 1), angle = c(90, 65, 40, 0), keep.par = FALSE, pconnect = 0.5, ... )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/plotPedigree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"plotPedigree A wrapped function to plot simulated pedigree from function simulatePedigree. This function require the installation of package kinship2. — plotPedigree","text":"ped simulated pedigree data.frame function simulatePedigree. pedigree dataframe colnames dataframe simulated function simulatePedigree. code_male optional input allows indicate value sex variable codes male. recoded \"M\" (Male). NULL, recoding performed. verbose logical TRUE, prints additional information. Default FALSE. affected optional parameter can either string specifying column name indicates affected status numeric/logical vector length number rows 'ped'. NULL, affected status assigned. cex font size IDs individual plot. col color id. Default assigns color everyone. symbolsize controls symbolsize. Default=1. branch defines much angle used connect various levels nuclear families. packed default=T. T, uniform distance individuals given level. align parameters control extra effort spent trying align children underneath parents, without making pedigree wide. Set F speed plotting. width default=8. packed pedigree, minimum width allowed realignment pedigrees. density defines density used symbols. Takes 4 different values. mar margin parmeters, par function angle defines angle used symbols. Takes 4 different values. keep.par Default = F, allows user keep parameter settings plotting (useful adding extras plot) pconnect connecting parent children program try make connecting line close vertical possible, subject lying inside endpoints line connects children least pconnect people. Setting option large number force line connect midpoint children. ... Extra options feed plot function.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/plotPedigree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"plotPedigree A wrapped function to plot simulated pedigree from function simulatePedigree. This function require the installation of package kinship2. — plotPedigree","text":"plot provided pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/potter.html","id":null,"dir":"Reference","previous_headings":"","what":"Fictional pedigree data on a wizarding family — potter","title":"Fictional pedigree data on a wizarding family — potter","text":"dataset created purely imagination includes subset Potter extended family.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/potter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fictional pedigree data on a wizarding family — potter","text":"","code":"data(potter)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/potter.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Fictional pedigree data on a wizarding family — potter","text":"data frame (ped object) 36 rows 8 variables","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/potter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fictional pedigree data on a wizarding family — potter","text":"variables follows: personID: Person identification variable famID: Family identification variable name: Name person gen: Generation person momID: ID mother dadID: ID father spouseID: ID spouse sex: Sex ID: 1 male; 0 female IDs 100s momIDs dadIDs people dataset.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/recodeSex.html","id":null,"dir":"Reference","previous_headings":"","what":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","title":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","text":"function serves wrapper around `checkSex` specifically handle repair sex coding pedigree dataframe. sets `repair` flag TRUE automatically forwards additional parameters `checkSex`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/recodeSex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","text":"","code":"recodeSex( ped, verbose = FALSE, code_male = NULL, code_na = NULL, code_female = NULL, recode_male = \"M\", recode_female = \"F\", recode_na = NA_character_ )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/recodeSex.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","text":"ped dataframe representing pedigree data 'sex' column. verbose logical flag indicating whether print progress validation messages console. code_male current code used represent males 'sex' column. code_female current code used represent females 'sex' column. NULL, recoding performed.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/recodeSex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","text":"modified version input data.frame ped, containing additional modified 'sex_recode' column 'sex' values recoded according code_male. NA values 'sex' column preserved.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/recodeSex.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","text":"function uses terms 'male' 'female' biological context, based chromosomes biologically-based characteristics relevant genetic studies. usage intended negate personal gender identity individual. recognize importance using language methodologies affirm respect gender identities. function focuses chromosomal information necessary constructing genetic pedigrees, affirm gender spectrum, encompassing wide range identities beyond binary. developers package express unequivocal support folx transgender LGBTQ+ communities. respect complexity gender identity acknowledge distinction biological aspect sex used genetic analysis (genotype) broader, richer concept gender identity (phenotype).","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":null,"dir":"Reference","previous_headings":"","what":"related_coef (Deprecated) — related_coef","title":"related_coef (Deprecated) — related_coef","text":"calling function, warning issued deprecation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"related_coef (Deprecated) — related_coef","text":"","code":"related_coef(...)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"related_coef (Deprecated) — related_coef","text":"... Arguments passed `calculateRelatedness`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"related_coef (Deprecated) — related_coef","text":"result calling `calculateRelatedness`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"related_coef (Deprecated) — related_coef","text":"function wrapper around new `calculateRelatedness` function. `related_coef` deprecated, advised use `calculateRelatedness` directly.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"related_coef (Deprecated) — related_coef","text":"","code":"if (FALSE) { # This is an example of the deprecated function: related_coef(...) # It is recommended to use: calculateRelatedness(...) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":null,"dir":"Reference","previous_headings":"","what":"relatedness (Deprecated) — relatedness","title":"relatedness (Deprecated) — relatedness","text":"calling function, warning issued deprecation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"relatedness (Deprecated) — relatedness","text":"","code":"relatedness(...)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"relatedness (Deprecated) — relatedness","text":"... Arguments passed `inferRelatedness`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"relatedness (Deprecated) — relatedness","text":"result calling `inferRelatedness`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"relatedness (Deprecated) — relatedness","text":"function wrapper around new `inferRelatedness` function. `relatedness` deprecated, advised use `inferRelatedness` directly.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"relatedness (Deprecated) — relatedness","text":"","code":"if (FALSE) { # This is an example of the deprecated function: relatedness(...) # It is recommended to use: inferRelatedness(...) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairIDs.html","id":null,"dir":"Reference","previous_headings":"","what":"Repair Missing IDs — repairIDs","title":"Repair Missing IDs — repairIDs","text":"function repairs missing IDs pedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairIDs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Repair Missing IDs — repairIDs","text":"","code":"repairIDs(ped, verbose = FALSE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairIDs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Repair Missing IDs — repairIDs","text":"ped pedigree object verbose logical indicating whether print progress messages","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairIDs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Repair Missing IDs — repairIDs","text":"corrected pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":null,"dir":"Reference","previous_headings":"","what":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"function serves wrapper around `checkSex` specifically handle repair sex coding pedigree dataframe.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"","code":"repairSex(ped, verbose = FALSE, code_male = NULL)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"ped dataframe representing pedigree data 'sex' column. verbose logical flag indicating whether print progress validation messages console. code_male current code used represent males 'sex' column.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"modified version input data.frame ped, containing additional modified 'sex_recode' column 'sex' values recoded according code_male. NA values 'sex' column preserved.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"function uses terms 'male' 'female' biological context, based chromosomes biologically-based characteristics relevant genetic studies. usage intended negate personal gender identity individual. recognize importance using language methodologies affirm respect gender identities. function focuses chromosomal information necessary constructing genetic pedigrees, affirm gender spectrum, encompassing wide range identities beyond binary. developers package express unequivocal support folx transgender LGBTQ+ communities. respect complexity gender identity acknowledge distinction biological aspect sex used genetic analysis (genotype) broader, richer concept gender identity (phenotype).","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"","code":"if (FALSE) { ped <- data.frame(ID = c(1, 2, 3), sex = c(\"M\", \"F\", \"M\")) repairSex(ped, code_male = \"M\", verbose = TRUE) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/resample.html","id":null,"dir":"Reference","previous_headings":"","what":"Resample Elements of a Vector — resample","title":"Resample Elements of a Vector — resample","text":"function performs resampling elements vector `x`. randomly shuffles elements `x` returns vector resampled elements. `x` empty, returns `NA_integer_`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/resample.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Resample Elements of a Vector — resample","text":"","code":"resample(x, ...)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/resample.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Resample Elements of a Vector — resample","text":"x vector containing elements resampled. `x` empty, function return `NA_integer_`. ... Additional arguments passed `sample.int`, `size` number items sample `replace` indicating whether sampling replacement.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/resample.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Resample Elements of a Vector — resample","text":"vector resampled elements `x`. `x` empty, returns `NA_integer_`. length type returned vector depend input vector `x` additional arguments provided via `...`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/rmvn.html","id":null,"dir":"Reference","previous_headings":"","what":"rmvn — rmvn","title":"rmvn — rmvn","text":"rmvn","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/rmvn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rmvn — rmvn","text":"","code":"rmvn(n, sigma)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/rmvn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"rmvn — rmvn","text":"n Sample Size sigma Covariance matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/rmvn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"rmvn — rmvn","text":"Generates multivariate normal data covariance matrix (sigma) length n","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/simulatePedigree.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate Pedigrees This function simulates ","title":"Simulate Pedigrees This function simulates ","text":"Simulate Pedigrees function simulates \"balanced\" pedigrees based group parameters: 1) k - Kids per couple; 2) G - Number generations; 3) p - Proportion males offspring; 4) r - Mating rate.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/simulatePedigree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate Pedigrees This function simulates ","text":"","code":"simulatePedigree( kpc = 3, Ngen = 4, sexR = 0.5, marR = 2/3, rd_kpc = FALSE, balancedSex = TRUE, balancedMar = TRUE, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/simulatePedigree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate Pedigrees This function simulates ","text":"kpc Number kids per couple. integer >= 2 determines many kids fertilized mated couple pedigree. Default value 3. Returns error kpc equals 1. Ngen Number generations. integer >= 2 determines many generations simulated pedigree . first generation always fertilized couple. last generation mated individuals. sexR Sex ratio offspring. numeric value ranging 0 1 determines proportion males offspring pedigree. instance, 0.4 means 40 percent offspring male. marR Mating rate. numeric value ranging 0 1 determines proportion mated (fertilized) couples pedigree within generation. instance, marR = 0.5 suggests 50 percent offspring specific generation mated offspring. rd_kpc logical. TRUE, number kids per mate randomly generated poisson distribution mean kpc. FALSE, number kids per mate fixed kpc. balancedSex fully developed yet. Always TRUE current version. balancedMar fully developed yet. Always TRUE current version. verbose logical TRUE, print progress stages algorithm","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/simulatePedigree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate Pedigrees This function simulates ","text":"data.frame row representing simulated individual. columns follows: fam: family id simulated individual. 'fam1' single simulated pedigree. ID: unique personal ID simulated individual. first digit fam id; fourth digit generation individual ; following digits represent order individual within /pedigree. example, 100411 suggests individual family id 1, 4th generation, 11th individual 4th generation. gen: generation simulated individual . dadID: Personal ID individual's father. momID: Personal ID individual's mother. spt: Personal ID individual's mate. sex: Biological sex individual. F - female; M - male.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/sizeAllGens.html","id":null,"dir":"Reference","previous_headings":"","what":"sizeAllGens An internal supporting function for simulatePedigree. — sizeAllGens","title":"sizeAllGens An internal supporting function for simulatePedigree. — sizeAllGens","text":"sizeAllGens internal supporting function simulatePedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/sizeAllGens.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"sizeAllGens An internal supporting function for simulatePedigree. — sizeAllGens","text":"","code":"sizeAllGens(kpc, Ngen, marR)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/sizeAllGens.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"sizeAllGens An internal supporting function for simulatePedigree. — sizeAllGens","text":"kpc Number kids per couple (integer >= 2). Ngen Number generations (integer >= 1). marR Mating rate (numeric value ranging 0 1).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/sizeAllGens.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"sizeAllGens An internal supporting function for simulatePedigree. — sizeAllGens","text":"Returns vector including number individuals every generation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/standardizeColnames.html","id":null,"dir":"Reference","previous_headings":"","what":"Standardize Column Names in a Dataframe (Internal) — standardizeColnames","title":"Standardize Column Names in a Dataframe (Internal) — standardizeColnames","text":"internal function standardizes column names given dataframe. utilizes regular expressions `tolower()` function match column names list predefined standard names. approach case-insensitive allows flexible matching column names.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/standardizeColnames.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Standardize Column Names in a Dataframe (Internal) — standardizeColnames","text":"","code":"standardizeColnames(df, verbose = FALSE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/standardizeColnames.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Standardize Column Names in a Dataframe (Internal) — standardizeColnames","text":"df dataframe whose column names need standardized. verbose logical indicating whether print progress messages.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/standardizeColnames.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Standardize Column Names in a Dataframe (Internal) — standardizeColnames","text":"dataframe standardized column names.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeFamilies.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the families in a pedigree — summarizeFamilies","title":"Summarize the families in a pedigree — summarizeFamilies","text":"Summarize families pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeFamilies.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the families in a pedigree — summarizeFamilies","text":"","code":"summarizeFamilies( ped, famID = \"famID\", personID = \"ID\", momID = \"momID\", dadID = \"dadID\", matID = \"matID\", patID = \"patID\", byr = NULL, founder_sort_var = NULL, include_founder = FALSE, nbiggest = 5, noldest = 5, skip_var = NULL, five_num_summary = FALSE, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeFamilies.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the families in a pedigree — summarizeFamilies","text":"ped pedigree dataset. Needs ID, momID, dadID columns famID character. Name column created ped family ID variable personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable matID Character. Maternal line ID variable created added pedigree patID Character. Paternal line ID variable created added pedigree byr Optional column name birth year. founder_sort_var variable sort founders . NULL, founders sorted birth year (`byr`) present `personID` otherwise. include_founder Logical, TRUE, include founder line summary statistics. nbiggest number biggest lines return. noldest number oldest lines return. skip_var character vector variables skip calculating summary statistics. five_num_summary Logical, TRUE, include 5-number summary (min, Q1, median, Q3, max) summary statistics. verbose Logical, TRUE, print progress messages.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeMatrilines.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the maternal lines in a pedigree — summarizeMatrilines","title":"Summarize the maternal lines in a pedigree — summarizeMatrilines","text":"Summarize maternal lines pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeMatrilines.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the maternal lines in a pedigree — summarizeMatrilines","text":"","code":"summarizeMatrilines( ped, famID = \"famID\", personID = \"ID\", momID = \"momID\", dadID = \"dadID\", matID = \"matID\", patID = \"patID\", byr = NULL, include_founder = FALSE, founder_sort_var = NULL, nbiggest = 5, noldest = 5, skip_var = NULL, five_num_summary = FALSE, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeMatrilines.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the maternal lines in a pedigree — summarizeMatrilines","text":"ped pedigree dataset. Needs ID, momID, dadID columns famID character. Name column created ped family ID variable personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable matID Character. Maternal line ID variable created added pedigree patID Character. Paternal line ID variable created added pedigree byr Optional column name birth year. include_founder Logical, TRUE, include founder line summary statistics. founder_sort_var variable sort founders . NULL, founders sorted birth year (`byr`) present `personID` otherwise. nbiggest number biggest lines return. noldest number oldest lines return. skip_var character vector variables skip calculating summary statistics. five_num_summary Logical, TRUE, include 5-number summary (min, Q1, median, Q3, max) summary statistics. verbose Logical, TRUE, print progress messages.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePatrilines.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the paternal lines in a pedigree — summarizePatrilines","title":"Summarize the paternal lines in a pedigree — summarizePatrilines","text":"Summarize paternal lines pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePatrilines.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the paternal lines in a pedigree — summarizePatrilines","text":"","code":"summarizePatrilines( ped, famID = \"famID\", personID = \"ID\", momID = \"momID\", dadID = \"dadID\", matID = \"matID\", patID = \"patID\", byr = NULL, founder_sort_var = NULL, include_founder = FALSE, nbiggest = 5, noldest = 5, skip_var = NULL, five_num_summary = FALSE, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePatrilines.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the paternal lines in a pedigree — summarizePatrilines","text":"ped pedigree dataset. Needs ID, momID, dadID columns famID character. Name column created ped family ID variable personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable matID Character. Maternal line ID variable created added pedigree patID Character. Paternal line ID variable created added pedigree byr Optional column name birth year. founder_sort_var variable sort founders . NULL, founders sorted birth year (`byr`) present `personID` otherwise. include_founder Logical, TRUE, include founder line summary statistics. nbiggest number biggest lines return. noldest number oldest lines return. skip_var character vector variables skip calculating summary statistics. five_num_summary Logical, TRUE, include 5-number summary (min, Q1, median, Q3, max) summary statistics. verbose Logical, TRUE, print progress messages.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePedigrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize Pedigree Data — summarizePedigrees","title":"Summarize Pedigree Data — summarizePedigrees","text":"function summarizes pedigree data, including calculating summary statistics numeric variables, finding originating member family, maternal, paternal line.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePedigrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize Pedigree Data — summarizePedigrees","text":"","code":"summarizePedigrees( ped, famID = \"famID\", personID = \"ID\", momID = \"momID\", dadID = \"dadID\", matID = \"matID\", patID = \"patID\", type = c(\"fathers\", \"mothers\", \"families\"), byr = NULL, include_founder = FALSE, founder_sort_var = NULL, nbiggest = 5, noldest = 5, skip_var = NULL, five_num_summary = FALSE, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePedigrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize Pedigree Data — summarizePedigrees","text":"ped pedigree dataset. Needs ID, momID, dadID columns famID character. Name column created ped family ID variable personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable matID Character. Maternal line ID variable created added pedigree patID Character. Paternal line ID variable created added pedigree type type summary statistics calculate. Options \"fathers\", \"mothers\", \"families\". byr Optional column name birth year. include_founder Logical, TRUE, include founder line summary statistics. founder_sort_var variable sort founders . NULL, founders sorted birth year (`byr`) present `personID` otherwise. nbiggest number biggest lines return. noldest number oldest lines return. skip_var character vector variables skip calculating summary statistics. five_num_summary Logical, TRUE, include 5-number summary (min, Q1, median, Q3, max) summary statistics. verbose Logical, TRUE, print progress messages.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePedigrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize Pedigree Data — summarizePedigrees","text":"data.frame (list) containing summary statistics family, maternal, paternal lines, well 5 oldest biggest lines.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/try_na.html","id":null,"dir":"Reference","previous_headings":"","what":"modified tryCatch function — try_na","title":"modified tryCatch function — try_na","text":"modified tryCatch function","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/try_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"modified tryCatch function — try_na","text":"","code":"try_na(x)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/try_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"modified tryCatch function — try_na","text":"x vector length","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/try_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"modified tryCatch function — try_na","text":"Fuses nullToNA function efunc","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":null,"dir":"Reference","previous_headings":"","what":"vech Create the half-vectorization of a matrix — vech","title":"vech Create the half-vectorization of a matrix — vech","text":"vech Create half-vectorization matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"vech Create the half-vectorization of a matrix — vech","text":"","code":"vech(x)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"vech Create the half-vectorization of a matrix — vech","text":"x matrix, half-vectorization desired","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"vech Create the half-vectorization of a matrix — vech","text":"vector containing lower triangle matrix, including diagonal.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"vech Create the half-vectorization of a matrix — vech","text":"function returns vectorized form lower triangle matrix, including diagonal. upper triangle ignored checking provided matrix symmetric.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"vech Create the half-vectorization of a matrix — vech","text":"","code":"vech(matrix(c(1, 0.5, 0.5, 1), nrow = 2, ncol = 2)) #> [1] 1.0 0.5 1.0"},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-1301","dir":"Changelog","previous_headings":"","what":"BGmisc 1.3.0.1","title":"BGmisc 1.3.0.1","text":"Created subfunctions reduce function complexity","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-130","dir":"Changelog","previous_headings":"","what":"BGmisc 1.3.0","title":"BGmisc 1.3.0","text":"Fixed incorrectly spelled last name potter pedigree Added function summarize variables family, matrilinael, patrilineal lines Added within row duplicate ID checks Added data validation vignettes Harmonized function names arguments","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-121","dir":"Changelog","previous_headings":"","what":"BGmisc 1.2.1","title":"BGmisc 1.2.1","text":"Added alternative transpose options matrix Added generalization Falconer’s formula","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-120","dir":"Changelog","previous_headings":"","what":"BGmisc 1.2.0","title":"BGmisc 1.2.0","text":"CRAN release: 2024-02-26 Added numerous code checks, increased code coverage 85% Replaced sapply usage Added additional data validation checks Accompanying paper published Journal Open Source Software","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-110","dir":"Changelog","previous_headings":"","what":"BGmisc 1.1.0","title":"BGmisc 1.1.0","text":"Added ability simulate twins Can now trace paternal maternal lines ’s now Harry Potter pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-101","dir":"Changelog","previous_headings":"","what":"BGmisc 1.0.1","title":"BGmisc 1.0.1","text":"CRAN release: 2023-09-26 Hot fix resolve plotPedigree wrapper function breaking pedigrees contained multiple families","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-10","dir":"Changelog","previous_headings":"","what":"BGmisc 1.0","title":"BGmisc 1.0","text":"CRAN release: 2023-09-20 Added major update include simulations, plotting, examples.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-01","dir":"Changelog","previous_headings":"","what":"BGmisc 0.1","title":"BGmisc 0.1","text":"CRAN release: 2020-12-04 Added NEWS.md file track changes package. Initial version launched","code":""}] +[{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement garrissm@wfu.edu. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing Guidelines for BGmisc","title":"Contributing Guidelines for BGmisc","text":"Thank considering contributing BGmisc. document outlines process best practices contributing R package hosted GitHub R Computing Lab. ## Table Contents Code Conduct Getting Started Bug Reports Feature Requests Pull Requests Code Style Testing Documentation Communication","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing Guidelines for BGmisc","text":"contributors expected adhere project’s Code Conduct. Please read carefully contributing.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting Started","title":"Contributing Guidelines for BGmisc","text":"Fork BGmisc repository GitHub account. Clone forked repository local machine. Install required packages set development environment.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"bug-reports","dir":"","previous_headings":"","what":"Bug Reports","title":"Contributing Guidelines for BGmisc","text":"reporting bugs, please create issue GitHub repository. Make sure : Provide clear title description. Include minimal reproducible example. Tag issue “bug” label.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"feature-requests","dir":"","previous_headings":"","what":"Feature Requests","title":"Contributing Guidelines for BGmisc","text":"New features welcome. request new feature: Open issue GitHub repository. Clearly describe feature potential benefits. Tag issue “feature request” label.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"pull-requests","dir":"","previous_headings":"","what":"Pull Requests","title":"Contributing Guidelines for BGmisc","text":"Fork repository create new branch work. Commit changes logical chunks. Open pull request clear title description. Make sure existing tests pass. Add new tests changes.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"","what":"Code Style","title":"Contributing Guidelines for BGmisc","text":"Follow Tidyverse Style Guide R programming maintain code consistency.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"testing","dir":"","previous_headings":"","what":"Testing","title":"Contributing Guidelines for BGmisc","text":"Tests implemented using testthat package. Make sure add new tests added functionality. Run tests ensure pass submitting pull request.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"Contributing Guidelines for BGmisc","text":"Update README.Rmd relevant documentation. Use roxygen2 documenting functions. Include examples documentation possible.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/CONTRIBUTING.html","id":"communication","dir":"","previous_headings":"","what":"Communication","title":"Contributing Guidelines for BGmisc","text":"Use GitHub issues communication. direct communication, can contact maintainers. contributing, agree abide guidelines project’s Code Conduct. Thank contributing BGmisc!","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 3, 29 June 2007Copyright © 2007 Free Software Foundation, Inc.  Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"GNU General Public License free, copyleft license software kinds works. licenses software practical works designed take away freedom share change works. contrast, GNU General Public License intended guarantee freedom share change versions program–make sure remains free software users. , Free Software Foundation, use GNU General Public License software; applies also work released way authors. can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. protect rights, need prevent others denying rights asking surrender rights. Therefore, certain responsibilities distribute copies software, modify : responsibilities respect freedom others. example, distribute copies program, whether gratis fee, must pass recipients freedoms received. must make sure , , receive can get source code. must show terms know rights. Developers use GNU GPL protect rights two steps: (1) assert copyright software, (2) offer License giving legal permission copy, distribute /modify . developers’ authors’ protection, GPL clearly explains warranty free software. users’ authors’ sake, GPL requires modified versions marked changed, problems attributed erroneously authors previous versions. devices designed deny users access install run modified versions software inside , although manufacturer can . fundamentally incompatible aim protecting users’ freedom change software. systematic pattern abuse occurs area products individuals use, precisely unacceptable. Therefore, designed version GPL prohibit practice products. problems arise substantially domains, stand ready extend provision domains future versions GPL, needed protect freedom users. Finally, every program threatened constantly software patents. States allow patents restrict development use software general-purpose computers, , wish avoid special danger patents applied free program make effectively proprietary. prevent , GPL assures patents used render program non-free. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions","title":"GNU General Public License","text":"“License” refers version 3 GNU General Public License. “Copyright” also means copyright-like laws apply kinds works, semiconductor masks. “Program” refers copyrightable work licensed License. licensee addressed “”. “Licensees” “recipients” may individuals organizations. “modify” work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called “modified version” earlier work work “based ” earlier work. “covered work” means either unmodified Program work based Program. “propagate” work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. “convey” work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays “Appropriate Legal Notices” extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code","title":"GNU General Public License","text":"“source code” work means preferred form work making modifications . “Object code” means non-source form work. “Standard Interface” means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. “System Libraries” executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. “Major Component”, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . “Corresponding Source” work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions","title":"GNU General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law","title":"GNU General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies","title":"GNU General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions","title":"GNU General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: ) work must carry prominent notices stating modified , giving relevant date. b) work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 “keep intact notices”. c) must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . d) work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called “aggregate” compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms","title":"GNU General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: ) Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. b) Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. c) Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. d) Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. e) Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. “User Product” either (1) “consumer product”, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, “normally used” refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. “Installation Information” User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms","title":"GNU General Public License","text":"“Additional permissions” terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: ) Disclaiming warranty limiting liability differently terms sections 15 16 License; b) Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; c) Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; d) Limiting use publicity purposes names licensors authors material; e) Declining grant rights trademark law use trade names, trademarks, service marks; f) Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered “restrictions” within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination","title":"GNU General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies","title":"GNU General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients","title":"GNU General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. “entity transaction” transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents","title":"GNU General Public License","text":"“contributor” copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s “contributor version”. contributor’s “essential patent claims” patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, “control” includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, “patent license” express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). “grant” patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. “Knowingly relying” means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license “discriminatory” include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom","title":"GNU General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_13-use-with-the-gnu-affero-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Use with the GNU Affero General Public License","title":"GNU General Public License","text":"Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU Affero General Public License single combined work, convey resulting work. terms License continue apply part covered work, special requirements GNU Affero General Public License, section 13, concerning interaction network apply combination .","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License","title":"GNU General Public License","text":"Free Software Foundation may publish revised /new versions GNU General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU General Public License “later version” applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty","title":"GNU General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability","title":"GNU General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16","title":"GNU General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/LICENSE.html","id":"how-to-apply-these-terms-to-your-new-programs","dir":"","previous_headings":"","what":"How to Apply These Terms to Your New Programs","title":"GNU General Public License","text":"develop new program, want greatest possible use public, best way achieve make free software everyone can redistribute change terms. , attach following notices program. safest attach start source file effectively state exclusion warranty; file least “copyright” line pointer full notice found. Also add information contact electronic paper mail. program terminal interaction, make output short notice like starts interactive mode: hypothetical commands show w show c show appropriate parts General Public License. course, program’s commands might different; GUI interface, use “box”. also get employer (work programmer) school, , sign “copyright disclaimer” program, necessary. information , apply follow GNU GPL, see . GNU General Public License permit incorporating program proprietary programs. program subroutine library, may consider useful permit linking proprietary applications library. want , use GNU Lesser General Public License instead License. first, please read .","code":" Copyright (C) 2020 Jonathan D. Trattner This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . BGmisc Copyright (C) 2020 Jonathan D. Trattner This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details."},{"path":"https://r-computing-lab.github.io/BGmisc/articles/analyticrelatedness.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Calculating and Inferring Relatedness Coefficients with BGmisc","text":"vignette demonstrates analytic methods determining relatedness pedigree. relatedness coefficient measure genetic overlap two individuals. simplest terms, quantifies genetic overlap two individuals. relatedness coefficient ranges 0 1, 1 indicating perfect genetic match (occurs comparing individual , identical twin, clone), whereas 0 indicates genetic overlap. introduce two functions: calculateRelatedness inferRelatedness, allow users compute infer relatedness coefficient, respectively.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/analyticrelatedness.html","id":"loading-required-libraries","dir":"Articles","previous_headings":"Introduction","what":"Loading Required Libraries","title":"Calculating and Inferring Relatedness Coefficients with BGmisc","text":"","code":"library(BGmisc)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/analyticrelatedness.html","id":"calculating-relatedness-coefficient","dir":"Articles","previous_headings":"Introduction","what":"Calculating Relatedness Coefficient","title":"Calculating and Inferring Relatedness Coefficients with BGmisc","text":"calculateRelatedness function offers method compute relatedness coefficient based shared ancestry, described Wright (1922). function utilizes formula: \\[ r_{bc} = \\sum \\left(\\frac{1}{2}\\right)^{n+n'+1} (1+f_a) \\] \\(n\\) \\(n'\\) represent number generations back common ancestors pair share.","code":"# Example usage: # For full siblings, the relatedness coefficient is expected to be 0.5: calculateRelatedness(generations = 1, full = TRUE) #> [1] 0.5 # For half siblings, the relatedness coefficient is expected to be 0.25: calculateRelatedness(generations = 1, full = FALSE) #> [1] 0.25"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/analyticrelatedness.html","id":"inferring-relatedness-coefficient","dir":"Articles","previous_headings":"","what":"Inferring Relatedness Coefficient","title":"Calculating and Inferring Relatedness Coefficients with BGmisc","text":"inferRelatedness function designed infer relatedness coefficient two groups based observed correlation additive genetic variance shared environmental variance. function leverages ACE framework.","code":"# Example usage: # Infer the relatedness coefficient: inferRelatedness(obsR = 0.5, aceA = 0.9, aceC = 0, sharedC = 0) #> [1] 0.5555556"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/modelingrelatedness.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Modeling and Relatedness","text":"vignette provides detailed guide specific functions within BGmisc package aid identification fitting variance component models common behavior genetics. explore key functions identifyComponentModel, providing practical examples theoretical background. Identification ensures unique set parameters define model-implied covariance matrix, preventing free parameters trading one another.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/modelingrelatedness.html","id":"loading-required-libraries","dir":"Articles","previous_headings":"Introduction","what":"Loading Required Libraries","title":"Modeling and Relatedness","text":"Ensure BGmisc package installed loaded. Ensure following dependencies installed proceeding provide us behavior genetic data models: EasyMx OpenMx Note: libraries installed, can install using install.packages(“package_name”).","code":"library(BGmisc) library(EasyMx) library(OpenMx)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/modelingrelatedness.html","id":"working-with-variance-component-models","dir":"Articles","previous_headings":"","what":"Working with Variance Component Models","title":"Modeling and Relatedness","text":"section, demonstrate core functions related identification fitting variance component models.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/modelingrelatedness.html","id":"using-comp2vech-function","dir":"Articles","previous_headings":"Working with Variance Component Models","what":"Using comp2vech Function","title":"Modeling and Relatedness","text":"comp2vech function used vectorize components model. function often used conjunction identification process. example, apply list matrices: result showcases matrices transformed, reflecting role subsequent variance component analysis.","code":"comp2vech(list( matrix(c(1, .5, .5, 1), 2, 2), matrix(1, 2, 2) )) #> [1] 1.0 0.5 1.0 1.0 1.0 1.0"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/modelingrelatedness.html","id":"using-identifycomponentmodel-function","dir":"Articles","previous_headings":"Working with Variance Component Models","what":"Using identifyComponentModel Function","title":"Modeling and Relatedness","text":"identifyComponentModel function helps determine variance components model identified. accepts relatedness component matrices returns information identified non-identified parameters. ’s example using classical twin model MZ twins: can see, model identified. need add additional group sufficient information. Let us add rest classical twin model, case DZ twins. can see model identified, now ’ve added another group. Let us confirm fitting model. First prepare data. Let us fit data MZ twins . can see model unsuccessful identified. add another group, model identified, model now fits.","code":"identifyComponentModel( A = list(matrix(1, 2, 2)), C = list(matrix(1, 2, 2)), E = diag(1, 2) ) #> Component model is not identified. #> Non-identified parameters are A, C #> $identified #> [1] FALSE #> #> $nidp #> [1] \"A\" \"C\" identifyComponentModel( A = list(matrix(c(1, .5, .5, 1), 2, 2), matrix(1, 2, 2)), C = list(matrix(1, 2, 2), matrix(1, 2, 2)), E = diag(1, 4) ) #> Component model is identified. #> $identified #> [1] TRUE #> #> $nidp #> character(0) require(dplyr) #> Loading required package: dplyr #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union # require(purrr) data(twinData, package = \"OpenMx\") selVars <- c(\"ht1\", \"ht2\") mzdzData <- subset( twinData, zyg %in% c(1, 3), c(selVars, \"zyg\") ) mzdzData$RCoef <- c(1, NA, .5)[mzdzData$zyg] mzData <- mzdzData %>% filter(zyg == 1) run1 <- emxTwinModel( model = \"Cholesky\", relatedness = \"RCoef\", data = mzData, use = selVars, run = TRUE, name = \"TwCh\" ) #> Running TwCh with 4 parameters #> Warning: In model 'TwCh' Optimizer returned a non-zero status code 5. The #> Hessian at the solution does not appear to be convex. See #> ?mxCheckIdentification for possible diagnosis (Mx status RED). summary(run1) #> Summary of TwCh #> #> The Hessian at the solution does not appear to be convex. See ?mxCheckIdentification for possible diagnosis (Mx status RED). #> #> free parameters: #> name matrix row col Estimate Std.Error A lbound ubound #> 1 sqrtA11 sqrtA 1 1 0.05090090 NA 1e-06 #> 2 sqrtC11 sqrtC 1 1 0.03565565 NA ! 0! #> 3 sqrtE11 sqrtE 1 1 0.02325722 0.0007017955 ! 0! #> 4 Mht1 Means ht1 1 1.62974907 0.0027023908 #> #> Model Statistics: #> | Parameters | Degrees of Freedom | Fit (-2lnL units) #> Model: 4 1112 -3693.148 #> Saturated: 5 1111 NA #> Independence: 4 1112 NA #> Number of observations/statistics: 569/1116 #> #> #> ** Information matrix is not positive definite (not at a candidate optimum). #> Be suspicious of these results. At minimum, do not trust the standard errors. #> #> Information Criteria: #> | df Penalty | Parameters Penalty | Sample-Size Adjusted #> AIC: -5917.148 -3685.148 -3685.078 #> BIC: -10747.543 -3667.773 -3680.471 #> To get additional fit indices, see help(mxRefModels) #> timestamp: 2024-06-13 17:58:40 #> Wall clock time: 0.2066751 secs #> optimizer: SLSQP #> OpenMx version number: 2.21.11 #> Need help? See help(mxSummary) run2 <- emxTwinModel( model = \"Cholesky\", relatedness = \"RCoef\", data = mzdzData, use = selVars, run = TRUE, name = \"TwCh\" ) #> Running TwCh with 4 parameters summary(run2) #> Summary of TwCh #> #> free parameters: #> name matrix row col Estimate Std.Error A lbound ubound #> 1 sqrtA11 sqrtA 1 1 0.06339271 0.0014377690 1e-06 #> 2 sqrtC11 sqrtC 1 1 0.00000100 0.0250258713 ! 0! #> 3 sqrtE11 sqrtE 1 1 0.02330040 0.0007015267 0! #> 4 Mht1 Means ht1 1 1.63295540 0.0020511844 #> #> Model Statistics: #> | Parameters | Degrees of Freedom | Fit (-2lnL units) #> Model: 4 1803 -5507.092 #> Saturated: 5 1802 NA #> Independence: 4 1803 NA #> Number of observations/statistics: 920/1807 #> #> Information Criteria: #> | df Penalty | Parameters Penalty | Sample-Size Adjusted #> AIC: -9113.092 -5499.092 -5499.048 #> BIC: -17811.437 -5479.794 -5492.498 #> To get additional fit indices, see help(mxRefModels) #> timestamp: 2024-06-13 17:58:41 #> Wall clock time: 0.05611944 secs #> optimizer: SLSQP #> OpenMx version number: 2.21.11 #> Need help? See help(mxSummary)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Network tools for finding extended pedigrees and path tracing","text":"vignette showcases two key features capitalize network structure inherent pedigrees: Finding extended families connecting relationships members. feature strictly uses person’s ID, mother’s ID, father’s ID find people dataset remotely related path, effectively finding separable extended families dataset. Using path tracing rules quantify amount relatedness pairs individuals dataset. amount relatedness can characterized additive nuclear DNA, shared mitochondrial DNA, sharing parents, part extended pedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"loading-required-libraries-and-data","dir":"Articles","previous_headings":"Introduction","what":"Loading Required Libraries and Data","title":"Network tools for finding extended pedigrees and path tracing","text":"","code":"library(BGmisc) data(potter)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"finding-extended-families","dir":"Articles","previous_headings":"","what":"Finding Extended Families","title":"Network tools for finding extended pedigrees and path tracing","text":"Many pedigree datasets contain information person, mother, father, often without nuclear extended family IDs. Recognizing sets people unrelated simplifies many pedigree-related tasks. function facilitates tasks finding extended families. People within extended family least form relation, however distant, different extended families relations. Potter Family Pedigree use potter pedigree data example. convenience, ’ve renamed family ID variable oldfam avoid confusion new family ID variable create. potter data already family ID variable, compare newly created variable pre-existing one. match!","code":"df_potter <- potter names(df_potter)[names(df_potter) == \"famID\"] <- \"oldfam\" ds <- ped2fam(df_potter, famID = \"famID\", personID = \"personID\") table(ds$famID, ds$oldfam) #> #> 1 #> 1 36"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"computing-relatedness","dir":"Articles","previous_headings":"","what":"Computing Relatedness","title":"Network tools for finding extended pedigrees and path tracing","text":"know sets people related one another, ’ll likely want know much. additive genetic relatedness, can use ped2add() function. computes additive genetic relatedness everyone data. returns square, symmetric matrix many rows columns IDs. entry ith row jth column gives relatedness person person j. example, person 1 (Vernon Dursley) shares 0.5 nuclear DNA person 6 (Dudley Dursley), shares 0.5 nuclear DNA person 2 (Marjorie Dursley). ’s probably fine whole dataset data fewer 10,000 people. data get large, however, ’s much efficient compute relatedness separately extended family.","code":"add <- ped2add(potter) add[1:7, 1:7] #> 1 2 3 4 5 6 7 #> 1 1.0 0.50 0.00 0.00 0.0 0.500 0.000 #> 2 0.5 1.00 0.00 0.00 0.0 0.250 0.000 #> 3 0.0 0.00 1.00 0.50 0.0 0.500 0.250 #> 4 0.0 0.00 0.50 1.00 0.0 0.250 0.500 #> 5 0.0 0.00 0.00 0.00 1.0 0.000 0.500 #> 6 0.5 0.25 0.50 0.25 0.0 1.000 0.125 #> 7 0.0 0.00 0.25 0.50 0.5 0.125 1.000 table(add) #> add #> 0 0.0625 0.125 0.25 0.5 1 #> 788 6 94 208 164 36 add_list <- lapply( unique(potter$famID), function(d) { tmp <- potter[potter$famID %in% d, ] ped2add(tmp) } )"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"other-relatedness-measures","dir":"Articles","previous_headings":"Computing Relatedness","what":"Other relatedness measures","title":"Network tools for finding extended pedigrees and path tracing","text":"function works similarly mitochondrial (ped2mit), common nuclear environment sharing parents (ped2cn), common extended family environment (ped2ce).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"computing-mitochondrial-relatedness","dir":"Articles","previous_headings":"Computing Relatedness > Other relatedness measures","what":"Computing mitochondrial relatedness","title":"Network tools for finding extended pedigrees and path tracing","text":"calculate mitochondrial relatedness pairs individuals potter dataset. can see, family members share mitochondrial DNA, person 2 person 3 0, whereas person 1 person 3 .","code":"mit <- ped2mit(potter) mit[1:7, 1:7] #> 1 2 3 4 5 6 7 #> 1 1 1 0 0 0 0 0 #> 2 1 1 0 0 0 0 0 #> 3 0 0 1 1 0 1 1 #> 4 0 0 1 1 0 1 1 #> 5 0 0 0 0 1 0 0 #> 6 0 0 1 1 0 1 1 #> 7 0 0 1 1 0 1 1 table(mit) #> mit #> 0 1 #> 1082 214"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"computing-relatedness-through-common-nuclear-environment","dir":"Articles","previous_headings":"Computing Relatedness > Other relatedness measures","what":"Computing relatedness through common nuclear environment","title":"Network tools for finding extended pedigrees and path tracing","text":"calculate relatedness pairs individuals potter dataset sharing parents.","code":"commonNuclear <- ped2cn(potter) commonNuclear[1:7, 1:7] #> 1 2 3 4 5 6 7 #> 1 1 1 0 0 0 0 0 #> 2 1 1 0 0 0 0 0 #> 3 0 0 1 1 0 0 0 #> 4 0 0 1 1 0 0 0 #> 5 0 0 0 0 1 0 0 #> 6 0 0 0 0 0 1 0 #> 7 0 0 0 0 0 0 1 table(commonNuclear) #> commonNuclear #> 0 1 #> 1196 100"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"computing-relatedness-through-common-extended-family-environment","dir":"Articles","previous_headings":"Computing Relatedness > Other relatedness measures","what":"Computing relatedness through common extended family environment","title":"Network tools for finding extended pedigrees and path tracing","text":"calculate relatedness pairs individuals potter dataset sharing extended family.","code":"extendedFamilyEnvironment <- ped2ce(potter) extendedFamilyEnvironment[1:7, 1:7] #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] 1 1 1 1 1 1 1 #> [2,] 1 1 1 1 1 1 1 #> [3,] 1 1 1 1 1 1 1 #> [4,] 1 1 1 1 1 1 1 #> [5,] 1 1 1 1 1 1 1 #> [6,] 1 1 1 1 1 1 1 #> [7,] 1 1 1 1 1 1 1 table(extendedFamilyEnvironment) #> extendedFamilyEnvironment #> 1 #> 1296"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/network.html","id":"subsetting-pedigrees","dir":"Articles","previous_headings":"","what":"Subsetting Pedigrees","title":"Network tools for finding extended pedigrees and path tracing","text":"Subsetting pedigree allows researchers focus specific family lines individuals within larger dataset. can particularly useful data validation well simplifying complex pedigrees visualization. However, subsetting pedigree can result underestimation relatedness individuals. subsetted pedigree may contain individuals connect two people together. example remove Arthur Weasley (person 9) Molly Prewett (person 10) potter dataset, lose connections amongst children. Potter Subset Pedigree plot , removed Arthur Weasley (person 9) Molly Prewett (person 10) potter dataset. result, connections children lost. Similarly, remove children Vernon Dursley (1) Petunia Evans (3) potter dataset, lose connections two individuals. However, subset plot relationship spouses (marriage Vernon Dursley Petunia Evans), children connect two individuals together yet.","code":"subset_rows <- c(1:5, 31:36) subset_potter <- potter[subset_rows, ]"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/pedigree.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Pedigree Simulation and Visualization with BGmisc","text":"Unlike Tolstoy, happy families alike, pedigrees alike – least, simulated pedigrees alike. simulatePedigree function generates pedigree user-specified number generations individuals per generation. function provides users opportunity test family models pedigrees customized pedigree length width. pedigrees can simulated function several parameters, including number children per mate, generations, sex ratio newborns, mating rate. Given large family pedigrees difficult collect access, simulated pedigrees serve efficient tool researchers. simulated pedigrees useful building family-based statistical models, evaluating statistical properties, power, bias, computational efficiency. illustrate functionality, let us generate pedigree. pedigree total four generations (Ngen), person “mates”, grows family four offspring (kpc). scenario, number male female newborns equal, can adjusted via (sexR). illustration 70% individuals mate bear offspring (marR). pedigree structure can simulated running following code: simulation output data.frame 57 rows 7 columns. row corresponds simulated individual. columns represents individual’s family ID, individual’s personal ID, generation individual , IDs father mother, ID spouse, biological sex individual, respectively.","code":"## Loading Required Libraries library(BGmisc) set.seed(5) df_ped <- simulatePedigree( kpc = 4, Ngen = 4, sexR = .5, marR = .7 ) summary(df_ped) #> fam ID gen dadID #> Length:57 Min. : 10011 Min. :1.000 Min. : 10012 #> Class :character 1st Qu.: 10036 1st Qu.:3.000 1st Qu.: 10024 #> Mode :character Median :100312 Median :3.000 Median : 10037 #> Mean : 59171 Mean :3.298 Mean : 42859 #> 3rd Qu.:100416 3rd Qu.:4.000 3rd Qu.:100311 #> Max. :100432 Max. :4.000 Max. :100320 #> NA's :13 #> momID spt sex #> Min. : 10011 Min. : 10011 Length:57 #> 1st Qu.: 10022 1st Qu.: 10025 Class :character #> Median : 10036 Median : 10036 Mode :character #> Mean : 42859 Mean : 40124 #> 3rd Qu.:100316 3rd Qu.:100311 #> Max. :100318 Max. :100320 #> NA's :13 NA's :33 df_ped[21, ] #> fam ID gen dadID momID spt sex #> 21 fam 1 100312 3 10024 10022 100317 M"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/pedigree.html","id":"summarizing-pedigrees","dir":"Articles","previous_headings":"Introduction","what":"Summarizing Pedigrees","title":"Pedigree Simulation and Visualization with BGmisc","text":"","code":"summarizeFamilies(df_ped, famID = \"fam\")$family_summary #> fam count gen_mean gen_median gen_min gen_max gen_sd spt_mean #> #> 1: fam 1 57 3.298246 3 1 4 0.8229935 40123.5 #> spt_median spt_min spt_max spt_sd #> #> 1: 10035.5 10011 100320 43476.96"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/pedigree.html","id":"plotting-pedigree","dir":"Articles","previous_headings":"Introduction","what":"Plotting Pedigree","title":"Pedigree Simulation and Visualization with BGmisc","text":"Pedigrees visual diagrams represent family relationships across generations. commonly used genetics trace inheritance specific traits conditions. vignette guide visualizing simulated pedigrees using plotPedigree function. function wrapper function Kinship2’s base R plotting.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/articles/pedigree.html","id":"single-pedigree-visualization","dir":"Articles","previous_headings":"Introduction > Plotting Pedigree","what":"Single Pedigree Visualization","title":"Pedigree Simulation and Visualization with BGmisc","text":"visualize single simulated pedigree, use plotPedigree() function. resulting plot, biological males represented squares, biological females represented circles, following standard pedigree conventions.","code":"# Plot the simulated pedigree plotPedigree(df_ped) #> Did not plot the following people: 10032 #> $plist #> $plist$n #> [1] 2 7 19 28 #> #> $plist$nid #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] #> [1,] 2 1 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 6 4 5 3 9 7 8 0 0 0 0 0 0 0 #> [3,] 18 17 19 22 21 26 23 10 12 13 14 16 15 24 #> [4,] 38 39 40 42 41 43 45 48 47 50 52 53 30 31 #> [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] #> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [3,] 20 25 28 29 27 0 0 0 0 0 0 0 #> [4,] 32 33 34 35 36 37 44 46 49 51 54 55 #> [,27] [,28] #> [1,] 0 0 #> [2,] 0 0 #> [3,] 0 0 #> [4,] 56 57 #> #> $plist$pos #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] 1.550317e+01 16.503171 0.000000 0.000000 0.000000 0.000000 0.00000 #> [2,] 8.255043e+00 9.255043 14.147242 15.147242 18.805200 19.805200 20.80520 #> [3,] 2.351008e+00 3.351008 5.751008 6.751008 8.585014 9.585014 10.58501 #> [4,] -1.257081e-13 1.000000 2.000000 3.000000 4.000000 5.000000 6.00000 #> [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] #> [1,] 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 #> [2,] 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 #> [3,] 12.13453 13.13453 14.13453 15.13453 16.32945 17.32945 18.98794 19.98794 #> [4,] 7.00000 8.00000 9.00000 10.00000 11.00000 12.00000 13.00000 14.00000 #> [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] #> [1,] 0.00000 0.00000 0.00000 0.00000 0 0 0 0 0 0 #> [2,] 0.00000 0.00000 0.00000 0.00000 0 0 0 0 0 0 #> [3,] 20.98794 21.98794 23.86104 24.86104 0 0 0 0 0 0 #> [4,] 15.00000 16.00000 17.00000 18.00000 19 20 21 22 23 24 #> [,26] [,27] [,28] #> [1,] 0 0 0 #> [2,] 0 0 0 #> [3,] 0 0 0 #> [4,] 25 26 27 #> #> $plist$fam #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] #> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 0 1 1 0 0 1 1 0 0 0 0 0 0 0 #> [3,] 0 1 1 0 1 0 1 3 3 3 0 0 3 5 #> [4,] 1 1 1 1 3 3 3 3 5 5 5 5 10 10 #> [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] #> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [3,] 0 5 5 5 0 0 0 0 0 0 0 0 #> [4,] 10 10 12 12 12 12 15 15 15 15 18 18 #> [,27] [,28] #> [1,] 0 0 #> [2,] 0 0 #> [3,] 0 0 #> [4,] 18 18 #> #> $plist$spouse #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] #> [1,] 1 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 1 0 1 0 1 0 0 0 0 0 0 0 0 0 #> [3,] 1 0 1 0 1 0 0 0 0 1 0 1 0 0 #> [4,] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] #> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [3,] 1 0 0 1 0 0 0 0 0 0 0 0 #> [4,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [,27] [,28] #> [1,] 0 0 #> [2,] 0 0 #> [3,] 0 0 #> [4,] 0 0 #> #> #> $x #> [1] 1.650317e+01 1.550317e+01 1.514724e+01 9.255043e+00 1.414724e+01 #> [6] 8.255043e+00 1.980520e+01 2.080520e+01 1.880520e+01 1.213453e+01 #> [11] NA 1.313453e+01 1.413453e+01 1.513453e+01 1.732945e+01 #> [16] 1.632945e+01 3.351008e+00 2.351008e+00 5.751008e+00 1.998794e+01 #> [21] 8.585014e+00 6.751008e+00 1.058501e+01 1.898794e+01 2.098794e+01 #> [26] 9.585014e+00 2.486104e+01 2.198794e+01 2.386104e+01 1.200000e+01 #> [31] 1.300000e+01 1.400000e+01 1.500000e+01 1.600000e+01 1.700000e+01 #> [36] 1.800000e+01 1.900000e+01 -1.257081e-13 1.000000e+00 2.000000e+00 #> [41] 4.000000e+00 3.000000e+00 5.000000e+00 2.000000e+01 6.000000e+00 #> [46] 2.100000e+01 8.000000e+00 7.000000e+00 2.200000e+01 9.000000e+00 #> [51] 2.300000e+01 1.000000e+01 1.100000e+01 2.400000e+01 2.500000e+01 #> [56] 2.600000e+01 2.700000e+01 #> #> $y #> [1] 1 1 2 2 2 2 2 2 2 3 NA 3 3 3 3 3 3 3 3 3 3 3 3 3 3 #> [26] 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 #> [51] 4 4 4 4 4 4 4 #> #> $boxw #> [1] 0.5158615 #> #> $boxh #> [1] 0.08681352 #> #> $call #> kinship2::plot.pedigree(x = p3, cex = cex, col = col, symbolsize = symbolsize, #> branch = branch, packed = packed, align = align, width = width, #> density = density, angle = angle, keep.par = keep.par, pconnect = pconnect, #> mar = mar)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/pedigree.html","id":"visualizing-multiple-pedigrees-side-by-side","dir":"Articles","previous_headings":"Introduction > Plotting Pedigree","what":"Visualizing Multiple Pedigrees Side-by-Side","title":"Pedigree Simulation and Visualization with BGmisc","text":"wish compare different pedigrees side side, can plot together. instance, let’s visualize pedigrees families spanning three four generations, respectively. examining side--side plots, can contrast analyze structures different families, tracing inheritance specific traits conditions needed.","code":"set.seed(8) # Simulate a family with 3 generations df_ped_3 <- simulatePedigree(Ngen = 3) # Simulate a family with 4 generations df_ped_4 <- simulatePedigree(Ngen = 4) # Set up plotting parameters for side-by-side display par(mfrow = c(1, 2)) # Plot the 3-generation pedigree plotPedigree(df_ped_3, width = 3) #> $plist #> $plist$n #> [1] 2 5 6 #> #> $plist$nid #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 2 1 0 0 0 0 #> [2,] 3 5 4 6 7 0 #> [3,] 8 10 11 9 12 13 #> #> $plist$pos #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 1.166667e+00 2.166667 0 0 0 0 #> [2,] 2.047042e-09 1.000000 2 3 4 0 #> [3,] 0.000000e+00 1.000000 2 3 4 5 #> #> $plist$fam #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 0 0 0 0 0 0 #> [2,] 1 1 0 0 1 0 #> [3,] 2 2 2 4 4 4 #> #> $plist$spouse #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 1 0 0 0 0 0 #> [2,] 0 1 0 1 0 0 #> [3,] 0 0 0 0 0 0 #> #> #> $x #> [1] 2.166667e+00 1.166667e+00 2.047042e-09 2.000000e+00 1.000000e+00 #> [6] 3.000000e+00 4.000000e+00 0.000000e+00 3.000000e+00 1.000000e+00 #> [11] 2.000000e+00 4.000000e+00 5.000000e+00 #> #> $y #> [1] 1 1 2 2 2 2 2 3 3 3 3 3 3 #> #> $boxw #> [1] 0.2060484 #> #> $boxh #> [1] 0.05787568 #> #> $call #> kinship2::plot.pedigree(x = p3, cex = cex, col = col, symbolsize = symbolsize, #> branch = branch, packed = packed, align = align, width = width, #> density = density, angle = angle, keep.par = keep.par, pconnect = pconnect, #> mar = mar) # Plot the 4-generation pedigree plotPedigree(df_ped_4, width = 1) #> $plist #> $plist$n #> [1] 2 5 10 12 #> #> $plist$nid #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] #> [1,] 2 1 0 0 0 0 0 0 0 0 0 0 #> [2,] 3 5 4 6 7 0 0 0 0 0 0 0 #> [3,] 8 9 11 15 14 13 10 12 17 16 0 0 #> [4,] 18 21 23 22 25 26 19 20 24 27 28 29 #> #> $plist$pos #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] 6.399999e+00 7.399999 0.000000 0.000000 0.000000 0.000000 0.000000 #> [2,] 3.299999e+00 4.299999 6.699999 7.699999 8.699999 0.000000 0.000000 #> [3,] 9.333331e-01 1.933333 2.933333 3.933333 4.933333 6.066666 7.066666 #> [4,] 1.854016e-14 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 #> [,8] [,9] [,10] [,11] [,12] #> [1,] 0.000000 0.000000 0.00000 0 0 #> [2,] 0.000000 0.000000 0.00000 0 0 #> [3,] 8.066666 9.066666 10.06667 0 0 #> [4,] 7.000000 8.000000 9.00000 10 11 #> #> $plist$fam #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] #> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 0 1 0 1 1 0 0 0 0 0 0 0 #> [3,] 0 1 1 1 0 0 3 3 3 0 0 0 #> [4,] 1 1 1 4 4 4 6 6 6 9 9 9 #> #> $plist$spouse #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] #> [1,] 1 0 0 0 0 0 0 0 0 0 0 0 #> [2,] 1 0 1 0 0 0 0 0 0 0 0 0 #> [3,] 1 0 0 1 0 1 0 0 1 0 0 0 #> [4,] 0 0 0 0 0 0 0 0 0 0 0 0 #> #> #> $x #> [1] 7.399999e+00 6.399999e+00 3.299999e+00 6.699999e+00 4.299999e+00 #> [6] 7.699999e+00 8.699999e+00 9.333331e-01 1.933333e+00 7.066666e+00 #> [11] 2.933333e+00 8.066666e+00 6.066666e+00 4.933333e+00 3.933333e+00 #> [16] 1.006667e+01 9.066666e+00 1.854016e-14 6.000000e+00 7.000000e+00 #> [21] 1.000000e+00 3.000000e+00 2.000000e+00 8.000000e+00 4.000000e+00 #> [26] 5.000000e+00 9.000000e+00 1.000000e+01 1.100000e+01 #> #> $y #> [1] 1 1 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 #> #> $boxw #> [1] 0.4533065 #> #> $boxh #> [1] 0.08681352 #> #> $call #> kinship2::plot.pedigree(x = p3, cex = cex, col = col, symbolsize = symbolsize, #> branch = branch, packed = packed, align = align, width = width, #> density = density, angle = angle, keep.par = keep.par, pconnect = pconnect, #> mar = mar)"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Validation tools for identifying and repairing errors in pedigrees","text":"BGmisc R package offers comprehensive suite functions tailored extended behavior genetics analysis, including model identification, calculating relatedness, pedigree conversion, pedigree simulation. vignette provides overview validation tools available package, designed identify repair errors pedigrees. ideal world, perfect pedigrees errors. However, real world, pedigrees often incomplete, contain errors, missing data. BGmisc package provides tools identify errors, particularly useful large pedigrees manual inspection feasible. errors package can automatically repaired, vast majority require manual inspection. often possible automatically repair errors pedigrees, correct solution may obvious, may depend additional information universally available.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"id-validation","dir":"Articles","previous_headings":"Identifying and Repairing Errors in Pedigrees","what":"ID Validation","title":"Validation tools for identifying and repairing errors in pedigrees","text":"One common issue pedigree data presence duplicate IDs. two main types ID duplication: within-row duplication across-row duplication. Within-row duplication occurs individual’s parents’ IDs incorrectly listed ID. Across-row duplication occurs two individuals share ID. checkIDs function BGmisc helps identify kinds duplicates. ’s use : example, checkIDs function returns list several elements. all_unique_ids element indicates whether IDs dataset unique. total_non_unique_ids element indicates total number non-unique IDs. total_own_father total_own_mother elements indicate total number individuals whose father’s mother’s IDs match ID, respectively. total_duplicated_parents element indicates total number individuals duplicated parent IDs. total_within_row_duplicates element indicates total number within-row duplicates. within_row_duplicates element indicates whether within-row duplicates dataset. output shows, duplicates sample dataset.","code":"library(BGmisc) # Create a sample dataset df <- ped2fam(potter, famID = \"newFamID\", personID = \"personID\") # Call the checkIDs function result <- checkIDs(df, repair = FALSE) print(result) #> $all_unique_ids #> [1] TRUE #> #> $total_non_unique_ids #> [1] 0 #> #> $total_own_father #> [1] 0 #> #> $total_own_mother #> [1] 0 #> #> $total_duplicated_parents #> [1] 0 #> #> $total_within_row_duplicates #> [1] 0 #> #> $within_row_duplicates #> [1] FALSE #> $all_unique_ids #> [1] TRUE #> #> $total_non_unique_ids #> [1] 0 #> #> $total_own_father #> [1] 0 #> #> $total_own_mother #> [1] 0 #> #> $total_duplicated_parents #> [1] 0 #> #> $total_within_row_duplicates #> [1] 0 #> #> $within_row_duplicates #> [1] FALSE"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"between-person-duplicates","dir":"Articles","previous_headings":"Identifying and Repairing Errors in Pedigrees > ID Validation","what":"Between-Person Duplicates","title":"Validation tools for identifying and repairing errors in pedigrees","text":"Let us now consider scenario -person duplicates dataset. checkIDs function can identify duplicates , repair argument set TRUE, attempt repair . example , created two -person duplicates. First, overwritten personID one person sibling’s ID. Second, added copy Dudley Dursley dataset. Now, let’s call sumarizeFamilies function see dataset looks like. didn’t know look duplicates, might notice issue. Indeed, duplicates selected founder member. However, checkIDs function can help us identify repair errors: can see output, 4 non-unique IDs dataset, specifically 2, 6. Let’s take peek duplicates: Yep, definitely duplicates. Great! function able repair full duplicate, without manual intervention. still leaves us sibling overwrite, ’s complex issue require manual intervention. ’ll leave now.","code":"# Create a sample dataset with duplicates df <- ped2fam(potter, famID = \"newFamID\", personID = \"personID\") # Sibling overwrite df$personID[df$name == \"Vernon Dursley\"] <- df$personID[df$name == \"Marjorie Dursley\"] # Add a copy of Dudley Dursley df <- rbind(df, df[df$name == \"Dudley Dursley\",]) library(tidyverse) #> ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── #> ✔ dplyr 1.1.4 ✔ readr 2.1.5 #> ✔ forcats 1.0.0 ✔ stringr 1.5.1 #> ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 #> ✔ lubridate 1.9.3 ✔ tidyr 1.3.1 #> ✔ purrr 1.0.2 #> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ── #> ✖ dplyr::filter() masks stats::filter() #> ✖ dplyr::lag() masks stats::lag() #> ℹ Use the conflicted package () to force all conflicts to become errors summarizeFamilies(df, famID = \"newFamID\", personID = \"personID\")$family_summary %>% glimpse() #> Rows: 1 #> Columns: 17 #> $ newFamID 1 #> $ count 37 #> $ gen_mean 1.756757 #> $ gen_median 2 #> $ gen_min 0 #> $ gen_max 3 #> $ gen_sd 1.038305 #> $ spouseID_mean 38.2 #> $ spouseID_median 15 #> $ spouseID_min 1 #> $ spouseID_max 106 #> $ spouseID_sd 44.15118 #> $ sex_mean 0.5135135 #> $ sex_median 1 #> $ sex_min 0 #> $ sex_max 1 #> $ sex_sd 0.5067117 # Call the checkIDs result <- checkIDs(df) print(result) #> $all_unique_ids #> [1] FALSE #> #> $total_non_unique_ids #> [1] 4 #> #> $non_unique_ids #> [1] 2 6 #> #> $total_own_father #> [1] 0 #> #> $total_own_mother #> [1] 0 #> #> $total_duplicated_parents #> [1] 0 #> #> $total_within_row_duplicates #> [1] 0 #> #> $within_row_duplicates #> [1] FALSE df %>% filter(personID %in% result$non_unique_ids) %>% arrange(personID) #> personID newFamID famID name gen momID dadID spouseID sex #> 1 2 1 1 Vernon Dursley 1 101 102 3 1 #> 2 2 1 1 Marjorie Dursley 1 101 102 NA 0 #> 6 6 1 1 Dudley Dursley 2 3 1 NA 1 #> 61 6 1 1 Dudley Dursley 2 3 1 NA 1 df_repair <- checkIDs(df, repair = TRUE) df_repair %>% filter(ID %in% result$non_unique_ids) %>% arrange(ID) #> ID newFamID fam name gen momID dadID spt sex #> 1 2 1 1 Vernon Dursley 1 101 102 3 1 #> 2 2 1 1 Marjorie Dursley 1 101 102 NA 0 #> 6 6 1 1 Dudley Dursley 2 3 1 NA 1 result <- checkIDs(df_repair) print(result) #> $all_unique_ids #> [1] FALSE #> #> $total_non_unique_ids #> [1] 2 #> #> $non_unique_ids #> [1] 2 #> #> $total_own_father #> [1] 0 #> #> $total_own_mother #> [1] 0 #> #> $total_duplicated_parents #> [1] 0 #> #> $total_within_row_duplicates #> [1] 0 #> #> $within_row_duplicates #> [1] FALSE"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"handling-within-row-duplicates","dir":"Articles","previous_headings":"Identifying and Repairing Errors in Pedigrees > ID Validation","what":"Handling Within-Row Duplicates","title":"Validation tools for identifying and repairing errors in pedigrees","text":"Sometimes, individual’s parents’ IDs may incorrectly listed ID, leading within-row duplicates. checkIDs function can also identify errors: example, created within-row duplicate setting momID Vernon Dursley ID. checkIDs function correctly identifies error.","code":"# Create a sample dataset with within-person duplicate parent IDs df <- ped2fam(potter, famID = \"newFamID\", personID = \"personID\") df$momID[df$name == \"Vernon Dursley\"] <- df$personID[df$name == \"Vernon Dursley\"] # Check for within-row duplicates result <- checkIDs(df, repair = FALSE) print(result) #> $all_unique_ids #> [1] TRUE #> #> $total_non_unique_ids #> [1] 0 #> #> $total_own_father #> [1] 0 #> #> $total_own_mother #> [1] 1 #> #> $total_duplicated_parents #> [1] 0 #> #> $total_within_row_duplicates #> [1] 1 #> #> $within_row_duplicates #> [1] TRUE #> #> $is_own_mother_ids #> [1] 1"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"verifying-sex-coding","dir":"Articles","previous_headings":"Identifying and Repairing Errors in Pedigrees","what":"Verifying Sex Coding","title":"Validation tools for identifying and repairing errors in pedigrees","text":"Another common issue pedigree data incorrect coding biological sex. genetic studies, ensuring accurate recording biological sex pedigree data crucial analyses rely information. checkSex function BGmisc helps identify repair errors related biological sex coding, inconsistencies individual’s sex incorrectly recorded. example parent biologically male, listed mother. checkSex function can help identify correct errors. essential distinguish biological sex (genotype) gender identity (phenotype). Biological sex based chromosomes biological characteristics, gender identity broader, richer, personal, deeply-held sense male, female, blend , neither, another gender entirely. checkSex focuses biological sex necessary genetic analysis, respect recognize full spectrum gender identities beyond binary. developers package affirm support folx LGBTQ+ community. checkSex function BGmisc performs two main tasks: identifying possible errors inconsistencies variables related biological sex. function capable validating sex coding pedigree optionally repairing sex coding based specified logic. ’s can use checkSex function validate optionally repair sex coding pedigree dataset: example, checkSex function checks unique values sex column identifies inconsistencies sex coding parents. function returns list containing validation results, unique values found sex column inconsistencies sex coding parents. incorrect sex codes found, can attempt repair automatically using repair argument: repair argument set TRUE, function attempts repair sex coding based specified logic. recodes sex variable based frequent sex values found among parents. ensures sex coding consistent accurate, essential constructing valid genetic pedigrees.","code":"# Validate sex coding results <- checkSex(potter, code_male = 1, code_female = 0, verbose = TRUE, repair = FALSE) #> Step 1: Checking how many sexes/genders... #> 2 unique values found. #> 1 2 unique values found. #> 0Checks Made: #> $sex_unique #> [1] 1 0 #> #> $sex_length #> [1] 2 #> #> $all_sex_dad #> [1] \"1\" #> #> $all_sex_mom #> [1] \"0\" #> #> $most_frequent_sex_dad #> [1] \"1\" #> #> $most_frequent_sex_mom #> [1] \"0\" print(results) #> $sex_unique #> [1] 1 0 #> #> $sex_length #> [1] 2 #> #> $all_sex_dad #> [1] \"1\" #> #> $all_sex_mom #> [1] \"0\" #> #> $most_frequent_sex_dad #> [1] \"1\" #> #> $most_frequent_sex_mom #> [1] \"0\" # Repair sex coding df_fix <- checkSex(potter, code_male = 1, code_female = 0, verbose = TRUE, repair = TRUE) #> Step 1: Checking how many sexes/genders... #> 2 unique values found. #> 1 2 unique values found. #> 0Step 2: Attempting to repair sex coding... #> Changes Made: #> [[1]] #> [1] \"Recode sex based on most frequent sex in dads: 1. Total gender changes made: 36\" print(df_fix) #> ID fam name gen momID dadID spt sex #> 1 1 1 Vernon Dursley 1 101 102 3 M #> 2 2 1 Marjorie Dursley 1 101 102 NA F #> 3 3 1 Petunia Evans 1 103 104 1 F #> 4 4 1 Lily Evans 1 103 104 5 F #> 5 5 1 James Potter 1 NA NA 4 M #> 6 6 1 Dudley Dursley 2 3 1 NA M #> 7 7 1 Harry Potter 2 4 5 8 M #> 8 8 1 Ginny Weasley 2 10 9 7 F #> 9 9 1 Arthur Weasley 1 NA NA 10 M #> 10 10 1 Molly Prewett 1 NA NA 9 F #> 11 11 1 Ron Weasley 2 10 9 17 M #> 12 12 1 Fred Weasley 2 10 9 NA M #> 13 13 1 George Weasley 2 10 9 NA M #> 14 14 1 Percy Weasley 2 10 9 20 M #> 15 15 1 Charlie Weasley 2 10 9 NA M #> 16 16 1 Bill Weasley 2 10 9 18 M #> 17 17 1 Hermione Granger 2 NA NA 11 F #> 18 18 1 Fleur Delacour 2 105 106 16 F #> 19 19 1 Gabrielle Delacour 2 105 106 NA F #> 20 20 1 Audrey UNKNOWN 2 NA NA 14 F #> 21 21 1 James Potter II 3 8 7 NA M #> 22 22 1 Albus Potter 3 8 7 NA M #> 23 23 1 Lily Potter 3 8 7 NA F #> 24 24 1 Rose Weasley 3 17 11 NA F #> 25 25 1 Hugo Weasley 3 17 11 NA M #> 26 26 1 Victoire Weasley 3 18 16 NA F #> 27 27 1 Dominique Weasley 3 18 16 NA F #> 28 28 1 Louis Weasley 3 18 16 NA M #> 29 29 1 Molly Weasley 3 20 14 NA F #> 30 30 1 Lucy Weasley 3 20 14 NA F #> 31 101 1 Mother Dursley 0 NA NA 102 F #> 32 102 1 Father Dursley 0 NA NA 101 M #> 33 104 1 Father Evans 0 NA NA 103 M #> 34 103 1 Mother Evans 0 NA NA 104 F #> 35 106 1 Father Delacour 0 NA NA 105 M #> 36 105 1 Mother Delacour 0 NA NA 106 F"},{"path":"https://r-computing-lab.github.io/BGmisc/articles/validation.html","id":"conclusion","dir":"Articles","previous_headings":"","what":"Conclusion","title":"Validation tools for identifying and repairing errors in pedigrees","text":"vignette demonstrates use BGmisc package identify repair errors pedigrees. leveraging functions like checkIDs, checkSex, recodeSex, can ensure integrity pedigree data, facilitating accurate analysis research.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"S. Mason Garrison. Author, maintainer. Michael D. Hunter. Author. Xuanyu Lyu. Author. Rachel N. Good. Contributor. Jonathan D. Trattner. Author. https://www.jdtrat.com/ S. Alexandra Burt. Author.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Garrison, S. Mason, Hunter, Michael D., Lyu, Xuanyu, Trattner, Jonathan D., Burt, S. Alexandra (2024). “BGmisc: R Package Extended Behavior Genetics Analysis.” Journal Open Source Software, 9(94). doi:10.21105/joss.06203.","code":"@Article{bgmisc, title = {BGmisc: An R Package for Extended Behavior Genetics Analysis}, author = {{Garrison, S. Mason} and {Hunter, Michael D.} and {Lyu, Xuanyu} and {Trattner, Jonathan D.} and {Burt, S. Alexandra}}, journal = {Journal of Open Source Software}, year = {2024}, volume = {9}, number = {94}, doi = {10.21105/joss.06203}, }"},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"bgmisc","dir":"","previous_headings":"","what":"An R Package for Extended Behavior Genetics Analysis","title":"An R Package for Extended Behavior Genetics Analysis","text":"BGmisc R package offers comprehensive suite functions tailored extended behavior genetics analysis, including model identification, calculating relatedness, pedigree conversion, pedigree simulation, .","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"An R Package for Extended Behavior Genetics Analysis","text":"can install released version BGmisc CRAN : install development version BGmisc GitHub use:","code":"install.packages(\"BGmisc\") # install.packages(\"devtools\") devtools::install_github(\"R-Computing-Lab/BGmisc\")"},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"An R Package for Extended Behavior Genetics Analysis","text":"use BGmisc research wish refer , please cite following paper: Garrison, S. Mason, Hunter, Michael D., Lyu, Xuanyu, Trattner, Jonathan D., Burt, S. Alexandra (2024). “BGmisc: R Package Extended Behavior Genetics Analysis.” Journal Open Source Software, 9(94). doi:10.21105/joss.06203 https://doi.org/10.21105/joss.06203. BibTeX entry LaTeX users ","code":"citation(package = \"BGmisc\") @Article{bgmisc, title = {BGmisc: An R Package for Extended Behavior Genetics Analysis}, author = {{Garrison, S. Mason} and {Hunter, Michael D.} and {Lyu, Xuanyu} and {Trattner, Jonathan D.} and {Burt, S. Alexandra}}, journal = {Journal of Open Source Software}, year = {2024}, volume = {9}, number = {94}, doi = {10.21105/joss.06203}, }"},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"An R Package for Extended Behavior Genetics Analysis","text":"Contributions BGmisc project welcome. guidelines contribute, please refer Contributing Guidelines. Issues pull requests submitted GitHub repository. support, please use GitHub issues page.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"branching-and-versioning-system","dir":"","previous_headings":"Contributing","what":"Branching and Versioning System","title":"An R Package for Extended Behavior Genetics Analysis","text":"development BGmisc follows GitFlow branching strategy: Feature Branches: major changes new features developed separate branches created dev_main branch. Name branches according feature change meant address. dev_main: branch final integration stage changes merged main branch. considered stable, well-tested features updates ready next release cycle merged . dev: branch serves less stable, active development environment. Feature branches merged . Changes fluid branch higher risk breaking. Main Branch (main): main branch mirrors stable state project seen CRAN. fully tested approved changes dev_main branch merged main prepare new release.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"An R Package for Extended Behavior Genetics Analysis","text":"BGmisc licensed GNU General Public License v3.0. details, see LICENSE.md file.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/BGmisc-package.html","id":null,"dir":"Reference","previous_headings":"","what":"BGmisc: An R Package for Extended Behavior Genetics Analysis — BGmisc-package","title":"BGmisc: An R Package for Extended Behavior Genetics Analysis — BGmisc-package","text":"BGmisc R package offers comprehensive suite functions tailored extended behavior genetics analysis, including model identification, calculating relatedness, pedigree conversion, pedigree simulation, .","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/BGmisc-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"BGmisc: An R Package for Extended Behavior Genetics Analysis — BGmisc-package","text":"Maintainer: S. Mason Garrison garrissm@wfu.edu (ORCID) Authors: Michael D. Hunter (ORCID) Xuanyu Lyu (ORCID) Jonathan D. Trattner code@jdtrat.com (ORCID) (https://www.jdtrat.com/) S. Alexandra Burt (ORCID) contributors: Rachel N. Good [contributor]","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/Null.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute the null space of a matrix — Null","title":"Compute the null space of a matrix — Null","text":"Compute null space matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/Null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute the null space of a matrix — Null","text":"","code":"Null(M)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/Null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute the null space of a matrix — Null","text":"M matrix null space desired","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/Null.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute the null space of a matrix — Null","text":"method uses QR factorization determine basis null space matrix. sometimes also called orthogonal complement matrix. implemented, function identical function name MASS package.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":null,"dir":"Reference","previous_headings":"","what":"SimPed (Deprecated) — SimPed","title":"SimPed (Deprecated) — SimPed","text":"calling function, warning issued deprecation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"SimPed (Deprecated) — SimPed","text":"","code":"SimPed(...)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"SimPed (Deprecated) — SimPed","text":"... Arguments passed `simulatePedigree`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"SimPed (Deprecated) — SimPed","text":"result calling `simulatePedigree`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"SimPed (Deprecated) — SimPed","text":"function wrapper around new `simulatePedigree` function. `SimPed` deprecated, advised use `simulatePedigree` directly.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/SimPed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"SimPed (Deprecated) — SimPed","text":"","code":"if (FALSE) { # This is an example of the deprecated function: SimPed(...) # It is recommended to use: simulatePedigree(...) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/adjustKidsPerCouple.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate or Adjust Number of Kids per Couple Based on Mating Rate — adjustKidsPerCouple","title":"Generate or Adjust Number of Kids per Couple Based on Mating Rate — adjustKidsPerCouple","text":"function generates adjusts number kids per couple generation based specified average whether count randomly determined.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/adjustKidsPerCouple.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate or Adjust Number of Kids per Couple Based on Mating Rate — adjustKidsPerCouple","text":"","code":"adjustKidsPerCouple(nMates, kpc, rd_kpc)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/adjustKidsPerCouple.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate or Adjust Number of Kids per Couple Based on Mating Rate — adjustKidsPerCouple","text":"nMates Integer, number mated pairs generation. kpc Number kids per couple. integer >= 2 determines many kids fertilized mated couple pedigree. Default value 3. Returns error kpc equals 1. rd_kpc logical. TRUE, number kids per mate randomly generated poisson distribution mean kpc. FALSE, number kids per mate fixed kpc.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/adjustKidsPerCouple.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate or Adjust Number of Kids per Couple Based on Mating Rate — adjustKidsPerCouple","text":"numeric vector generated adjusted number kids per couple.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/allGens.html","id":null,"dir":"Reference","previous_headings":"","what":"allGens A function to calculate the number of individuals in each generation. This is a supporting function for simulatePedigree. — allGens","title":"allGens A function to calculate the number of individuals in each generation. This is a supporting function for simulatePedigree. — allGens","text":"allGens function calculate number individuals generation. supporting function simulatePedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/allGens.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"allGens A function to calculate the number of individuals in each generation. This is a supporting function for simulatePedigree. — allGens","text":"","code":"allGens(kpc, Ngen, marR)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/allGens.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"allGens A function to calculate the number of individuals in each generation. This is a supporting function for simulatePedigree. — allGens","text":"kpc Number kids per couple (integer >= 2). Ngen Number generations (integer >= 1). marR Mating rate (numeric value ranging 0 1).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/allGens.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"allGens A function to calculate the number of individuals in each generation. This is a supporting function for simulatePedigree. — allGens","text":"Returns vector containing number individuals every generation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/assignCoupleIds.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign Couple IDs — assignCoupleIds","title":"Assign Couple IDs — assignCoupleIds","text":"subfunction assigns unique couple ID mated pair generation. Unmated individuals assigned NA couple ID.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/assignCoupleIds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign Couple IDs — assignCoupleIds","text":"","code":"assignCoupleIds(df_Ngen)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/assignCoupleIds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign Couple IDs — assignCoupleIds","text":"df_Ngen dataframe current generation, including columns individual IDs spouse IDs.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/assignCoupleIds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign Couple IDs — assignCoupleIds","text":"input dataframe augmented 'coupleId' column, mated pair unique identifier.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildBetweenGenerations.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Generation Connections — buildBetweenGenerations","title":"Process Generation Connections — buildBetweenGenerations","text":"function processes connections two generations pedigree simulation. marks individuals parents, sons, daughters based generational position relationships. function also handles assignment couple IDs, manages single coupled individuals, establishes parent-offspring links across generations.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildBetweenGenerations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Generation Connections — buildBetweenGenerations","text":"","code":"buildBetweenGenerations( df_Fam, Ngen, sizeGens, verbose, marR, sexR, kpc, rd_kpc )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildBetweenGenerations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Generation Connections — buildBetweenGenerations","text":"df_Fam data frame containing simulated pedigree information current generation. Must include columns family ID, individual ID, generation number, spouse ID (spt), sex. data frame updated place include flags parental status (ifparent), son status (ifson), daughter status (ifdau), well couple IDs. Ngen Number generations. integer >= 2 determines many generations simulated pedigree . first generation always fertilized couple. last generation mated individuals. sizeGens numeric vector containing sizes generation within pedigree. verbose logical TRUE, print progress stages algorithm marR Mating rate. numeric value ranging 0 1 determines proportion mated (fertilized) couples pedigree within generation. instance, marR = 0.5 suggests 50 percent offspring specific generation mated offspring. sexR Sex ratio offspring. numeric value ranging 0 1 determines proportion males offspring pedigree. instance, 0.4 means 40 percent offspring male. kpc Number kids per couple. integer >= 2 determines many kids fertilized mated couple pedigree. Default value 3. Returns error kpc equals 1. rd_kpc logical. TRUE, number kids per mate randomly generated poisson distribution mean kpc. FALSE, number kids per mate fixed kpc.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildBetweenGenerations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Generation Connections — buildBetweenGenerations","text":"function updates `df_Fam` data frame place, adding modifying columns related parental offspring status, well assigning unique couple IDs. return value explicitly.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildBetweenGenerations.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Process Generation Connections — buildBetweenGenerations","text":"function iterates generation, starting second, establish connections based mating parentage. first generation, sets parental status directly. subsequent generations, calculates number couples, expected number offspring, assigns offspring parents. handles gender-based assignments sons daughters, deals nuances single individuals couple formation. function relies external functions `assignCoupleIds` `adjustKidsPerCouple` handle specific tasks related couple ID assignment offspring number adjustments, respectively.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildWithinGenerations.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Generations for Pedigree Simulation — buildWithinGenerations","title":"Process Generations for Pedigree Simulation — buildWithinGenerations","text":"function iterates generations pedigree simulation, assigning IDs, creating data frames, determining sexes, managing pairing within generation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildWithinGenerations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Generations for Pedigree Simulation — buildWithinGenerations","text":"","code":"buildWithinGenerations(sizeGens, marR, sexR, Ngen)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildWithinGenerations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Generations for Pedigree Simulation — buildWithinGenerations","text":"sizeGens numeric vector containing sizes generation within pedigree. marR Mating rate. numeric value ranging 0 1 determines proportion mated (fertilized) couples pedigree within generation. instance, marR = 0.5 suggests 50 percent offspring specific generation mated offspring. sexR Sex ratio offspring. numeric value ranging 0 1 determines proportion males offspring pedigree. instance, 0.4 means 40 percent offspring male. Ngen Number generations. integer >= 2 determines many generations simulated pedigree . first generation always fertilized couple. last generation mated individuals.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/buildWithinGenerations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Generations for Pedigree Simulation — buildWithinGenerations","text":"data frame representing simulated pedigree, including columns family ID (`fam`),","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateH.html","id":null,"dir":"Reference","previous_headings":"","what":"Falconer's Formula — calculateH","title":"Falconer's Formula — calculateH","text":"Use Falconer's formula solve H using observed correlations two groups two levels relatednesses.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateH.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Falconer's Formula — calculateH","text":"","code":"calculateH(r1, r2, obsR1, obsR2)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateH.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Falconer's Formula — calculateH","text":"r1 Relatedness coefficient first group. r2 Relatedness coefficient second group. obsR1 Observed correlation members first group. obsR2 Observed correlation members second group.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateH.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Falconer's Formula — calculateH","text":"Heritability estimates (`heritability_estimates`).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateH.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Falconer's Formula — calculateH","text":"generalization Falconer's formula provides method calculate heritability using observed correlations two groups two relatednesses. function solves H using formula: $$H^2 = \\frac{obsR1 - obsR2}{r1 - r2}$$ r1 r2 relatedness coefficients first second group, respectively, obsR1 obsR2 observed correlations.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Relatedness Coefficient — calculateRelatedness","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"function calculates relatedness coefficient two individuals based shared ancestry, described Wright (1922).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"","code":"calculateRelatedness( generations = 2, path = NULL, full = TRUE, maternal = FALSE, empirical = FALSE, segregating = TRUE, total_a = 6800 * 1e+06, total_m = 16500, weight_a = 1, weight_m = 1, denom_m = FALSE, ... )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"generations Number generations back common ancestors pair share. path Traditional method count common ancestry, twice number generations removed common ancestors. provided, calculated 2*generations. full Logical. Indicates kin share parents common ancestor's generation. Default TRUE. maternal Logical. Indicates maternal lineage considered calculation. empirical Logical. Adjusts coefficient based empirical data, using total number nucleotides parameters. segregating Logical. Adjusts segregating genes. total_a Numeric. Represents total size autosomal genome terms nucleotides, used empirical adjustment. Default 6800*1000000. total_m Numeric. Represents total size mitochondrial genome terms nucleotides, used empirical adjustment. Default 16500. weight_a Numeric. Represents weight phenotypic influence additive genetic variance, used empirical adjustment. weight_m Numeric. Represents weight phenotypic influence mitochondrial effects, used empirical adjustment. denom_m Logical. Indicates `total_m` `weight_m` included denominator empirical adjustment calculation. ... named arguments may passed another function.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"Relatedness Coefficient (`coef`): measure genetic relationship two individuals.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"relatedness coefficient two people (b & c) defined relation common ancestors: \\(r_{bc} = \\sum \\left(\\frac{1}{2}\\right)^{n+n'+1} (1+f_a)\\)","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/calculateRelatedness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate Relatedness Coefficient — calculateRelatedness","text":"","code":"if (FALSE) { # For full siblings, the relatedness coefficient is expected to be 0.5: calculateRelatedness(generations = 1, full = TRUE) # For half siblings, the relatedness coefficient is expected to be 0.25: calculateRelatedness(generations = 1, full = FALSE) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkIDs.html","id":null,"dir":"Reference","previous_headings":"","what":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","title":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","text":"function takes pedigree object performs two main tasks: 1. Checks uniqueness individual IDs. 2. Optionally repairs non-unique IDs based specified logic.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkIDs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","text":"","code":"checkIDs(ped, verbose = FALSE, repair = FALSE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkIDs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","text":"ped dataframe representing pedigree data columns `ID`, `dadID`, `momID`. verbose logical flag indicating whether print progress validation messages console. repair logical flag indicating whether attempt repairs non-unique IDs.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkIDs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","text":"Depending `repair` value, either returns list containing validation results repaired dataframe","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkIDs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe — checkIDs","text":"","code":"if (FALSE) { ped <- data.frame(ID = c(1, 2, 2, 3), dadID = c(NA, 1, 1, 2), momID = c(NA, NA, 2, 2)) checkIDs(ped, verbose = TRUE, repair = FALSE) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":null,"dir":"Reference","previous_headings":"","what":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"function performs two main tasks: 1. Optionally recodes 'sex' variable based given codes males females. 2. Optionally repairs sex coding based specified logic, facilitating accurate construction genetic pedigrees.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"","code":"checkSex( ped, code_male = NULL, code_female = NULL, verbose = FALSE, repair = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"ped dataframe representing pedigree data 'sex' column. code_male current code used represent males 'sex' column. code_female current code used represent females 'sex' column. NULL, recoding performed. verbose logical flag indicating whether print progress validation messages console. repair logical flag indicating whether attempt repairs sex coding.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"Depending value `repair`, either list containing validation results repaired dataframe returned.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"function uses terms 'male' 'female' biological context, based chromosomes biologically-based characteristics relevant genetic studies. usage intended negate personal gender identity individual. recognize importance using language methodologies affirm respect gender identities. function focuses chromosomal information necessary constructing genetic pedigrees, affirm gender spectrum, encompassing wide range identities beyond binary. developers package express unequivocal support folx transgender LGBTQ+ communities. respect complexity gender identity acknowledge distinction biological aspect sex used genetic analysis (genotype) broader, richer concept gender identity (phenotype).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/checkSex.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe — checkSex","text":"","code":"if (FALSE) { ped <- data.frame(ID = c(1, 2, 3), sex = c(\"M\", \"F\", \"M\")) checkSex(ped, code_male = \"M\", verbose = TRUE, repair = FALSE) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":null,"dir":"Reference","previous_headings":"","what":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"comp2vech Turn variance component relatedness matrix half-vectorization","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"","code":"comp2vech(x, include.zeros = FALSE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"x Relatedness component matrix (can matrix, list, object inherits 'Matrix'). include.zeros logical. Whether include -zero rows. Default FALSE.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"half-vectorization relatedness component matrix.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"function wrapper around vech function, extending allow blockwise matrices specific classes. facilitates conversion variance component relatedness matrix half-vectorized form.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/comp2vech.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"comp2vech Turn a variance component relatedness matrix into its half-vectorization — comp2vech","text":"","code":"comp2vech(list(matrix(c(1, .5, .5, 1), 2, 2), matrix(1, 2, 2))) #> [1] 1.0 0.5 1.0 1.0 1.0 1.0"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/createGenDataFrame.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Data Frame for Generation — createGenDataFrame","title":"Create Data Frame for Generation — createGenDataFrame","text":"function creates data frame specific generation within simulated pedigree. initializes data frame default values family ID, individual ID, generation number, paternal ID, maternal ID, spouse ID, sex. individuals initially set NA paternal, maternal, spouse IDs, sex, awaiting assignment.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/createGenDataFrame.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Data Frame for Generation — createGenDataFrame","text":"","code":"createGenDataFrame(sizeGens, genIndex, idGen)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/createGenDataFrame.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Data Frame for Generation — createGenDataFrame","text":"sizeGens numeric vector containing sizes generation within pedigree. genIndex integer representing current generation index data frame created. idGen numeric vector containing ID numbers assigned individuals current generation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/createGenDataFrame.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Data Frame for Generation — createGenDataFrame","text":"data frame representing initial structure individuals specified generation relationships (parental, spousal) defined. columns include family ID (`fam`), individual ID (`id`), generation number (`gen`), father's ID (`pat`), mother's ID (`mat`), spouse's ID (`spt`), sex (`sex`), NA values paternal, maternal, spouse IDs, sex.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/createGenDataFrame.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Data Frame for Generation — createGenDataFrame","text":"","code":"sizeGens <- c(3, 5, 4) # Example sizes for 3 generations genIndex <- 2 # Creating data frame for the 2nd generation idGen <- 101:105 # Example IDs for the 2nd generation df_Ngen <- createGenDataFrame(sizeGens, genIndex, idGen) print(df_Ngen) #> fam id gen pat mat spt sex #> 1 fam 1 101 2 NA NA NA NA #> 2 fam 1 102 2 NA NA NA NA #> 3 fam 1 103 2 NA NA NA NA #> 4 fam 1 104 2 NA NA NA NA #> 5 fam 1 105 2 NA NA NA NA"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/determineSex.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine Sex of Offspring — determineSex","title":"Determine Sex of Offspring — determineSex","text":"function assigns sexes offspring generation based specified sex ratio.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/determineSex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine Sex of Offspring — determineSex","text":"","code":"determineSex(idGen, sexR)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/determineSex.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine Sex of Offspring — determineSex","text":"idGen Vector IDs generation. sexR Numeric value indicating sex ratio (proportion males).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/determineSex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine Sex of Offspring — determineSex","text":"Vector sexes (\"M\" male, \"F\" female) offspring.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/dropLink.html","id":null,"dir":"Reference","previous_headings":"","what":"dropLink A function to drop a person from his/her parents in the simulated pedigree data.frame. 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 simulatePedigree. — dropLink","title":"dropLink A function to drop a person from his/her parents in the simulated pedigree data.frame. 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 simulatePedigree. — dropLink","text":"dropLink function drop person /parents simulated pedigree data.frame. person can dropped specifying /ID specifying generation randomly --dropped person . function can separate one pedigree two pedigrees. Separating small pieces done running function multiple times. supplementary function simulatePedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/dropLink.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"dropLink A function to drop a person from his/her parents in the simulated pedigree data.frame. 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 simulatePedigree. — dropLink","text":"","code":"dropLink( ped, ID_drop = NA_integer_, gen_drop = 2, sex_drop = NA_character_, n_drop = 1 )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/dropLink.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"dropLink A function to drop a person from his/her parents in the simulated pedigree data.frame. 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 simulatePedigree. — dropLink","text":"ped pedigree simulated simulatePedigree function format ID_drop ID person dropped /parents. gen_drop generation randomly dropped person . work `ID_drop` specified. sex_drop biological sex randomly dropped person. n_drop number times mutation happens.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/dropLink.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"dropLink A function to drop a person from his/her parents in the simulated pedigree data.frame. 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 simulatePedigree. — dropLink","text":"pedigree dropped person's `dadID` `momID` set NA.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/efunc.html","id":null,"dir":"Reference","previous_headings":"","what":"Error Function — efunc","title":"Error Function — efunc","text":"Error Function","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/efunc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Error Function — efunc","text":"","code":"efunc(error)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/efunc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Error Function — efunc","text":"error error output","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/efunc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Error Function — efunc","text":"Replaces error message (error) NA","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/evenInsert.html","id":null,"dir":"Reference","previous_headings":"","what":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","title":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","text":"evenInsert function insert m elements evenly length n vector.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/evenInsert.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","text":"","code":"evenInsert(m, n, verbose = FALSE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/evenInsert.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","text":"m numeric vector length less equal n. elements inserted. n numeric vector. vector elements m inserted. verbose logical TRUE, prints additional information. Default FALSE.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/evenInsert.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","text":"Returns numeric vector elements m evenly inserted n.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/evenInsert.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"evenInsert A function to insert m elements evenly into a length n vector. — evenInsert","text":"function takes two vectors, m n, inserts elements m evenly n. length m greater length n, vectors swapped, insertion proceeds. resulting vector combination m n, elements m evenly distributed within n.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/famSizeCal.html","id":null,"dir":"Reference","previous_headings":"","what":"famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function simulatePedigree — famSizeCal","title":"famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function simulatePedigree — famSizeCal","text":"famSizeCal function calculate total number individuals pedigree given parameters. supporting function function simulatePedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/famSizeCal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function simulatePedigree — famSizeCal","text":"","code":"famSizeCal(kpc, Ngen, marR)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/famSizeCal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function simulatePedigree — famSizeCal","text":"kpc Number kids per couple (integer >= 2). Ngen Number generations (integer >= 1). marR Mating rate (numeric value ranging 0 1).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/famSizeCal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function simulatePedigree — famSizeCal","text":"Returns numeric value indicating total pedigree size.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":null,"dir":"Reference","previous_headings":"","what":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"fitComponentModel Fit estimated variance components model covariance data","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"","code":"fitComponentModel(covmat, ...)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"covmat covariance matrix raw data, may blockwise. ... Comma-separated relatedness component matrices representing variance components model.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"regression (linear model fitted lm). coefficients regression represent estimated variance components.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"function fits estimated variance components model given covariance data. rank component matrices checked ensure variance components identified. Warnings issued inconsistencies.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/fitComponentModel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"fitComponentModel Fit the estimated variance components of a model to covariance data — fitComponentModel","text":"","code":"if (FALSE) { # install.packages(\"OpenMX\") data(twinData, package = \"OpenMx\") sellVars <- c(\"ht1\", \"ht2\") mzData <- subset(twinData, zyg %in% c(1), c(selVars, \"zyg\")) dzData <- subset(twinData, zyg %in% c(3), c(selVars, \"zyg\")) fitComponentModel( covmat = list(cov(mzData[, selVars], use = \"pair\"), cov(dzData[, selVars], use = \"pair\")), A = list(matrix(1, nrow = 2, ncol = 2), matrix(c(1, 0.5, 0.5, 1), nrow = 2, ncol = 2)), C = list(matrix(1, nrow = 2, ncol = 2), matrix(1, nrow = 2, ncol = 2)), E = list(diag(1, nrow = 2), diag(1, nrow = 2)) ) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/hazard.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulated pedigree with two extended families and an age-related hazard — hazard","title":"Simulated pedigree with two extended families and an age-related hazard — hazard","text":"dataset simulated age-related hazard. two extended families sampled population.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/hazard.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulated pedigree with two extended families and an age-related hazard — hazard","text":"","code":"data(hazard)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/hazard.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simulated pedigree with two extended families and an age-related hazard — hazard","text":"data frame 43 rows 14 variables","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/hazard.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simulated pedigree with two extended families and an age-related hazard — hazard","text":"variables follows: FamID: ID extended family ID: Person identification variable sex: Sex ID: 1 female; 0 male dadID: ID father momID: ID mother affected: logical. Whether person affected DA1: Binary variable signifying meaninglessness life DA2: Binary variable signifying fundamental unknowability existence birthYr: Birth year person onsetYr: Year onset person deathYr: Death year person available: logical. Whether Gen: Generation person proband: logical. Whether person proband ","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":null,"dir":"Reference","previous_headings":"","what":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"identifyComponentModel Determine variance components model identified","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"","code":"identifyComponentModel(..., verbose = TRUE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"... Comma-separated relatedness component matrices representing variance components model. verbose logical. FALSE, suppresses messages identification; TRUE default.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"list length 2 containing: identified: TRUE model identified, FALSE otherwise. nidp: vector non-identified parameters, specifying names components simultaneously identified.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"function checks identification status given variance components model examining rank concatenated matrices components. components identified, names returned output.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/identifyComponentModel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"identifyComponentModel Determine if a variance components model is identified — identifyComponentModel","text":"","code":"identifyComponentModel(A = list(matrix(1, 2, 2)), C = list(matrix(1, 2, 2)), E = diag(1, 2)) #> Component model is not identified. #> Non-identified parameters are A, C #> $identified #> [1] FALSE #> #> $nidp #> [1] \"A\" \"C\" #>"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inbreeding.html","id":null,"dir":"Reference","previous_headings":"","what":"Artificial pedigree data on eight families with inbreeding — inbreeding","title":"Artificial pedigree data on eight families with inbreeding — inbreeding","text":"dataset created purely imagination includes several types inbreeding. Different kinds inbreeding occur extended family.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inbreeding.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Artificial pedigree data on eight families with inbreeding — inbreeding","text":"","code":"data(inbreeding)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inbreeding.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Artificial pedigree data on eight families with inbreeding — inbreeding","text":"data frame (ped object) 134 rows 7 variables","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inbreeding.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Artificial pedigree data on eight families with inbreeding — inbreeding","text":"types inbreeding follows: Extended Family 1: Sister wives - Children father different mothers sisters. Extended Family 2: Full siblings children. Extended Family 3: Half siblings children. Extended Family 4: First cousins children. Extended Family 5: Father child daughter. Extended Family 6: Half sister wives - Children father different mothers half sisters. Extended Family 7: Uncle-niece Aunt-nephew children. Extended Family 8: father-son pairs children corresponding mother-daughter pair. Although structures technically inbreeding, aim test pedigree diagramming path tracing algorithms. variables follows: ID: Person identification variable sex: Sex ID: 1 female; 0 male dadID: ID father momID: ID mother FamID: ID extended family Gen: Generation person proband: Always FALSE","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":null,"dir":"Reference","previous_headings":"","what":"Infer Relatedness Coefficient — inferRelatedness","title":"Infer Relatedness Coefficient — inferRelatedness","text":"function infers relatedness coefficient two groups based observed correlation additive genetic variance shared environmental variance.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Infer Relatedness Coefficient — inferRelatedness","text":"","code":"inferRelatedness(obsR, aceA = 0.9, aceC = 0, sharedC = 0)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Infer Relatedness Coefficient — inferRelatedness","text":"obsR Numeric. Observed correlation two groups. Must -1 1. aceA Numeric. Proportion variance attributable additive genetic variance. Must 0 1. Default 0.9. aceC Numeric. Proportion variance attributable shared environmental variance. Must 0 1. Default 0. sharedC Numeric. Proportion shared environment shared two individuals. Must 0 1. Default 0.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Infer Relatedness Coefficient — inferRelatedness","text":"Numeric. calculated relatedness coefficient (`est_r`).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Infer Relatedness Coefficient — inferRelatedness","text":"function uses ACE (Additive genetic, Common environmental, Unique environmental) model infer relatedness two individuals groups. considering observed correlation (`obsR`), proportion variance attributable additive genetic variance (`aceA`), proportion shared environmental variance (`aceC`), calculates relatedness coefficient.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/inferRelatedness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Infer Relatedness Coefficient — inferRelatedness","text":"","code":"if (FALSE) { # Infer the relatedness coefficient: inferRelatedness(obsR = 0.5, aceA = 0.9, aceC = 0, sharedC = 0) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeInbreeding.html","id":null,"dir":"Reference","previous_headings":"","what":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","title":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","text":"makeInbreeding function create inbred mates simulated pedigree data.frame. Inbred mates can created specifying IDs generation inbred mate created. specifying generation, inbreeding siblings 1st cousin needs specified. supplementary function simulatePedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeInbreeding.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","text":"","code":"makeInbreeding( ped, ID_mate1 = NA_integer_, ID_mate2 = NA_integer_, verbose = FALSE, gen_inbred = 2, type_inbred = \"sib\" )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeInbreeding.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","text":"ped data.frame format output simulatePedigree. ID_mate1 vector ID first mate. provided, function randomly select two individuals second generation. ID_mate2 vector ID second mate. verbose logical. TRUE, print progress stages algorithm gen_inbred vector generation twin imputed. type_inbred character vector indicating type inbreeding. \"sib\" sibling inbreeding \"cousin\" cousin inbreeding.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeInbreeding.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","text":"Returns data.frame inbred mates.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeInbreeding.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"makeInbreeding A function to create inbred mates in the simulated pedigree data.frame. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for simulatePedigree. — makeInbreeding","text":"function creates inbred mates simulated pedigree data.frame. function's purpose evaluate effect inbreeding model fitting parameter estimation. case needs said, condone inbreeding real life. recognize common practice fields create inbred strains research purposes.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeTwins.html","id":null,"dir":"Reference","previous_headings":"","what":"makeTwins A function to impute twins in the simulated pedigree data.frame. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for simulatePedigree. — makeTwins","title":"makeTwins A function to impute twins in the simulated pedigree data.frame. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for simulatePedigree. — makeTwins","text":"makeTwins function impute twins simulated pedigree data.frame. Twins can imputed specifying IDs specifying generation twin imputed. supplementary function simulatePedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeTwins.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"makeTwins A function to impute twins in the simulated pedigree data.frame. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for simulatePedigree. — makeTwins","text":"","code":"makeTwins( ped, ID_twin1 = NA_integer_, ID_twin2 = NA_integer_, gen_twin = 2, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeTwins.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"makeTwins A function to impute twins in the simulated pedigree data.frame. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for simulatePedigree. — makeTwins","text":"ped data.frame format output simulatePedigree. ID_twin1 vector ID first twin. ID_twin2 vector ID second twin. gen_twin vector generation twin imputed. verbose logical. TRUE, print progress stages algorithm","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/makeTwins.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"makeTwins A function to impute twins in the simulated pedigree data.frame. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for simulatePedigree. — makeTwins","text":"Returns data.frame MZ twins information added new column.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/markPotentialChildren.html","id":null,"dir":"Reference","previous_headings":"","what":"Mark and Assign children — markPotentialChildren","title":"Mark and Assign children — markPotentialChildren","text":"subfunction marks individuals generation potential sons, daughters, parents based relationships assigns unique couple IDs. processes assignment roles relationships within generations pedigree simulation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/markPotentialChildren.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mark and Assign children — markPotentialChildren","text":"","code":"markPotentialChildren(df_Ngen, i, Ngen, sizeGens, CoupleF)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/markPotentialChildren.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mark and Assign children — markPotentialChildren","text":"df_Ngen data frame current generation processed. must include columns individual IDs (`id`), spouse IDs (`spt`), sex (`sex`), previously assigned roles (`ifparent`, `ifson`, `ifdau`). Integer, index current generation processed. Ngen Integer, total number generations simulation. sizeGens Numeric vector, containing size (number individuals) generation. CoupleF Integer, MIGHT number couples current generation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/markPotentialChildren.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Mark and Assign children — markPotentialChildren","text":"Modifies `df_Ngen` place updating adding columns related individual roles (`ifparent`, `ifson`, `ifdau`) couple IDs (`coupleId`). updated data frame also returned integration larger pedigree data frame (`df_Fam`).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/nullToNA.html","id":null,"dir":"Reference","previous_headings":"","what":"nullToNA — nullToNA","title":"nullToNA — nullToNA","text":"nullToNA","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/nullToNA.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"nullToNA — nullToNA","text":"","code":"nullToNA(x)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/nullToNA.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"nullToNA — nullToNA","text":"x vector length","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/nullToNA.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"nullToNA — nullToNA","text":"replaces null values vector NA","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2add.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a pedigree and turn it into an additive genetics relatedness matrix — ped2add","title":"Take a pedigree and turn it into an additive genetics relatedness matrix — ped2add","text":"Take pedigree turn additive genetics relatedness matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2add.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a pedigree and turn it into an additive genetics relatedness matrix — ped2add","text":"","code":"ped2add( ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2add.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a pedigree and turn it into an additive genetics relatedness matrix — ped2add","text":"ped pedigree dataset. Needs ID, momID, dadID columns max.gen maximum number generations compute (e.g., 4th degree relatives). default 25. However can set infinity. `Inf` uses many generations data. sparse logical. TRUE, use return sparse matrices Matrix package verbose logical. TRUE, print progress stages algorithm gc logical. TRUE, frequent garbage collection via gc save memory flatten.diag logical. TRUE, overwrite diagonal final relatedness matrix ones standardize.colnames logical. TRUE, standardize column names pedigree dataset tcross.alt.crossprod logical. TRUE, use alternative method using Crossprod function computing transpose tcross.alt.star logical. TRUE, use alternative method using %\\*% computing transpose","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2add.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a pedigree and turn it into an additive genetics relatedness matrix — ped2add","text":"algorithms methodologies used function discussed exemplified vignette titled \"examplePedigreeFunctions\". advanced scenarios detailed explanations, consult vignette.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2ce.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a pedigree and turn it into an extended environmental relatedness matrix — ped2ce","title":"Take a pedigree and turn it into an extended environmental relatedness matrix — ped2ce","text":"Take pedigree turn extended environmental relatedness matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2ce.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a pedigree and turn it into an extended environmental relatedness matrix — ped2ce","text":"","code":"ped2ce(ped)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2ce.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a pedigree and turn it into an extended environmental relatedness matrix — ped2ce","text":"ped pedigree dataset. Needs ID, momID, dadID columns","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2ce.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a pedigree and turn it into an extended environmental relatedness matrix — ped2ce","text":"algorithms methodologies used function discussed exemplified vignette titled \"examplePedigreeFunctions\". advanced scenarios detailed explanations, consult vignette.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2cn.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a pedigree and turn it into a common nuclear environmental relatedness matrix — ped2cn","title":"Take a pedigree and turn it into a common nuclear environmental relatedness matrix — ped2cn","text":"Take pedigree turn common nuclear environmental relatedness matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2cn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a pedigree and turn it into a common nuclear environmental relatedness matrix — ped2cn","text":"","code":"ped2cn( ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2cn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a pedigree and turn it into a common nuclear environmental relatedness matrix — ped2cn","text":"ped pedigree dataset. Needs ID, momID, dadID columns max.gen maximum number generations compute (e.g., 4th degree relatives). default 25. However can set infinity. `Inf` uses many generations data. sparse logical. TRUE, use return sparse matrices Matrix package verbose logical. TRUE, print progress stages algorithm gc logical. TRUE, frequent garbage collection via gc save memory flatten.diag logical. TRUE, overwrite diagonal final relatedness matrix ones standardize.colnames logical. TRUE, standardize column names pedigree dataset tcross.alt.crossprod logical. TRUE, use alternative method using Crossprod function computing transpose tcross.alt.star logical. TRUE, use alternative method using %\\*% computing transpose","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2cn.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a pedigree and turn it into a common nuclear environmental relatedness matrix — ped2cn","text":"algorithms methodologies used function discussed exemplified vignette titled \"examplePedigreeFunctions\". advanced scenarios detailed explanations, consult vignette.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2com.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a pedigree and turn it into a relatedness matrix — ped2com","title":"Take a pedigree and turn it into a relatedness matrix — ped2com","text":"Take pedigree turn relatedness matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2com.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a pedigree and turn it into a relatedness matrix — ped2com","text":"","code":"ped2com( ped, component, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE, ... )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2com.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a pedigree and turn it into a relatedness matrix — ped2com","text":"ped pedigree dataset. Needs ID, momID, dadID columns component character. component pedigree return. See Details. max.gen maximum number generations compute (e.g., 4th degree relatives). default 25. However can set infinity. `Inf` uses many generations data. sparse logical. TRUE, use return sparse matrices Matrix package verbose logical. TRUE, print progress stages algorithm gc logical. TRUE, frequent garbage collection via gc save memory flatten.diag logical. TRUE, overwrite diagonal final relatedness matrix ones standardize.colnames logical. TRUE, standardize column names pedigree dataset tcross.alt.crossprod logical. TRUE, use alternative method using Crossprod function computing transpose tcross.alt.star logical. TRUE, use alternative method using %\\*% computing transpose ... additional arguments passed ped2com","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2com.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a pedigree and turn it into a relatedness matrix — ped2com","text":"algorithms methodologies used function discussed exemplified vignette titled \"examplePedigreeFunctions\". advanced scenarios detailed explanations, consult vignette.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2fam.html","id":null,"dir":"Reference","previous_headings":"","what":"Segment Pedigree into Extended Families — ped2fam","title":"Segment Pedigree into Extended Families — ped2fam","text":"function adds extended family ID variable pedigree segmenting dataset independent extended families using weakly connected components algorithm.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2fam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Segment Pedigree into Extended Families — ped2fam","text":"","code":"ped2fam( ped, personID = \"ID\", momID = \"momID\", dadID = \"dadID\", famID = \"famID\" )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2fam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Segment Pedigree into Extended Families — ped2fam","text":"ped pedigree dataset. Needs ID, momID, dadID columns personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable famID character. Name column created ped family ID variable","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2fam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Segment Pedigree into Extended Families — ped2fam","text":"pedigree dataset one additional column newly created extended family ID","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2fam.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Segment Pedigree into Extended Families — ped2fam","text":"general idea function use person ID, mother ID, father ID create extended family ID everyone family ID (perhaps extended) pedigree. , pair people family ID least one traceable relation length one another. function works turning pedigree mathematical graph using igraph package. graph form, function uses weakly connected components search possible relationship paths connect anyone data anyone else data.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2graph.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn a pedigree into a graph — ped2graph","title":"Turn a pedigree into a graph — ped2graph","text":"Turn pedigree graph","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn a pedigree into a graph — ped2graph","text":"","code":"ped2graph( ped, personID = \"ID\", momID = \"momID\", dadID = \"dadID\", directed = TRUE, adjacent = c(\"parents\", \"mothers\", \"fathers\") )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Turn a pedigree into a graph — ped2graph","text":"ped pedigree dataset. Needs ID, momID, dadID columns personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable directed Logical scalar. Default TRUE. Indicates whether create directed graph. adjacent Character. Relationship defines adjacency graph: parents, mothers, fathers","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Turn a pedigree into a graph — ped2graph","text":"graph","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2graph.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Turn a pedigree into a graph — ped2graph","text":"general idea function represent pedigree graph using igraph package. graph form, several common pedigree tasks become much simpler. adjacent argument allows different kinds graph structures. using parents adjacency, graph shows parent-child relationships. using mother adjacency, graph shows mother-child relationships. Similarly using father adjacency, father-child relationships appear graph. Construct extended families parent graph, maternal lines mothers graph, paternal lines fathers graph.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2maternal.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a maternal line ID variable to a pedigree — ped2maternal","title":"Add a maternal line ID variable to a pedigree — ped2maternal","text":"Add maternal line ID variable pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2maternal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a maternal line ID variable to a pedigree — ped2maternal","text":"","code":"ped2maternal( ped, personID = \"ID\", momID = \"momID\", dadID = \"dadID\", matID = \"matID\" )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2maternal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a maternal line ID variable to a pedigree — ped2maternal","text":"ped pedigree dataset. Needs ID, momID, dadID columns personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable matID Character. Maternal line ID variable created added pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2maternal.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a maternal line ID variable to a pedigree — ped2maternal","text":"various scenarios useful know people pedigree belong maternal lines. function first turns pedigree graph adjacency defined mother-child relationships. Subsequently, weakly connected components algorithm finds separate maternal lines gives ID variable.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2mit.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a pedigree and turn it into a mitochondrial relatedness matrix — ped2mit","title":"Take a pedigree and turn it into a mitochondrial relatedness matrix — ped2mit","text":"Take pedigree turn mitochondrial relatedness matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2mit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a pedigree and turn it into a mitochondrial relatedness matrix — ped2mit","text":"","code":"ped2mit( ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2mit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a pedigree and turn it into a mitochondrial relatedness matrix — ped2mit","text":"ped pedigree dataset. Needs ID, momID, dadID columns max.gen maximum number generations compute (e.g., 4th degree relatives). default 25. However can set infinity. `Inf` uses many generations data. sparse logical. TRUE, use return sparse matrices Matrix package verbose logical. TRUE, print progress stages algorithm gc logical. TRUE, frequent garbage collection via gc save memory flatten.diag logical. TRUE, overwrite diagonal final relatedness matrix ones standardize.colnames logical. TRUE, standardize column names pedigree dataset tcross.alt.crossprod logical. TRUE, use alternative method using Crossprod function computing transpose tcross.alt.star logical. TRUE, use alternative method using %\\*% computing transpose","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2mit.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a pedigree and turn it into a mitochondrial relatedness matrix — ped2mit","text":"algorithms methodologies used function discussed exemplified vignette titled \"examplePedigreeFunctions\". advanced scenarios detailed explanations, consult vignette.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2paternal.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a paternal line ID variable to a pedigree — ped2paternal","title":"Add a paternal line ID variable to a pedigree — ped2paternal","text":"Add paternal line ID variable pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2paternal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a paternal line ID variable to a pedigree — ped2paternal","text":"","code":"ped2paternal( ped, personID = \"ID\", momID = \"momID\", dadID = \"dadID\", patID = \"patID\" )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2paternal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a paternal line ID variable to a pedigree — ped2paternal","text":"ped pedigree dataset. Needs ID, momID, dadID columns personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable patID Character. Paternal line ID variable created added pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/ped2paternal.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a paternal line ID variable to a pedigree — ped2paternal","text":"various scenarios useful know people pedigree belong paternal lines. function first turns pedigree graph adjacency defined father-child relationships. Subsequently, weakly connected components algorithm finds separate paternal lines gives ID variable.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/plotPedigree.html","id":null,"dir":"Reference","previous_headings":"","what":"plotPedigree A wrapped function to plot simulated pedigree from function simulatePedigree. This function require the installation of package kinship2. — plotPedigree","title":"plotPedigree A wrapped function to plot simulated pedigree from function simulatePedigree. This function require the installation of package kinship2. — plotPedigree","text":"plotPedigree wrapped function plot simulated pedigree function simulatePedigree. function require installation package kinship2.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/plotPedigree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"plotPedigree A wrapped function to plot simulated pedigree from function simulatePedigree. This function require the installation of package kinship2. — plotPedigree","text":"","code":"plotPedigree( ped, code_male = NULL, verbose = FALSE, affected = NULL, cex = 0.5, col = 1, symbolsize = 1, branch = 0.6, packed = TRUE, align = c(1.5, 2), width = 8, density = c(-1, 35, 65, 20), mar = c(2.1, 1, 2.1, 1), angle = c(90, 65, 40, 0), keep.par = FALSE, pconnect = 0.5, ... )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/plotPedigree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"plotPedigree A wrapped function to plot simulated pedigree from function simulatePedigree. This function require the installation of package kinship2. — plotPedigree","text":"ped simulated pedigree data.frame function simulatePedigree. pedigree dataframe colnames dataframe simulated function simulatePedigree. code_male optional input allows indicate value sex variable codes male. recoded \"M\" (Male). NULL, recoding performed. verbose logical TRUE, prints additional information. Default FALSE. affected optional parameter can either string specifying column name indicates affected status numeric/logical vector length number rows 'ped'. NULL, affected status assigned. cex font size IDs individual plot. col color id. Default assigns color everyone. symbolsize controls symbolsize. Default=1. branch defines much angle used connect various levels nuclear families. packed default=T. T, uniform distance individuals given level. align parameters control extra effort spent trying align children underneath parents, without making pedigree wide. Set F speed plotting. width default=8. packed pedigree, minimum width allowed realignment pedigrees. density defines density used symbols. Takes 4 different values. mar margin parmeters, par function angle defines angle used symbols. Takes 4 different values. keep.par Default = F, allows user keep parameter settings plotting (useful adding extras plot) pconnect connecting parent children program try make connecting line close vertical possible, subject lying inside endpoints line connects children least pconnect people. Setting option large number force line connect midpoint children. ... Extra options feed plot function.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/plotPedigree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"plotPedigree A wrapped function to plot simulated pedigree from function simulatePedigree. This function require the installation of package kinship2. — plotPedigree","text":"plot provided pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/potter.html","id":null,"dir":"Reference","previous_headings":"","what":"Fictional pedigree data on a wizarding family — potter","title":"Fictional pedigree data on a wizarding family — potter","text":"dataset created purely imagination includes subset Potter extended family.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/potter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fictional pedigree data on a wizarding family — potter","text":"","code":"data(potter)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/potter.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Fictional pedigree data on a wizarding family — potter","text":"data frame (ped object) 36 rows 8 variables","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/potter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fictional pedigree data on a wizarding family — potter","text":"variables follows: personID: Person identification variable famID: Family identification variable name: Name person gen: Generation person momID: ID mother dadID: ID father spouseID: ID spouse sex: Sex ID: 1 male; 0 female IDs 100s momIDs dadIDs people dataset.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/recodeSex.html","id":null,"dir":"Reference","previous_headings":"","what":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","title":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","text":"function serves wrapper around `checkSex` specifically handle repair sex coding pedigree dataframe. sets `repair` flag TRUE automatically forwards additional parameters `checkSex`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/recodeSex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","text":"","code":"recodeSex( ped, verbose = FALSE, code_male = NULL, code_na = NULL, code_female = NULL, recode_male = \"M\", recode_female = \"F\", recode_na = NA_character_ )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/recodeSex.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","text":"ped dataframe representing pedigree data 'sex' column. verbose logical flag indicating whether print progress validation messages console. code_male current code used represent males 'sex' column. code_na current value used missing values. code_female current code used represent females 'sex' column. NULL, recoding performed. recode_male value use males. Default \"M\" recode_female value use females. Default \"F\" recode_na value use missing values. Default NA_character_","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/recodeSex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","text":"modified version input data.frame ped, containing additional modified 'sex_recode' column 'sex' values recoded according code_male. NA values 'sex' column preserved.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/recodeSex.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Recodes Sex Variable in a Pedigree Dataframe — recodeSex","text":"function uses terms 'male' 'female' biological context, based chromosomes biologically-based characteristics relevant genetic studies. usage intended negate personal gender identity individual. recognize importance using language methodologies affirm respect gender identities. function focuses chromosomal information necessary constructing genetic pedigrees, affirm gender spectrum, encompassing wide range identities beyond binary. developers package express unequivocal support folx transgender LGBTQ+ communities. respect complexity gender identity acknowledge distinction biological aspect sex used genetic analysis (genotype) broader, richer concept gender identity (phenotype).","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":null,"dir":"Reference","previous_headings":"","what":"related_coef (Deprecated) — related_coef","title":"related_coef (Deprecated) — related_coef","text":"calling function, warning issued deprecation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"related_coef (Deprecated) — related_coef","text":"","code":"related_coef(...)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"related_coef (Deprecated) — related_coef","text":"... Arguments passed `calculateRelatedness`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"related_coef (Deprecated) — related_coef","text":"result calling `calculateRelatedness`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"related_coef (Deprecated) — related_coef","text":"function wrapper around new `calculateRelatedness` function. `related_coef` deprecated, advised use `calculateRelatedness` directly.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/related_coef.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"related_coef (Deprecated) — related_coef","text":"","code":"if (FALSE) { # This is an example of the deprecated function: related_coef(...) # It is recommended to use: calculateRelatedness(...) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":null,"dir":"Reference","previous_headings":"","what":"relatedness (Deprecated) — relatedness","title":"relatedness (Deprecated) — relatedness","text":"calling function, warning issued deprecation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"relatedness (Deprecated) — relatedness","text":"","code":"relatedness(...)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"relatedness (Deprecated) — relatedness","text":"... Arguments passed `inferRelatedness`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"relatedness (Deprecated) — relatedness","text":"result calling `inferRelatedness`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"relatedness (Deprecated) — relatedness","text":"function wrapper around new `inferRelatedness` function. `relatedness` deprecated, advised use `inferRelatedness` directly.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/relatedness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"relatedness (Deprecated) — relatedness","text":"","code":"if (FALSE) { # This is an example of the deprecated function: relatedness(...) # It is recommended to use: inferRelatedness(...) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairIDs.html","id":null,"dir":"Reference","previous_headings":"","what":"Repair Missing IDs — repairIDs","title":"Repair Missing IDs — repairIDs","text":"function repairs missing IDs pedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairIDs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Repair Missing IDs — repairIDs","text":"","code":"repairIDs(ped, verbose = FALSE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairIDs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Repair Missing IDs — repairIDs","text":"ped pedigree object verbose logical indicating whether print progress messages","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairIDs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Repair Missing IDs — repairIDs","text":"corrected pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":null,"dir":"Reference","previous_headings":"","what":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"function serves wrapper around `checkSex` specifically handle repair sex coding pedigree dataframe.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"","code":"repairSex(ped, verbose = FALSE, code_male = NULL)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"ped dataframe representing pedigree data 'sex' column. verbose logical flag indicating whether print progress validation messages console. code_male current code used represent males 'sex' column.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"modified version input data.frame ped, containing additional modified 'sex_recode' column 'sex' values recoded according code_male. NA values 'sex' column preserved.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"function uses terms 'male' 'female' biological context, based chromosomes biologically-based characteristics relevant genetic studies. usage intended negate personal gender identity individual. recognize importance using language methodologies affirm respect gender identities. function focuses chromosomal information necessary constructing genetic pedigrees, affirm gender spectrum, encompassing wide range identities beyond binary. developers package express unequivocal support folx transgender LGBTQ+ communities. respect complexity gender identity acknowledge distinction biological aspect sex used genetic analysis (genotype) broader, richer concept gender identity (phenotype).","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/repairSex.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Repairs Sex Coding in a Pedigree Dataframe — repairSex","text":"","code":"if (FALSE) { ped <- data.frame(ID = c(1, 2, 3), sex = c(\"M\", \"F\", \"M\")) repairSex(ped, code_male = \"M\", verbose = TRUE) }"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/resample.html","id":null,"dir":"Reference","previous_headings":"","what":"Resample Elements of a Vector — resample","title":"Resample Elements of a Vector — resample","text":"function performs resampling elements vector `x`. randomly shuffles elements `x` returns vector resampled elements. `x` empty, returns `NA_integer_`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/resample.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Resample Elements of a Vector — resample","text":"","code":"resample(x, ...)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/resample.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Resample Elements of a Vector — resample","text":"x vector containing elements resampled. `x` empty, function return `NA_integer_`. ... Additional arguments passed `sample.int`, `size` number items sample `replace` indicating whether sampling replacement.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/resample.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Resample Elements of a Vector — resample","text":"vector resampled elements `x`. `x` empty, returns `NA_integer_`. length type returned vector depend input vector `x` additional arguments provided via `...`.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/rmvn.html","id":null,"dir":"Reference","previous_headings":"","what":"rmvn — rmvn","title":"rmvn — rmvn","text":"rmvn","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/rmvn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rmvn — rmvn","text":"","code":"rmvn(n, sigma)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/rmvn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"rmvn — rmvn","text":"n Sample Size sigma Covariance matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/rmvn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"rmvn — rmvn","text":"Generates multivariate normal data covariance matrix (sigma) length n","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/simulatePedigree.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate Pedigrees This function simulates ","title":"Simulate Pedigrees This function simulates ","text":"Simulate Pedigrees function simulates \"balanced\" pedigrees based group parameters: 1) k - Kids per couple; 2) G - Number generations; 3) p - Proportion males offspring; 4) r - Mating rate.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/simulatePedigree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate Pedigrees This function simulates ","text":"","code":"simulatePedigree( kpc = 3, Ngen = 4, sexR = 0.5, marR = 2/3, rd_kpc = FALSE, balancedSex = TRUE, balancedMar = TRUE, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/simulatePedigree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate Pedigrees This function simulates ","text":"kpc Number kids per couple. integer >= 2 determines many kids fertilized mated couple pedigree. Default value 3. Returns error kpc equals 1. Ngen Number generations. integer >= 2 determines many generations simulated pedigree . first generation always fertilized couple. last generation mated individuals. sexR Sex ratio offspring. numeric value ranging 0 1 determines proportion males offspring pedigree. instance, 0.4 means 40 percent offspring male. marR Mating rate. numeric value ranging 0 1 determines proportion mated (fertilized) couples pedigree within generation. instance, marR = 0.5 suggests 50 percent offspring specific generation mated offspring. rd_kpc logical. TRUE, number kids per mate randomly generated poisson distribution mean kpc. FALSE, number kids per mate fixed kpc. balancedSex fully developed yet. Always TRUE current version. balancedMar fully developed yet. Always TRUE current version. verbose logical TRUE, print progress stages algorithm","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/simulatePedigree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate Pedigrees This function simulates ","text":"data.frame row representing simulated individual. columns follows: fam: family id simulated individual. 'fam1' single simulated pedigree. ID: unique personal ID simulated individual. first digit fam id; fourth digit generation individual ; following digits represent order individual within /pedigree. example, 100411 suggests individual family id 1, 4th generation, 11th individual 4th generation. gen: generation simulated individual . dadID: Personal ID individual's father. momID: Personal ID individual's mother. spt: Personal ID individual's mate. sex: Biological sex individual. F - female; M - male.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/sizeAllGens.html","id":null,"dir":"Reference","previous_headings":"","what":"sizeAllGens An internal supporting function for simulatePedigree. — sizeAllGens","title":"sizeAllGens An internal supporting function for simulatePedigree. — sizeAllGens","text":"sizeAllGens internal supporting function simulatePedigree.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/sizeAllGens.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"sizeAllGens An internal supporting function for simulatePedigree. — sizeAllGens","text":"","code":"sizeAllGens(kpc, Ngen, marR)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/sizeAllGens.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"sizeAllGens An internal supporting function for simulatePedigree. — sizeAllGens","text":"kpc Number kids per couple (integer >= 2). Ngen Number generations (integer >= 1). marR Mating rate (numeric value ranging 0 1).","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/sizeAllGens.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"sizeAllGens An internal supporting function for simulatePedigree. — sizeAllGens","text":"Returns vector including number individuals every generation.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/standardizeColnames.html","id":null,"dir":"Reference","previous_headings":"","what":"Standardize Column Names in a Dataframe (Internal) — standardizeColnames","title":"Standardize Column Names in a Dataframe (Internal) — standardizeColnames","text":"internal function standardizes column names given dataframe. utilizes regular expressions `tolower()` function match column names list predefined standard names. approach case-insensitive allows flexible matching column names.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/standardizeColnames.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Standardize Column Names in a Dataframe (Internal) — standardizeColnames","text":"","code":"standardizeColnames(df, verbose = FALSE)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/standardizeColnames.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Standardize Column Names in a Dataframe (Internal) — standardizeColnames","text":"df dataframe whose column names need standardized. verbose logical indicating whether print progress messages.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/standardizeColnames.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Standardize Column Names in a Dataframe (Internal) — standardizeColnames","text":"dataframe standardized column names.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeFamilies.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the families in a pedigree — summarizeFamilies","title":"Summarize the families in a pedigree — summarizeFamilies","text":"Summarize families pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeFamilies.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the families in a pedigree — summarizeFamilies","text":"","code":"summarizeFamilies( ped, famID = \"famID\", personID = \"ID\", momID = \"momID\", dadID = \"dadID\", matID = \"matID\", patID = \"patID\", byr = NULL, founder_sort_var = NULL, include_founder = FALSE, nbiggest = 5, noldest = 5, skip_var = NULL, five_num_summary = FALSE, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeFamilies.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the families in a pedigree — summarizeFamilies","text":"ped pedigree dataset. Needs ID, momID, dadID columns famID character. Name column created ped family ID variable personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable matID Character. Maternal line ID variable created added pedigree patID Character. Paternal line ID variable created added pedigree byr Optional column name birth year. founder_sort_var variable sort founders . NULL, founders sorted birth year (`byr`) present `personID` otherwise. include_founder Logical, TRUE, include founder line summary statistics. nbiggest number biggest lines return. noldest number oldest lines return. skip_var character vector variables skip calculating summary statistics. five_num_summary Logical, TRUE, include 5-number summary (min, Q1, median, Q3, max) summary statistics. verbose Logical, TRUE, print progress messages.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeMatrilines.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the maternal lines in a pedigree — summarizeMatrilines","title":"Summarize the maternal lines in a pedigree — summarizeMatrilines","text":"Summarize maternal lines pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeMatrilines.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the maternal lines in a pedigree — summarizeMatrilines","text":"","code":"summarizeMatrilines( ped, famID = \"famID\", personID = \"ID\", momID = \"momID\", dadID = \"dadID\", matID = \"matID\", patID = \"patID\", byr = NULL, include_founder = FALSE, founder_sort_var = NULL, nbiggest = 5, noldest = 5, skip_var = NULL, five_num_summary = FALSE, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizeMatrilines.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the maternal lines in a pedigree — summarizeMatrilines","text":"ped pedigree dataset. Needs ID, momID, dadID columns famID character. Name column created ped family ID variable personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable matID Character. Maternal line ID variable created added pedigree patID Character. Paternal line ID variable created added pedigree byr Optional column name birth year. include_founder Logical, TRUE, include founder line summary statistics. founder_sort_var variable sort founders . NULL, founders sorted birth year (`byr`) present `personID` otherwise. nbiggest number biggest lines return. noldest number oldest lines return. skip_var character vector variables skip calculating summary statistics. five_num_summary Logical, TRUE, include 5-number summary (min, Q1, median, Q3, max) summary statistics. verbose Logical, TRUE, print progress messages.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePatrilines.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the paternal lines in a pedigree — summarizePatrilines","title":"Summarize the paternal lines in a pedigree — summarizePatrilines","text":"Summarize paternal lines pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePatrilines.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the paternal lines in a pedigree — summarizePatrilines","text":"","code":"summarizePatrilines( ped, famID = \"famID\", personID = \"ID\", momID = \"momID\", dadID = \"dadID\", matID = \"matID\", patID = \"patID\", byr = NULL, founder_sort_var = NULL, include_founder = FALSE, nbiggest = 5, noldest = 5, skip_var = NULL, five_num_summary = FALSE, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePatrilines.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the paternal lines in a pedigree — summarizePatrilines","text":"ped pedigree dataset. Needs ID, momID, dadID columns famID character. Name column created ped family ID variable personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable matID Character. Maternal line ID variable created added pedigree patID Character. Paternal line ID variable created added pedigree byr Optional column name birth year. founder_sort_var variable sort founders . NULL, founders sorted birth year (`byr`) present `personID` otherwise. include_founder Logical, TRUE, include founder line summary statistics. nbiggest number biggest lines return. noldest number oldest lines return. skip_var character vector variables skip calculating summary statistics. five_num_summary Logical, TRUE, include 5-number summary (min, Q1, median, Q3, max) summary statistics. verbose Logical, TRUE, print progress messages.","code":""},{"path":[]},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePedigrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize Pedigree Data — summarizePedigrees","title":"Summarize Pedigree Data — summarizePedigrees","text":"function summarizes pedigree data, including calculating summary statistics numeric variables, finding originating member family, maternal, paternal line.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePedigrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize Pedigree Data — summarizePedigrees","text":"","code":"summarizePedigrees( ped, famID = \"famID\", personID = \"ID\", momID = \"momID\", dadID = \"dadID\", matID = \"matID\", patID = \"patID\", type = c(\"fathers\", \"mothers\", \"families\"), byr = NULL, include_founder = FALSE, founder_sort_var = NULL, nbiggest = 5, noldest = 5, skip_var = NULL, five_num_summary = FALSE, verbose = FALSE )"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePedigrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize Pedigree Data — summarizePedigrees","text":"ped pedigree dataset. Needs ID, momID, dadID columns famID character. Name column created ped family ID variable personID character. Name column ped person ID variable momID character. Name column ped mother ID variable dadID character. Name column ped father ID variable matID Character. Maternal line ID variable created added pedigree patID Character. Paternal line ID variable created added pedigree type type summary statistics calculate. Options \"fathers\", \"mothers\", \"families\". byr Optional column name birth year. include_founder Logical, TRUE, include founder line summary statistics. founder_sort_var variable sort founders . NULL, founders sorted birth year (`byr`) present `personID` otherwise. nbiggest number biggest lines return. noldest number oldest lines return. skip_var character vector variables skip calculating summary statistics. five_num_summary Logical, TRUE, include 5-number summary (min, Q1, median, Q3, max) summary statistics. verbose Logical, TRUE, print progress messages.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/summarizePedigrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize Pedigree Data — summarizePedigrees","text":"data.frame (list) containing summary statistics family, maternal, paternal lines, well 5 oldest biggest lines.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/try_na.html","id":null,"dir":"Reference","previous_headings":"","what":"modified tryCatch function — try_na","title":"modified tryCatch function — try_na","text":"modified tryCatch function","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/try_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"modified tryCatch function — try_na","text":"","code":"try_na(x)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/try_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"modified tryCatch function — try_na","text":"x vector length","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/try_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"modified tryCatch function — try_na","text":"Fuses nullToNA function efunc","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":null,"dir":"Reference","previous_headings":"","what":"vech Create the half-vectorization of a matrix — vech","title":"vech Create the half-vectorization of a matrix — vech","text":"vech Create half-vectorization matrix","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"vech Create the half-vectorization of a matrix — vech","text":"","code":"vech(x)"},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"vech Create the half-vectorization of a matrix — vech","text":"x matrix, half-vectorization desired","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"vech Create the half-vectorization of a matrix — vech","text":"vector containing lower triangle matrix, including diagonal.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"vech Create the half-vectorization of a matrix — vech","text":"function returns vectorized form lower triangle matrix, including diagonal. upper triangle ignored checking provided matrix symmetric.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/reference/vech.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"vech Create the half-vectorization of a matrix — vech","text":"","code":"vech(matrix(c(1, 0.5, 0.5, 1), nrow = 2, ncol = 2)) #> [1] 1.0 0.5 1.0"},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-1301","dir":"Changelog","previous_headings":"","what":"BGmisc 1.3.0.1","title":"BGmisc 1.3.0.1","text":"Created subfunctions reduce function complexity","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-130","dir":"Changelog","previous_headings":"","what":"BGmisc 1.3.0","title":"BGmisc 1.3.0","text":"Fixed incorrectly spelled last name potter pedigree Added function summarize variables family, matrilinael, patrilineal lines Added within row duplicate ID checks Added data validation vignettes Harmonized function names arguments","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-121","dir":"Changelog","previous_headings":"","what":"BGmisc 1.2.1","title":"BGmisc 1.2.1","text":"Added alternative transpose options matrix Added generalization Falconer’s formula","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-120","dir":"Changelog","previous_headings":"","what":"BGmisc 1.2.0","title":"BGmisc 1.2.0","text":"CRAN release: 2024-02-26 Added numerous code checks, increased code coverage 85% Replaced sapply usage Added additional data validation checks Accompanying paper published Journal Open Source Software","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-110","dir":"Changelog","previous_headings":"","what":"BGmisc 1.1.0","title":"BGmisc 1.1.0","text":"Added ability simulate twins Can now trace paternal maternal lines ’s now Harry Potter pedigree","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-101","dir":"Changelog","previous_headings":"","what":"BGmisc 1.0.1","title":"BGmisc 1.0.1","text":"CRAN release: 2023-09-26 Hot fix resolve plotPedigree wrapper function breaking pedigrees contained multiple families","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-10","dir":"Changelog","previous_headings":"","what":"BGmisc 1.0","title":"BGmisc 1.0","text":"CRAN release: 2023-09-20 Added major update include simulations, plotting, examples.","code":""},{"path":"https://r-computing-lab.github.io/BGmisc/news/index.html","id":"bgmisc-01","dir":"Changelog","previous_headings":"","what":"BGmisc 0.1","title":"BGmisc 0.1","text":"CRAN release: 2020-12-04 Added NEWS.md file track changes package. Initial version launched","code":""}]