comparison data_manager/data_manager_snpEff_download.py @ 3:c6769a700e55

Update loc data to separate version 4 databases
author Jim Johnson <jj@umn.edu>
date Tue, 21 Oct 2014 14:04:33 -0500
parents bc50aa3b328a
children 78bcf4ac437c
comparison
equal deleted inserted replaced
2:5a01e5cfa6bc 3:c6769a700e55
108 for fname in files: 108 for fname in files:
109 if fname.startswith('snpEffectPredictor'): 109 if fname.startswith('snpEffectPredictor'):
110 # if snpEffectPredictor.bin download succeeded 110 # if snpEffectPredictor.bin download succeeded
111 name = genome_version + (' : ' + organism if organism else '') 111 name = genome_version + (' : ' + organism if organism else '')
112 data_table_entry = dict(value=genome_version, name=name, path=data_dir) 112 data_table_entry = dict(value=genome_version, name=name, path=data_dir)
113 _add_data_table_entry( data_manager_dict, 'snpeff_genomedb', data_table_entry ) 113 _add_data_table_entry( data_manager_dict, 'snpeff4_genomedb', data_table_entry )
114 else: 114 else:
115 m = re.match(regulation_pattern,fname) 115 m = re.match(regulation_pattern,fname)
116 if m: 116 if m:
117 name = m.groups()[0] 117 name = m.groups()[0]
118 data_table_entry = dict(genome=genome_version,value=name, name=name) 118 data_table_entry = dict(genome=genome_version,value=name, name=name)
119 _add_data_table_entry( data_manager_dict, 'snpeff_regulationdb', data_table_entry ) 119 _add_data_table_entry( data_manager_dict, 'snpeff4_regulationdb', data_table_entry )
120 elif fname in annotations_dict: 120 elif fname in annotations_dict:
121 value = annotations_dict[fname] 121 value = annotations_dict[fname]
122 name = value.lstrip('-') 122 name = value.lstrip('-')
123 data_table_entry = dict(genome=genome_version,value=value, name=name) 123 data_table_entry = dict(genome=genome_version,value=value, name=name)
124 _add_data_table_entry( data_manager_dict, 'snpeff_annotations', data_table_entry ) 124 _add_data_table_entry( data_manager_dict, 'snpeff4_annotations', data_table_entry )
125 return data_manager_dict 125 return data_manager_dict
126 126
127 def _add_data_table_entry( data_manager_dict, data_table, data_table_entry ): 127 def _add_data_table_entry( data_manager_dict, data_table, data_table_entry ):
128 data_manager_dict['data_tables'] = data_manager_dict.get( 'data_tables', {} ) 128 data_manager_dict['data_tables'] = data_manager_dict.get( 'data_tables', {} )
129 data_manager_dict['data_tables'][data_table] = data_manager_dict['data_tables'].get( data_table, [] ) 129 data_manager_dict['data_tables'][data_table] = data_manager_dict['data_tables'].get( data_table, [] )