Skip to content

Commit 77fd74d

Browse files
authored
Merge pull request #73 from AlexandrovLab/up1b
Up1b
2 parents 29549ef + e0b5cad commit 77fd74d

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dist: xenial
22
language: python
33

44
vm:
5-
size: large
5+
size: 2x-large
66

77
python:
88
- '3.8'

SigProfilerAssignment/DecompositionPlots/PlotDecomposition.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ def install_cosmic_plots(context_type="96", genome_build="GRCh37", cosmic_versio
126126
savefig_format="buffer_stream")
127127
elif context_type_str == "DBS":
128128
cosmic_mtx = pd.read_csv(cosmic_file_path, sep="\t")
129-
cosmic_buff_plots = mPlt.plotDBS(cosmic_mtx, "buffer",
130-
"buffer", cosmic_mtype, percentage=True)
129+
cosmic_buff_plots = sigPlt.plotDBS(cosmic_mtx, "buffer",
130+
"buffer", cosmic_mtype, percentage=True,
131+
savefig_format="buffer_stream")
131132
elif context_type_str == "ID":
132133
cosmic_buff_plots = sigPlt.plotID(cosmic_file_path, "buffer",
133134
"buffer", cosmic_mtype, percentage=True,
@@ -251,11 +252,11 @@ def genSBS_pngs(denovo_mtx, basis_mtx, output_path, project, mtype, ss_decomp=Fa
251252
def genDBS_pngs(denovo_mtx, basis_mtx, output_path, project, mtype):
252253
denovo_plots = dict()
253254
basis_plots = dict()
254-
denovo_plots = mPlt.plotDBS(denovo_mtx, output_path, project, mtype,
255-
percentage=True)
255+
denovo_plots = sigPlt.plotDBS(denovo_mtx, output_path, project, mtype,
256+
percentage=True, savefig_format="buffer_stream")
256257
if basis_mtx is not None:
257-
basis_plots = mPlt.plotDBS(basis_mtx, output_path, project, mtype,
258-
percentage=True)
258+
basis_plots = sigPlt.plotDBS(basis_mtx, output_path, project, mtype,
259+
percentage=True, savefig_format="buffer_stream")
259260
return denovo_plots,basis_plots
260261

261262
def genID_pngs(denovo_mtx, basis_mtx, output_path, project, mtype):
@@ -332,8 +333,8 @@ def gen_reconstructed_png_percent(denovo_name, basis_mtx, basis_names, weights,
332333
reconstruction_plot=sigPlt.plotSBS(reconstruction_mtx, output_path, \
333334
"reconstruction_" + project, mtype, percentage=True, savefig_format='buffer_stream')
334335
elif mtype in DBS_CONTEXTS:
335-
reconstruction_plot=mPlt.plotDBS(reconstruction_mtx, output_path,
336-
"reconstruction_" + project, mtype, percentage=True)
336+
reconstruction_plot=sigPlt.plotDBS(reconstruction_mtx, output_path,
337+
"reconstruction_" + project, mtype, percentage=True, savefig_format='buffer_stream')
337338
elif mtype in ID_CONTEXTS:
338339
reconstruction_plot=sigPlt.plotID(reconstruction_mtx, output_path,
339340
"reconstruction_" + project, mtype, percentage=True, savefig_format='buffer_stream')
@@ -367,11 +368,11 @@ def gen_reconstructed_png_numerical(denovo_mtx, denovo_name, basis_mtx, basis_na
367368
"reconstruction_" + project, mtype, percentage=False,
368369
savefig_format="buffer_stream")
369370
elif mtype in DBS_CONTEXTS:
370-
reconstruction_plot=mPlt.plotDBS(reconstruction_mtx, output_path,
371-
"reconstruction_" + project, mtype, percentage=False)
371+
reconstruction_plot=sigPlt.plotDBS(reconstruction_mtx, output_path,
372+
"reconstruction_" + project, mtype, percentage=False, savefig_format="buffer_stream")
372373
elif mtype in ID_CONTEXTS:
373374
reconstruction_plot=sigPlt.plotID(reconstruction_mtx, output_path,
374-
"reconstruction_" + project, mtype, percentage=False)
375+
"reconstruction_" + project, mtype, percentage=False, savefig_format="buffer_stream")
375376
elif mtype in CNV_CONTEXTS:
376377
reconstruction_plot = sigPlt.plotCNV(reconstruction_mtx, output_path,
377378
"reconstruction_"+project, plot_type="pdf", percentage=True,
@@ -493,15 +494,15 @@ def run_PlotDecomposition(denovo_mtx, denovo_name, basis_mtx, basis_names,
493494
-------
494495
None.
495496
"""
496-
497497
# Create the denovo plots and load basis plots
498-
if mtype == "48":
499-
denovo_plots_dict, basis_plots_dict = gen_sub_plots(denovo_mtx, basis_mtx,
500-
output_path, project, mtype, ss_decomp=False)
501-
else:
498+
if mtype != "48":
502499
denovo_plots_dict = gen_sub_plots(denovo_mtx, None,
503500
output_path, project, mtype, ss_decomp=False)
504501
denovo_plots_dict = denovo_plots_dict[0]
502+
else:
503+
# cnv basis plots need to be generated and not loaded
504+
denovo_plots_dict, basis_plots_dict = gen_sub_plots(denovo_mtx, basis_mtx,
505+
output_path, project, mtype, ss_decomp=False)
505506
# Create the matrix and plot for the reconstructed matrix
506507
reconstructed_mtx,reconstruction_plot_dict = gen_reconstructed_png_percent(
507508
denovo_name, basis_mtx, basis_names, weights, output_path, project, mtype)

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
if os.path.exists("dist"):
77
shutil.rmtree("dist")
88

9-
VERSION = '0.0.24'
9+
VERSION = '0.0.25'
1010

1111

1212
def write_version_py(filename='SigProfilerAssignment/version.py'):
@@ -15,7 +15,7 @@ def write_version_py(filename='SigProfilerAssignment/version.py'):
1515
# THIS FILE IS GENERATED FROM SigProfilerAssignment SETUP.PY
1616
short_version = '%(version)s'
1717
version = '%(version)s'
18-
Update = 'v0.0.24: Upgrade decomposition plot dependencies, rename signature subgroups'
18+
Update = 'v0.0.25: DBS Decomposition Plots Plotting'
1919
2020
2121
"""
@@ -31,7 +31,7 @@ def write_version_py(filename='SigProfilerAssignment/version.py'):
3131
'numpy>=1.21.2',
3232
'pandas>=1.2.4',
3333
'SigProfilerMatrixGenerator>=1.2.13',
34-
'sigProfilerPlotting>=1.3.8',
34+
'sigProfilerPlotting>=1.3.10',
3535
'pillow>=9.1.1',
3636
'statsmodels>=0.9.0',
3737
'scikit-learn>=0.24.2',

0 commit comments

Comments
 (0)