Skip to content

Commit 22fbb5e

Browse files
committed
Rename ncpu parameter to cpu for consistency across SigProfiler tools
1 parent d7efc1d commit 22fbb5e

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

SigProfilerAssignment/Analyzer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def decompose_fit(
2424
export_probabilities=True,
2525
export_probabilities_per_mutation=False,
2626
volume=None,
27-
ncpu=-1,
27+
cpu=-1,
2828
):
2929
decomp.spa_analyze(
3030
samples=samples,
@@ -52,7 +52,7 @@ def decompose_fit(
5252
export_probabilities=export_probabilities,
5353
export_probabilities_per_mutation=export_probabilities_per_mutation,
5454
volume=volume,
55-
ncpu=ncpu,
55+
cpu=cpu,
5656
)
5757

5858

@@ -78,7 +78,7 @@ def denovo_fit(
7878
export_probabilities=True,
7979
export_probabilities_per_mutation=False,
8080
volume=None,
81-
ncpu=-1,
81+
cpu=-1,
8282
):
8383
decomp.spa_analyze(
8484
samples=samples,
@@ -105,7 +105,7 @@ def denovo_fit(
105105
export_probabilities=export_probabilities,
106106
export_probabilities_per_mutation=export_probabilities_per_mutation,
107107
volume=volume,
108-
ncpu=ncpu,
108+
cpu=cpu,
109109
)
110110

111111

@@ -132,7 +132,7 @@ def cosmic_fit(
132132
export_probabilities_per_mutation=False,
133133
sample_reconstruction_plots=False,
134134
volume=None,
135-
ncpu=-1,
135+
cpu=-1,
136136
):
137137
decomp.spa_analyze(
138138
samples=samples,
@@ -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-
ncpu=ncpu
163+
cpu=cpu
164164
)

SigProfilerAssignment/decompose_subroutines.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@ def make_final_solution(
18361836
denovo_refit_option=True,
18371837
exome=False,
18381838
volume=None,
1839-
ncpu = -1
1839+
cpu = -1
18401840
):
18411841
if processAvg.shape[0] == allgenomes.shape[0] and processAvg.shape[0] != 96:
18421842
collapse_to_SBS96 = False
@@ -1925,10 +1925,10 @@ def make_final_solution(
19251925
# Passing inputs as a single argument and unpacking in the process_sample function
19261926
# with tqdm(total=len(inputs)) as progress_bar:
19271927
n_samples = allgenomes.shape[1]
1928-
if ncpu == -1:
1928+
if cpu == -1:
19291929
njobs=min(cpu_count(), allgenomes.shape[1])
19301930
else:
1931-
njobs=min(ncpu, allgenomes.shape[1])
1931+
njobs=min(cpu, allgenomes.shape[1])
19321932
# njobs=64
19331933
# batchs= n_samples // njobs
19341934
results = Parallel(n_jobs=njobs,mmap_mode='r',verbose=5,batch_size="auto")(delayed(process_sample)(input) for input in inputs)

SigProfilerAssignment/decomposition.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def spa_analyze(
261261
sample_reconstruction_plots=None,
262262
make_metadata=True,
263263
volume=None,
264-
ncpu=-1,
264+
cpu=-1,
265265
):
266266
"""
267267
Decomposes the De Novo Signatures into COSMIC Signatures and assigns COSMIC signatures into samples.
@@ -686,7 +686,7 @@ def spa_analyze(
686686
denovo_refit_option=denovo_refit_option,
687687
exome=exome,
688688
volume=volume,
689-
ncpu = -1,
689+
cpu = -1,
690690
)
691691

692692
else:
@@ -695,7 +695,7 @@ def spa_analyze(
695695
signature_stats = devopts["signature_stats"]
696696
sequence = devopts["sequence"]
697697
processSTE = devopts["processSTE"]
698-
ncpu_extractor = devopts["ncpu"]
698+
cpu_extractor = devopts["cpu"]
699699

700700
exposureAvg = sub.make_final_solution(
701701
processAvg,
@@ -727,7 +727,7 @@ def spa_analyze(
727727
denovo_refit_option=denovo_refit_option,
728728
exome=exome,
729729
volume=volume,
730-
ncpu = ncpu_extractor,
730+
cpu = cpu_extractor,
731731
)
732732

733733
if make_metadata:
@@ -904,7 +904,7 @@ def spa_analyze(
904904
denovo_refit_option=denovo_refit_option,
905905
exome=exome,
906906
volume=volume,
907-
ncpu=ncpu
907+
cpu=cpu
908908
)
909909

910910
if make_metadata:
@@ -1069,7 +1069,7 @@ def spa_analyze(
10691069
denovo_refit_option=denovo_refit_option,
10701070
exome=exome,
10711071
volume=volume,
1072-
ncpu=ncpu,
1072+
cpu=cpu,
10731073
)
10741074
if make_metadata:
10751075
with open(os.path.join(output, "JOB_METADATA_SPA.txt"), "a") as sysdata:

0 commit comments

Comments
 (0)