Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusdv committed Jun 28, 2024
1 parent baa9819 commit 2ed3154
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 25 deletions.
6 changes: 3 additions & 3 deletions R/ped_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,10 @@ plotPedList = function(plots, widths = NULL, groups = NULL, titles = NULL,
newpeds = lapply(p, list)
else { # if list of ped with plot arguments
p1 = p[[1]]
if(inherits(p[[1]], "pedList"))
if(inherits(p1, "pedList"))
class(p[[1]]) = "list"
else if (!is.ped(p[[1]]))
stop2("First element must be a `ped` object", p[[1]])
else if (!is.ped(p1))
stop2("First element must be a `ped` object", p1)
newpeds = list(p)
}

Expand Down
15 changes: 0 additions & 15 deletions R/ped_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ generations = function(x, what = c("max", "compMax", "indiv", "depth")) {
N = length(x$ID)
FIDX = x$FIDX
MIDX = x$MIDX
FOU = which(FIDX == 0) # founders(x, internal = TRUE)
NONFOU = which(FIDX > 0)

dp = rep(1L, N) # depth = 1 for founders
Expand Down Expand Up @@ -375,20 +374,6 @@ generateLabs = function(x, n = 1, avoid = NULL, prefix = "") {
.mysetdiff(cand, taken)[seq_len(n)]
}

# TODO: Delete - no longer used. Replaced by generateLabs
# Utility function for generating numbered "NN" labels.
# Returns "NN_i" where i increments largest j occurring as NN_j, NN.j or NN-j in input.
nextNN = function(labs) { # labs a character vector
NNs = grepl("^NN", labs)
if(!any(NNs))
return("NN_1")
NNnum = suppressWarnings(as.numeric(sub("^NN[._-]?", "", labs[NNs])))
if(all(is.na(NNnum)))
return("NN_1")
nextNNnum = max(NNnum, na.rm = TRUE) + 1
return(sprintf("NN_%d", nextNNnum))
}


#' Pedigree component
#'
Expand Down
1 change: 0 additions & 1 deletion R/readPed.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,4 @@ readPed = function(pedfile, colSep = "", header = NA,
locusAttributes = locusAttributes, missing = missing,
sep = sep, sexCodes = sexCodes, addMissingFounders = addMissingFounders,
validate = validate)

}
7 changes: 6 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ The goal of **pedtools** is to provide a lightweight, but comprehensive tool set

**pedtools** is the hub of the **pedsuite**, a collection of R packages for pedigree analysis, including applications in forensic and medical genetics. The **pedsuite** has its own [GitHub repository](https://github.com/magnusdv/pedsuite) and a dedicated [website](https://magnusdv.github.io/pedsuite/) offering more information.

<span style="color:red;"> Try the **QuickPed** app for building and analysing pedigrees here: [https://magnusdv.shinyapps.io/quickped/](https://magnusdv.shinyapps.io/quickped/) </span>
#### Citation
If you use **pedtools** in a publication, please cite the book [Pedigree Analysis in R](https://shop.elsevier.com/books/pedigree-analysis-in-r/vigeland/978-0-12-824430-2)
(Vigeland, 2021. Academic Press. ISBN:<span>9780128244302</span>).

#### Online app
Try the online app **QuickPed** for building and analysing pedigrees here: [https://magnusdv.shinyapps.io/quickped/](https://magnusdv.shinyapps.io/quickped/)


## Installation
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,24 @@ loop breaking, and merging pedigrees. The plotting feature imports
machinery from the
[kinship2](https://CRAN.R-project.org/package=kinship2) package.

**pedtools** is the hub of the **ped suite**, a collection of R packages
**pedtools** is the hub of the **pedsuite**, a collection of R packages
for pedigree analysis, including applications in forensic and medical
genetics. The **ped suite** has its own [GitHub
genetics. The **pedsuite** has its own [GitHub
repository](https://github.com/magnusdv/pedsuite) and a dedicated
[website](https://magnusdv.github.io/pedsuite/) offering more
information.

<span style="color:red;"> Try the **QuickPed** app for building and
analysing pedigrees here: <https://magnusdv.shinyapps.io/quickped/>
</span>
#### Citation

If you use **pedtools** in a publication, please cite the book [Pedigree
Analysis in
R](https://shop.elsevier.com/books/pedigree-analysis-in-r/vigeland/978-0-12-824430-2)
(Vigeland, 2021. Academic Press. ISBN:9780128244302).

#### Online app

Try the online app **QuickPed** for building and analysing pedigrees
here: <https://magnusdv.shinyapps.io/quickped/>

## Installation

Expand Down

0 comments on commit 2ed3154

Please sign in to comment.