From 35ab3f06113e84848feba7a9659dbb746ae5cfeb Mon Sep 17 00:00:00 2001 From: xiaoliz0 Date: Wed, 15 Apr 2026 09:05:09 +0200 Subject: [PATCH 1/4] Chnage the TMB number in the blue circle of the report from in-house TMB to Illumina TMB. And the number needs to be rounded. This is the request from national molecular biology group. GitHub issue 100. --- Script/PRONTO.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Script/PRONTO.py b/Script/PRONTO.py index 15ff89c..99633eb 100755 --- a/Script/PRONTO.py +++ b/Script/PRONTO.py @@ -806,6 +806,7 @@ def update_ppt_variant_summary_table(data_nrows,DNA_sampleID,RNA_sampleID,TMB_DR else: TMB_illumina = "TMB = " + line.split('\t')[1] TMB_TSO500 = line.split('\t')[1] + TMB_TSO500_nr = round(float(TMB_TSO500.split()[0])) if(line.split('\t')[2] == 'NA'): MSI_illumina = "MSI = NA" msi_text = "-" @@ -910,32 +911,32 @@ def update_ppt_variant_summary_table(data_nrows,DNA_sampleID,RNA_sampleID,TMB_DR tf5.paragraphs[0].text = str(preMTB_appendix_nrows) tf5.paragraphs[0].font.size = Pt(7) tf5.paragraphs[0].alignment = PP_ALIGN.CENTER - if(TMB_DRUP_nr >= 0 and TMB_DRUP_nr <= 5 and str_TMB_DRUP != "" and str_TMB_DRUP != "NA"): + if(TMB_TSO500_nr >= 0 and TMB_TSO500_nr <= 5 and TMB_TSO500 != "" and TMB_TSO500 != "NA"): roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(7.07), Cm(3.90), Cm(0.58), Cm(0.58)) roundshape.line.color.rgb = RGBColor(255,165,0) textbox5 = slide.shapes.add_textbox(Inches(2.74), Inches(1.54), Inches(0.32), Inches(0.21)) tf5 = textbox5.text_frame - tf5.paragraphs[0].text = str_TMB_DRUP + tf5.paragraphs[0].text = str(TMB_TSO500_nr) tf5.paragraphs[0].font.size = Pt(7) tf5.paragraphs[0].font.bold = True tf5.paragraphs[0].alignment = PP_ALIGN.CENTER tf5.paragraphs[0].font.color.rgb = RGBColor(250,250,250) - if((TMB_DRUP_nr > 5 and TMB_DRUP_nr <= 20) or str_TMB_DRUP == "" or str_TMB_DRUP == "NA"): + if((TMB_TSO500_nr > 5 and TMB_TSO500_nr <= 20) or TMB_TSO500 == "" or TMB_TSO500 == "NA"): roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(8.27), Cm(3.90), Cm(0.58), Cm(0.58)) roundshape.line.color.rgb = RGBColor(255,165,0) textbox5 = slide.shapes.add_textbox(Cm(8.23), Cm(3.90), Cm(0.58), Cm(0.60)) tf5 = textbox5.text_frame - tf5.paragraphs[0].text = str_TMB_DRUP + tf5.paragraphs[0].text = str(TMB_TSO500_nr) tf5.paragraphs[0].font.size = Pt(7) tf5.paragraphs[0].font.bold = True tf5.paragraphs[0].alignment = PP_ALIGN.CENTER tf5.paragraphs[0].font.color.rgb = RGBColor(250,250,250) - if(TMB_DRUP_nr > 20 and str_TMB_DRUP != "" and str_TMB_DRUP != "NA"): + if(TMB_TSO500_nr > 20 and TMB_TSO500 != "" and TMB_TSO500 != "NA"): roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(10.26), Cm(3.90), Cm(0.58), Cm(0.58)) roundshape.line.color.rgb = RGBColor(255,165,0) textbox5 = slide.shapes.add_textbox(Cm(10.20), Cm(3.95), Cm(0.58), Cm(0.60)) tf5 = textbox5.text_frame - tf5.paragraphs[0].text = str_TMB_DRUP + tf5.paragraphs[0].text = str(TMB_TSO500_nr) tf5.paragraphs[0].font.size = Pt(7) tf5.paragraphs[0].font.bold = True tf5.paragraphs[0].alignment = PP_ALIGN.CENTER From 10afde28b8d90df90c599a9f05cf0879f4dd44df Mon Sep 17 00:00:00 2001 From: Xiaoli Zhang <81294502+xiaoliz0@users.noreply.github.com> Date: Tue, 28 Apr 2026 12:29:05 +0200 Subject: [PATCH 2/4] Update Script/PRONTO.py Co-authored-by: Martin Rippin <74295098+marrip@users.noreply.github.com> --- Script/PRONTO.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Script/PRONTO.py b/Script/PRONTO.py index 99633eb..47fb924 100755 --- a/Script/PRONTO.py +++ b/Script/PRONTO.py @@ -940,6 +940,22 @@ def update_ppt_variant_summary_table(data_nrows,DNA_sampleID,RNA_sampleID,TMB_DR tf5.paragraphs[0].font.size = Pt(7) tf5.paragraphs[0].font.bold = True tf5.paragraphs[0].alignment = PP_ALIGN.CENTER + if(TMB_TSO500 != "" and TMB_TSO500 != "NA"): + if(TMB_TSO500_nr >= 0 and TMB_TSO500_nr <= 5): + roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(7.07), Cm(3.90), Cm(0.58), Cm(0.58)) + textbox5 = slide.shapes.add_textbox(Inches(2.74), Inches(1.54), Inches(0.32), Inches(0.21)) + if(TMB_TSO500_nr > 5 and TMB_TSO500_nr <= 20): + roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(8.27), Cm(3.90), Cm(0.58), Cm(0.58)) + textbox5 = slide.shapes.add_textbox(Cm(8.23), Cm(3.90), Cm(0.58), Cm(0.60)) + if(TMB_TSO500_nr > 20 and TMB_TSO500 != "" and TMB_TSO500 != "NA"): + roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(10.26), Cm(3.90), Cm(0.58), Cm(0.58)) + textbox5 = slide.shapes.add_textbox(Cm(10.20), Cm(3.95), Cm(0.58), Cm(0.60)) + roundshape.line.color.rgb = RGBColor(255,165,0) + tf5 = textbox5.text_frame + tf5.paragraphs[0].text = str(TMB_TSO500_nr) + tf5.paragraphs[0].font.size = Pt(7) + tf5.paragraphs[0].font.bold = True + tf5.paragraphs[0].alignment = PP_ALIGN.CENTER tf5.paragraphs[0].font.color.rgb = RGBColor(250,250,250) textbox6 = slide.shapes.add_textbox(Inches(6.23), Inches(1.06), Inches(0.97), Inches(0.19)) tf6 = textbox6.text_frame From 7f227235db4790e9240bb4378a2f1a16ea78f734 Mon Sep 17 00:00:00 2001 From: xiaoliz0 Date: Tue, 28 Apr 2026 12:43:34 +0200 Subject: [PATCH 3/4] Use the suggested codes from Martin and remove the old codes. Give correct order numbers for the textbox in report. --- Script/PRONTO.py | 101 +++++++++++++++++------------------------------ 1 file changed, 36 insertions(+), 65 deletions(-) diff --git a/Script/PRONTO.py b/Script/PRONTO.py index 47fb924..ca736d9 100755 --- a/Script/PRONTO.py +++ b/Script/PRONTO.py @@ -911,89 +911,60 @@ def update_ppt_variant_summary_table(data_nrows,DNA_sampleID,RNA_sampleID,TMB_DR tf5.paragraphs[0].text = str(preMTB_appendix_nrows) tf5.paragraphs[0].font.size = Pt(7) tf5.paragraphs[0].alignment = PP_ALIGN.CENTER - if(TMB_TSO500_nr >= 0 and TMB_TSO500_nr <= 5 and TMB_TSO500 != "" and TMB_TSO500 != "NA"): - roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(7.07), Cm(3.90), Cm(0.58), Cm(0.58)) - roundshape.line.color.rgb = RGBColor(255,165,0) - textbox5 = slide.shapes.add_textbox(Inches(2.74), Inches(1.54), Inches(0.32), Inches(0.21)) - tf5 = textbox5.text_frame - tf5.paragraphs[0].text = str(TMB_TSO500_nr) - tf5.paragraphs[0].font.size = Pt(7) - tf5.paragraphs[0].font.bold = True - tf5.paragraphs[0].alignment = PP_ALIGN.CENTER - tf5.paragraphs[0].font.color.rgb = RGBColor(250,250,250) - if((TMB_TSO500_nr > 5 and TMB_TSO500_nr <= 20) or TMB_TSO500 == "" or TMB_TSO500 == "NA"): - roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(8.27), Cm(3.90), Cm(0.58), Cm(0.58)) - roundshape.line.color.rgb = RGBColor(255,165,0) - textbox5 = slide.shapes.add_textbox(Cm(8.23), Cm(3.90), Cm(0.58), Cm(0.60)) - tf5 = textbox5.text_frame - tf5.paragraphs[0].text = str(TMB_TSO500_nr) - tf5.paragraphs[0].font.size = Pt(7) - tf5.paragraphs[0].font.bold = True - tf5.paragraphs[0].alignment = PP_ALIGN.CENTER - tf5.paragraphs[0].font.color.rgb = RGBColor(250,250,250) - if(TMB_TSO500_nr > 20 and TMB_TSO500 != "" and TMB_TSO500 != "NA"): - roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(10.26), Cm(3.90), Cm(0.58), Cm(0.58)) - roundshape.line.color.rgb = RGBColor(255,165,0) - textbox5 = slide.shapes.add_textbox(Cm(10.20), Cm(3.95), Cm(0.58), Cm(0.60)) - tf5 = textbox5.text_frame - tf5.paragraphs[0].text = str(TMB_TSO500_nr) - tf5.paragraphs[0].font.size = Pt(7) - tf5.paragraphs[0].font.bold = True - tf5.paragraphs[0].alignment = PP_ALIGN.CENTER if(TMB_TSO500 != "" and TMB_TSO500 != "NA"): if(TMB_TSO500_nr >= 0 and TMB_TSO500_nr <= 5): roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(7.07), Cm(3.90), Cm(0.58), Cm(0.58)) - textbox5 = slide.shapes.add_textbox(Inches(2.74), Inches(1.54), Inches(0.32), Inches(0.21)) + textbox6 = slide.shapes.add_textbox(Inches(2.74), Inches(1.54), Inches(0.32), Inches(0.21)) if(TMB_TSO500_nr > 5 and TMB_TSO500_nr <= 20): roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(8.27), Cm(3.90), Cm(0.58), Cm(0.58)) - textbox5 = slide.shapes.add_textbox(Cm(8.23), Cm(3.90), Cm(0.58), Cm(0.60)) + textbox6 = slide.shapes.add_textbox(Cm(8.23), Cm(3.90), Cm(0.58), Cm(0.60)) if(TMB_TSO500_nr > 20 and TMB_TSO500 != "" and TMB_TSO500 != "NA"): roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(10.26), Cm(3.90), Cm(0.58), Cm(0.58)) - textbox5 = slide.shapes.add_textbox(Cm(10.20), Cm(3.95), Cm(0.58), Cm(0.60)) + textbox6 = slide.shapes.add_textbox(Cm(10.20), Cm(3.95), Cm(0.58), Cm(0.60)) roundshape.line.color.rgb = RGBColor(255,165,0) - tf5 = textbox5.text_frame - tf5.paragraphs[0].text = str(TMB_TSO500_nr) - tf5.paragraphs[0].font.size = Pt(7) - tf5.paragraphs[0].font.bold = True - tf5.paragraphs[0].alignment = PP_ALIGN.CENTER - tf5.paragraphs[0].font.color.rgb = RGBColor(250,250,250) - textbox6 = slide.shapes.add_textbox(Inches(6.23), Inches(1.06), Inches(0.97), Inches(0.19)) - tf6 = textbox6.text_frame - tf6.paragraphs[0].text = splicing - tf6.paragraphs[0].font.size = Pt(7) - tf6.paragraphs[0].alignment = PP_ALIGN.LEFT - textbox7 = slide.shapes.add_textbox(Inches(6.23), Inches(1.26), Inches(0.97), Inches(0.19)) - tf7 = textbox7.text_frame - tf7.paragraphs[0].text = fusion - tf7.paragraphs[0].font.size = Pt(7) + tf6 = textbox6.text_frame + tf6.paragraphs[0].text = str(TMB_TSO500_nr) + tf6.paragraphs[0].font.size = Pt(7) + tf6.paragraphs[0].font.bold = True + tf6.paragraphs[0].alignment = PP_ALIGN.CENTER + tf6.paragraphs[0].font.color.rgb = RGBColor(250,250,250) + textbox7 = slide.shapes.add_textbox(Inches(6.23), Inches(1.06), Inches(0.97), Inches(0.19)) + tf7 = textbox7.text_frame + tf7.paragraphs[0].text = splicing + tf7.paragraphs[0].font.size = Pt(7) tf7.paragraphs[0].alignment = PP_ALIGN.LEFT + textbox8 = slide.shapes.add_textbox(Inches(6.23), Inches(1.26), Inches(0.97), Inches(0.19)) + tf8 = textbox8.text_frame + tf8.paragraphs[0].text = fusion + tf8.paragraphs[0].font.size = Pt(7) + tf8.paragraphs[0].alignment = PP_ALIGN.LEFT if(index == 1): - textbox8 = slide.shapes.add_textbox(Inches(5.14), Inches(2.63), Inches(0.53), Inches(0.25)) - tf8 = textbox8.text_frame - tf8.paragraphs[0].text = TMB_DRUP_str - tf8.paragraphs[0].font.size = Pt(8) - tf8.paragraphs[0].alignment = PP_ALIGN.LEFT - textbox9 = slide.shapes.add_textbox(Inches(3.95), Inches(3.70), Inches(0.88), Inches(0.25)) + textbox9 = slide.shapes.add_textbox(Inches(5.14), Inches(2.63), Inches(0.53), Inches(0.25)) tf9 = textbox9.text_frame - tf9.paragraphs[0].text = TMB_illumina + tf9.paragraphs[0].text = TMB_DRUP_str tf9.paragraphs[0].font.size = Pt(8) tf9.paragraphs[0].alignment = PP_ALIGN.LEFT - textbox10 = slide.shapes.add_textbox(Inches(4.90), Inches(3.84), Inches(1.14), Inches(0.25)) + textbox10 = slide.shapes.add_textbox(Inches(3.95), Inches(3.70), Inches(0.88), Inches(0.25)) tf10 = textbox10.text_frame - tf10.paragraphs[0].text = MSI_illumina + tf10.paragraphs[0].text = TMB_illumina tf10.paragraphs[0].font.size = Pt(8) - tf10.paragraphs[0].alignment = PP_ALIGN.CENTER - if(index == 5): - textbox11 = slide.shapes.add_textbox(Inches(6.03), Inches(2.14), Inches(0.59), Inches(0.25)) + tf10.paragraphs[0].alignment = PP_ALIGN.LEFT + textbox11 = slide.shapes.add_textbox(Inches(4.90), Inches(3.84), Inches(1.14), Inches(0.25)) tf11 = textbox11.text_frame - tf11.paragraphs[0].text = TMB_DRUP_str - tf11.paragraphs[0].font.size = Pt(9) - tf11.paragraphs[0].alignment = PP_ALIGN.LEFT - textbox12 = slide.shapes.add_textbox(Inches(6.22), Inches(2.29), Inches(0.88), Inches(0.25)) + tf11.paragraphs[0].text = MSI_illumina + tf11.paragraphs[0].font.size = Pt(8) + tf11.paragraphs[0].alignment = PP_ALIGN.CENTER + if(index == 5): + textbox12 = slide.shapes.add_textbox(Inches(6.03), Inches(2.14), Inches(0.59), Inches(0.25)) tf12 = textbox12.text_frame - tf12.paragraphs[0].text = TMB_illumina + tf12.paragraphs[0].text = TMB_DRUP_str tf12.paragraphs[0].font.size = Pt(9) - tf12.paragraphs[0].alignment = PP_ALIGN.LEFT + tf12.paragraphs[0].alignment = PP_ALIGN.LEFT + textbox13 = slide.shapes.add_textbox(Inches(6.22), Inches(2.29), Inches(0.88), Inches(0.25)) + tf13 = textbox13.text_frame + tf13.paragraphs[0].text = TMB_illumina + tf13.paragraphs[0].font.size = Pt(9) + tf13.paragraphs[0].alignment = PP_ALIGN.LEFT ppt.save(output_ppt_file) return stable_text From b88c26e6d23a5b1d34fe9d5d61b88af725e89cff Mon Sep 17 00:00:00 2001 From: xiaoliz0 Date: Tue, 28 Apr 2026 13:03:16 +0200 Subject: [PATCH 4/4] Remove the overwrite conditions. --- Script/PRONTO.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Script/PRONTO.py b/Script/PRONTO.py index ca736d9..05062e4 100755 --- a/Script/PRONTO.py +++ b/Script/PRONTO.py @@ -918,7 +918,7 @@ def update_ppt_variant_summary_table(data_nrows,DNA_sampleID,RNA_sampleID,TMB_DR if(TMB_TSO500_nr > 5 and TMB_TSO500_nr <= 20): roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(8.27), Cm(3.90), Cm(0.58), Cm(0.58)) textbox6 = slide.shapes.add_textbox(Cm(8.23), Cm(3.90), Cm(0.58), Cm(0.60)) - if(TMB_TSO500_nr > 20 and TMB_TSO500 != "" and TMB_TSO500 != "NA"): + if(TMB_TSO500_nr > 20): roundshape = slide.shapes.add_shape(MSO_SHAPE.OVAL, Cm(10.26), Cm(3.90), Cm(0.58), Cm(0.58)) textbox6 = slide.shapes.add_textbox(Cm(10.20), Cm(3.95), Cm(0.58), Cm(0.60)) roundshape.line.color.rgb = RGBColor(255,165,0)