Skip to content

Commit 9281590

Browse files
Merge pull request #57 from R-Computing-Lab/makelinks
Makelinks
2 parents c176a68 + fd376c7 commit 9281590

30 files changed

Lines changed: 2613 additions & 74 deletions

DESCRIPTION

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: BGmisc
22
Title: An R Package for Extended Behavior Genetics Analysis
3-
Version: 1.3.4.1
3+
Version: 1.3.5
44
Authors@R: c(
55
person("S. Mason", "Garrison", , "garrissm@wfu.edu", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0002-4804-6003")),
@@ -33,8 +33,10 @@ Imports:
3333
kinship2,
3434
Matrix,
3535
stats,
36-
stringr
36+
stringr,
37+
methods
3738
Suggests:
39+
corrplot,
3840
dplyr,
3941
EasyMx,
4042
knitr,

NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ export(allGens)
55
export(calculateRelatedness)
66
export(checkIDs)
77
export(checkSex)
8+
export(com2links)
89
export(comp2vech)
910
export(createGenDataFrame)
1011
export(dropLink)
1112
export(evenInsert)
13+
export(extractSummaryText)
1214
export(famSizeCal)
1315
export(fitComponentModel)
1416
export(identifyComponentModel)
1517
export(inferRelatedness)
1618
export(makeInbreeding)
1719
export(makeTwins)
20+
export(parseTree)
1821
export(ped2add)
1922
export(ped2ce)
2023
export(ped2cn)
@@ -26,6 +29,7 @@ export(ped2mit)
2629
export(ped2paternal)
2730
export(plotPedigree)
2831
export(readGedcom)
32+
export(readWikifamilytree)
2933
export(recodeSex)
3034
export(related_coef)
3135
export(relatedness)

NEWS.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
# BGmisc 1.3.5
2+
* Add com2links function that converts components to kinship links
3+
* Add tests for com2links
4+
* Add function to extract family tree from wiki family tree template
5+
* Add tests for readWikifamilytree
6+
* Create vignette for adjacency matrix methods
7+
* Silences invisible list for plot
8+
19
# BGmisc 1.3.4.1
210
* Hot fix to resolve issue with list of adjacency matrix not loading saved version
311
* Reoptimized generation calculation
412

513
# BGmisc 1.3.4
614
* Added alternative (and faster) methods to create the adjacency matrix
7-
* Add tests for comparison of adjacency matrix methods
15+
* Add tests for comparison of adjacency matrix build methods
816
* Added Royal Family pedigree
917

1018
# BGmisc 1.3.3

R/checkSex.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,23 +166,23 @@ recodeSex <- function(
166166
}
167167

168168
# Recode as "F" or "M" based on code_male, preserving NAs
169-
if (!is.null(code_male) & !is.null(code_female)) {
169+
if (!is.null(code_male) && !is.null(code_female)) {
170170
# Initialize sex_recode as NA, preserving the length of the 'sex' column
171171
ped$sex_recode <- recode_na
172172
ped$sex_recode[ped$sex == code_female] <- recode_female
173173
ped$sex_recode[ped$sex == code_male] <- recode_male
174174
# Overwriting temp recode variable
175175
ped$sex <- ped$sex_recode
176176
ped$sex_recode <- NULL
177-
} else if (!is.null(code_male) & is.null(code_female)) {
177+
} else if (!is.null(code_male) && is.null(code_female)) {
178178
# Initialize sex_recode as NA, preserving the length of the 'sex' column
179179
ped$sex_recode <- recode_na
180180
ped$sex_recode[ped$sex != code_male & !is.na(ped$sex)] <- recode_female
181181
ped$sex_recode[ped$sex == code_male] <- recode_male
182182
# Overwriting temp recode variable
183183
ped$sex <- ped$sex_recode
184184
ped$sex_recode <- NULL
185-
} else if (is.null(code_male) & !is.null(code_female)) {
185+
} else if (is.null(code_male) && !is.null(code_female)) {
186186
# Initialize sex_recode as NA, preserving the length of the 'sex' column
187187
ped$sex_recode <- recode_na
188188
ped$sex_recode[ped$sex != code_female & !is.na(ped$sex)] <- recode_male

R/convertPedigree.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ ped2com <- function(ped, component,
144144
if (verbose) cat("Resuming: Constructed matrix...\n")
145145
jss <- readRDS(checkpoint_files$jss)
146146
iss <- readRDS(checkpoint_files$iss)
147-
list_of_adjacencies <- list(iss=iss, jss=jss)
147+
list_of_adjacencies <- list(iss = iss, jss = jss)
148148
} else {
149149

150150
list_of_adjacencies <- compute_parent_adjacency(
@@ -177,7 +177,7 @@ ped2com <- function(ped, component,
177177
}
178178
# Garbage collection if gc is TRUE
179179
if (gc) {
180-
rm(parList, lens,list_of_adjacencies)
180+
rm(parList, lens, list_of_adjacencies)
181181
gc()
182182
}
183183
}
@@ -264,7 +264,7 @@ ped2com <- function(ped, component,
264264

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

0 commit comments

Comments
 (0)