Using samtools with GCS (google cloud storage) on a docker container seems to give "Protocol Not Supported" error
1
0
Entering edit mode
5 months ago

enter image description hereHaving an issue trying to use the samtools view gs://mybucket/myfile.bam > myfile.bam when using this command with docker.

Always get the error "samtools view: failed to open "gs://mybucket/myfile.bam" for reading: Protocol not supported"

Although the command works just fine GCP VMs, Im unable to recreate this in a docker container.

samtools gcs • 960 views
ADD COMMENT
1
Entering edit mode

This is a bit late, but the first thing to go is to run samtools --version and make sure the docker samtools is configured with the the GCS protocols.

ADD REPLY
3
Entering edit mode
4 months ago
export GOOGLE_APPLICATION_CREDENTIALS="./credentials.json"
export GCS_OAUTH_TOKEN=$(gcloud auth print-access-token)

gcloud storage cp <yourbai.bai> mybai.bai

#Download specific chromosome of BAM file
samtools view -h -b -L chr1 mybai.bai gcs://mybam.bam > "mybam.bam"

I have got it to work with this sort of script.

ADD COMMENT

Login before adding your answer.

Traffic: 1033 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6