AlexandrovLab / SigProfilerExtractor

SigProfilerExtractor allows de novo extraction of mutational signatures from data generated in a matrix format. The tool identifies the number of operative mutational signatures, their activities in each sample, and the probability for each signature to cause a specific mutation type in a cancer sample. The tool makes use of SigProfilerMatrixGenerator and SigProfilerPlotting.
BSD 2-Clause "Simplified" License
154 stars 52 forks source link

numpy version error expected np.ndarray (got numpy.ndarray) #254

Closed ahgillmo closed 4 months ago

ahgillmo commented 4 months ago

Hi, I am trying to run the Extractor on the test data set and getting a numpy error.

The error is:

Traceback (most recent call last): File "", line 1, in File "miniconda3/envs/MySigProfiler/lib/python3.10/site-packages/SigProfilerExtractor/sigpro.py", line 900, in sigProfilerExtractor ) = sub.decipher_signatures( File "/miniconda3/envs/MySigProfiler/lib/python3.10/site-packages/SigProfilerExtractor/subroutines.py", line 679, in decipher_signatures results = parallel_runs( File "/miniconda3/envs/MySigProfiler/lib/python3.10/site-packages/SigProfilerExtractor/subroutines.py", line 606, in parallel_runs result_list = pool.map(pool_nmf, batch_generator_pair) File "/miniconda3/envs/MySigProfiler/lib/python3.10/multiprocessing/pool.py", line 367, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/miniconda3/envs/MySigProfiler/lib/python3.10/multiprocessing/pool.py", line 774, in get raise self._value

TypeError: expected np.ndarray (got numpy.ndarray)

I have tried creating multiple environments and different version of numpy.

I would appreciate any suggestions.

mdbarnesUCSD commented 4 months ago

Hi,

Could you please provide the versions of SigProfiler packages that you have installed and how you ran the code? If you are not currently, it may help to run your code from within a if __name__ == __main__ idiom.

ahgillmo commented 4 months ago

Hello.

The version numbers are: SigProfilerMatrixGenerator is 1.2.26 SigProfilerExtractor version is 1.1.24

I am running the code on the command line in a Linux system. The lines of code I was testing with are:

from SigProfilerExtractor import sigpro as sig sig.sigProfilerExtractor("matrix", "matrix_results", "/home/ahgillmo/Sarcoma_analysis_July2024/Sarcoma_Mutation_clusters/21BRCA/21BRCA.txt",reference_genome="GRCh38", minimum_signatures=1, maximum_signatures=10, nmf_replicates=100)

I also tried putting the commands within a script and using the if name == main functionality. This did not work either.

Thanks.

mdbarnesUCSD commented 4 months ago

Thanks, we have not made our code compatible yet with 2.0.0 release of numpy. Could you please confirm that using a version before 2.0.0, like 1.26.4 also produces the same error?

Additionally, in case you have an older version of SigProfilerAssignment installed please update to the current release of 0.1.7. Thanks!

ahgillmo commented 4 months ago

Hello.

The issue is solved. I had multiple versions of numpy installed (2.0.0) and numpy-base 1.26.4.

Thank you for helping me solve this.