Mercurial > repos > earlhaminst > gstf_preparation
comparison gstf_preparation.py @ 3:7e11a7f4bdba draft
planemo upload for repository https://github.com/TGAC/earlham-galaxytools/tree/master/tools/gstf_preparation commit 77ed525b753e34d3e9dd4f07a239592ce764f7e6-dirty
author | earlhaminst |
---|---|
date | Fri, 24 Nov 2017 12:32:39 -0500 |
parents | a36645976342 |
children | 284f64ad9d43 |
comparison
equal
deleted
inserted
replaced
2:19644996bc2a | 3:7e11a7f4bdba |
---|---|
218 | 218 |
219 def write_gene_dict_to_db(conn, gene_dict): | 219 def write_gene_dict_to_db(conn, gene_dict): |
220 cur = conn.cursor() | 220 cur = conn.cursor() |
221 | 221 |
222 for gene in gene_dict.values(): | 222 for gene in gene_dict.values(): |
223 if gene is None: | |
224 # This can happen when loading a JSON file from Ensembl | |
225 continue | |
223 gene_id = gene['id'] | 226 gene_id = gene['id'] |
224 cur.execute('INSERT INTO gene (gene_id, gene_symbol, species, gene_json) VALUES (?, ?, ?, ?)', | 227 cur.execute('INSERT INTO gene (gene_id, gene_symbol, species, gene_json) VALUES (?, ?, ?, ?)', |
225 (gene_id, gene.get('display_name', None), gene['species'], json.dumps(gene))) | 228 (gene_id, gene.get('display_name', None), gene['species'], json.dumps(gene))) |
226 | 229 |
227 if "Transcript" in gene: | 230 if "Transcript" in gene: |