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

pip3 install HAPPE failed... #7

Open
hughesdj opened this issue Oct 16, 2024 · 4 comments
Open

pip3 install HAPPE failed... #7

hughesdj opened this issue Oct 16, 2024 · 4 comments

Comments

@hughesdj
Copy link

... with this error message:

Collecting sklearn (from HAPPE)
Downloading sklearn-0.0.post12.tar.gz (2.6 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [15 lines of output]
The 'sklearn' PyPI package is deprecated, use 'scikit-learn'
rather than 'sklearn' for pip commands.

  Here is how to fix this error in the main use cases:
  - use 'pip install scikit-learn' rather than 'pip install sklearn'
  - replace 'sklearn' by 'scikit-learn' in your pip requirements files
    (requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)
  - if the 'sklearn' package is used by one of your dependencies,
    it would be great if you take some time to track which package uses
    'sklearn' instead of 'scikit-learn' and report it to their issue tracker
  - as a last resort, set the environment variable
    SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error
@fengcong3
Copy link
Owner

fengcong3 commented Dec 30, 2024

Thank you for trying HAPPE. As the error message says: set the environment variable SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error, You can install and use it first. I will update the HAPPE version on github and pypi when I have time.

@hughesdj
Copy link
Author

Thank you. We got HAPPE running in the way you suggest.
However, it fails on test data, because the script provided wants to read a hard coded file
/public/agis/chengshifeng_group/fengcong/WGRS/software/Fc-code/partlen.txt
which is not provided.

@fengcong3
Copy link
Owner

Can you provide detailed installation and execution commands and complete error output?

@hughesdj
Copy link
Author

hughesdj commented Jan 22, 2025

Please see below for installation, execution commands and output.
The example script provided wants to read a hard coded file
/public/agis/chengshifeng_group/fengcong/WGRS/software/Fc-code/partlen.txt
which is not provided.

cd HAPPE/
module load Python/3.12.3-GCCcore-13.3.0
python3 -m venv happe
source happe/bin/activate
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
env |grep SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL
pip3 install HAPPE
HAPPE -h
which bcftools	##not found, must load
module load BCFtools
which bcftools	##to find path
which bgzip	##to find path
which tabix	##to find path
#	[edit config.ini]
cd example/
./example.sh 
#		#ModuleNotFoundError: No module named 'sklearn'
python -m pip list
pip install scikit-learn
python -m pip list
./example.sh >out.log 2>&1
##

[2025-01-22 10:42:20,846] - HAPPE - INFO - deal args.
[2025-01-22 10:42:20,852] - HAPPE - INFO - Filter samples and variants.
[2025-01-22 10:42:20,952] - HAPPE - INFO - convert file format.
[2025-01-22 10:42:21,141] - HAPPE - INFO - hierarchy clustering.
cluster min and max: 1 5
[2025-01-22 10:42:36,463] - HAPPE - INFO - read snp information file.
[2025-01-22 10:42:36,463] - HAPPE - INFO - calc out the snp_info_row_num = 7.
[2025-01-22 10:42:36,463] - HAPPE - INFO - plot tree to excel file.
[2025-01-22 10:42:39,844] - HAPPE - INFO - get sample information start col and get sample order.
[2025-01-22 10:42:39,877] - HAPPE - INFO - write sample information to excel file.
[2025-01-22 10:42:43,020] - HAPPE - INFO - plot genotype matrix to excel file.
[2025-01-22 10:42:50,495] - HAPPE - INFO - plot RDV to excel file.
Traceback (most recent call last):
  File "/home/data/bioinf_resources/Wheat_resources/HAPPE/happe/lib/python3.12/site-packages/HAPPE/normalization_depth_from_mosdepth_output.py", line 47, in <module>
    infp = open(part_len,"r")
           ^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/public/agis/chengshifeng_group/fengcong/WGRS/software/Fc-code/partlen.txt'

########################[lines omitted]

/home/data/bioinf_resources/Wheat_resources/HAPPE/happe/lib/python3.12/site-packages/numpy/_core/fromnumeric.py:3860: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/home/data/bioinf_resources/Wheat_resources/HAPPE/happe/lib/python3.12/site-packages/numpy/_core/_methods.py:145: RuntimeWarning: invalid value encountered in scalar divide
  ret = ret.dtype.type(ret / rcount)
Traceback (most recent call last):
  File "/home/data/bioinf_resources/Wheat_resources/HAPPE/happe/lib/python3.12/site-packages/HAPPE/depth2excel.py", line 185, in <module>
    ws.cell(row=start_row+index1*cell_row+i,column=col+1).value = round(np.mean(sample_depth[sample]),2)
                                          ^
NameError: name 'i' is not defined. Did you mean: 'id'?
[2025-01-22 10:43:01,844] - HAPPE - ERROR - add RDV matrix -- retrun code:256

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