Closed DevangThakkar closed 2 years ago
@DevangThakkar Can you do this in python using pysam? If you can, igv-reports could be modified to do this. See the file igv_reports/bam.py, this is where alignments are read.
"gs" protocol will likely not be recognized by pysam, however the mapping of "gs" -> "https" protocol is a simple matter of parsing bucket and object name from the gs: url, then adding the parameter "alt=media" . In javascript this looks like
`https://storage.googleapis.com/storage/v1/b/${bucket}/o/${object}?alt=media`
@DevangThakkar Have you had a chance to experiment with pysam? The gs -> https mapping is trivial, the challenge here is doing oAuth in python. I'm curious what you have in mind here for "passing credentials", you cannot of course just pass a username and password. Did you have in mind an access token? I'm not sure how you would do that securely.
Hi @jrobinso I was actually able to figure this out! Support for oAuth was added to htslib using an environment variable so igv-reports also works as long as that htslib is able to access the file (see #390). This issue can be closed.
Ahh yes, perfect.
Hi,
I was wondering if it is possible to load a BAM file from a Google Cloud bucket. I tried loading a public BAM (example code with only the BAM location replaced) and that didn't seem to work. I understand that igv.js is able to load private Google cloud storage if we provide it with the requisite credentials - would it be possible to extend that to igv-reports as well?