-
|
Hello - thanks a lot for this great set of crates! Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
|
For AWS we wrote this with aws-sdk-rust, with a modular storage trait/layer: https://github.com/umccr/htsget-rs But for a more general storage access crate I might try OpenDAL?: https://github.com/apache/opendal Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
|
@brainstorm thanks! |
Beta Was this translation helpful? Give feedback.
-
I haven't one at hand with neither of those crates (didn't know the object_store TRAIT crate btw, cool one)... Instead, perhaps we can assist you if you move this thread issue to a discussion and share your attempts/code there? |
Beta Was this translation helpful? Give feedback.
-
|
noodles provides readers where the underlying source is generic over either synchronous read traits (provided by In the case of, e.g., OpenDAL, it only supports Here is a full example of streaming a BAM file from a public GCS bucket using OpenDAL:
|
Beta Was this translation helpful? Give feedback.
-
|
@zaeleus thank you a lot ! const BUCKET: &str = "gcp-public-data--gnomad";
const NAME: &str = "release/4.1/vcf/exomes/gnomad.exomes.v4.1.sites.chr21.vcf.bgz";
#[tokio::main(flavor = "multi_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>>{
let builder = Gcs::default()
.bucket(BUCKET)
.disable_vm_metadata()
.allow_anonymous();
let operator = Operator::new(builder)?.finish();
let stream = operator.reader(NAME).await?.into_bytes_stream(..).await?;
let inner = StreamReader::new(stream);
let mut reader = vcf::r#async::io::Reader::new(inner);
let header = reader.read_header().await?;
println!("{:?}", header);
Ok(())
}I get the error: and this was actually the problem I was facing before with the object_store crate and a code like this: object_store = {version = "0.11.2", features = ["gcp"] }const BUCKET: &str = "gcp-public-data--gnomad";
const NAME: &str = "release/4.1/vcf/exomes/gnomad.exomes.v4.1.sites.chr21.vcf.bgz";
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>>{
let gcs = GoogleCloudStorageBuilder::default().with_bucket_name(BUCKET).build()?;
let path = Path::from(NAME);
let result = gcs.get(&path).await?;
let stream = result.into_stream();
let inner = StreamReader::new(stream);
let mut reader = vcf::r#async::io::Reader::new(inner);
let header = reader.read_header().await?;
println!("{:?}", header);
Ok(())
}Do you have any idea what might be wrong here? |
Beta Was this translation helpful? Give feedback.
yes! this was it ! thank you @zaeleus and @brainstorm !