def run(self, records, total=None, fast_run=True, write=True):
records = self.filter(records)
for record in tqdm(records, mininterval=2, total=total):
entrez_gene = str(record['entrezgene']['@value'])
if entrez_gene not in self.gene_wdid_mapping:
wdi_core.WDItemEngine.log("WARNING", format_msg(entrez_gene, "P351", None,
"Gene item not found during protein creation", None))
continue
gene_wdid = self.gene_wdid_mapping[entrez_gene]
# handle multiple protiens
if 'uniprot' in record and 'Swiss-Prot' in record['uniprot']['@value']:
uniprots = record['uniprot']['@value']['Swiss-Prot']
for uniprot in uniprots:
record['uniprot']['@value']['Swiss-Prot'] = uniprot
self.run_one(record, gene_wdid, write)
else:
self.run_one(record, gene_wdid, write)
评论列表
文章目录