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

AttributeError: module 'numpy' has no attribute 'object' #8

Open
timothykoala opened this issue Jan 9, 2023 · 4 comments
Open

AttributeError: module 'numpy' has no attribute 'object' #8

timothykoala opened this issue Jan 9, 2023 · 4 comments

Comments

@timothykoala
Copy link

timothykoala commented Jan 9, 2023

Hi Dr. Wang,
I tried to convert a hg19 .hic into hg38 .hic by command line below and faced an error:

pairLiftOver --input /RPE-1_HiC/GSE71831_RPE1-WT.hic --input-format juicer --out-pre test-hg38 --output-format hic --out-chromsizes hg38.chrom.sizes --in-assembly hg19 --out-assembly hg38 --logFile pairLiftOver.log --memory 14G

Here is the log:

# ARGUMENT LIST:
# Input path = /RPE-1_HiC/GSE71831_RPE1-WT.hic
# Input format = juicer
# Output prefix = test-hg38
# Output format = hic
# Chromosome Sizes of the output assembly = hg38.chrom.sizes
# Generate contact maps at 11 resolutions = False
# Input assembly = hg19
# Output assembly = hg38
# Chain file = None
# Temporary Dir = .pairliftover
# Allocated memory = 14G
# Number of Processes = 8
# Log file name = /RPE-1_HiC/pairLiftOver.log
/home/txpn/anaconda3/envs/pairliftover/lib/python3.9/site-packages/cooler/util.py:690: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
  columns, dtype=None, index_columns=None, index_names=None, default_dtype=np.object
Traceback (most recent call last):
  File "/home/txpn/anaconda3/envs/pairliftover/bin/pairLiftOver", line 137, in <module>
    run()
  File "/home/txpn/anaconda3/envs/pairliftover/bin/pairLiftOver", line 101, in run
    from pairLiftOver.utilities import liftover
  File "/home/txpn/anaconda3/envs/pairliftover/lib/python3.9/site-packages/pairLiftOver/utilities.py", line 1, in <module>
    import subprocess, sys, os, io, logging, cooler, pairLiftOver
  File "/home/txpn/anaconda3/envs/pairliftover/lib/python3.9/site-packages/cooler/__init__.py", line 14, in <module>
    from .api import Cooler, annotate
  File "/home/txpn/anaconda3/envs/pairliftover/lib/python3.9/site-packages/cooler/api.py", line 22, in <module>
    from .util import parse_cooler_uri, parse_region, open_hdf5, closing_hdf5
  File "/home/txpn/anaconda3/envs/pairliftover/lib/python3.9/site-packages/cooler/util.py", line 690, in <module>
    columns, dtype=None, index_columns=None, index_names=None, default_dtype=np.object
  File "/home/txpn/anaconda3/envs/pairliftover/lib/python3.9/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'object'

Thanks in advance for developing the tool and looking forward for more discussion.

Sincerely,
Timothy

@timothykoala
Copy link
Author

Update: Looks like the solution is downgrade numpy.

python -m pip uninstall numpy
python -m pip install numpy==1.23.1

Will provide an update for the result.

@timothykoala
Copy link
Author

timothykoala commented Jan 10, 2023

Preprocess done, suggested downgrade numpy solved the problem.
I got two errors on the following process: OutOfMemoryError and CalledProcessError, but I still got a functional hg38.hic at outpuit. Maybe I need to allocate more memory next time?

Calculating norms for zoom BP_2500000 Calculating norms for zoom BP_1000000 Calculating norms for zoom BP_500000 Calculating norms for zoom BP_250000 Calculating norms for zoom BP_100000 Calculating norms for zoom BP_50000 Calculating norms for zoom BP_25000Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.base/java.util.Arrays.copyOf(Arrays.java:3481) at java.base/java.util.ArrayList.grow(ArrayList.java:237) at java.base/java.util.ArrayList.grow(ArrayList.java:244) at java.base/java.util.ArrayList.add(ArrayList.java:454) at java.base/java.util.ArrayList.add(ArrayList.java:467) at juicebox.tools.utils.norm.GenomeWideNormalizationVectorUpdater.createWholeGenomeRecords(GenomeWideNormalizationVectorUpdater.java:207) at juicebox.tools.utils.norm.GenomeWideNormalizationVectorUpdater.getWGVectors(GenomeWideNormalizationVectorUpdater.java:134) at juicebox.tools.utils.norm.GenomeWideNormalizationVectorUpdater.updateHicFileForGWfromPreOnly(GenomeWideNormalizationVectorUpdater.java:226) at juicebox.tools.utils.norm.NormalizationVectorUpdater.updateHicFile(NormalizationVectorUpdater.java:76) at juicebox.tools.clt.old.PreProcessing.run(PreProcessing.java:127) at juicebox.tools.HiCTools.main(HiCTools.java:96) Traceback (most recent call last): File "/home/txpn/anaconda3/envs/pairliftover/bin/pairLiftOver", line 137, in <module> run() File "/home/txpn/anaconda3/envs/pairliftover/bin/pairLiftOver", line 123, in run liftover( File "/home/txpn/anaconda3/envs/pairliftover/lib/python3.9/site-packages/pairLiftOver/utilities.py", line 253, in liftover subprocess.check_call(' '.join(command), shell=True) File "/home/txpn/anaconda3/envs/pairliftover/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command 'java -Xmx15g -jar /home/txpn/anaconda3/envs/pairliftover/lib/python3.9/site-packages/pairLiftOver/data/juicer_tools_1.11.09_jcuda.0.8.jar pre -r 2500000,1000000,500000,250000,100000,50000,25000,10000,5000 /home/txpn/.pairliftover/test-hg38.pairs.gz test-hg38.hic hg38.chrom.sizes' returned non-zero exit status 1.

@XiaoTaoWang
Copy link
Owner

Thanks for your feedback! Yes, --output-format hic generally need more memory to be allocated.

@timothykoala
Copy link
Author

changed to --memory 40G, The conversion done perfectly.
Thanks for developing the tool!

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