MyNixOS website logo
Description

Streamlined Analysis of Wild Pedigree Data.

Analyzing pedigree data of wild populations. While primarily designed to process outputs from the 'COLONY' (Jones & Wang (2010) <doi:10.1111/j.1755-0998.2009.02787.x>) pedigree reconstruction software, it can also accommodate data from other sources. By linking reconstructed pedigrees with genetic sample metadata, 'wpeR' produces spatial and temporal visualizations as well as tabular summaries that support interpretation of family structures and dynamics. The main goal of the package is to provide a solution for the analysis of complex wild pedigree data and to help the user to gain insights into genetic relationships within wild animal populations.

wpeR

wild pedigree explorerR is an R package designed to simplify the analysis of wild pedigree data. The package was primarily developed to work with pedigree data generated by COLONY pedigree reconstruction software. However, it can also accommodate pedigree data from other sources. By combining the reconstructed pedigree with genetic sample metadata, wpeR creates visual and tabular representations of the pedigree, allowing the user to interpret the pedigree in spatial and temporal terms. The main goal of the package is to provide an efficient solution for the analysis of complex wild pedigree data and to help the user to gain valuable insights into genetic relationships within wild animal populations.

Installation

devtools::install_github("GR3602/wpeR")

Key Features

  • Pedigree import and formatting
  • Individual observation timeframe identification
  • Family organization
  • Temporal pedigree visualization
  • Geographic pedigree visualization and GIS output
  • Integration with other R packages

Input Data

The wpeR package requires two main input datasets for analysis: Pedigree and Genetic samples metadata.

Basic workflow

Function
call
order
FunctionDescription
1aget_colony()Organizes COLONY output
1bget_ped()Organizes pedigree data
2anim_timespan()Get dates of individuals first and last sample
3org_fams()Organizes animals into families and expands pedigree data
4plot_table()Prepares pedigree data for plotting and spatial representation
5.1ped_satplot()Temporal plot of pedigree
5.2ped_spatial()Get files for spatial representation of pedigree
####DATA PREPARATION####
# Define the path to the pedigree data file.
path <- paste0(system.file("extdata", package = "wpeR"), "/wpeR_samplePed")

# Retrieve the pedigree data from the get_colony function.
ped_colony <- get_colony(path, sampledata, rm_obsolete_parents = TRUE, out = "FamAgg")


# Get animal timespan data using the anim_timespan() function.
animal_ts <- anim_timespan(wolf_samples$AnimalRef,
                           wolf_samples$Date,
                           wolf_samples$SType,
                           dead = c("Tissue"))

# Add animal timespan to the sampledata
sampledata <- merge(wolf_samples, animal_ts, by.x = "AnimalRef", by.y = "ID", all.x = TRUE)

# Organize families and expand pedigree data using the org_fams function.
## families data frame
fams <- org_fams(ped_colony, sampledata, output = "fams")
## extended pedigree data frame
ped <- org_fams(ped_colony,sampledata, output = "ped")


# The example show just one family 
## Prepare data for plotting.
pt <- plot_table(plot_fams = 1,
                 org_tables$fams,
                 org_tables$ped,
                 sampledata,
                 deadSample = c("Tissue"))
                 

####VISUALIZATION####                 
## Get a temporal pedigree plot.
ped_satplot(plottable = pt)

image

EXAMPLE Visualization using kinship2 package

# optional pedigre plot pedigree plot from kinship2
### extract parent codes
parents1 = strsplit(fams[fams$FamID == 1,]$parents, "_")[[1]]
### filter the family from pedigre
Fam1 = ped[(ped$FamID == 1 | ped$id %in% parents1),]
### plot using kinship2 
plot(kinship2::pedigree(Fam1$id, Fam1$father, Fam1$mother, Fam1$sex))

image

## Create spatial files
<!-- ps <- ped_spatial(pt) -->
summary(ps)

Object Name

Description

mother…

Rpoints

POINT object representing reference samples of each animal. Reference sample for parents is their first sample, reference sample for the offspring is their last sample within the user defined time frame.

father…

offspring…

mother…

MovePoints

POINT object representing all samples of a particular animal.

father…

offspring…

maternity…

Lines

LINESTRING object connecting reference samples of mothers or fathers with reference samples of their offspring.

paternity…

mother…

MoveLines

LINESTRING object connecting all samples of an individual in chronological order, showcasing the movement or changes in location over time for the specific animal.

father…

offspring…

mother…

MovePolygon

POLYGON object representing a convex hull that encloses all the samples of an individual. It provides a graphical representation of the spatial extent or range covered by the animal based on its sample locations.

father…


EXAMPLE Using spatial files together with ggplot2, basemaps and ggsflabel for spatial visualization.

image
Spatial representation using mother/father/offspringRpoints and maternety/paternitylines
!image
Spatial representation using mother/fatherRpoints/MovePoints/MoveLines.
Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows