annotate plot_filter.py @ 1:a60f7f660872 draft default tip

planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
author devteam
date Tue, 13 Oct 2015 12:17:35 -0400
parents 9c0d844f4e48
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
1
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
2 def validate(incoming):
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
3 """Validator for the plotting program"""
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
4
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
5 bins = incoming.get("bins","")
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
6 col = incoming.get("col","")
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
7
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
8 if not bins or not col:
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
9 raise Exception, "You need to specify a number for bins and columns"
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
10
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
11 try:
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
12 bins = int(bins)
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
13 col = int(col)
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
14 except:
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
15 raise Exception, "Parameters are not valid numbers, columns:%s, bins:%s" % (col, bins)
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
16
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
17 if not 1<bins<100:
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
18 raise Exception, "The number of bins %s must be a number between 1 and 100" % bins
9c0d844f4e48 Imported from capsule None
devteam
parents:
diff changeset
19