Created
October 31, 2021 00:15
-
-
Save chapmanb/42d2a81321a04350974daed85d76c4d1 to your computer and use it in GitHub Desktop.
Example of adding and updating a sequence in Arvados, with required remove/save step to avoid certificate error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def simple_add_update(): | |
"""Test adding and updating a collection to reproduce certificate error. | |
""" | |
project_uuid = "pirca-j7d0g-h13mew3i5ya8cqq" | |
name = "save_new_test" | |
fname = "seqs.fa" | |
avoid_an_error = True | |
arvados_conn = get_connection_config() | |
c = arvados.collection.Collection(apiconfig=arvados_conn) | |
with c.open(fname, "wb") as writer: | |
writer.write(">aseq\nGATC\n") | |
c.save_new(name=name, owner_uuid=project_uuid) | |
c2 = arvados.collection.Collection(c.manifest_locator(), apiconfig=arvados_conn) | |
c2.remove(fname) | |
if avoid_an_error: | |
c2.save() | |
with c2.open(fname, "wb") as writer: | |
writer.write(">aseq\nGATTACA\n") | |
c2.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment