PageRenderTime 33ms CodeModel.GetById 22ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

/tools/visualization/build_ucsc_custom_track_code.py

https://bitbucket.org/cistrome/cistrome-harvard/
Python | 21 lines | 16 code | 2 blank | 3 comment | 11 complexity | 1578fe3c5a9bdeff0847af8a73f48158 MD5 | raw file
 1# runs after the job (and after the default post-filter)
 2
 3# Older py compatibility
 4try:
 5    set()
 6except:
 7    from sets import Set as set
 8
 9def validate_input( trans, error_map, param_values, page_param_map ):
10    dbkeys = set()
11    tracks = param_values['tracks']
12    for track in tracks:
13        if track['input']:
14            dbkeys.add( track['input'].dbkey )
15    if len( dbkeys ) > 1:
16        # FIXME: Should be able to assume error map structure is created
17        if 'tracks' not in error_map:
18            error_map['tracks'] = [ dict() for t in tracks ]
19            for i in range( len( tracks ) ):
20                error_map['tracks'][i]['input'] = \
21                    "All datasets must belong to same genomic build"