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

import.bw() fails with long file names #65

Closed
mtmorgan opened this issue May 10, 2022 · 3 comments · Fixed by #67
Closed

import.bw() fails with long file names #65

mtmorgan opened this issue May 10, 2022 · 3 comments · Fixed by #67

Comments

@mtmorgan
Copy link
Contributor

mtmorgan commented May 10, 2022

This works

url <- "http://genome.ucsc.edu/goldenPath/help/examples/bigWigExample.bw"
import.bw(long_url)

but creating a longer 'name' for the file (the ?... are ignored by the server; the use case comes from 'signed' URLs where the query includes authentication information)

set.seed(123)
long_url <- paste0(url, "?", paste(sample(letters, 500, TRUE), collapse = ""))
import.bw(long_url)

leads to the error

File name too long
Error in seqinfo(ranges) : UCSC library operation failed
In addition: Warning message:
In seqinfo(ranges) :
  Couldn't make directory /tmp/udcCache_ma38727/http/genome.ucsc.edu/goldenPath/help/examples/bigWigExample.bwQ3Fosncjrvketnvyzesyyichzgjisdnqkgulojmgiijwugufybehlmrayyfuoiozptfkhvvgpqvrqbdmevsytvynywchplyncngcwvzouehsjrjlbjvltnqnvchnsoxqwkgowzfngjefpxuwkdlnsygvzigbpmsxtogdahtypxvkpthcdtlvqjtkywhnumbkmnfyhlzdmnupwahhjyhruiggzjxvwzkaysjuvmkkytzgywztxyiiewnnfazjqzqzuguzitfrqeytcynabdjaeuyhwyumrjfgipqumuhugtrqabqbmxqcrbelymjfjjfppcdcwcpbowcigidbvzlikgmekaslbuqlcyrovcsyrqfjhjzmtfttiphgjqrhsjwkqlbsmmsvjpedrapqlub

A solution might be to more completely separate the url into a correct 'basename', or create a simple hash (e.g., djb2 of http://www.cse.yorku.ca/~oz/hash.html) of the path and use that as the 'key' to store in 'udcCache'.

@lawremi
Copy link
Owner

lawremi commented May 23, 2022

Sounds like an upstream issue that we should at least report. I wonder if @sanchit-saini could find a temporary fix?

@sanchit-saini
Copy link
Contributor

Yes, I looked at the codebase and I think it might be possible to fix it. I'll create a PR soon

@mtmorgan
Copy link
Contributor Author

mtmorgan commented Jun 7, 2022

Reporting that this solved my problem, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants