deeptools/HiCExplorer

hicPCA -we default option

StrohD opened this issue · 3 comments

StrohD commented

hicexplorer --version
hicexplorer 3.7.2

hicPCA -m in.mcool::/resolutions/500000 -f bedgraph -o pca1.bedgraph pca2.bedgraph
ERROR:hicexplorer.hicPCA:Number of output file names and number of eigenvectors does not match. Please provide the name of each file.
Files: ['pca1.bedgraph', 'pca2.bedgraph']
Number of eigenvectors: 3

hicPCA -m in.mcool::/resolutions/500000 -f bedgraph -o pca1.bedgraph pca2.bedgraph pca3.bedgraph
Traceback (most recent call last):
File "PATH/miniconda3/envs/hicexplorer/bin/hicPCA", line 7, in
main()
File "PATH/miniconda3/envs/hicexplorer/lib/python3.10/site-packages/hicexplorer/hicPCA.py", line 318, in main
eigenvectors_correlate = np.hstack((eigenvectors_correlate, eigs[:, int(id) - 1:int(id)]))
ValueError: invalid literal for int() with base 10: ' '

hicPCA -m in.mcool::/resolutions/500000 -f bedgraph -o pca1.bedgraph pca2.bedgraph pca3.bedgraph -we 1 2 3

By definition in the documentation the default should be '1 2', returning the data for the first two eigenvectors. Command one shows that this is not true.

When executing command two, it shows an error trying to convert ' ' to an integer.

Command three runs without errors and produces the right output.

HiCExplorer/hicexplorer/hicPCA.py line 60 defines the default as '1 2' were it should be [1,2] as the blank between 1 and 2 is converted to an int and the module fails.

Can you check if it works with the today published version 3.7.3?

@joachimwolff Version 3.7.3 still has this error!