dartR.base::gl2vcf

15 views
Skip to first unread message

Francisco José Franco Piccioli

unread,
Oct 13, 2025, 11:17:28 AMOct 13
to dartR
Hello, I need to transform Genlight data into a VCF (dartR.base::gl2vcf) for use with ShiNyP, but the following error occurs.

gl2vcf(x = data, outfile = "data_final.vcf")

system(..., intern = T)
3.
system_verbose(paste(plink.bin.path, "--file", prefix.in, "--recode",
"vcf", if (autosome.only) "--autosome "else "", "--allow-no-sex",
paste("--reference-allele", file.path(tempdir(), "mylist.txt")),
"--out", prefix.out, extra.options))
2.
make_plink(plink.bin.path = paste0(plink.bin.path, "/plink"),
extra.options = "--aec")
1.
gl2vcf(x = data, outfile = "data_final.vcf")

Best, regards,
Francisco

Jose Luis Mijangos

unread,
Oct 13, 2025, 2:48:55 PMOct 13
to dartR
Hi Francisco,

I couldn't see any error message in the text you sent. 

Would you mind sending me a small subset of your data that replicates the behaviour you’re seeing to my email (luis.mijangos at gmail.com)? The code below shows how you can create and save a subset.

If you could please send me:

1. the file `test.rds` (from the code example below), and
2. the code you’re running,

that would be great.

library(dartRverse)

# subset loci
# you can increase the number of loci, for example n = 400
test <- gl.subsample.loci(your_data.gl, n = 200, method = "random")

# subset individuals
# you can adjust the number of individuals, e.g. indNames(test)[1:20]
test <- gl.keep.ind(test, ind.list = indNames(test)[1:10])

# save object in the working directory
saveRDS(test, "test.rds")

Cheers,
Luis

Francisco José Franco Piccioli

unread,
Oct 13, 2025, 3:06:50 PMOct 13
to da...@googlegroups.com


Hi Luis,

Thanks for your response. 
The error is as follows:

> gl2vcf(x = glsnp6,
+        outfile = "datos_FINAL_CONVERTIDOS.vcf")
Starting gl2vcf
  Processing genlight object with SNP data
  Chromosome information is not present in the slot 'chromosome'. Setting '0' as the name chromosome for all the SNPs.
Starting gl2plink
  Processing genlight object with SNP data
Completed: gl2plink

Error en system(..., intern = T): 'C:/proyectos_shiny/plink' not found



4.

system(..., intern = T)
3.
system_verbose(paste(plink.bin.path, "--file", prefix.in, "--recode",
"vcf", if (autosome.only) "--autosome" else "", "--allow-no-sex",
paste("--reference-allele", file.path(tempdir(), "mylist.txt")),
"--out", prefix.out, extra.options))
2.
make_plink(plink.bin.path = paste0(plink.bin.path, "/plink"),
extra.options = "--aec")
1.
gl2vcf(x = glsnp6, outfile = "datos_FINAL_CONVERTIDOS.vcf")
1.
gl2vcf(x = data, outfile = "data_final.vcf")  


Best regards, 
Francisco


--
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/7a58b969-df53-4115-9123-654e07a68864n%40googlegroups.com.

Jose Luis Mijangos

unread,
Oct 13, 2025, 3:14:06 PMOct 13
to dartR
Hi Francisco,

As mentioned in the function documentation, you’ll need to download the binary file of PLINK 1.9 and provide its path in the plink.bin.path. By default, this points to the working directory, so the easiest option is just to place the binary file there.

You can download the binary here: https://www.cog-genomics.org/plink/

Let us know if we can help further.

Cheers,
Luis

Bernd.Gruber

unread,
Oct 13, 2025, 9:22:18 PMOct 13
to da...@googlegroups.com

gl.download.binary("plink", os = "windows", out.dir ="path" )

 

works as well to download the binary. (see variants below)

 

Cheers, Bernd

 

 

 

Arguments

software

name of the software package to download. Currently supported are: "epos", "NeEstimator", "Stairway2" and "Gone". Please note, depending on the software several files will be downloaded

os

the operating system to download the binary for. Currently supported are: "windows", "mac" and "linux". Please be aware some binaries are not available for all operating systems.

branch

which branch to download from (leave empty for the main branch and there should not be a reason to change that)

out.dir

the path where to save the binary. If left empty the binary will be saved in the temporary directory.

Francisco José Franco Piccioli

unread,
Oct 15, 2025, 2:41:01 PMOct 15
to da...@googlegroups.com
Hi, Luis and Bernd.

Thank you very much for the information.

Best regards!

You received this message because you are subscribed to a topic in the Google Groups "dartR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dartr/oZ-HkPJYhXs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dartr+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dartr/ME3PR01MB794454A0061295F6E6A87C2CD4EBA%40ME3PR01MB7944.ausprd01.prod.outlook.com.
Reply all
Reply to author
Forward
0 new messages