From 57f37551f80bc869176125b5dd6f16863e6fdf57 Mon Sep 17 00:00:00 2001 From: Ilya Kolpakov Date: Wed, 6 Jun 2018 16:26:23 +0200 Subject: [PATCH] expose mm_idx_is_idx, mm_idx_load and mm_idx_dump --- minimap.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/minimap.h b/minimap.h index 6f1b701..092d9b6 100644 --- a/minimap.h +++ b/minimap.h @@ -219,6 +219,33 @@ void mm_idx_reader_close(mm_idx_reader_t *r); int mm_idx_reader_eof(const mm_idx_reader_t *r); +/** + * Check whether the file contains a minimap2 index + * + * @param fn index file name + * @return 1 if file can be opened and is a minimap2 index; 0 otherwise + */ +int64_t mm_idx_is_idx(const char *fn); + +/** + * Load an index + * + * Unlike mm_idx_reader_read this function specifically loads an existing + * index. + * + * @param fp pointer to FILE object + * @return minimap2 index read from fp + */ +mm_idx_t *mm_idx_load(FILE *fp); + +/** + * Save an index + * + * @param fp pointer to FILE object + * @param mi minimap2 index + */ +void mm_idx_dump(FILE *fp, const mm_idx_t *mi); + /** * Create an index from strings in memory *