AlexandrovLab / SigProfilerSingleSample

SigProfilerSingleSample allows attributing a known set of mutational signatures to an individual sample. The tool identifies the activity of each signature in the sample and assigns the probability for each signature to cause a specific mutation type in the sample. The tool makes use of SigProfilerMatrixGenerator and SigProfilerPlotting.
23 stars 2 forks source link

IndexError when run with GRCh38 #19

Closed hubentu closed 2 years ago

hubentu commented 2 years ago

Hi,

Error happened when running with GRCh38, but it worked with GRCh37. Could you please help?

Thanks, Qiang

>>> from sigproSS import spss
>>> spss.single_sample("results", "results", exome=True, ref="GRCh38")

Starting matrix generation for SNVs and DINUCs...Completed! Elapsed time: 1.61 seconds.
Starting matrix generation for INDELs...Completed! Elapsed time: 1.39 seconds.
Matrices generated for 1 samples with 0 errors. Total of 24 SNVs, 0 DINUCs, and 1 INDELs were successfully analyzed.
##########################################################
Exacting Profile for Sample 1
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/local/lib/python3.8/site-packages/sigproSS/signatures_optimizer.py", line 158, in remove_signatures
    sol = optimize.minimize(parameterized_objective2_custom, x0, args=(W1, genomes),  bounds=bnds, constraints =cons1, tol=1e-15)
  File "/usr/local/lib/python3.8/site-packages/scipy/optimize/_minimize.py", line 684, in minimize
    bounds = standardize_bounds(bounds, x0, meth)
  File "/usr/local/lib/python3.8/site-packages/scipy/optimize/_minimize.py", line 947, in standardize_bounds
    bounds = new_bounds_to_old(bounds.lb, bounds.ub, x0.shape[0])
IndexError: tuple index out of range
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "spss.py", line 13, in <module>
    spss.single_sample("results", "results", exome=True, ref="GRCh38")
  File "/usr/local/lib/python3.8/site-packages/sigproSS/spss.py", line 620, in single_sample
    results = analysis_individual_samples(samples,
  File "/usr/local/lib/python3.8/site-packages/sigproSS/spss.py", line 441, in analysis_individual_samples
    results = parallel_for_loop(iSample, inputSamples, allGenomeSignatures, allExomeSignatures, cancerType,
  File "/usr/local/lib/python3.8/site-packages/sigproSS/spss.py", line 237, in parallel_for_loop
    output = [p.get() for p in results]
  File "/usr/local/lib/python3.8/site-packages/sigproSS/spss.py", line 237, in <listcomp>
    output = [p.get() for p in results]
  File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
IndexError: tuple index out of range
marcos-diazg commented 2 years ago

Dear @hubentu,

Thanks for your interest. As mentioned in previous issues, we are in the process of retiring SigProfilerSingleSample, and we strongly recommend users to use our new SigProfilerAssignment tool, which has support for different reference genomes and COSMIC versions. To replicate your analysis, you should use the cosmic_fit function.

I hope this helps, and please reopen the ticket if you have further questions.

hubentu commented 2 years ago

Hi @marcos-diazg ,

The problem was caused by scipy. It can be fixed with scipy==1.7.1. I would suggest using a tool like pipreqs to generate a requirements.txt. Great to have a new tool. Thanks!