Skip to content
Snippets Groups Projects
Commit c10cf502 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Fallback to default attribut when title and desc are not provided

parent d5be60de
No related branches found
No related tags found
No related merge requests found
...@@ -32,11 +32,15 @@ def get_inittable_meta(file_name): ...@@ -32,11 +32,15 @@ def get_inittable_meta(file_name):
nb_snps = init_store.get_storer("SumStatTab").nrows nb_snps = init_store.get_storer("SumStatTab").nrows
init_store.close() init_store.close()
nb_phenotypes = read_hdf(file_name, "PhenoList").shape[0] nb_phenotypes = read_hdf(file_name, "PhenoList").shape[0]
f = h5py.File(file_name, mode='r') try:
name=f.attrs['title'] f = h5py.File(file_name, mode='r')
desc=f.attrs["description"] name=f.attrs['title']
f.close() desc=f.attrs["description"]
f.close()
except KeyError:
name = f"Filename: {file_name.split('/')[-1]}"
desc = "No description"
return dict( return dict(
nb_snps=int(nb_snps), nb_snps=int(nb_snps),
nb_phenotypes=int(nb_phenotypes), nb_phenotypes=int(nb_phenotypes),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment