Handling pedigrees Facundo Muñoz 2017-04-28 breedR version: 0.12.1

Contents What is a pedigree • A 3-column data.frame or matrix with the codes for each individual and its parents • A family effect is easily translated into a pedigree: – use the family code as the identification of a fictitious mother – use 0 or NA as codes for the unknown fathers • A pedigree sintetizes any kind of (genetic) relationship between individuals from one or more generations self

dad

mum

69 70 71 72 73 74

0 0 0 0 0 0

64 41 56 55 22 50

Checking pedigrees • For computational reasons, the pedigree needs to meet certain conditions: – Completness: all the individuals (also parents) must have an entry ∗ with possibly unknown parents (code 0 or NA) – The offspring must follow the parents – The codes must be sorted increasingly – The codes must be consecutive • So, not every 3-column data.frame or matrix with codes is a proper pedigree: set.seed(123); n.ped <- 5 ped.nightmare <- matrix(sample(30, n.ped*3), n.ped, 3, dimnames = list(NULL, c('self', 'sire', 'dam'))) check_pedigree(ped.nightmare) ## ##

full_ped FALSE

offsp_follows FALSE

codes_sorted codes_consecutive FALSE FALSE

Building pedigrees • breedR implements a pedigree constructor that completes, sorts and recodes as necessary • The resulting object, of class pedigree is guranteed to meet the conditions

1

ped.fix <- build_pedigree(1:3, data = ped.nightmare) ## Warning in build_pedigree(1:3, data = ped.nightmare): The pedigree has been ## recoded. Check attr(ped, 'map'). check_pedigree(ped.fix) ## ##

full_ped TRUE

attr(ped.fix, 'map')

offsp_follows TRUE

codes_sorted codes_consecutive TRUE TRUE

# map from old to new codes

## [1] NA 1 NA NA NA NA NA NA ## [24] 13 15 14 11 NA 12 9

3

4 NA

7

8 NA NA NA NA NA NA

self

sire

dam

9 23 12 24 25

2 13 21 27 10

20 30 22 29 26

self

sire

dam

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

NA NA 1 NA NA NA 5 NA NA 8 NA NA 11 NA 4

NA NA 2 NA NA NA 6 NA NA 9 NA NA 12 NA 14

2

5

6 10

Using a pedigree in an additive genetic effect • just include your original pedigree information and let breedR fix it for you test.dat <- data.frame(ped.nightmare, y = rnorm(n.ped)) = y ~ 1, res.raw <- remlf90(fixed genetic = list(model = 'add_animal', pedigree = ped.nightmare, # pedigree = test.dat[, 1:3], var.ini = 1, id = 'self'), var.ini = list(resid = 1), data = test.dat)

2

# same thing

## Warning in build_pedigree(1:3, data = ped.df): The pedigree has been ## recoded. Check attr(ped, 'map'). ## pedigree has been recoded! length(ranef(res.raw)$genetic) ## [1] 15 ## The pedigree used in the model matches the one manually built identical(ped.fix, get_pedigree(res.raw)) ## [1] TRUE

Recovering Breeding Values in the original coding ## Predicted Breeding Valuess of the observed individuals ## Left-multiplying the vector of BLUP by the incidence matrix ## gives the BLUP of the observations in the right order. Za <- model.matrix(res.raw)$genetic # incidence matrix gen.blup <- with(ranef(res.raw), cbind(value=genetic, 's.e.'=attr(genetic, 'se'))) PBVs <- Za %*% gen.blup rownames(PBVs) <- test.dat$self value

s.e.

0.21 -1.29 0.42 -0.18 0.84

0.89 0.89 0.89 0.89 0.89

9 23 12 24 25

Recovering Breeding Values for the founders, in the original coding ## original codes of non-observed parents (founders.orig <- setdiff( sort(unique(as.vector(ped.nightmare[, c("sire", "dam")]))), ped.nightmare[, "self"] )) ## [1] 2 10 13 20 21 22 26 27 29 30 ## map from original to internal codes map.codes <- attr(get_pedigree(res.raw), "map") ## internal codes of non-observed parents founders.int <- map.codes[founders.orig] ## Breeding Values of non-observed parents founders.PBVs <- gen.blup[founders.int, ] rownames(founders.PBVs) <- founders.orig

3

2 10 13 20 21 22 26 27 29 30

value

s.e.

0.11 0.42 -0.64 0.11 0.21 0.21 0.42 -0.09 -0.09 -0.64

1.08 1.08 1.08 1.08 1.08 1.08 1.08 1.08 1.08 1.08

Identifying original codes from internal representation If, for whatever reason, you want to reverse-identify specific individuals from the internal codes, you can match their codes: ## individuals of interest in internal codification idx <- c(3, 5, 9) ## original codes (match(idx, map.codes)) ## [1]

9 21 30

4

Handling pedigrees - GitHub

A 3-column data.frame or matrix with the codes for each individual and its parents. • A family effect is easily translated into a pedigree: – use the family code as ...

44KB Sizes 13 Downloads 243 Views

Recommend Documents

How to make error handling less error-prone - GitHub
“Back to the Future™” is a trademark of Universal City Studios, Inc. and Amblin ... In the Apple OpenSSL “goto fail;” bug, the cleanup code was written incorrectly, ...

Expectify Rich Polymorphic Error Handling with llvm ... - GitHub
7 days ago - Composition. Expected T std::unique_ptr storage. T .. .... multiple times. - deduplicate according to __FILE__ and __LINE__ ...

MeqParm: Parameter Handling in the MeqTree System - GitHub
Astronomical Data Analysis Software and Systems XV. P78 ... nected ParmTable, the best solution should be determined from either a default funklet or via ...

[1603-7C1509] Air Handling Unit & Modular Air Handling UnitA4.pdf ...
iOS Version Android Version. Midea CAC After-service Application. iOS Version ... 2001 Cooperated with Copeland to develop the digital scroll VRF system.

Accurately Handling the Word
The evidence is much stronger in support of another figurative meaning: “to put into practice” or “to make what is theoretical a practical reality.” Interestingly, the ...

Manual Handling
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means (electronic, ..... Movement of a load. □ Avoid loads in containers shifting unexpectedly. Using packing mat

Handling Exceptions in Haskell
Jan 19, 1999 - ... less idealistic programmers can write in C, Java, Ada and other useful .... since the Prelude is not just ordinary Haskell code, requires a lot of ...

Handling Exceptions in Haskell
Jan 19, 1999 - Handling Exceptions in Haskell. Alastair Reid. Yale University. Department of Computer Science. New Haven, CT 06520 [email protected].

Module6-Handling Devices.pdf
peripherals; monitor, keyboard, mouse and speaker to the system unit. This module contains 5 activities: Activity 1: Naming the peripheral port on the system unit.

Handling Conditional Discrimination
explanatory. Experimental evaluation demonstrates that the new local techniques remove exactly the bad discrimination, allowing differences in decisions as long as they are explainable. Index Terms—discrimination; classification; independence;. I.

Community is Everything - handling objections.pdf
discretion to look at what is the best sentencing for a child, including access to programs that get them. back on the right track. We want to avoid where possible ...

pneumatic ash handling system pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. pneumatic ash ...

Scalable I/O Event Handling for GHC
The I/O manager uses the venerable select system call for two purposes. .... to block until it can perform I/O has no way to tell how long the I/O event ..... Proceedings of the International Conference on Coordination Models and Languages ...

Handling Cyber Threats: Ransomware - Snell & Wilmer
Aug 28, 2017 - James P. Melendres is co-chair of the Cybersecurity, Data Protection, and Privacy practice ... intelligence and gain control of systems on the.

Best Enough Complaints Handling Policy.pdf
... the Policy does not apply to. feedback of this nature. Page 3 of 6. Best Enough Complaints Handling Policy.pdf. Best Enough Complaints Handling Policy.pdf.

PDF Humane Livestock Handling: Understanding ...
... GB of storage less spam and mobile access Latest environmental news features and updates Pictures video and more Table of Contents How ... healthier animals, read online Humane Livestock Handling: Understanding livestock behavior ...