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

Problem with csd locus when choosing to simulate only two csd alleles #585

Open
janaobsteter opened this issue Aug 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@janaobsteter
Copy link
Collaborator

founderGenomes <- quickHaplo(nInd = 4, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes, nCsdAlleles = 2)
basePop <- createCastePop(founderGenomes, caste = "virginQueens")

This returns the error

Error in x[1, ] : incorrect number of dimensions

Because of the following check in the editCsdLocus()

  if (any(sapply(alleles, FUN = function(x) all(x[1, ] == x[2, ])))) {
    stop("You must provide two different alleles for each individual!")
  }
@janaobsteter janaobsteter added the bug Something isn't working label Aug 30, 2024
@gregorgorjanc
Copy link
Member

It looks like more that x has lost a dimension somewhere and is now not a matrix anymore? Sometimes this happens if we do x = x[,n] but n is 1 and then R is clever and converts matrix to a vector. I think it must be some to like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants