Converting object from dartR to use in SNPRelate

I apologize in advance, I am new in the scripting business and am only using this for my project right now to graduate. I am not entirely sure how to format my text here correctly, I tried following the instructions on here but I don't think I am getting it right. To fix this, I hope I have written it down in such a way that it is easy to follow nevertheless and that I have given all the information necessary. I also couldn't tag the packages this topic concerns as they didn't come up on the list. Please let me know if I need to alter this in some way!

My issue: I am using the dartR package in R studio to work with DArTseq data. I have been using a tutorial for this and it has been working perfectly for me so far:

https://cran.r-project.org/web/packages/dartR/vignettes/IntroTutorial_dartR.pdf

Now I want to convert the dartR objects into something I can use in SNPRelate. The tutorial mentions this step as well in chapter 17.4. I also googled outside of this tutorial and I found the same code for this (the name of my object is 'gl':

  1. gl2gds(gl, outfile = "gl2gds.gds", outpath = getwd())
  2. gds <- snpgdsOpen("g12gds.gds")

The part that is not working for me is the second line; loading in the new file in SNPRelate.
This is the message in my console:

gl2gds(gl, outfile = "gl2gds.gds", outpath = getwd())
Converting gl object to gds formatted file /Users/.../dartR-master/gl2gds.gds

gds <- snpgdsOpen("g12gds.gds")
Error in openfn.gds(filename, readonly, allow.duplicate = allow.duplicate, :
Can not open file 'g12gds.gds'. No such file or directory

I shortened the working directory for easier viewing with '/.../'

Can anyone help me to understand why the file is not found? In my understanding the file IS created, the name is correct. But why can't R find it?

I use the following packages following tutorials for both dartR and SNPRelate and they have all been installed and loaded correctly:

library(dartR)
library(ggplot2)
library(devtools)
library(SNPRelate)
library(qvalue)
library(gdsfmt)

Thank you!

The problem is that

gl2gds(gl, outfile = "gl2gds.gds", outpath = getwd())

creates a zero-byte file, as does the example in the help page. Don't think there's anything to be done other than contact the maintainer.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.