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
)