annotate build_ucsc_custom_track_code.py @ 1:2e057d4433b2 draft

planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
author devteam
date Tue, 13 Oct 2015 12:34:12 -0400
parents 783448899c63
children f1fd9e6e026e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
1 # runs after the job (and after the default post-filter)
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
2
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
3 # Older py compatibility
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
4 try:
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
5 set()
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
6 except:
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
7 from sets import Set as set
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
8
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
9 def validate_input( trans, error_map, param_values, page_param_map ):
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
10 dbkeys = set()
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
11 tracks = param_values['tracks']
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
12 for track in tracks:
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
13 if track['input']:
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
14 dbkeys.add( track['input'].dbkey )
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
15 if len( dbkeys ) > 1:
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
16 # FIXME: Should be able to assume error map structure is created
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
17 if 'tracks' not in error_map:
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
18 error_map['tracks'] = [ dict() for t in tracks ]
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
19 for i in range( len( tracks ) ):
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
20 error_map['tracks'][i]['input'] = \
783448899c63 Imported from capsule None
devteam
parents:
diff changeset
21 "All datasets must belong to same genomic build"