-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnicodeDecodeError When running hicConvertFormat to convert HiC to Cool format #821
Comments
Hi,
|
Hello, I have encountered the same problem. But SRR1791297_ 30. hic succeeded in hic2cool. My hic file is downloaded from ENCODE, could you help me? Thank you very much! |
Would you mind to give the URL? |
The URL is https://www.encodeproject.org/files/ENCFF080DPJ/@@download/ENCFF080DPJ.hic. |
Hi, |
Waiting for a better solution, this python script is working, using hicstraw (available on pip: https://pypi.org/project/hic-straw/) and cooler (https://cooler.readthedocs.io/en/latest/):
The code above has a mistake, please use the one below. |
Hi, |
Glad it has been useful for someone. 😉 |
Hi, I tried your code, however I'm getting chrom_sizes is not defined, as the variable does not seem to be declared anywhere. |
Oups indeed...
|
Hi there, thank you for providing the code above which can be successfully run in my case. But when I check the information inside the converted .cool file using 'hicInfo' command, it only has 'chrom', 'start', 'end' columns available. I did not see any 'weight' column or in my case, it should be 'SCALE' column. Is it normal to see or do you have any advice to deal with this problem? Many thanks! |
Welcome to the HiCExplorer GitHub repository! Before opening the issue please check
that the following requirements are met :
Search whether this issue (or a similar issue) has been solved before using the search tab above. Link the previous issue if appropriate below.
Paste your HiCExplorer version (
hicInfo --version
) and your python version (python --version
) below.HiC Version: 3.7.2 and Python version 3.9
Have you checked our documentation on hicexplorer.readthedocs.io? Yes
Do you use conda to install HiCExplorer? Yes
Do you use the latest HiCExplorer release? If not, please install it via a conda environment:
conda create --name hicexplorer hicexplorer=3.6 python=3.8 -c bioconda -c conda-forge
and activate the environment:
conda activate hicexplorer
. Retry your command. You can exit a conda environment viaconda deactivate
. To learn more about conda and environments, please consider the following documentation.Retry your command, is it solved now? If not please continue with the following:
(ignore if you simply spotted the issue in the code/documentation).
hicConvertFormat -m K0_S2_mapped_contact_map.hic --inputFormat hic --outputFormat cool -o K0_S2_mapped_contact_map.cool
below (ignore if you simply spotted the issue in the code/documentation).
INFO:hicexplorer.hicConvertFormat:Converting with hic2cool.
Traceback (most recent call last):
File "/programs/x86_64-linux/hicexplorer/3.7.2/bin/hicConvertFormat", line 7, in
main()
File "/programs/x86_64-linux/hicexplorer/3.7.2/lib/python3.9/site-packages/hicexplorer/hicConvertFormat.py", line 131, in main
hic2cool_convert(matrix, args.outFileName[i], 0)
File "/programs/x86_64-linux/hicexplorer/3.7.2/lib/python3.9/site-packages/hic2cool/hic2cool_utils.py", line 860, in hic2cool_convert
pair_footer_info, expected, factors, norm_info = read_footer(req, mmap_buf, masteridx)
File "/programs/x86_64-linux/hicexplorer/3.7.2/lib/python3.9/site-packages/hic2cool/hic2cool_utils.py", line 131, in read_footer
unit = readcstr(f)
File "/programs/x86_64-linux/hicexplorer/3.7.2/lib/python3.9/site-packages/hic2cool/hic2cool_utils.py", line 59, in readcstr
return buf.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa5 in position 1: invalid start byte
The text was updated successfully, but these errors were encountered: