# Path: core/kover/utils.py
# def _hdf5_open_no_chunk_cache(filename, access_type=h.h5f.ACC_RDONLY):
#     fid = h.h5f.open(filename, access_type)
#     access_property_list = fid.get_access_plist()
#     cache_properties = list(access_property_list.get_cache())
#     fid.close()
#     # Disable chunk caching
#     cache_properties[2] = 0  # No chunk caching
#     access_property_list.set_cache(*cache_properties)
#     file_id = h.h5f.open(filename, access_type, fapl=access_property_list)
#     return h.File(file_id)


import numpy as np
from functools import partial
from ..utils import _hdf5_open_no_chunk_cache
#!/usr/bin/env python
"""
	Kover: Learn interpretable computational phenotyping models from k-merized genomic data
	Copyright (C) 2018  Alexandre Drouin & Gael Letarte

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""




class KoverDataset(object):
	def __init__(self, file):
		self.path = file

# Path: core/kover/utils.py
# def _hdf5_open_no_chunk_cache(filename, access_type=h.h5f.ACC_RDONLY):
#     fid = h.h5f.open(filename, access_type)
#     access_property_list = fid.get_access_plist()
#     cache_properties = list(access_property_list.get_cache())
#     fid.close()
#     # Disable chunk caching
#     cache_properties[2] = 0  # No chunk caching
#     access_property_list.set_cache(*cache_properties)
#     file_id = h.h5f.open(filename, access_type, fapl=access_property_list)
#     return h.File(file_id)


# Path: core/kover/dataset/ds.py
import numpy as np
from functools import partial
from ..utils import _hdf5_open_no_chunk_cache

#!/usr/bin/env python
"""
	Kover: Learn interpretable computational phenotyping models from k-merized genomic data
	Copyright (C) 2018  Alexandre Drouin & Gael Letarte

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""




class KoverDataset(object):
	def __init__(self, file):
		self.path = file

		self.dataset_open = partial(_hdf5_open_no_chunk_cache, file)