annotate build_ucsc_custom_track_code.py @ 0:618e56c3109b draft

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