diff --git a/PretextView.cpp b/PretextView.cpp index a3f04a4..d7ef3cf 100644 --- a/PretextView.cpp +++ b/PretextView.cpp @@ -1454,14 +1454,13 @@ FileBrowserRun(const char *name, struct file_browser *browser, struct nk_context { /* define a string here for filtering */ std::string searchbuf_str=""; - if (!save){ // only need this while loading something - nk_layout_row_dynamic(NK_Context, Screen_Scale.y * 25.0f, 3); - nk_label(NK_Context, "Search: ", NK_TEXT_LEFT); - nk_edit_string_zero_terminated(NK_Context, NK_EDIT_FIELD, searchbuf, sizeof(searchbuf) - 1, nk_filter_default); - caseSensitive_search_sequences = nk_check_label(NK_Context, "Case Sensitive", caseSensitive_search_sequences) ? 1 : 0; - searchbuf_str = std::string(searchbuf); - if (!caseSensitive_search_sequences) std::transform(searchbuf_str.begin(), searchbuf_str.end(), searchbuf_str.begin(), ::tolower); - } + // Show search box for all file browser dialogs (load and save) + nk_layout_row_dynamic(NK_Context, Screen_Scale.y * 25.0f, 3); + nk_label(NK_Context, "Search: ", NK_TEXT_LEFT); + nk_edit_string_zero_terminated(NK_Context, NK_EDIT_FIELD, searchbuf, sizeof(searchbuf) - 1, nk_filter_default); + caseSensitive_search_sequences = nk_check_label(NK_Context, "Case Sensitive", caseSensitive_search_sequences) ? 1 : 0; + searchbuf_str = std::string(searchbuf); + if (!caseSensitive_search_sequences) std::transform(searchbuf_str.begin(), searchbuf_str.end(), searchbuf_str.begin(), ::tolower); s32 index = -1; size_t i = 0, j = 0;//, k = 0; @@ -5790,7 +5789,7 @@ LoadFile(const char *filePath, memory_arena *arena, char **fileName, u64 *header { u64 fileSize = 0; - FILE *file = TestFile(filePath, &fileSize); // 检查前4个字节读取到的数据, 如果为 u08 Magic[] = {'p', 's', 't', 'm'} 则通过验证,否则将指针file设置为空指针 + FILE *file = TestFile(filePath, &fileSize); // Check the data read from the first 4 bytes. If it matches u08 Magic[] = {'p', 's', 't', 'm'}, the verification passes; otherwise, set the pointer file to a null pointer. if (!file) // 如果为空指针, 返回读取错误fileErr { return(fileErr); @@ -8867,7 +8866,7 @@ KeyBoard(GLFWwindow* window, s32 key, s32 scancode, s32 action, s32 mods) break; case GLFW_KEY_3: - if (Extension_Mode && Extensions.head) + if (Extensions.head) { TraverseLinkedList(Extensions.head, extension_node) { @@ -8884,7 +8883,6 @@ KeyBoard(GLFWwindow* window, s32 key, s32 scancode, s32 action, s32 mods) } } } - break; } else { @@ -8893,7 +8891,7 @@ KeyBoard(GLFWwindow* window, s32 key, s32 scancode, s32 action, s32 mods) break; case GLFW_KEY_5: - if (Extension_Mode && Extensions.head) + if (Extensions.head) { TraverseLinkedList(Extensions.head, extension_node) { @@ -8910,7 +8908,6 @@ KeyBoard(GLFWwindow* window, s32 key, s32 scancode, s32 action, s32 mods) } } } - break; } else { diff --git a/README.md b/README.md index f52f304..d2d2d56 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ PretextView is a desktop application for viewing pretext contact maps.
- `L`: toggle the Grid Line. - `T`: toggle the Tooltip. - `I`: toggle the ID bar. +- `3`: toggle the 3p_telomere extension. +- `5`: toggle the 5p_telomere extension. - `Up` / `Down`: change the color map. - `Left` / `Right`: decrease / increase the Gamma mid (default: 0.5). @@ -50,15 +52,15 @@ Enter scaffolding mode with the 's' key. ## Extension edit mode (`X`) Enter extension mode with the `X` key to toggle various genomic feature overlays. Once in extension mode, press: -- `3`: Toggle **3p_telomere** track on/off -- `5`: Toggle **5p_telomere** track on/off +- `3`: Toggle **3p_telomere** track on/off (also works at top level) +- `5`: Toggle **5p_telomere** track on/off (also works at top level) - `T`: Toggle general **telomere** track on/off - `C`: Toggle **coverage** track on/off - `G`: Toggle **gap** track on/off - `R`: Toggle **repeat_density** track on/off - `X`: Exit extension mode -**Note:** These shortcuts only work when in Extension Mode (after pressing `X`). Outside of this mode, some keys (like `T`) have different functions. +**Note:** The `3` and `5` keys work both inside and outside Extension Mode. Other shortcuts (C, G, R, T) only work when in Extension Mode, as these keys have different functions outside of it. ## Select sort area mode (`F`) diff --git a/python/frag_cluster/kmeans_utils.py b/python/frag_cluster/kmeans_utils.py index 6602a5a..6480cd4 100644 --- a/python/frag_cluster/kmeans_utils.py +++ b/python/frag_cluster/kmeans_utils.py @@ -6,10 +6,13 @@ import numpy as np """ - genome片段聚类分析: - 1. 读取基因组片段数据 - 2. 计算拉普拉斯矩阵 - 3. 谱聚类 + Genome Fragment Clustering Analysis: + + Read genome fragment data + + Compute Laplacian matrix + + Spectral clustering """