Skip to content

Commit

Permalink
perform update in function
Browse files Browse the repository at this point in the history
  • Loading branch information
talavis committed Apr 24, 2019
1 parent 7229753 commit 0dbd0e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/importer/data_importer/raw_data_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ def _insert_variants(self):
for x in alt_alleles]
fmt_alleles2 = [f'{base["chrom"]}-{base["pos"]}-{base["ref"]}-{x}' for x in alt_alleles]
if fmt_alleles != fmt_alleles2:
print(f"UPDATE data.variants SET orig_alt_alleles='{fmt_alleles2}' WHERE chrom='{base['chrom']} AND pos={base['pos']} AND ref='{base['ref']}'")
query = db.Variant.update(orig_alt_alleles=fmt_alleles2).where((chrom==base['chrom']) &
(pos==base['pos']) &
(ref=base['ref']))
query.execute()

for i, alt in enumerate(alt_alleles):
if not self.settings.beacon_only:
Expand Down

0 comments on commit 0dbd0e0

Please sign in to comment.