Skip to content

Comments

Remove deprecated refit_denovo_signatures parameter from sigprofiler_extract#475

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-sigprofiler-extract-error
Draft

Remove deprecated refit_denovo_signatures parameter from sigprofiler_extract#475
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-sigprofiler-extract-error

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

The refit_denovo_signatures parameter was removed in newer versions of SigProfilerExtractor, causing unused argument errors when users call sigprofiler_extract().

Changes

  • Removed deprecated parameter from Python calls: Eliminated refit_denovo_signatures from both the direct sigpro$sigProfilerExtractor() call and the fallback command string
  • Updated documentation: Marked refit parameter as deprecated with clear deprecation notice
  • Maintained backward compatibility: Kept refit in function signature to avoid breaking existing code (parameter is now silently ignored)

Example

Users can now call the function without encountering parameter errors:

sigprofiler_extract(
  nmf_matrix = nmf_sample,
  output = "./sigprofiler/",
  genome_build = "hg19",
  use_conda = FALSE,
  py_path = "C:/path/to/python.exe",
  refit = FALSE,  # Now deprecated and ignored
  refit_plot = FALSE
)

The function will work with both older SigProfilerExtractor versions (that ignore missing parameters) and newer versions (that reject the deprecated parameter).

Additional

  • Fixed typos: "sigantures" → "signatures", "decompostion" → "decomposition"
Original prompt

This section details on the original issue you should resolve

<issue_title>Refit error in sigprofiler_extract</issue_title>
<issue_description>I am getting two error when trying to run sigprofiler_extract. The first one is due to a possibly deprecated argument in SigProfilerExtractor called "refit". The second one is probably related to the fact that i am using a Windows PC.

I manually installed SigProfilerExtractor because conda was giving me another problems and that is why I have the python path option. I have tried this with and without the refit and refit_plot options.

> sigprofiler_extract(
+   nmf_matrix = nmf_sample,
+   output = "./sigprofiler/",
+   genome_build = "hg19",
+   use_conda = FALSE,  # do NOT auto-create environment
+   py_path   = "C:/Users/jrc356/.conda/envs/sigprofiler_env/python.exe",
+   refit  = FALSE,  # explicitly turn off refit so it won't pass that param
+   refit_plot = FALSE
+ )
Loading required namespace: reticulate
Python environment configuration.
====================
python:         C:/Users/jrc356/.conda/envs/sigprofiler_env/python.exe
libpython:      C:/Users/jrc356/.conda/envs/sigprofiler_env/python311.dll
pythonhome:     C:/Users/jrc356/.conda/envs/sigprofiler_env
version:        3.11.11 | packaged by Anaconda, Inc. | (main, Dec 11 2024, 16:34:19) [MSC v.1929 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:/Users/jrc356/.conda/envs/sigprofiler_env/Lib/site-packages/numpy
numpy_version:  1.26.4

NOTE: Python version was forced by use_python() function
The follow samples dropped due to null catalogue:
	GENIE-JHU-00143-00324, GENIE-MSK-P-0051808-T01-IM6, GENIE-MSK-P-0081238-T02-IM7, GENIE-UHN-OCT886607-ARC1, GENIE-MSK-P-0025374-T01-IM6, GENIE-NKI-PSNJ-VDY8, GENIE-MSK-P-0045205-T01-IM6, GENIE-MSK-P-0008424-T01-IM5, GENIE-MSK-P-0029386-T01-IM6, GENIE-WAKE-F2263-01, GENIE-MSK-P-0051608-T02-IH3, GENIE-MSK-P-0019281-T01-IM6, GENIE-MSK-P-0030600-T01-IH3, GENIE-COLU-700-1, GENIE-MSK-P-0016617-T01-IM6, GENIE-UCSF-782593-90632T, GENIE-MSK-P-0044869-T01-IH3, GENIE-MSK-P-0033310-T01-IM6
unused argument (refit_denovo_signatures = refit)Error detected, try recalling with python command.
===
C:/Users/jrc356/.conda/envs/sigprofiler_env/python.exe -c "from SigProfilerExtractor import sigpro as sig;sig.sigProfilerExtractor('matrix','./sigprofiler/','C:\Users\jrc356\AppData\Local\Temp\RtmpuA1nnQ/dir8e9c7fc35e75/sigprofiler_input.txt',reference_genome='GRCh37',opportunity_genome='GRCh37',minimum_signatures=2,maximum_signatures=5,nmf_replicates=10,exome=False,nmf_init='random',refit_denovo_signatures=False,make_decomposition_plots=False,cpu=-1)"
===
  File "<string>", line 1
    from SigProfilerExtractor import sigpro as sig;sig.sigProfilerExtractor('matrix','./sigprofiler/','C:\Users\jrc356\AppData\Local\Temp\RtmpuA1nnQ/dir8e9c7fc35e75/sigprofiler_input.txt',reference_genome='GRCh37',opportunity_genome='GRCh37',minimum_signatures=2,maximum_signatures=5,nmf_replicates=10,exome=False,nmf_init='random',refit_denovo_signatures=False,make_decomposition_plots=False,cpu=-1)
                                                                                                                                                                                           ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
[1] 1
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
<comment_new><author>@ShixiangWang</author><body>
Thanks! Cause the sigminer fits a fixed version of sigprofiler. We will take a look and see how we can solve it smoothly.</body></comment_new>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 25, 2025 15:39
…extract

Co-authored-by: ShixiangWang <25057508+ShixiangWang@users.noreply.github.com>
… decomposition

Co-authored-by: ShixiangWang <25057508+ShixiangWang@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix refit error in sigprofiler_extract Remove deprecated refit_denovo_signatures parameter from sigprofiler_extract Dec 25, 2025
Copilot AI requested a review from ShixiangWang December 25, 2025 15:41
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

Successfully merging this pull request may close these issues.

Refit error in sigprofiler_extract

2 participants