Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zip_datafiles throws error if data in different directory #102

Closed
tavareshugo opened this issue Feb 15, 2019 · 2 comments
Closed

zip_datafiles throws error if data in different directory #102

tavareshugo opened this issue Feb 15, 2019 · 2 comments
Labels

Comments

@tavareshugo
Copy link

zip_datafiles() seems to throw an error when data are in a sub-directory. Here's an example:

# work from temporary directory
setwd(tempdir())

# create a sub-directory
dir.create("data")

# download example data in there
download.file("https://github.com/rqtl/qtl2data/raw/master/ArabMAGIC/arabmagic.zip", 
              "data/qtl2data.zip", "wget")

# unzip contents
unzip("data/qtl2data.zip", exdir = "data")

# create new zip_datafiles - error
qtl2::zip_datafiles("./data/arabmagic.json")

I think the problem is in lines 76-79 of function, which change working directory, but then line 99 uses zip_file that includes the full path. Not sure lines 76-79 are necessary at all?

@kbroman
Copy link
Member

kbroman commented Feb 15, 2019

I think the problem I had was preventing the zip file from containing the full depth of directories.

kbroman added a commit to kbroman/qtl2 that referenced this issue Feb 16, 2019
kbroman added a commit to kbroman/qtl2 that referenced this issue Feb 16, 2019
@kbroman kbroman added the bug label Feb 16, 2019
@kbroman
Copy link
Member

kbroman commented Feb 16, 2019

Hi, @tavareshugo, It should be working now; thanks for reporting the problem, and particularly for providing the example!

@kbroman kbroman closed this as completed Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants