Skip to content

Commit

Permalink
fix for bug with different genotype for same allele in different moduals
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Karmazin committed Oct 10, 2023
1 parent 14a2fe5 commit 890a204
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions coronary_ref_homo.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def setup(self, parent, result_cursor:sqlite3.Cursor, data_cursor:sqlite3.Cursor
self.result_cursor: sqlite3.Cursor = result_cursor
self.data_cursor: sqlite3.Cursor = data_cursor

sql:str = "SELECT rsID, Risk_allele FROM coronary_disease WHERE state = 'ref' AND zygosity = 'hom'"
sql:str = "SELECT rsID, Ref_allele FROM coronary_disease WHERE state = 'ref' AND zygosity = 'hom'"
self.data_cursor.execute(sql)
rows:list = self.data_cursor.fetchall()
for rsid, risk_allele in rows:
self.rsid_map[rsid] = {'exist':True, 'risk':risk_allele}
for rsid, ref_allele in rows:
self.rsid_map[rsid] = {'exist':True, 'ref':ref_allele}


def process_row(self, row):
Expand All @@ -37,11 +37,11 @@ def process_row(self, row):
def end(self) -> None:
for rsid in self.rsid_map:
if self.rsid_map[rsid]['exist']:
risk:str = self.rsid_map[rsid]['risk']
risk = risk+risk
ref:str = self.rsid_map[rsid]['ref']
ref = ref+ref

query:str = "SELECT Risk_allele, Gene, Genotype, Conclusion, Weight, PMID, Population, GWAS_study_design, P_value " \
f"FROM coronary_disease WHERE rsID = '{rsid}' AND Genotype = '{risk}';"
f"FROM coronary_disease WHERE rsID = '{rsid}' AND Genotype = '{ref}';"

self.data_cursor.execute(query)
row:list = self.data_cursor.fetchone()
Expand Down

0 comments on commit 890a204

Please sign in to comment.