mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-07 18:58:12 +08:00
ensure annotation directory for new annotations
This commit is contained in:
@@ -62,3 +62,8 @@ def make_h5ad(el):
|
|||||||
|
|
||||||
def make_annotations(el):
|
def make_annotations(el):
|
||||||
return el[:-5] + annotations_suffix
|
return el[:-5] + annotations_suffix
|
||||||
|
|
||||||
|
|
||||||
|
def ensure_dir_exists(file_path):
|
||||||
|
if not os.path.exists(file_path):
|
||||||
|
os.makedirs(file_path)
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ class FileItemSource(ItemSource):
|
|||||||
)
|
)
|
||||||
item = self.lookup_item(h5ad_descriptor)
|
item = self.lookup_item(h5ad_descriptor)
|
||||||
if item is not None:
|
if item is not None:
|
||||||
|
dir_util.ensure_dir_exists(self.full_path(annotation_item.subpath))
|
||||||
return LookupResult(item, annotation_item)
|
return LookupResult(item, annotation_item)
|
||||||
else:
|
else:
|
||||||
item = self.lookup_item(descriptor)
|
item = self.lookup_item(descriptor)
|
||||||
|
|||||||
Reference in New Issue
Block a user