Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9d7f3e4
Create makeLinks.R
smasongarrison Mar 10, 2025
93c3656
Update makeLinks.R
smasongarrison Mar 10, 2025
e669c5c
Update makeLinks.R
smasongarrison Mar 11, 2025
85f2d76
style
smasongarrison Mar 11, 2025
1313e47
Update makeLinks.R
smasongarrison Mar 11, 2025
1d7fb5f
Update makeLinks.R
smasongarrison Mar 11, 2025
29874f9
add buffer
smasongarrison Mar 11, 2025
3dd1796
tests
smasongarrison Mar 11, 2025
21da97a
links
smasongarrison Mar 12, 2025
0f7d43d
fixed methods call error
smasongarrison Mar 12, 2025
6dc9fe7
read wikitree
smasongarrison Mar 12, 2025
8f8b8f6
REFACTOR
smasongarrison Mar 13, 2025
8ebf258
add different data types
smasongarrison Mar 13, 2025
1120a3d
adding documenation
smasongarrison Mar 13, 2025
b71256c
forgfot to export
smasongarrison Mar 13, 2025
72859a5
Update makeLinks.R
smasongarrison Mar 13, 2025
92b0ca8
adds IDs
smasongarrison Mar 13, 2025
3c7df6c
convert warnings to messages
smasongarrison Mar 13, 2025
b717ce7
smarter
smasongarrison Mar 13, 2025
6e7261b
Update makeLinks.R
smasongarrison Mar 14, 2025
6d9d765
Merge branch 'dev_main' into makelinks
smasongarrison Mar 14, 2025
0d4e518
merge legacy
smasongarrison Mar 15, 2025
f625081
Merge branch 'dev_main' into makelinks
smasongarrison Mar 17, 2025
2e06731
Update test-convertPedigree.R
smasongarrison Mar 17, 2025
cb29d27
testing out
smasongarrison Mar 17, 2025
d1d473d
temp
smasongarrison Mar 19, 2025
5ce5a2a
Update partial.Rmd
smasongarrison Mar 20, 2025
04a084d
Update partial.Rmd
smasongarrison Mar 20, 2025
c8e8129
Update partial.Rmd
smasongarrison Mar 20, 2025
7d4f150
bias
smasongarrison Mar 21, 2025
394a48c
Update partial.Rmd
smasongarrison Mar 24, 2025
578d3cd
documentation
smasongarrison Mar 24, 2025
5411f25
forgot suggestions
smasongarrison Mar 24, 2025
35e39c9
fix tests?
smasongarrison Mar 24, 2025
fd376c7
now returns silently
smasongarrison Mar 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: BGmisc
Title: An R Package for Extended Behavior Genetics Analysis
Version: 1.3.4.1
Version: 1.3.5
Authors@R: c(
person("S. Mason", "Garrison", , "garrissm@wfu.edu", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4804-6003")),
Expand Down Expand Up @@ -33,8 +33,10 @@ Imports:
kinship2,
Matrix,
stats,
stringr
stringr,
methods
Suggests:
corrplot,
dplyr,
EasyMx,
knitr,
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ export(allGens)
export(calculateRelatedness)
export(checkIDs)
export(checkSex)
export(com2links)
export(comp2vech)
export(createGenDataFrame)
export(dropLink)
export(evenInsert)
export(extractSummaryText)
export(famSizeCal)
export(fitComponentModel)
export(identifyComponentModel)
export(inferRelatedness)
export(makeInbreeding)
export(makeTwins)
export(parseTree)
export(ped2add)
export(ped2ce)
export(ped2cn)
Expand All @@ -26,6 +29,7 @@ export(ped2mit)
export(ped2paternal)
export(plotPedigree)
export(readGedcom)
export(readWikifamilytree)
export(recodeSex)
export(related_coef)
export(relatedness)
Expand Down
10 changes: 9 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# BGmisc 1.3.5
* Add com2links function that converts components to kinship links
* Add tests for com2links
* Add function to extract family tree from wiki family tree template
* Add tests for readWikifamilytree
* Create vignette for adjacency matrix methods
* Silences invisible list for plot

# BGmisc 1.3.4.1
* Hot fix to resolve issue with list of adjacency matrix not loading saved version
* Reoptimized generation calculation

# BGmisc 1.3.4
* Added alternative (and faster) methods to create the adjacency matrix
* Add tests for comparison of adjacency matrix methods
* Add tests for comparison of adjacency matrix build methods
* Added Royal Family pedigree

# BGmisc 1.3.3
Expand Down
6 changes: 3 additions & 3 deletions R/checkSex.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,23 @@ recodeSex <- function(
}

# Recode as "F" or "M" based on code_male, preserving NAs
if (!is.null(code_male) & !is.null(code_female)) {
if (!is.null(code_male) && !is.null(code_female)) {
# Initialize sex_recode as NA, preserving the length of the 'sex' column
ped$sex_recode <- recode_na
ped$sex_recode[ped$sex == code_female] <- recode_female
ped$sex_recode[ped$sex == code_male] <- recode_male
# Overwriting temp recode variable
ped$sex <- ped$sex_recode
ped$sex_recode <- NULL
} else if (!is.null(code_male) & is.null(code_female)) {
} else if (!is.null(code_male) && is.null(code_female)) {
# Initialize sex_recode as NA, preserving the length of the 'sex' column
ped$sex_recode <- recode_na
ped$sex_recode[ped$sex != code_male & !is.na(ped$sex)] <- recode_female
ped$sex_recode[ped$sex == code_male] <- recode_male
# Overwriting temp recode variable
ped$sex <- ped$sex_recode
ped$sex_recode <- NULL
} else if (is.null(code_male) & !is.null(code_female)) {
} else if (is.null(code_male) && !is.null(code_female)) {
# Initialize sex_recode as NA, preserving the length of the 'sex' column
ped$sex_recode <- recode_na
ped$sex_recode[ped$sex != code_female & !is.na(ped$sex)] <- recode_male
Expand Down
6 changes: 3 additions & 3 deletions R/convertPedigree.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ ped2com <- function(ped, component,
if (verbose) cat("Resuming: Constructed matrix...\n")
jss <- readRDS(checkpoint_files$jss)
iss <- readRDS(checkpoint_files$iss)
list_of_adjacencies <- list(iss=iss, jss=jss)
list_of_adjacencies <- list(iss = iss, jss = jss)
} else {

list_of_adjacencies <- compute_parent_adjacency(
Expand Down Expand Up @@ -177,7 +177,7 @@ ped2com <- function(ped, component,
}
# Garbage collection if gc is TRUE
if (gc) {
rm(parList, lens,list_of_adjacencies)
rm(parList, lens, list_of_adjacencies)
gc()
}
}
Expand Down Expand Up @@ -264,7 +264,7 @@ ped2com <- function(ped, component,

# r is I + A + A^2 + ... = (I-A)^-1 from RAM
# could trim, here
while (mtSum != 0 & count < maxCount) {
while (mtSum != 0 && count < maxCount) {
r <- r + newIsPar
gen <- gen + (Matrix::rowSums(newIsPar) > 0)
newIsPar <- newIsPar %*% isPar
Expand Down
Loading