Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inclusion of birth year in plotted pedigrees #8

Open
Dejan1983 opened this issue Mar 14, 2022 · 2 comments
Open

inclusion of birth year in plotted pedigrees #8

Dejan1983 opened this issue Mar 14, 2022 · 2 comments

Comments

@Dejan1983
Copy link

Hello,
thank you for making kinship2 - i've found the plotting of pedigrees very helpful.
One question i can't seem to resolve is how to incorporate additional information into the plotted pedigrees. For example, i would love to color my plots by year of birth but there doesn't seem to be any way to do this. I know that the plots can be shaded/unshaded by affected status, but this is limited to a 0/1 option as far as i can tell. I have a pedigree that spans several breeding attempts by birds in successive years, and hence colouring each brood by year would be really informative.
Also, i seem to have a couple of issues that i can't explain in my pedigrees. For instance, there's randomly repeated individuals individuals in my pedigrees (e.g. M0046 in the image below) and also the shapes don't correspond to the sexes specified in my pedigree files.
Rplot01
Any suggestions would be much appreciated.
thanks,
D

@bethatkinson
Copy link
Member

bethatkinson commented Mar 14, 2022 via email

@sinnweja
Copy link
Member

sinnweja commented Mar 14, 2022

Beth's example should work for the brood year. Here is an example using "test1" that is created in example(kinship), where I add some text to the id, and birth year on a new line, but I think color might be better. Also, if you re-order the pedigree or look at how to do "hints", you can minimize the need to make extra copies of individuals. Also, for sex/gender, they need to be either 0/1 (1 for female) or 1/2, (2 for female). It gets a little tricky, especially if you have them as character.

R> ped1 <- with(test1, pedigree(id=id, dad, mom, sex))
R> test1$birthYR <- c(1950:1953, 1970:1977, 1995:1996)
R> ped1 <- with(test1, pedigree(id=id, dad, mom, sex))
R> plot(ped1, id=paste0(test1$id, ": <more text> \n ", test1$birthYR), cex=0.8)
ped_test1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants