read(filepath, metadata_file=None, sample_file=None, verbose=True)¶
Read a given BGEN file.
filepath (str) – A BGEN file path.
metadata_file (str, optional) – If
True, it will try to read the variants metadata from the metadata file
filepath + ".metadata". If this is not possible, the variants metadata will be read from the BGEN file itself. If
filepath + ".metadata"does not exist, it will try to create one with the same name to speed up reads. If
False, variants metadata will be read only from the BGEN file. If a file path is given instead, it assumes that the specified metadata file is valid and readable and therefore it will read variants metadata from that file only. Defaults to
verbose (bool, optional) –
Trueto show progress;
Metadata files can speed up subsequent reads tremendously. But often the user does not have write permission for the default metadata file location
filepath + ".metadata". We thus provide the
limix.io.bgen.create_metadata_file()function for creating one at the given path.