Coordinate <= 0 detected. Did you forget to use the -0 option?
Hi,
I am trying to use Spectre but I keep getting this error
spectre::2025-03-14 14:34:43,092::INFO::spectre.spectre> Spectre input: CNVCaller --coverage /home/zeddafir/LRS-CNV-calling/EP2086.08/EP2086.08.regions.bed.gz --sample-id EP2086 --output-dir output/ --reference /net/mergefs/mergefs/complgen/refseq/hg38/genome_hg38.ifas --blacklist /home/zeddafir/LRS-CNV-calling/Spectre/data/grch38_blacklist_spectre.bed --min-cnv-len 11000 --snfj /home/zeddafir/LRS-CNV-calling/EP2086.08.snfj.gz --metadata /home/zeddafir/LRS-CNV-calling/metadata.mdr
spectre::2025-03-14 14:34:43,092::INFO::spectre.spectre> Spectre version: 0.2.1-patch-july15
spectre::2025-03-14 14:34:43,092::INFO::spectre.spectre> Starting spectre
spectre::2025-03-14 14:34:43,092::INFO::spectre.spectre> Evaluate if a new .mdr file needs to be created
spectre::2025-03-14 14:34:43,092::INFO::spectre.spectre> Using existing metadata file /home/zeddafir/LRS-CNV-calling/metadata.mdr
spectre::2025-03-14 14:34:43,093::INFO::spectre.spectreCNV> Spectre calculating for: /home/zeddafir/LRS-CNV-calling/EP2086.08/EP2086.08.regions.bed.gz
spectre::2025-03-14 14:34:43,093::INFO::spectre.spectreCNV> Data normalization and outlier removal (right tail)
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
spectre::2025-03-14 14:34:43,431::INFO::spectre.analysis.analysis> Determined bin size from Mosdepth coverage: 1000
spectre::2025-03-14 14:34:43,437::WARNING::spectre.analysis.analysis> Minimum CNV length is smaller then 100000 base pairs
spectre::2025-03-14 14:34:43,438::WARNING::spectre.analysis.analysis> Expect trouble!
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
[W::tbx_parse1] Coordinate <= 0 detected. Did you forget to use the -0 option?
spectre::2025-03-14 14:34:47,579::INFO::spectre.analysis.analysis> Number positions to be tested on chromosome chr1: 248957
Traceback (most recent call last):
File "/home/zeddafir/miniforge3/envs/spectre/bin/spectre", line 8, in <module>
sys.exit(main())
File "/home/zeddafir/miniforge3/envs/spectre/lib/python3.10/site-packages/spectre/spectre.py", line 648, in main
spectre_run.spectre_exe()
File "/home/zeddafir/miniforge3/envs/spectre/lib/python3.10/site-packages/spectre/spectre.py", line 359, in spectre_exe
spectre_main.cnv_call()
File "/home/zeddafir/miniforge3/envs/spectre/lib/python3.10/site-packages/spectre/spectreCNV.py", line 88, in cnv_call
self.cnv_analysis.data_normalization()
File "/home/zeddafir/miniforge3/envs/spectre/lib/python3.10/site-packages/spectre/analysis/analysis.py", line 189, in data_normalization
cov_stats, norm_stats, cov_data = self.__normalization_and_statistics(reference_chromosome)
File "/home/zeddafir/miniforge3/envs/spectre/lib/python3.10/site-packages/spectre/analysis/analysis.py", line 224, in __normalization_and_statistics
cov_stats = CoverageStatistics()
File "/home/zeddafir/miniforge3/envs/spectre/lib/python3.10/site-packages/spectre/analysis/coverage_stats.py", line 11, in __init__
self.average = np.NaN
File "/home/zeddafir/.local/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__
raise AttributeError(
AttributeError: `np.NaN` was removed in the NumPy 2.0 release. Use `np.nan` instead.. Did you mean: 'nan'?
I installed Spectre according to the instructions listed by creating a conda env and cloning the gitub page. Can you maybe help me?
Thank you in advance!
Hi @zaka-edd
My applogies for the late reply. Two things are happening here:
Coordinate <= 0 detected. Did you forget to use the -0 option?
This is just a warning from the Pysam package on which we don't have an influence. However, you can disregard this.
AttributeError:
np.NaNwas removed in the NumPy 2.0 release. Usenp.naninstead.. Did you mean: 'nan'?
This is related to the newest numpy version, where they removed this command and switched np.NaN to be np.nan. We will address this change in the next update.
As an easy fix I would recommend using a previous numpy version. I have tested Spectre successfully with the following package version:
pip install numpy==1.24.3 pandas==2.0.1 pysam==0.22.0 matplotlib==3.7.1 scipy==1.10.1
This should take care of the problems! Please let me know if this worked for you!
Best, Philippe