Skip to content

Chnage the TMB number in the blue circle of the report from in-house TMB to Illumina TMB #104

Open
xiaoliz0 wants to merge 1 commit intomainfrom
develop_issue100
Open

Chnage the TMB number in the blue circle of the report from in-house TMB to Illumina TMB #104
xiaoliz0 wants to merge 1 commit intomainfrom
develop_issue100

Conversation

@xiaoliz0
Copy link
Copy Markdown
Contributor

Request from the national molecular biology group:
Change the TMB number in the blue circle of report from in-house TMB to Illumina TMB. And the number will be rounded when reading into the report.

…TMB to Illumina TMB. And the number needs to be rounded. This is the request from national molecular biology group. GitHub issue 100.
Copy link
Copy Markdown
Collaborator

@marrip marrip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I think your changes are quite straight forward but I would consider to make this part in the code DRYer. Please have a look at my suggestion and let me know what you think ☺️

Comment thread Script/PRONTO.py
Comment on lines +914 to 943
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
tf5.paragraphs[0].font.color.rgb = RGBColor(250,250,250)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we make this whole part DRYer. I see there is a lot of repetition which seems unnecessary? Maybe something like:

Suggested change
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)

I changed the logic in if((TMB_TSO500_nr > 5 and TMB_TSO500_nr <= 20) or TMB_TSO500 == "" or TMB_TSO500 == "NA") because I thought it was a mistake that it would also handle TMB_TSO500 == "" to be empty and TMB_TSO500to beNA` but I can adjust it for this case if I got it wrong. Just let me know

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.

Change the TMB number in the blue circle of report from in-house TMB to Illumina TMB

3 participants