From eb832b506a4dd8f78c299f19c524ac4f5feacebf Mon Sep 17 00:00:00 2001 From: Magnus Dehli Vigeland Date: Sun, 17 Mar 2024 21:38:58 +0200 Subject: [PATCH] Minor doc updates --- NEWS.md | 6 ++++-- R/ped_plot.R | 18 ++++++++++-------- R/plot_internal.R | 4 ++-- README.Rmd | 2 +- man/internalplot.Rd | 4 ++-- man/plot.ped.Rd | 2 +- vignettes/pedtools.Rmd | 2 +- 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/NEWS.md b/NEWS.md index 666bb7d..1a78496 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ ## Breaking changes +* In pedigree plots, Long labels are now automatically folded to an approximate width of 12 characters by default. Use the new argument `foldLabs` to adjust the folding width, or to switch off folding (`foldLabs = FALSE`). + * When adding children or parents to a pedigree, the default labelling of new individuals has been simplified. The new labels are now always the smallest integers not already in use. (Previous versions used "NN_1", "NN_2", etc for pedigrees with nonnumeric labels.) * `labels(x)` now always returns a character vector, also when `x` is a list of pedigrees. Use `labels(x, unlist = FALSE)` to retain the old behaviour. @@ -235,7 +237,7 @@ The main theme of this version is to make `pedtools` more adapted to piping, e.g * `readPed()` gains the argument `colSep`, which fixes the previous inability to handle names with spaces. -* New function `descentPaths()`, mostly intended for use in other ped suite packages. +* New function `descentPaths()`, mostly intended for use in other pedsuite packages. * `relabel(x, new = "generations")` now gives automatic, generation-aware labelling: I-1, I-2, II-1, ... @@ -254,7 +256,7 @@ The main theme of this version is to make `pedtools` more adapted to piping, e.g * `father()` and `mother()` now accepts ped lists as input. -* Added info and links to **ped suite** in README. +* Added info and links to **pedsuite** in README. ## Bug fixes diff --git a/R/ped_plot.R b/R/ped_plot.R index 056babf..6d15c58 100644 --- a/R/ped_plot.R +++ b/R/ped_plot.R @@ -13,7 +13,7 @@ #' duplications. #' #' If `x` is a list of `ped` objects these are plotted next to each other, -#' vertically centered in the plot window. For finer control, and possibly +#' vertically centred in the plot window. For finer control, and possibly #' nested lists of pedigrees, use [plotPedList()]. #' #' @param x A [ped()] object or a list of such. @@ -90,10 +90,12 @@ #' # Use functions to specify colours #' plot(x, fill = list(red = leaves, blue = ancestors(x, "boy"))) #' -#' # Line type and width -#' plot(x, lty = 2, lwd = 3, cex = 2) +#' #----- Symbol line types and widths ----- #' -#' # Detailed line type and width +#' # Dotted, thick symbols +#' plot(x, lty = 3, lwd = 4, cex = 2) +#' +#' # Detailed specification of line types and width #' plot(x, lty = list(dashed = founders), lwd = c(boy = 4)) #' #' #----- Genotypes ----- @@ -114,14 +116,14 @@ #' # Multiple markers #' plot(x, marker = 1:2) #' -#' #----- Further tex annotation ----- +#' #----- Further text annotation ----- #' #' # Founder inbreeding is shown by default -#' founderInbreeding(x, "mo") = 0.1 -#' plot(x) +#' xinb = x |> setFounderInbreeding("mo", value = 0.1) +#' plot(xinb) #' #' # ... but can be suppressed -#' plot(x, fouInb = NULL) +#' plot(xinb, fouInb = NULL) #' #' # Text can be placed around and inside symbols #' plot(x, textAnnot = list(topright = 1:3, inside = LETTERS[1:3])) diff --git a/R/plot_internal.R b/R/plot_internal.R index 4371f89..ae7ee46 100644 --- a/R/plot_internal.R +++ b/R/plot_internal.R @@ -66,8 +66,8 @@ #' * If `labs` is a function, it is replaced with `labs(x)` and handled as #' above. (See Examples.) #' -#' The argument `textAnnot` allows customised annotation around and inside -#' each symbol. This takes a list of lists, whose names may include "topleft", +#' The argument `textAnnot` allows customised annotation around and inside each +#' symbol. This takes a list of lists, whose names may include "topleft", #' "topright", "left", "right", "bottomleft", "bottom", "bottomright" and #' "inside". Each inner list should contain a character vector as its first #' element (with the text to printed), followed by further arguments passed to diff --git a/README.Rmd b/README.Rmd index 9ad8d9f..240d85c 100644 --- a/README.Rmd +++ b/README.Rmd @@ -25,7 +25,7 @@ knitr::opts_chunk$set( ## Introduction The goal of **pedtools** is to provide a lightweight, but comprehensive tool set for creating, manipulating and visualizing pedigrees with or without marker data. Common pedigree structures are quickly produced with tailor-made functions, while a range of utilities enable modifications like adding or removing individuals, extracting subsets, 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 for pedigree analysis, including applications in forensic and medical genetics. The **ped suite** has its own [GitHub repository](https://github.com/magnusdv/pedsuite) and a dedicated [website](https://magnusdv.github.io/pedsuite/) offering more information. +**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. Try the **QuickPed** app for building and analysing pedigrees here: [https://magnusdv.shinyapps.io/quickped/](https://magnusdv.shinyapps.io/quickped/) diff --git a/man/internalplot.Rd b/man/internalplot.Rd index a58054f..d4ff913 100644 --- a/man/internalplot.Rd +++ b/man/internalplot.Rd @@ -240,8 +240,8 @@ labelled following the internal ordering. above. (See Examples.) } -The argument \code{textAnnot} allows customised annotation around and inside -each symbol. This takes a list of lists, whose names may include "topleft", +The argument \code{textAnnot} allows customised annotation around and inside each +symbol. This takes a list of lists, whose names may include "topleft", "topright", "left", "right", "bottomleft", "bottom", "bottomright" and "inside". Each inner list should contain a character vector as its first element (with the text to printed), followed by further arguments passed to diff --git a/man/plot.ped.Rd b/man/plot.ped.Rd index f4df52c..357111e 100644 --- a/man/plot.ped.Rd +++ b/man/plot.ped.Rd @@ -54,7 +54,7 @@ some minor adjustments have been made to improve scaling and avoid unneeded duplications. If \code{x} is a list of \code{ped} objects these are plotted next to each other, -vertically centered in the plot window. For finer control, and possibly +vertically centred in the plot window. For finer control, and possibly nested lists of pedigrees, use \code{\link[=plotPedList]{plotPedList()}}. } \examples{ diff --git a/vignettes/pedtools.Rmd b/vignettes/pedtools.Rmd index 08687e8..a4751d0 100644 --- a/vignettes/pedtools.Rmd +++ b/vignettes/pedtools.Rmd @@ -43,7 +43,7 @@ library(pedtools) # Pedigrees -In **pedtools** and the ped suite packages, pedigrees are stored as `ped` objects. We start by explaining briefly what these objects look like, and their basic constructor. If you are reading this vignette simply to learn how to create a particular pedigree, you may want to skip ahead to section 1.3 where we describe practical shortcuts to common pedigree structures. +In **pedtools** and all other pedsuite packages, pedigrees are stored as `ped` objects. We start by explaining briefly what these objects look like, and their basic constructor. If you are reading this vignette simply to learn how to create a particular pedigree, you may want to skip ahead to section 1.3 where we describe practical shortcuts to common pedigree structures. ## The `ped` class