-
Notifications
You must be signed in to change notification settings - Fork 7
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
How to get files' ids? #32
Comments
UpdateI noticed that I can use the number from a link to file on Dryad website as For example the file Using 33893 as > dryad_files(33893)
# truncated output
$`33893`$`_links`$`stash:dataset`$href
[1] "/api/v2/datasets/doi%3A10.5061%2Fdryad.7nt8f" |
Thanks for opening the issue. It's quite a mystery to me too how it works. i'll have a look though |
Sorry for the confusion on this. I hate to point fingers, but Dryad has not explained their API well at all, especially how the different ids work, and why we have to deal with their internal IDs, and not just the DOI for the dataset itself. And they don't really respond to questions, so really is a joy! |
Okay, so this should work, where you have to get version information first: last <- function(x) x[length(x)]
z = dryad_dataset_versions("10.5061/dryad.7nt8f")
idpath <- z[[1]]$`_embedded`$`stash:versions`$`_links.self.href`
id <- as.numeric(last(strsplit(idpath, "/")[[1]]))
# gives you information about the files, including their individual IDs
dryad_versions_files(id) Then you still have regex/etc. the IDs out of the strings for each file. We really need to make this easier - any pull requests welcome - don't have a lot of time to devote to this |
Thanks for your reply and tips. Early next year I plan to work on one pipeline which starts by pulling data from Dryad, so I will work more closely with this package. I cannot promise anything, but I will see if I can help to make it work in some way. |
Thanks, sounds good |
Hi, sorry for stupid question, but I don't know how to get files'
ids
so I can download individual files from a dryad dataset.I tried looking at our published dataset with:
However if I try to use that
id
to get files, it shows different doi for this id:i.e. the returned doi is rather 10.5061/dryad.nf757 instead of 10.5061/dryad.7nt8f.
So how do I get:
ids
for my dataset, to be used in functions likedryad_files
?Appendix S2.txt
in the doi link above)?Session Info
The text was updated successfully, but these errors were encountered: