mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-09 05:58:11 +08:00
#81 moved gene set check into fileitem_source
This commit is contained in:
@@ -35,6 +35,8 @@ class FileItemSource(ItemSource):
|
||||
def name(self):
|
||||
return self._name or f"Files:{self.base_path}"
|
||||
|
||||
def is_gene_set(self, path:str) -> bool:
|
||||
return ('_gene_sets' in path or '-gene-sets' in path) and path.endswith(self.annotation_file_suffix)
|
||||
def is_h5ad_file(self, path: str) -> bool:
|
||||
return path.endswith(self.h5ad_suffix) and os.path.isfile(path)
|
||||
|
||||
@@ -180,6 +182,7 @@ class FileItemSource(ItemSource):
|
||||
self.make_fileitem_from_path(annotation, annotations_subpath, True)
|
||||
for annotation in sorted(os.listdir(annotations_fullpath))
|
||||
if annotation.endswith(self.annotation_file_suffix)
|
||||
and not self.is_gene_set(annotation)
|
||||
and os.path.isfile(os.path.join(annotations_fullpath, annotation))
|
||||
]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user