Skip to content

Commit

Permalink
put in check for missing dicts before assignment?
Browse files Browse the repository at this point in the history
  • Loading branch information
duibuqi committed Nov 15, 2023
1 parent b5d1f51 commit 692289a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nPYc/plotting/_plotTIC.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def plotTIC(dataset, addViolin=True, addBatchShading=False, colourBy='SampleClas
raise ValueError('If colourDict is specified every unique entry in dataset.sampleMetadata[colourBy] must be a key in colourDict')
# Otherwise create colour dict
else:
colourDict = {}
for u in uniq:
colourDict[u] = 'blue' # TODO CAZ iterate through colours

Expand All @@ -80,6 +81,7 @@ def plotTIC(dataset, addViolin=True, addBatchShading=False, colourBy='SampleClas
if not all(k in markerDict.keys() for k in uniq):
raise ValueError('If markerDict is specified every unique entry in dataset.sampleMetadata[colourBy] must be a key in markerDict')
else:
markerDict = {}
for u in uniq:
markerDict[u] = 'o'

Expand Down

0 comments on commit 692289a

Please sign in to comment.