Hello,
I am trying to convert my genlight file to vcf for analysis in TASSEL, but am having trouble with a few errors.
I would like to include SNP and chromosome positions from the reference genome, but I cannot tell if I am calling the right field names. I keep getting the error:
gl2vcf(May23Vibf, snp_pos = May23Vibf@other[["loc.metrics"]][["ChromPosSnp_viburnum_lautum_v031"]], snp_chr = May23Vibf@other[["loc.metrics"]][["Chrom_viburnum_lautum_v031"]], pos_cM = May23Vibf@other[["loc.metrics"]][["ChromPosSnp_viburnum_lautum_v031"]],plink_path = "/Users/davidtork/Desktop/'R projects'/Vib_May23Hyb/plink_mac_20230116", outfile = "May23Vibf_vcf", outpath = getwd(), verbose = 5)
Starting gl2vcf
[dartR vers. 2.7.2 Build = Jody ]
Processing genlight object with SNP data
Error in if (snp_pos == "0") { : the condition has length > 1
If I remove SNP/chr information, it returns a different error, and I am still not able to generate a VCF file:
gl2vcf(May23Vibf,plink_path = "/Users/davidtork/Desktop/'R projects'/Vib_May23Hyb/plink_mac_20230116", outfile = "May23Vibf_vcf", outpath = getwd(), verbose = 5)
Starting gl2vcf
[dartR vers. 2.7.2 Build = Jody ]
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: --out only accepts 1 parameter.
For more information, try "plink --help <flag name>" or "plink --help | more".
Warning: running command '/Users/davidtork/Desktop/'R projects'/Vib_May23Hyb/plink_mac_20230116/plink --file /Users/davidtork/Desktop/R projects/Vib_May23Hyb/gl_plink_temp --recode vcf --allow-no-sex --reference-allele /var/folders/4v/9qc45m6x7_97f72bwk135_y00000gn/T//RtmpJhxHoE/mylist.txt --out /Users/davidtork/Desktop/R projects/Vib_May23Hyb/May23Vibf_vcf --aec' had status 5
----------Output of function start:
PLINK v1.90b7 64-bit (16 Jan 2023) www.cog-genomics.org/plink/1.9/
(C) 2005-2023 Shaun Purcell, Christopher Chang GNU General Public License v3
----------Output of function finished...
Completed: gl2vcf
I attached a screenshot of my loc.metrics for reference. I apologize if this is a basic question. I am not familiar with PLINK, and have had no luck finding solutions to this problem elsewhere.
Final note -- I saw this mentioned
elsewhere on this forum, but the "plink_path" argument does not accept spaces in the path name. It would be helpful if this was mentioned in the gl2vcf() documentation. A simple workaround is to put single quotes around the directory level with a space:
"/Users/davidtork/Desktop/'R projects'/Vib_May23Hyb/plink_mac_20230116"
Thank you,
David