Hi Jim, Wei, and anyone else stumbling upon this:
I, too, was looking to do this. What I have are a bunch of index bam files on a private S3 bucket. Although IGV provides HTTP access to files and AWS S3 provides an HTTP API, the two are not immediately compatible:
- the S3 API expects "signed" requests, created by hashing the path and current time. While it is possible to create this signed URL and feed that to IGV, for indexed files, the subsequent GET request for the index (e.g., the .bam.bai in the same folder) will fail, as IGV does not correctly sign the URL. This is what is likely causing the 401 unauthorized request in the logs above.
- Range requests-- as noted above, the byte-range header is missing. I'm not totally sure why, but it's possible that the hosted S3auth service (which provides effectively a proxy between S3 and HTTP) is not forwarding these appropriately.
In light of this I wrote a up a quick and dirty flask-based server ("S3proxy") which reads S3 objects via the boto AWS library and serves them up via HTTP/REST. From the limited amount of testing I've done so far, this seems to work quite well with IGV-- by passing the S3proxy URL to IGV, IGV can manipulate the /bam/bai endings and find the index file; additionally, as boto can handle byte-range requests, the streaming functionality works as expected.
Thanks, and let me know if you test it!
~Nik
ps. Jim, if you're willing, I have a few other questions regarding the HTTP interface for IGV-- I'll start a separate thread to address those. Mostly about the size of the byte-range request..