Skip to content

Commit c8e5cf9

Browse files
committed
v1.0.0: Added parallel assignment and cpu parameter for configurable core usage
1 parent 22fbb5e commit c8e5cf9

File tree

9 files changed

+108
-969
lines changed

9 files changed

+108
-969
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [1.0.0] - 2025-10-07
10+
11+
### Added
12+
- Parallel execution of SPA runs for improved performance on multi-core systems.
13+
- `cpu` parameter to control the number of processor cores used during assignment. Defaults to `-1` to use all available cores.
14+
15+
### Documentation
16+
- Updated README to document the new `cpu` parameter.
17+
918
## [0.2.6] - 2025-09-17
1019

1120
### Added

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ Analyze.cosmic_fit(samples, output, input_type="matrix", context_type="96",
7474
| make_plots | Boolean | Toggle on and off for making and saving plots. The default value is True. |
7575
| sample_reconstruction_plots | String | Select the output format for sample reconstruction plots. Valid inputs are {'pdf', 'png', 'both', 'none'}. The default value is 'none'. If set to 'png' or 'both', the external binary `poppler` must be installed. Install via `conda install -c conda-forge poppler` or `brew install poppler` on macOS. |
7676
| verbose | Boolean | Prints detailed statements. The default value is False. |
77+
| cpu | Integer | Number of processor cores to use during assignment. The default value is -1, which uses all available cores. |
7778
| volume | String | Path to SigProfilerAssignment volumes. Used for Docker/Singularity. Environmental variable "SIGPROFILERASSIGNMENT_VOLUME" takes precedence. Default value is None. |
7879

7980

8081

82+
8183
### <a name="subgroups"></a> Signature Subgroups
8284

8385
When using COSMIC reference signatures, some subgroups of signatures can be removed to improve the refitting analysis. To use this feature, the `exclude_signature_subgroups` parameter should be added, following the sintax below:

SigProfilerAssignment/Analyzer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,5 @@ def cosmic_fit(
160160
export_probabilities_per_mutation=export_probabilities_per_mutation,
161161
sample_reconstruction_plots=sample_reconstruction_plots,
162162
volume=volume,
163-
cpu=cpu
163+
cpu=cpu,
164164
)

SigProfilerAssignment/DecompositionPlots/PlotDecomposition.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,16 +281,22 @@ def calculate_similarities(denovo, denovo_name, est_denovo):
281281
if denovo.shape[0] == 1536:
282282
denovo["IndexKey"] = denovo.iloc[:, 0].astype(str)
283283
denovo["GroupKey"] = denovo["IndexKey"].str[1:8]
284-
denovo_grouped = denovo.groupby("GroupKey", as_index=False).sum(numeric_only=True)
284+
denovo_grouped = denovo.groupby("GroupKey", as_index=False).sum(
285+
numeric_only=True
286+
)
285287
denovo_grouped.rename(columns={"GroupKey": "MutationType"}, inplace=True)
286288
denovo = denovo_grouped.reset_index(drop=True)
287289

288290
elif denovo.shape[0] == 288:
289291
denovo["MutationType"] = denovo["MutationType"].astype(str) # Ensure strings
290-
denovo["GroupKey"] = denovo["MutationType"].str[2:9] # Extract substring for grouping
291-
denovo_grouped = denovo.groupby("GroupKey", as_index=False).sum(numeric_only=True)
292+
denovo["GroupKey"] = denovo["MutationType"].str[
293+
2:9
294+
] # Extract substring for grouping
295+
denovo_grouped = denovo.groupby("GroupKey", as_index=False).sum(
296+
numeric_only=True
297+
)
292298
denovo_grouped.rename(columns={"GroupKey": "MutationType"}, inplace=True)
293-
denovo = denovo_grouped.reset_index(drop=True) # updated pandas 2.0.0
299+
denovo = denovo_grouped.reset_index(drop=True) # updated pandas 2.0.0
294300
sample_names = [denovo_name]
295301

296302
if sample_names is False:

SigProfilerAssignment/DecompositionPlots/PlotDecomposition_SV32.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
PLOT_NAME = 0
129129
CONTRIBUTION = 1
130130

131+
131132
# Helper functions for plotting the layout of a graph with 1-5 basis signatures
132133
# Parameters:
133134
# bases - (List of Strings) The list of basis names

SigProfilerAssignment/controllers/cli_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def parse_arguments_common(args: List[str], description: str) -> argparse.Namesp
146146
"'pdf' (generate only PDF), "
147147
"'both' (PDF + PNG), or "
148148
"'png' (PNG only, PDF removed)."
149-
)
149+
),
150150
)
151151

152152
return parser.parse_args(args)

0 commit comments

Comments
 (0)