matthewwolak / nadiv

R package that constructs (non)additive genetic relationship matrices, and their inverses, from a pedigree to be used in linear mixed effect models (A.K.A. the 'animal model').
17 stars 7 forks source link

Upgrade to 2.17 gives error #27

Closed jhagberg closed 3 years ago

jhagberg commented 3 years ago

Using this lib via OptiSel

Upgrading to 2.17.0 gives this warning loading the Pedigree

Warning messages:
1: In nPed_fixed[] <- numPed(ped_fixed_ord, check = FALSE) :
  number of items to replace is not a multiple of replacement length
2: In nPed_fixed[] <- numPed(ped_fixed_ord, check = FALSE) :
  number of items to replace is not a multiple of replacement length
matthewwolak commented 3 years ago

@jhagberg Could you let me know what code you ran that produced this Warning so I can start to trace down the issue?

jhagberg commented 3 years ago

Hej Thanks we are a bit confused where is the 2.17 release source? We just find that version on cran but not here. We run this.

Pedi <- optiSel::prePed(rabbits)

https://github.com/NBISweden/theherdbook/blob/fb60c18c12cdcdfcbf6137b9daf43921de9bf5ae/R/api.R#L70

I can see if we can make a small test data to replicate the error. But this worked before without warning on version 2.16.

matthewwolak commented 3 years ago

Hi,

I apologize, I was a few days behind updating my master branch on GitHub. The source that was submitted to CRAN was from the devel branch. The 2.17.0 source is currently available both on CRAN and at the master branch repository.

Is it possible to send me the rabbits data or somehow make it easy for me to access so that I can use this to track down the problem in nadiv::prepPed()?

matthewwolak commented 3 years ago

@jhagberg I think I tracked down the problem, does the rabbits data have >3 columns?

I've made the following change (commit 7ded8b0041c09d2c1a2b0666bd229f4f3faa0d8c) which should allow for more general cases to work without throwing the error like you first reported.

Note, the commit above was made to the devel branch, which represents the current state of nadiv (right now this is v2.17.1). I would suggest installing this branch directly from GitHub using the R package devtools, specifically:

devtools::install_github("matthewwolak/nadiv", ref = "devel")

Let me know if this solves your warning.

jhagberg commented 3 years ago

Hej Sorry I missed your update. Yes the rabbits have more than 3 columns. I will test this asap!

jhagberg commented 3 years ago

Sorry. I thought I started fresh but I did not. A restart fixed this!

matthewwolak commented 3 years ago

Great, thank you for following up with this!