HighlanderLab / SIMplyBee

SIMplyBee R package extends AlphaSimR for simulating honeybee populations and breeding programmes
http://www.simplybee.info/
Other
0 stars 5 forks source link

getCastePop (getDrones) should not have an argument "removeFathers" #504

Open janaobsteter opened 1 year ago

janaobsteter commented 1 year ago

removeFather = TRUE by default - this means that the drones that were used in mating are removed when getting out the drones. I think this shouldn't even be an option - these individuals are dead and are only in the drone slot for computational reasons - but they shouldn't be accessible by users.

gregorgorjanc commented 1 year ago

Fair point! They will be available in the queen's misc slot anyway.

gregorgorjanc commented 8 months ago

@janaobsteter I am looking at this. So we have:

getCastePop(..., removeFathers = TRUE, ...) at https://github.com/HighlanderLab/SIMplyBee/blob/efca86c203d068741f5f680823f1b39e2795b91c/R/Functions_L1_Pop.R#L93

with docs at https://github.com/HighlanderLab/SIMplyBee/blob/efca86c203d068741f5f680823f1b39e2795b91c/R/Functions_L1_Pop.R#L23 saying

#' @param removeFathers logical, removes \code{drones} that have already mated;
#'   set to \code{FALSE} if you would like to get drones for mating with multiple
#'   virgin queens, say via insemination

And then we do at https://github.com/HighlanderLab/SIMplyBee/blob/efca86c203d068741f5f680823f1b39e2795b91c/R/Functions_L1_Pop.R#L133

        if (caste == "drones" && removeFathers) {
          test <- isDrone(pop)
          if (any(!test)) {
            pop <- pop[test]
          }
        }

Then we have:

with a note

#' @param removeFathers logical, removes \code{drones} that have already mated;
#'   set to \code{FALSE} if you would like to get drones for mating with multiple
#'   virgin queens, say via insemination
#'
#' @details In reality, drones leave the colony to mate. They die after that.
#'   In this function we only get a copy of drones from \code{x}, for
#'   computational efficiency and ease of use. However, any mating will change
#'   the caste of drones to fathers, and they won't be available for future
#'   matings (see \code{\link{cross}}). Not unless
#'   \code{removeFathers = FALSE}.

with a note

#' @param removeFathers logical, removes \code{drones} that have already mated;
#'   set to \code{FALSE} if you would like to get drones for mating with multiple
#'   virgin queens, say via insemination

Now, why do we want to remove this argument? What if we actually want to replicate a drone, say for insemination purposes? Are you saying that if we want to do that (insemination), we would have got/pulled a drone out and used it multiple times and that is why you would like to remove the removeFathers option - because we should be doing this by default all the time, which we do now, but you would like to hide this from the user?