linkage disequilibrium function

33 views
Skip to first unread message

Theresa Cole

unread,
Oct 12, 2025, 4:52:27 PMOct 12
to dartR
Hi, I am trying to run the latest version of DartR using the gl.filter.ld function. I have achieved the initial step gl.report.ld.map but the gl.filter.ld function does not seem to be an available function (e.g. it doesn't come up when I search it in the help page for DartR, or when I try and enter it in manually on R), and on the manual, there is a description about it in the text, but it isn't included as a function on the main list. Has this been removed on purpose?

Jose Luis Mijangos

unread,
Oct 13, 2025, 12:51:23 AMOct 13
to dartR
Hi Theresa,
We are no longer maintaining the dartR package. Instead, we are now developing the dartRverse packages. You can find more information here:

https://github.com/green-striped-gecko/dartR/wiki/Installation-tutorial#dartrverse
You will find the gl.filter.ld function in the dartRverse. 
To install the development versions of the dartRverse packages (that include the latest fixes), please follow the below steps.
Let us know if we can help further.
Cheers,
Luis

# 1. Clean your workspace
# Menu > Session > Clear workspace

# 2. Restart your R session
# Menu > Session > Restart R

# 3. Install the necessary Bioconductor packages
install.packages("devtools")
install.packages("BiocManager")
BiocManager::install("SNPRelate")
BiocManager::install("LEA")
BiocManager::install("snpStats")
BiocManager::install("gdsfmt")
BiocManager::install("BiocGenerics")
BiocManager::install("zlibbioc")

# 4. Install dartRverse
install.packages("dartRverse")

# 5. Install the development versions of the dartRverse packages
devtools::install_github('green-striped-gecko/dartR.sexlinked@dev')
devtools::install_github('green-striped-gecko/dartR.spatial@dev')
devtools::install_github('green-striped-gecko/dartR.captive@dev')
devtools::install_github('green-striped-gecko/dartR.popgen@dev')
devtools::install_github('green-striped-gecko/dartR.base@dev')
devtools::install_github('green-striped-gecko/dartR.sim@dev')

Theresa Cole

unread,
Oct 14, 2025, 6:02:43 AMOct 14
to dartR
Thank you Luis! I have installed the dartRverse packages and they are working. This work is for a project that was undertaken 2 years ago, so it's taking a bit to undertake just a couple of additional steps.....

Another question, when I run the gl.report.ld.map I am getting the issue "Error: vector memory limit of 16.0 Gb reached, see men.maxVsize()"

I am assuming my Mac doesn't have enough memory to run this analysis. Is there a way of running it on my computer using R without having to upload it to a high performance computing network?

Thanks again,
Tess

Jose Luis Mijangos

unread,
Oct 14, 2025, 4:03:51 PMOct 14
to dartR
Hi Tess,

I can think of a few options that might help with the memory issue:

1. Try increasing the memory limit in your RStudio session with:
> mem.maxVsize(Inf)
and then give it another go.

2. If you have a reference genome for your species (or a closely related one), you could BLAST your trimmed DArT sequences using the function gl.blast. That way, you can assign chromosome and position to your SNPs and calculate LD only up to a certain physical distance. I’ve included some example code below.

3. Consider running the LD filtering as the very last step in your filtering process.

4. You can send me your dataset and I’ll run the LD filtering on my end and send you back the filtered genlight object.

Cheers,
Luis

# Load the dartRverse meta-package (brings in dartR.popgen, dartR.data, etc.)
library(dartRverse)
# Example genlight object
x <- platypus.gl
# Assign genomic position and chromosome
x$position <- x$other$loc.metrics$ChromPos_Platypus_Chrom_NCBIv1
x$chromosome <- as.factor(x$other$loc.metrics$Chrom_Platypus_Chrom_NCBIv1)
# Generate LD report (within 10 Mb window)
ld_res <- gl.report.ld.map(
  x,
  ld_max_pairwise = 10000000
)
# Filter on LD with r^2 threshold of 0.2
x2 <- gl.filter.ld(
  x,
  ld.report = ld_res,
  threshold = 0.2
)


Bernd.Gruber

unread,
Oct 14, 2025, 4:49:36 PMOct 14
to da...@googlegroups.com, dartR
Also you could try to use a linux system. 
Those do not habe those Memory System. 

Cheers Bernd

@luis. This might be a function thatvwould benefit from the fbm approach. Have to test it. 
---------


On 15 Oct 2025, at 07:04, Jose Luis Mijangos <luis.m...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "dartR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dartr+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dartr/717caf48-ae4b-47c9-b7bd-52886287a4d9n%40googlegroups.com.

Theresa Cole

unread,
Oct 21, 2025, 11:34:05 PM (11 days ago) Oct 21
to dartR
Thanks. It works on my Mac now!

Best,
Tess

Reply all
Reply to author
Forward
0 new messages