comparison ensure_synced.py @ 9:05920a4bd5b6 draft default tip

Uploaded
author greg
date Sat, 16 Nov 2024 18:34:02 +0000
parents aaa6ae7c64de
children
comparison
equal deleted inserted replaced
8:aaa6ae7c64de 9:05920a4bd5b6
3 import argparse 3 import argparse
4 import sys 4 import sys
5 5
6 import psycopg2 6 import psycopg2
7 from sqlalchemy import create_engine 7 from sqlalchemy import create_engine
8 from sqlalchemy import MetaData
9 from sqlalchemy.engine.url import make_url 8 from sqlalchemy.engine.url import make_url
10
11 metadata = MetaData()
12 9
13 SKIP_VALS = ['#CHROM', 'POS', 'ID', 'REF', 'ALT', 'QUAL', 'FILTER', 'INFO', 'FORMAT'] 10 SKIP_VALS = ['#CHROM', 'POS', 'ID', 'REF', 'ALT', 'QUAL', 'FILTER', 'INFO', 'FORMAT']
14 11
15 12
16 class EnsureSynced(object): 13 class EnsureSynced(object):
19 self.conn = None 16 self.conn = None
20 self.parse_args() 17 self.parse_args()
21 self.outfh = open(self.args.output, "w") 18 self.outfh = open(self.args.output, "w")
22 self.connect_db() 19 self.connect_db()
23 self.engine = create_engine(self.args.database_connection_string) 20 self.engine = create_engine(self.args.database_connection_string)
24 self.metadata = MetaData(self.engine)
25 self.coral_mlg_rep_sample_ids_from_db = [] 21 self.coral_mlg_rep_sample_ids_from_db = []
26 self.affy_ids_from_file = [] 22 self.affy_ids_from_file = []
27 23
28 def connect_db(self): 24 def connect_db(self):
29 url = make_url(self.args.database_connection_string) 25 url = make_url(self.args.database_connection_string)