Importing Structure results into dartRverse

28 views
Skip to first unread message

Nelia Perry

unread,
May 5, 2025, 2:22:58 AMMay 5
to dartR
Hi all,

I ran Structure and got my results. I used Structure Selector to determine the optimal K and to run CLUMPAK. For some additional visualization, I was hoping to use dartRverse packages. However, I am not sure how to read in my Structure results to R. Everything I am seeing is how to use gl.plot.structure, for example, if your results are stored in R already because Structure was run withing R (I used the Microsoft app of Structure). I am wondering if there is a way to read in my Structure results to R.

A second question: I used CLUMPAK to visualize my clusters for the best K value, but I am not sure if there is a way to see which individual is actually assigned to each cluster. Is there a straightforward way to do this? I was thinking this might be possible within R, but again I need to be able to import my Structure data first.

All help is very appreciated!

Best,
Nelia

Jose Luis Mijangos

unread,
May 8, 2025, 2:31:09 AMMay 8
to dartR
Hi Nelia,

We added a new function to read Structure's output files into dartR (gl.read.structure). To try the function, please install the developing version of dartR.popgen as shown below:

#Install developing version of dartR.popgen
devtools::install_github("green-striped-gecko/dartR.popgen@dev")
library(dartRverse)
# load genlight object
t1 <- readRDS("filtered_ledbirdi_genlight.rds")
# read output files from running structure outside of dartR
sr <- gl.read.structure(folder.path= "lidgbirdi_all_results",
                        x = t1)
# evanno plot
ev <- gl.evanno(sr)
# bar plot ordered by population
gl.plot.structure(sr,
                  K=6)
# bar plot ordered using dendrogram
gl.plot.structure(sr,
                  K=6,
                  den = T,
                  x=t1,
                  ind_name = F)

Cheers,
Luis

Rajneesh Paliwal

unread,
May 8, 2025, 4:55:59 AMMay 8
to da...@googlegroups.com
Dear Jose,

Can you help us how to use Admixture software results similarly for bar plot and barplot with dendrogram, and population confirmation plot? How can be get the list of our lines based on over 70% ancestry coefficient and admixture lines in the population and its plot? Many time 
Please help us to share the script for admixture software as you shared for structure results. Most of times, with large data people preferred Admixture over Structure due to running time constraints. Thanks in advance for your kind help.
Best regards
Rajneesh

Rajneesh Paliwal, PhD (DAAD Fellow)

Associate Scientist

Genetic Resources Center

International Inst. for Tropical Agriculture

Oyo Road PMB-5320, Ibadan, Nigeria



--
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/5315e672-1774-4cb5-8daf-acb31ddc5149n%40googlegroups.com.

Jose Luis Mijangos

unread,
May 11, 2025, 10:36:00 PMMay 11
to dartR

Hi,

We haven’t implemented Admixture in dartR yet, but there are several alternative methods for population structure analysis that are already available:

  1. gl.run.faststructure() – works on macOS and Linux systems only

  2. gl.run.snmf() – also known as LEA

  3. gl.run.popcluster() – based on:
    Wang, J. (2022). Fast and accurate population admixture inference from genotype data from a few microsatellites to millions of SNPs. Heredity, 129(2), 79–92. https://doi.org/10.1038/s41437-022-00538-1

Cheers,

Luis


Reply all
Reply to author
Forward
0 new messages