annotate plot_filter.py @ 1:549d2cb4c6f2 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/dna_filtering commit a1517c9d22029095120643bbe2c8fa53754dd2b7
author devteam
date Wed, 11 Nov 2015 12:11:01 -0500
parents a6f0d355b05f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
1
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
2 def validate(incoming):
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
3 """Validator for the plotting program"""
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
4
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
5 bins = incoming.get("bins","")
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
6 col = incoming.get("col","")
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
7
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
8 if not bins or not col:
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
9 raise Exception, "You need to specify a number for bins and columns"
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
10
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
11 try:
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
12 bins = int(bins)
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
13 col = int(col)
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
14 except:
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
15 raise Exception, "Parameters are not valid numbers, columns:%s, bins:%s" % (col, bins)
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
16
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
17 if not 1<bins<100:
a6f0d355b05f 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
a6f0d355b05f Imported from capsule None
devteam
parents:
diff changeset
19