Skip to content
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

ValueError: The first argument of bincount must be non-negative #15

Open
zhanyinx opened this issue Aug 7, 2019 · 1 comment
Open

Comments

@zhanyinx
Copy link

zhanyinx commented Aug 7, 2019

Hi Fidel,

I am trying to use HiCAssemble to build a genome from Hi-C data. I have analysed the data using HiC-Pro and converted the output to h5 format using HiCExplorer 3.0

Then I used HiCAssemble to build the new genome as follow:

assemble -m goat_2019_july_120000_abs.h5 -o assembled_genome_goat --min_scaffold_length 100000 --bin_size 120000 --misassembly_zscore_threshold -1.0 --num_iterations 3 --num_processors 10 -f goat_v1_scaffolds.fa

This gave me the following error:

/work2/ggiorget/zhan/bin/Python-2.7.12/lib/python2.7/site-packages/hicexplorer/HiCMatrix.py:819: RuntimeWarning: divide by zero encountered in true_divide
dist_list = (np.array(dist_list).astype(float) / binsize).astype(int) + 1
/work2/ggiorget/zhan/bin/Python-2.7.12/lib/python2.7/site-packages/hicexplorer/HiCMatrix.py:819: RuntimeWarning: invalid value encountered in true_divide
dist_list = (np.array(dist_list).astype(float) / binsize).astype(int) + 1
Traceback (most recent call last):
File "/work2/ggiorget/zhan/bin/Python-2.7.12/bin/assemble", line 312, in
main(args)
File "/work2/ggiorget/zhan/bin/Python-2.7.12/bin/assemble", line 304, in main
scaffolds_to_ignore=args.scaffolds_to_ignore)
File "/work2/ggiorget/zhan/bin/Python-2.7.12/lib/python2.7/site-packages/hicassembler/HiCAssembler.py", line 88, in init
self.load_hic_matrix(hic_file_name, split_misassemblies, split_positions_file, matrix_bin_size)
File "/work2/ggiorget/zhan/bin/Python-2.7.12/lib/python2.7/site-packages/hicassembler/HiCAssembler.py", line 141, in load_hic_matrix
self.split_misassemblies(hic_file_name, split_positions_file)
File "/work2/ggiorget/zhan/bin/Python-2.7.12/lib/python2.7/site-packages/hicassembler/HiCAssembler.py", line 848, in split_misassemblies
ft.hic_ma.matrix = ft.hic_ma.convert_to_obs_exp_matrix(perchr=True)
File "/work2/ggiorget/zhan/bin/Python-2.7.12/lib/python2.7/site-packages/hicexplorer/HiCMatrix.py", line 822, in convert_to_obs_exp_matrix
sum_counts = np.bincount(dist_list, weights=submatrix.data)
ValueError: The first argument of bincount must be non-negative

HiCExplorer version on server: 2.1.1
HiCAssembler on server: last version
python version 2.7.12

Do you have any idea why this happend?

Thanks for your help
best
Zhan

@fidelram
Copy link
Contributor

Converting the data from HiC pro to HiC explorer may not work properly because of the structure of the data. Can you try producing the data directly with HiCExplorer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants