I have set a VCF file (from galaxy.eu) as my working directory but when using 'snpgdsVCF2GDS', I get an error saying there is no such file or directory even though I can see the file and data in my directory.
Code and error:
vcf.fn <- ("VCF")
setwd("~/Documents/Year 3/Sequence Analysis/Workshop 4 - Week 9/VCF")
snpgdsVCF2GDS(vcf.fn, "test.gds", method="biallelic.only") Start file conversion from VCF to SNP GDS ... Method: extracting biallelic SNPs Error in file(filename, "rt") : cannot open the connection In addition: Warning message: In file(filename, "rt") : cannot open file 'VCF': No such file or directory
Consider creating a .Rproj project in RStudio with the menu option. Create a folder data and place the data files you will be using there. (I like also to create a folder obj to put whatever new objects I derive in a separate folder to avoid overwriting the source data.)
install.packages("here")
Then when you open the project there is no need to setwd().