化疗bug

master
chaopower 2024-01-16 10:32:25 +08:00
parent ec9570521b
commit a8359efead
1 changed files with 9 additions and 7 deletions

View File

@ -98,13 +98,7 @@ class ChemoRun:
chrom = row['chr'] chrom = row['chr']
end = row['end'] end = row['end']
fliter = pd.DataFrame() fliter = pd.DataFrame()
if (chrom, end) not in records: if (chrom, end) in records:
fliter = pd.concat([fliter, drug_rsid_data[
(drug_rsid_data['chr'] == chrom) &
(drug_rsid_data['end'] == end) &
(drug_rsid_data['genotype'] == '0/0')
]])
else:
record = records[(chrom, end)] record = records[(chrom, end)]
ref = record.ref ref = record.ref
alt = record.alts[0] alt = record.alts[0]
@ -123,6 +117,14 @@ class ChemoRun:
(drug_rsid_data['alt'] == alt) & (drug_rsid_data['alt'] == alt) &
(drug_rsid_data['genotype'] == gt) (drug_rsid_data['genotype'] == gt)
]]) ]])
if fliter.empty:
fliter = pd.concat([fliter, drug_rsid_data[
(drug_rsid_data['chr'] == chrom) &
(drug_rsid_data['end'] == end) &
(drug_rsid_data['genotype'] == '0/0')
]])
if fliter.empty: if fliter.empty:
raise UserWarning( raise UserWarning(
'chr: %s , end: %s 数据库未能匹配, 野生型0/0也未能匹配' % (chrom, end)) 'chr: %s , end: %s 数据库未能匹配, 野生型0/0也未能匹配' % (chrom, end))