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

copy number signature #24

Closed hfl112 closed 1 year ago

hfl112 commented 1 year ago

Hi , I am trying to get the CN signature based on copy number 48 matrix. I don't know whether I missed something:

- I want to calculate the CN signature contribution for each signature, like : https://cancer.sanger.ac.uk/signatures/cn/.Then I ran spss:

########################################################## Exacting Profile for Sample 1

TypeError Traceback (most recent call last) Cell In[17], line 5 2 input_f = "/home/UTHSCSA/hef/2.Project/6.WGD/2.analysis/8.signature/CN_sig/CN_WGD.CNV48.matrix.tsv" 3 data = pd.read_table(input_f) ----> 5 spss.single_sample(data, wdir + "/results", ref="GRCh38.p12", exome=False)

File ~/Tools/miniconda3/lib/python3.8/site-packages/sigproSS/signatures_optimizer.py:239, in add_signatures(W, genome, cutoff, presentSignatures, toBeAdded) 237 #print(len(notToBeAdded)) 238 originalSimilarity = -1 # it can be also written as oldsimilarity --> 239 maxmutation = round(np.sum(genome)) 240 init_listed_idx = presentSignatures 241 init_nonlisted_idx = list(set(list(range(W.shape[1])))-set(init_listed_idx)-set(notToBeAdded))

TypeError: type str doesn't define round method

I changed round() to np.round() in "signatures_optimizer.py",  got other errors:

File ~/Tools/miniconda3/lib/python3.8/site-packages/numpy/core/fromnumeric.py:43, in _wrapit(obj, method, *args, *kwds) 41 except AttributeError: 42 wrap = None ---> 43 result = getattr(asarray(obj), method)(args, **kwds) 44 if wrap: 45 if not isinstance(result, mu.ndarray):

TypeError: ufunc 'rint' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''



Thanks in advance
hfl112 commented 1 year ago

Found an issue posted here: https://github.com/AlexandrovLab/SigProfilerExtractor/issues/136 It works for me.