Missing arguments for dartR.captive for relatedness

12 views
Skip to first unread message

Eeva Jansson

unread,
Feb 5, 2026, 5:02:23 AM (6 days ago) Feb 5
to dartR
Dear dartR community,

I could use some clarification/help running EMIBD9 inside dartR.captive. I have a situation where I probably have high background relatedness so I
need to adjust for this by selecting argument Inbreeding=TRUE in gl.run.EMIBD9() command. Have I understood correctly that default value for option
EM_Method is always 1 meaning that expectation maximisation (EM) algorithm estimates both Δ and allele frequencies jointly? This is not included
into arguments for gl.run.EMIBD9() nor simulations for kinship. Is there any way to add or change it?

Then related to this, I need to also run simulations with gl.sim.relatedness() to determine thresholds for kinship with the same setting, EM enabled (EM_Method = 1)
and Inbreeding = TRUE. Now I can see from the produced output that EM is enabled (it says: "Performming EM for Delta and P: Replicate=1" while running). However, there is no
argument to select Inbreeding=TRUE in arguments. Again, is it possible to get it added (manually) for the function to change the default which I think is FALSE?

Below the options I have selected currently to run this. I don't think they match now, one is using inbred model as I wish while the other one is not.
I assume both enable EM_Method but it would be nice to test own results against random background assumption as well.

I used dartR.captive version 1.0.2

To run EMIBD9:

EMIBD9 <- gl.run.EMIBD9(mydata_gl,
                        emibd9.path = "[path_toEMIBD9_here]",
                        Inbreed = TRUE,
ISeed = [randomnumber])

To run simulations for full sibs:
full_sibs_simulated <- gl.sim.relatedness(
  gl.run.EMIBD9(mydata_gl,
  rel = "full.sib",
  nboots = 100,
  emibd9.path = "[path_toEMIBD9_here]",
  conf = 0.95,
  iseed = [different_randomnumber],
  plot.out = TRUE,
  plot.dir = NULL,
  plot.file = NULL,
  verbose = NULL
)

Thanks a ton for any help!

Jose Luis Mijangos

unread,
Feb 5, 2026, 10:03:38 PM (5 days ago) Feb 5
to dartR
Hi,

I've added the parameters requested. To use the new parameters, please install the developing version of dartR.captive as shown below. 

# Clean your environment
# RStudio > Menu > Session > Clear workspace
# Restart R Session
# RStudio > Menu > Session > Restart R
# installing developing version of dartR.captive
devtools::install_github("green-striped-gecko/dartR.captive@dev")
library(dartRverse)
mydata_gl <- gl.filter.callrate(platypus.gl, threshold = 1, mono.rm = T)
# To run EMIBD9:
EMIBD9 <- gl.run.EMIBD9(
  mydata_gl,
  emibd9.path = getwd(),
  OutAlleleFre = 0,
  EM_Method = 1,
  Inbreed = T,
  ISeed = 42,
  plot.out = F
)

# To run simulations for full sibs
full_sibs_simulated <- gl.sim.relatedness(

  mydata_gl,
  rel = "full.sib",
  nboots = 5,
  emibd9.path = getwd(),
  conf = 0.95,
  OutAlleleFre = 0,
  EM_Method = 1,
  Inbreed = T,
  ISeed = 42,
  plot.out = F
)

Cheers,
Luis

Reply all
Reply to author
Forward
0 new messages