Skip to content

Commit

Permalink
proviral_landscape_plot: add colours for new error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Jul 12, 2024
1 parent 1105fb3 commit db17f90
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
'Premature Stop': "#CC6677",
'Chimera': "#AA4499",
'Scrambled': "#882255",
'Large Insertion': "#DDCC77",
'Frameshift': "#DDAA77",
}

# colors are chosen from Paul Tol's muted color scheme, which is color-blind safe
# if another defect color is needed, this one is recommended: #DDCC77
HIGHLIGHT_COLORS = {'Defect Region': "black",
'Inverted Region': "#AFAFAF",
}

DEFECT_TYPE = {'LargeDeletion': 'Large Deletion',
'LongDeletion': 'Large Deletion',
'InternalInversion': 'Inversion',
Expand All @@ -39,8 +43,8 @@
'Inferred_PrematureStopORInframeDEL_GagNoATG': 'Premature Stop',
'InternalStopInOrf': "Premature Stop",
'DeletionInOrf': "Premature Stop",
'InsertionInOrf': "Premature Stop",
'FrameshiftInOrf': "Premature Stop",
'InsertionInOrf': "Large Insertion",
'FrameshiftInOrf': "Frameshift",
'5DEFECT': "5' Defect",
'5DFECT_IntoGag': "5' Defect", # this is a typo in HIVSeqinR
'5DEFECT_GagNoATGGagPassed': "5' Defect",
Expand Down Expand Up @@ -254,6 +258,8 @@ def __init__(self, figure, tot_samples):
self.xaxisheight = 0

def add_line(self, samp_name, xstart, xend, defect_type, highlight):
# print("> add line ", [samp_name, xstart, xend, defect_type, highlight])

is_first = False
if defect_type not in DEFECT_TO_COLOR.keys():
print(f"Unknown defect: {defect_type}")
Expand Down

0 comments on commit db17f90

Please sign in to comment.