diff --git a/README.md b/README.md index c0d2f57..967a153 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,13 @@ cd ./src/models/swin pip install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple/ ``` -> Note: Either GPU or CPU can be installed according to the above steps, and the program will automatically identify the running configuration and environment. +> Note: > -> If you want to use GPU, please install [CUDA-11.3](https://developer.nvidia.com/cuda-11.3.0-download-archive) and [cuDNN-8.2](https://developer.nvidia.com/rdp/cudnn-archive) before. +> 1. If `src/straw.cpp:34:10: fatal error: curl/curl.h: No such file or directory` is encountered during installation, enter the following command `sudo apt-get install libcurl-dev libcurl4-openssl-dev libssl-dev` in the terminal or refer: `https://stackoverflow.com/questions/11471690/curl-h-no-such-file-or-directory`. +> +> 2. Either GPU or CPU can be installed according to the above steps, and the program will automatically identify the running configuration and environment. +> +> 3. If you want to use GPU, please install [CUDA-11.3](https://developer.nvidia.com/cuda-11.3.0-download-archive) and [cuDNN-8.2](https://developer.nvidia.com/rdp/cudnn-archive) before. ​ diff --git a/src/utils/get_chr_data.py b/src/utils/get_chr_data.py index 8868018..4c78435 100644 --- a/src/utils/get_chr_data.py +++ b/src/utils/get_chr_data.py @@ -164,7 +164,7 @@ def split_list(lst, val): return [lst[:lst.index(val)], lst[lst.index(val) + 1:]] if val in lst else [lst] -def divide_chr(chr_len_txt, hic_file, assembly_file, modified_assembly_file): +def divide_chr(chr_len_txt, hic_file, assembly_file, modified_assembly_file, hic_len): """ divide chr Args: @@ -172,6 +172,7 @@ def divide_chr(chr_len_txt, hic_file, assembly_file, modified_assembly_file): hic_file: hic file assembly_file: assembly file modified_assembly_file: modified assembly file + hic_len: hic length Returns: @@ -200,7 +201,10 @@ def divide_chr(chr_len_txt, hic_file, assembly_file, modified_assembly_file): assembly_file = modified_assembly_file # find ctg - error_contains_ctg = asy_operate.find_site_ctg_s(assembly_file, chr_len, chr_len + 2) + if chr_len + 2 >= hic_len: + error_contains_ctg = asy_operate.find_site_ctg_s(assembly_file, chr_len - 2, chr_len) + else: + error_contains_ctg = asy_operate.find_site_ctg_s(assembly_file, chr_len, chr_len + 2) # json format contain_ctg = json.loads(error_contains_ctg) @@ -322,7 +326,7 @@ def split_chr(img_file, asy_file, hic_file, cfg_file, device='cpu'): # split chr modified_assembly_file = os.path.join(os.path.dirname(img_file), "chr.assembly") - divide_chr(chr_output, hic_file, asy_file, modified_assembly_file) + divide_chr(chr_output, hic_file, asy_file, modified_assembly_file, hic_len) # get chr number with open(chr_output, 'r') as file: