diff --git a/jass/hdf5_add_attributes.py b/jass/hdf5_add_attributes.py new file mode 100644 index 0000000000000000000000000000000000000000..a43ef17a416b8a8bfed09ba120f0c120aed742d6 --- /dev/null +++ b/jass/hdf5_add_attributes.py @@ -0,0 +1,32 @@ +import h5py +# we need python package h5py to read/write .hdf5 file + + +def add_title_description(title, description, filename): + f = h5py.File(filename, "a") + f.attrs['title'] = title + f.attrs['description'] = description + f.close() + + +if __name__ == "__main__": + + title = 'Curated GWAS summary statistics on African ancestry on 19 blood count traits and glycemic traits (hg38)' + des = 'Genome wide curated summary statistics on 19 blood count traits and glycemic traits' \ + 'File format is the inittable format intended to be used with the Joint Analysis of Summary Statistics (JASS), which allows to perform multi-trait GWAS:' \ + 'https://gitlab.pasteur.fr/statistical-genetics/jass' \ + 'GWAS of hematological traits originate from Chen et al paper and were downloaded from the GWAS Catalog (https://www.ebi.ac.uk/gwas/publications/32888493#study_panel). GWAS of glycemic traits come from the (18) study downloadable from GWAS Catalog (https://www.ebi.ac.uk/gwas/publications/34059833).' + hdf5_file = 'test.hdf5' + + add_title_description(title=title, description=des, filename=hdf5_file) + + f = h5py.File(hdf5_file, "r") + print(f.attrs['title']) + print(f.attrs['description']) + f.close() + + + + + +