Skip to content

Commit

Permalink
add features_handle_ref && protein_handle_ref before upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangs18 committed Sep 10, 2024
1 parent 66af0b7 commit fcbb510
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/data/metagenomes/toy/features_handle_ref
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test features_handle_ref
2 changes: 0 additions & 2 deletions test/data/metagenomes/toy/metagenome.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"non_coding_features": 0,
"protein_encoding_gene": 20
},
"features_handle_ref": "KBH_736245",
"gc_content": 0.64469,
"genetic_code": 1,
"genome_type": "Metagenome",
Expand All @@ -36,7 +35,6 @@
}
],
"original_source_file_name": null,
"protein_handle_ref": "KBH_736243",
"publications": [],
"scientific_name": "Arabidopsis thaliana",
"source": "GFF",
Expand Down
1 change: 1 addition & 0 deletions test/data/metagenomes/toy/protein_handle_ref
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test protein_handle_ref
23 changes: 23 additions & 0 deletions test/problematic_tests/save_genome_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,29 @@ def prepare_data(cls):
cls.test_metagenome_data = json.load(open('data/metagenomes/toy/metagenome.json'))
cls.test_metagenome_data['assembly_ref'] = assembly_refs[1]["upa"]

# Move files to the share folder
fhr_path = os.path.join(cls.scratch,'features_handle_ref')
phr_path = os.path.join(cls.scratch,'protein_handle_ref')

shutil.copy('data/metagenomes/toy/features_handle_ref', fhr_path)
shutil.copy('data/metagenomes/toy/protein_handle_ref', phr_path)

# Upload files to the blobstore
handle_service_outputs = cls.dfu.file_to_shock_mass(
[
{'file_path': fhr_path, 'make_handle': 1, 'pack': 'gzip'},
{'file_path': phr_path, 'make_handle': 1, 'pack': 'gzip'}
]
)

# Update metagenome
cls.test_metagenome_data["features_handle_ref"] = handle_service_outputs[0]["handle"]["hid"]
cls.test_metagenome_data["protein_handle_ref"]= handle_service_outputs[1]["handle"]["hid"]

# Delete shock_ids
cls.nodes_to_delete.append(handle_service_outputs[0]["shock_id"])
cls.nodes_to_delete.append(handle_service_outputs[1]["shock_id"])

def getWsClient(self):
return self.__class__.wsClient

Expand Down

0 comments on commit fcbb510

Please sign in to comment.