aws-samples / amazon-omics-tutorials

Apache License 2.0
57 stars 24 forks source link

Regarding of code in 200-omics_storage.ipynb #3

Closed aws-hyunmin closed 9 months ago

aws-hyunmin commented 1 year ago

https://github.com/aws-samples/amazon-omics-tutorials/blob/main/notebooks/200-omics_storage.ipynb

After the downloading a readset, it will be gzip compressed data.

# download a part of the readset
response = omics.get_read_set(sequenceStoreId=readset['sequenceStoreId'], id=readset['id'], partNumber=1, file='SOURCE1')
with open(f"reads1.part.{readset_metadata['fileType'].lower()}", 'wb') as f:
    f.write(response['payload'].read())

to

# download a part of the readset
response = omics.get_read_set(sequenceStoreId=readset['sequenceStoreId'], id=readset['id'], partNumber=1, file='SOURCE1')
with open(f"reads1.part.{readset_metadata['fileType'].lower()}.gz", 'wb') as f:
    f.write(response['payload'].read())