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

sortPed function bug #110

Closed
AudreyAAMartin opened this issue Feb 9, 2023 · 7 comments
Closed

sortPed function bug #110

AudreyAAMartin opened this issue Feb 9, 2023 · 7 comments

Comments

@AudreyAAMartin
Copy link
Contributor

Describe the bug
The sortPed function should return a pedigree with information/column about which generation individuals are part of. In the current setting, all individuals are (wrongly) attributed gen 1.

Steps To Reproduce
#Pedigree setting
id = 1:5
mother = c(0,0,0,1,1)
father = c(0,0,2,0,3)
#creating the ped and getting the gen information
ped = sortPed(id=id, mother=mother, father=father, maxCycle=100)

Expected behavior
I would expect the founders to get a value of 1 for gen, and then the offspring to be of a later generation than their parents.
For the pedigree used as example, I would expect this output:
gen id mother father
1 1 0 0
1 2 0 0
2 3 0 2
2 4 1 0
3 5 1 3

@gregorgorjanc
Copy link
Contributor

Just to add that the behaviour is

AlphaSimR:::sortPed(id=id, mother=mother, father=father, maxCycle=100)
  gen id mother father motherID fatherID
1   1  1     NA     NA        0        0
2   1  2     NA     NA        0        0
3   1  3     NA      2        0        2
4   1  4      1     NA        1        0
5   1  5      1      3        1        3

So all individuals have the same generation.

@gregorgorjanc
Copy link
Contributor

This PR #111 proposes a fix

@gaynorr
Copy link
Owner

gaynorr commented Feb 9, 2023

Thanks for fix @AudreyAAMartin.

@gaynorr gaynorr closed this as completed Feb 9, 2023
@AudreyAAMartin
Copy link
Contributor Author

@gaynorr for some reason the current CRAN version does not include the PR #111, despite the fact that the main branch has this commit accepted, which is very odd 2215f29.

Perhaps you need to rebuild and reupload the package to CRAN?

@AudreyAAMartin
Copy link
Contributor Author

AudreyAAMartin commented Apr 11, 2023

@gaynorr is it because your devel and main branches are not in sync?
Screenshot 2023-04-11 at 15 37 55

@gaynorr
Copy link
Owner

gaynorr commented Apr 12, 2023

@AudreyAAMartin thanks for pointing this out. I forgot about this when submitting to CRAN, and submitted the source package from devel that didn't include your changes made on the master. I'll look into syncing these branches.

@gaynorr
Copy link
Owner

gaynorr commented Apr 14, 2023

@AudreyAAMartin I merged the master branch into devel and that should sort out the issue. Your changes are now reflected in both branches and should go to CRAN with the next submission.

I tend to do all my work on devel and submit to CRAN for there. I initiate a pull request from devel to master when I'm getting ready submit and use GitHub actions to test the package before submitting. I've been trying to approve the pull request after the package is accepted on CRAN, so that the master version reflect what's on CRAN. However, I'm not always consistent with what I do.

It was my mistake for forgetting to merge your submission to devel before submitting.

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