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
bug

Comments

@tavareshugo
Copy link

@tavareshugo tavareshugo commented Feb 15, 2019

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 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
- Fixes Issue rqtl#102
kbroman added a commit to kbroman/qtl2 that referenced this issue Feb 16, 2019
…lace

- Another revision to fix Issue rqtl#102
@kbroman kbroman added the bug label Feb 16, 2019
@kbroman
Copy link
Member

@kbroman 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 Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.