PageRenderTime 113ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/visualization/build_ucsc_custom_track_code.py

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