I am trying to pull regions from a bunch of BAM files on an online server. I'd like to pull the reads mapping to a certain 1kb or so chunk and download them for analysis. They are far too massive to download them all, and it's impractical even to wget them one at a time and pull the regions out using samtools (tried it, and it worked, but it took forever). Since I'll have to do this for a number of regions that I won't know in advance, I need a better way.
I noticed that samtools is capable of running 'samtools view' off of a web address. Sadly, this data is protected behind an https server, which samtools doesn't know how to handle. I notice that IGV is able to read the BAM files of the net by asking for my login and querying specific regions only that I bring up to view, but I don't have a way of automating the process on hundreds of files.
Does anyone have any ideas of how to run something like samtools view on specific regions over an https connection?
did you try to put your password in the url ? e.g: "https://userid:password@anywhere.org/bams/my.bam"
This does work for me in my case, thanks Pierre
Doesn't seem to work for me. I am not sure that samtools recognizes https is a web address. The response I get is:
(with my website, password etc, of course)