gl.run.structure output files not saving

32 views
Skip to first unread message

Emily Rush

unread,
Jul 31, 2025, 7:26:40 PMJul 31
to dartR
Hello, 

I have been running Structure in R and thought everything was running okay (for a few months). I can plot evanno and view the gl.plot.structure plots fine using the below code. 

structure_north_noadmix1 <- gl.run.structure(subsampled_north1, k.range = 1:10, num.k.rep = 5, exec = 'C:/Users/errus/Desktop/structure/structure.exe', noadmix=TRUE, burnin = 10000, numreps = 10000)

# Round 1: evanno plots
gl.evanno(structure_north_noadmix1)

# Round 1: view STRUCTURE plot - change k for different results
gl.plot.structure(structure_north_noadmix1, K=10, clumpak = FALSE)

It wasn't until yesterday that I wanted to start making plots for publication that I realised I am not getting the correct output files saved on my computer. I only had three saved to the working directory on a rerun yesterday, these were:...structureRun.k1; ...r1_extraparams and ....r1_mainparams. 

I read that maybe this was because I should be saving directly into the structure folder (where the executable is) on my desktop, so I changed this but then I got no output at all. I cannot find any more 'gtypes' file folders on my computer, other than those created in March back when I first started using the program. 

I do get this error when I looked to see if the program was executing properly:

system("C:/Users/errus/Desktop/structure/structure.exe", intern = TRUE) [1] ""                                                    
[2] ""                                                    
[3] "----------------------------------------------------"
[4] "STRUCTURE by Pritchard, Stephens and Donnelly (2000)"
[5] "     and Falush, Stephens and Pritchard (2003)"      
[6] "       Code by Pritchard, Falush and Hubisz"         
[7] "             Version 2.3.4 (Jul 2012)"               
[8] "----------------------------------------------------"
[9] ""                                                    
[10] ""                                                    
[11] "Can't open the file \"mainparams\"."                 
[12] ""                                                    
[13] "Exiting the program due to error(s) listed above."   
[14] ""                                                    
attr(,"status")
[1] 1Warning message:
In system("C:/Users/errus/Desktop/structure/structure.exe", intern = TRUE) :
  running command 'C:/Users/errus/Desktop/structure/structure.exe' had status 1

Hoping you can help. I did try "delete.files = FALSE" that I saw in another question on here but I got an error. 

Thank you, 
Emily

Jose Luis Mijangos

unread,
Jul 31, 2025, 8:07:37 PMJul 31
to dartR
Hi Emily,

Could you please install the development version of dartR.popgen as shown below, and then run the rest of the code? Please let us know if that doesn’t work, and we’ll work out an alternative solution.

# Install development version of dartR.popgen
devtools::install_github("green-striped-gecko/dartR.popgen@dev")

library(dartRverse)

x  <- platypus.gl
r1 <- gl.run.structure(x,
  exec        = "./structure",
  k.range     = 2:4,
  num.k.rep   = 1,
  delete.files = FALSE
)


Before installing, make sure you:

1. Have R version ≥ 4.4.2. If not, follow these instructions: [https://www.danieldsjoberg.com/updater/index.html](https://www.danieldsjoberg.com/updater/index.html)
2. Clear your RStudio environment (Menu ▸ Session ▸ Clear Workspace).
3. Restart your R session (Menu ▸ Session ▸ Restart R).
4. Confirm that, when installation finishes, the final message is `* DONE (dartR.popgen)`.

Sometimes Google Groups alters quotation marks in R code, so please double-check that the quotes are correct.

Cheers,
Luis

Emily Rush

unread,
Aug 3, 2025, 7:01:06 PMAug 3
to dartR
Hi Luis, 

Thanks you for your response. I had tried installing that dev package previously but unfortunately just got errors. I have followed your advice at the bottom with closing and restarting but still get the same issue. 

I am using R version 4.5.0 and I uninstalled the dartR.popgen I had in place previously prior to trying to install the development version. 

When I run this: 
# Install development version of dartR.popgen
devtools::install_github("green-striped-gecko/dartR.popgen@dev")

It tells me that updates are available (for 22 packages), I have tried runing with no updates and all updates but the result is the same. 

The final error after selecting to update packages is this:
The downloaded binary packages are in C:\Users\errus\AppData\Local\Temp\RtmpULjSPf\downloaded_packages ── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────── checking for file 'C:\Users\errus\AppData\Local\Temp\RtmpULjSPf\remotes90981ea2985\green-striped-gecko-dartR.popgen-8c96f12/DESCRIPTION' ... preparing 'dartR.popgen': (1.7s) checking DESCRIPTION meta-information ... checking for LF line-endings in source and make files and shell scripts (407ms) checking for empty or unneeded directories building 'dartR.popgen_1.0.6.tar.gz' (921ms) Installing package into ‘C:/Users/errus/AppData/Local/R/win-library/4.5’ (as ‘lib’ is unspecified) ERROR: dependency 'LEA' is not available for package 'dartR.popgen' Perhaps try a variation of: install.packages('LEA') * removing 'C:/Users/errus/AppData/Local/R/win-library/4.5/dartR.popgen'Warning messages: 1: package ‘LEA’ is not available for this version of R A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages 2: In file.copy(savedcopy, lib, recursive = TRUE) : problem copying C:\Users\errus\AppData\Local\R\win-library\4.5\00LOCK\Rcpp\libs\x64\Rcpp.dll to C:\Users\errus\AppData\Local\R\win-library\4.5\Rcpp\libs\x64\Rcpp.dll: Permission denied 3: In file.copy(savedcopy, lib, recursive = TRUE) : problem copying C:\Users\errus\AppData\Local\R\win-library\4.5\00LOCK\promises\libs\x64\promises.dll to C:\Users\errus\AppData\Local\R\win-library\4.5\promises\libs\x64\promises.dll: Permission denied 4: In file.copy(savedcopy, lib, recursive = TRUE) : problem copying C:\Users\errus\AppData\Local\R\win-library\4.5\00LOCK\purrr\libs\x64\purrr.dll to C:\Users\errus\AppData\Local\R\win-library\4.5\purrr\libs\x64\purrr.dll: Permission denied 5: In i.p(...) : installation of package ‘C:/Users/errus/AppData/Local/Temp/RtmpULjSPf/file90984a327127/dartR.popgen_1.0.6.tar.gz’ had non-zero exit status > library(dartRverse)
Error in library(dartRverse) : there is no package called ‘dartRverse’

Is there an alternative option? Would uninstalling Structure and then reinstalling help fix the saving issue or is it a common problem?

Thank you,
Emily

Jose Luis Mijangos

unread,
Aug 3, 2025, 9:37:28 PMAug 3
to dartR
Hi Emily,

Can you please try installing the two below packages from BiocManager as shown below and then please try installing again dartRverse as mentioned before.

install.packages("BiocManager")
BiocManager::install("SNPRelate")
BiocManager::install("LEA")

Cheers,
Luis 

Emily Rush

unread,
Aug 4, 2025, 1:18:07 AMAug 4
to dartR
Hi Luis, thank you. I have copied from the console below so that you can see the process and issues. 

BiocManager installed, SNPRelate was an issue so i tried to force it to overwrite previous versions with no luck. LEA also looked to unpack and then at the end said permission was denied. 


> install.packages("BiocManager") Installing package into ‘C:/Users/errus/AppData/Local/R/win-library/4.5’ (as ‘lib’ is unspecified)trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/BiocManager_1.30.26.zip' Content type 'application/zip' length 507685 bytes (495 KB) downloaded 495 KB package ‘BiocManager’ successfully unpacked and MD5 sums checked The downloaded binary packages are in C:\Users\errus\AppData\Local\Temp\RtmpULjSPf\downloaded_packages > BiocManager::install("SNPRelate") 'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package = "BiocManager")' for details. Replacement repositories: CRAN: https://cran.rstudio.com/ Bioconductor version 3.21 (BiocManager 1.30.26), R 4.5.0 (2025-04-11 ucrt) Installation paths not writeable, unable to update packages path: C:/Program Files/R/R-4.5.0/library packages: lattice, mgcv Old packages: 'bigassertr', 'bigutilsr', 'broom', 'cowplot', 'curl', 'dendextend', 'DEoptimR', 'directlabels', 'emmeans', 'FactoMineR', 'gdsfmt', 'GGally', 'ggstats', 'glmnet', 'haven', 'httr2', 'maps', 'mice', 'openssl', 'pbkrtest', 'pcadapt', 'pheatmap', 'plotly', 'promises', 'purrr', 'Rcpp', 'rnaturalearth', 'rprojroot', 'Rsolnp', 'waldo'Update all/some/none? [a/s/n]: n Warning message: package(s) not installed when version(s) same as or greater than current; use `force = TRUE` to re-install: 'SNPRelate' > force = TRUE > BiocManager::install("LEA") 'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package = "BiocManager")' for details. Replacement repositories: CRAN: https://cran.rstudio.com/ Bioconductor version 3.21 (BiocManager 1.30.26), R 4.5.0 (2025-04-11 ucrt) Installing package(s) 'LEA'trying URL 'https://bioconductor.org/packages/3.21/bioc/bin/windows/contrib/4.5/LEA_3.20.0.zip' Content type 'application/zip' length 979172 bytes (956 KB) downloaded 956 KB package ‘LEA’ successfully unpacked and MD5 sums checked The downloaded binary packages are in C:\Users\errus\AppData\Local\Temp\RtmpULjSPf\downloaded_packages Installation paths not writeable, unable to update packages path: C:/Program Files/R/R-4.5.0/library packages: lattice, mgcv Old packages: 'bigassertr', 'bigutilsr', 'broom', 'cowplot', 'curl', 'dendextend', 'DEoptimR', 'directlabels', 'emmeans', 'FactoMineR', 'gdsfmt', 'GGally', 'ggstats', 'glmnet', 'haven', 'httr2', 'maps', 'mice', 'openssl', 'pbkrtest', 'pcadapt', 'pheatmap', 'plotly', 'promises', 'purrr', 'Rcpp', 'rnaturalearth', 'rprojroot', 'Rsolnp', 'waldo'Update all/some/none? [a/s/n]: n > # Install development version of dartR.popgen > devtools::install_github("green-striped-gecko/dartR.popgen@dev") Downloading GitHub repo green-striped-gecko/dartR.popgen@devThese packages have more recent versions available. It is recommended to update all of them. Which would you like to update? 1: All 2: CRAN packages only 3: None 4: Rcpp (1.0.14 -> 1.1.0) [CRAN] 5: promises (1.3.2 -> 1.3.3) [CRAN] 6: purrr (1.0.4 -> 1.1.0) [CRAN] Enter one or more numbers, or an empty line to skip updates: 1 Rcpp (1.0.14 -> 1.1.0) [CRAN] promises (1.3.2 -> 1.3.3) [CRAN] purrr (1.0.4 -> 1.1.0) [CRAN] Skipping 3 packages not available: snpStats, SNPRelate, LEA Installing 3 packages: Rcpp, promises, purrr Installing packages into ‘C:/Users/errus/AppData/Local/R/win-library/4.5’ (as ‘lib’ is unspecified)trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/Rcpp_1.1.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/promises_1.3.3.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/purrr_1.1.0.zip' package ‘Rcpp’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘Rcpp’ Warning: restored ‘Rcpp’ package ‘promises’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘promises’ Warning: restored ‘promises’ package ‘purrr’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘purrr’ Warning: restored ‘purrr’ The downloaded binary packages are in C:\Users\errus\AppData\Local\Temp\RtmpULjSPf\downloaded_packages ── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────── checking for file 'C:\Users\errus\AppData\Local\Temp\RtmpULjSPf\remotes9098c2915a4\green-striped-gecko-dartR.popgen-8c96f12/DESCRIPTION' ... preparing 'dartR.popgen': (1.2s) checking DESCRIPTION meta-information ... checking for LF line-endings in source and make files and shell scripts checking for empty or unneeded directories building 'dartR.popgen_1.0.6.tar.gz' (722ms) Installing package into ‘C:/Users/errus/AppData/Local/R/win-library/4.5’ (as ‘lib’ is unspecified)* installing *source* package 'dartR.popgen' ... ** this is package 'dartR.popgen' version '1.0.6' ** using staged installation ** R ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices *** copying figures ** building package indices ** testing if installed package can be loaded from temporary location ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (dartR.popgen) Warning messages: 1: In file.copy(savedcopy, lib, recursive = TRUE) : problem copying C:\Users\errus\AppData\Local\R\win-library\4.5\00LOCK\Rcpp\libs\x64\Rcpp.dll to C:\Users\errus\AppData\Local\R\win-library\4.5\Rcpp\libs\x64\Rcpp.dll: Permission denied 2: In file.copy(savedcopy, lib, recursive = TRUE) : problem copying C:\Users\errus\AppData\Local\R\win-library\4.5\00LOCK\promises\libs\x64\promises.dll to C:\Users\errus\AppData\Local\R\win-library\4.5\promises\libs\x64\promises.dll: Permission denied 3: In file.copy(savedcopy, lib, recursive = TRUE) : problem copying C:\Users\errus\AppData\Local\R\win-library\4.5\00LOCK\purrr\libs\x64\purrr.dll to C:\Users\errus\AppData\Local\R\win-library\4.5\purrr\libs\x64\purrr.dll: Permission denied
###Tried again to install SNPRelate BiocManager::install("SNPRelate, force = TRUE") 'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package = "BiocManager")' for details. Replacement repositories: CRAN: https://cran.rstudio.com/ Bioconductor version 3.21 (BiocManager 1.30.26), R 4.5.0 (2025-04-11 ucrt) Installing package(s) 'SNPRelate, force = TRUE' Installation paths not writeable, unable to update packages path: C:/Program Files/R/R-4.5.0/library packages: lattice, mgcv Old packages: 'bigassertr', 'bigutilsr', 'broom', 'cowplot', 'curl', 'dendextend', 'DEoptimR', 'directlabels', 'emmeans', 'FactoMineR', 'gdsfmt', 'GGally', 'ggstats', 'glmnet', 'haven', 'httr2', 'maps', 'mice', 'openssl', 'pbkrtest', 'pcadapt', 'pheatmap', 'plotly', 'promises', 'purrr', 'Rcpp', 'rnaturalearth', 'rprojroot', 'Rsolnp', 'waldo'Update all/some/none? [a/s/n]: a also installing the dependency ‘future.apply’trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/future.apply_1.20.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/bigassertr_0.1.7.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/bigutilsr_0.3.11.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/broom_1.0.9.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/cowplot_1.2.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/curl_6.4.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/dendextend_1.19.1.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/DEoptimR_1.1-4.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/directlabels_2025.6.24.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/emmeans_1.11.2.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/FactoMineR_2.12.zip' trying URL 'https://bioconductor.org/packages/3.21/bioc/bin/windows/contrib/4.5/gdsfmt_1.44.1.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/GGally_2.3.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/ggstats_0.10.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/glmnet_4.1-10.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/haven_2.5.5.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/httr2_1.2.1.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/maps_3.4.3.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/mice_3.18.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/openssl_2.3.3.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/pbkrtest_0.5.5.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/pcadapt_4.4.1.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/pheatmap_1.0.13.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/plotly_4.11.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/promises_1.3.3.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/purrr_1.1.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/Rcpp_1.1.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/rnaturalearth_1.1.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/rprojroot_2.1.0.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/Rsolnp_2.0.1.zip' trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.5/waldo_0.6.2.zip' package ‘future.apply’ successfully unpacked and MD5 sums checked package ‘bigassertr’ successfully unpacked and MD5 sums checked package ‘bigutilsr’ successfully unpacked and MD5 sums checked package ‘broom’ successfully unpacked and MD5 sums checked package ‘cowplot’ successfully unpacked and MD5 sums checked package ‘curl’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘curl’ Warning: restored ‘curl’ package ‘dendextend’ successfully unpacked and MD5 sums checked package ‘DEoptimR’ successfully unpacked and MD5 sums checked package ‘directlabels’ successfully unpacked and MD5 sums checked package ‘emmeans’ successfully unpacked and MD5 sums checked package ‘FactoMineR’ successfully unpacked and MD5 sums checked package ‘gdsfmt’ successfully unpacked and MD5 sums checked package ‘GGally’ successfully unpacked and MD5 sums checked package ‘ggstats’ successfully unpacked and MD5 sums checked package ‘glmnet’ successfully unpacked and MD5 sums checked package ‘haven’ successfully unpacked and MD5 sums checked package ‘httr2’ successfully unpacked and MD5 sums checked package ‘maps’ successfully unpacked and MD5 sums checked package ‘mice’ successfully unpacked and MD5 sums checked package ‘openssl’ successfully unpacked and MD5 sums checked package ‘pbkrtest’ successfully unpacked and MD5 sums checked package ‘pcadapt’ successfully unpacked and MD5 sums checked package ‘pheatmap’ successfully unpacked and MD5 sums checked package ‘plotly’ successfully unpacked and MD5 sums checked package ‘promises’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘promises’ Warning: restored ‘promises’ package ‘purrr’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘purrr’ Warning: restored ‘purrr’ package ‘Rcpp’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘Rcpp’ Warning: restored ‘Rcpp’ package ‘rnaturalearth’ successfully unpacked and MD5 sums checked package ‘rprojroot’ successfully unpacked and MD5 sums checked package ‘Rsolnp’ successfully unpacked and MD5 sums checked package ‘waldo’ successfully unpacked and MD5 sums checked The downloaded binary packages are in C:\Users\errus\AppData\Local\Temp\RtmpULjSPf\downloaded_packages Warning messages: 1: package ‘SNPRelate, force = TRUE’ is not available for Bioconductor version '3.21' A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages 2: In file.copy(savedcopy, lib, recursive = TRUE) : problem copying C:\Users\errus\AppData\Local\R\win-library\4.5\00LOCK\curl\libs\x64\curl.dll to C:\Users\errus\AppData\Local\R\win-library\4.5\curl\libs\x64\curl.dll: Permission denied 3: In file.copy(savedcopy, lib, recursive = TRUE) : problem copying C:\Users\errus\AppData\Local\R\win-library\4.5\00LOCK\promises\libs\x64\promises.dll to C:\Users\errus\AppData\Local\R\win-library\4.5\promises\libs\x64\promises.dll: Permission denied 4: In file.copy(savedcopy, lib, recursive = TRUE) : problem copying C:\Users\errus\AppData\Local\R\win-library\4.5\00LOCK\purrr\libs\x64\purrr.dll to C:\Users\errus\AppData\Local\R\win-library\4.5\purrr\libs\x64\purrr.dll: Permission denied 5: In file.copy(savedcopy, lib, recursive = TRUE) : problem copying C:\Users\errus\AppData\Local\R\win-library\4.5\00LOCK\Rcpp\libs\x64\Rcpp.dll to C:\Users\errus\AppData\Local\R\win-library\4.5\Rcpp\libs\x64\Rcpp.dll: Permission denied
library(dartRverse)
Error in library(dartRverse) : there is no package called ‘dartRverse’
Reply all
Reply to author
Forward
0 new messages