comparison TrustStoreGalaxyBrowse.py @ 22:fb915c3aefb2

.fa => fasta
author Wise, Catherine (Digital, Acton) <Catherine.Wise@csiro.au>
date Thu, 25 Jun 2015 14:05:33 +1000
parents 4819fbb59766
children 194cf7e7e936
comparison
equal deleted inserted replaced
21:4819fbb59766 22:fb915c3aefb2
94 From https://github.com/mdshw5/galaxy-json-data-source/blob/master/json_data_source.py 94 From https://github.com/mdshw5/galaxy-json-data-source/blob/master/json_data_source.py
95 """ 95 """
96 filename = "%s_%s_%s_%s_%s" % ('primary', id, name, 'visible', file_type) 96 filename = "%s_%s_%s_%s_%s" % ('primary', id, name, 'visible', file_type)
97 return filename 97 return filename
98 98
99 def metadata_to_json(dataset_id, filename, name, extesion, ds_type='dataset', primary=False): 99 def metadata_to_json(dataset_id, filename, name, extension, ds_type='dataset', primary=False):
100 """ Return line separated JSON 100 """ Return line separated JSON
101 From https://github.com/mdshw5/galaxy-json-data-source/blob/master/json_data_source.py 101 From https://github.com/mdshw5/galaxy-json-data-source/blob/master/json_data_source.py
102 """ 102 """
103 ext = extension
104 if ext == 'fa':
105 ext = 'fasta'
103 meta_dict = dict(type=ds_type, 106 meta_dict = dict(type=ds_type,
104 ext=extesion, 107 ext=extension,
105 filename=filename, 108 filename=filename,
106 name=name, 109 name=name,
107 metadata={}) 110 metadata={})
108 if primary: 111 if primary:
109 meta_dict['base_dataset_id'] = dataset_id 112 meta_dict['base_dataset_id'] = dataset_id