Issue with gl.impute() Function in dartR

12 views
Skip to first unread message

Jean Rodrigue Sangaré

unread,
Oct 10, 2025, 9:19:30 AMOct 10
to dartR


Hello everyone,
I’d like to share an error I encountered while trying to impute missing SNP data in a genlight object using the gl.impute() function.

Here’s what I tried:


gl_imputed <- gl.impute(gl, method = "mean")
Starting gl.impute Processing genlight object with SNP data
Error in gl.impute(gl, method = "mean") : object 'x3' not found
> gl_imputed <- gl.impute(gl, method = "mode") Starting gl.impute Processing genlight object with SNP data
Error in gl.impute(gl, method = "mode") : object 'x3' not found

Kndalem Yaregal

unread,
Oct 10, 2025, 9:20:57 AMOct 10
to da...@googlegroups.com
Can I filter LD in geneligh object


--
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/6ebe5837-98ad-47fe-a424-7eaeb29ab0ecn%40googlegroups.com.


--
Thank you!
Kind regards,
Kndalem Yaregal 
MSc. Student in Plant Breeding and Genetics |Wollo University 
Plant Breeder |Sekota Dryland Agricultural Research Center  in Amhara Agricultural Research Institute 
Email (Alt): 21ethi...@gmail.com 
skype: Kndalem. Yaregal
 Mobile: +251916899864Ethiopia

"Improving the Dryland for Mind Glad."
 "Make a positive impact in our community!"

Jose Luis Mijangos

unread,
Oct 13, 2025, 1:36:15 AMOct 13
to dartR
Hi,

Thanks a lot for reporting this bug! Just to clarify, the function should run without issues as long as one of the four valid options is used for the method parameter: "frequency", "HW", "neighbour", or "random".

Cheers,
Luis

Jose Luis Mijangos

unread,
Oct 13, 2025, 1:53:24 AMOct 13
to dartR
Hi

Please see some example code below that shows how you can filter on LD in a genlight object.

Cheers,
Luis

library(dartRverse)

# sample dataset
t1 <- platypus.gl

# Optional: if SNPs are mapped to a reference genome,
# assign SNP position and chromosome
t1$position <- t1$other$loc.metrics$ChromPos_Platypus_Chrom_NCBIv1
t1$chromosome <- as.factor(t1$other$loc.metrics$Chrom_Platypus_Chrom_NCBIv1)

# access function documentation
?gl.report.ld.map
# or
help(gl.report.ld.map)

# generate LD report
ld_res <- gl.report.ld.map(t1,
                           ld.max.pairwise = 10000000)

# filter on LD
t2 <- gl.filter.ld(t1,
                   ld.report = ld_res,
                   threshold = 0.2)


Reply all
Reply to author
Forward
0 new messages