def orthologs_iterator(fo, version):
species_list = config["<STR_LIT>"].get("<STR_LIT>", [])<EOL>fo.seek(<NUM_LIT:0>)<EOL>with gzip.open(fo, "<STR_LIT>") as f:<EOL><INDENT>for line in f:<EOL><INDENT>edge = json.loads(line)<EOL>if "<STR_LIT>" in edge:<EOL><INDENT>source = edge["<STR_LIT>"]["<STR_LIT:source>"]<EOL>continue<EOL><DEDENT>if "<STR_LIT>" in edge:<EOL><INDENT>edge = edge["<STR_LIT>"]<EOL>subj_tax_id = edge["<STR_LIT>"]["<STR_LIT>"]<EOL>obj_tax_id = edge["<STR_LIT:object>"]["<STR_LIT>"]<EOL>if species_list and subj_tax_id and subj_tax_id not in species_list:<EOL><INDENT>continue<EOL><DEDENT>if species_list and obj_tax_id and obj_tax_id not in species_list:<EOL><INDENT>continue<EOL><DEDENT>subj_key = arangodb.arango_id_to_key(edge["<STR_LIT>"]["<STR_LIT:id>"])<EOL>subj_id = edge["<STR_LIT>"]["<STR_LIT:id>"]<EOL>obj_key = arangodb.arango_id_to_key(edge["<STR_LIT:object>"]["<STR_LIT:id>"])<EOL>obj_id = edge["<STR_LIT:object>"]["<STR_LIT:id>"]<EOL>yield (<EOL>arangodb.ortholog_nodes_name,<EOL>{<EOL>"<STR_LIT>": subj_key,<EOL>"<STR_LIT:name>": subj_id,<EOL>"<STR_LIT>": edge["<STR_LIT>"]["<STR_LIT>"],<EOL>"<STR_LIT:source>": source,<EOL>"<STR_LIT:version>": version,<EOL>},<EOL>)<EOL>yield (<EOL>arangodb.ortholog_nodes_name,<EOL>{<EOL>"<STR_LIT>": obj_key,<EOL>"<STR_LIT:name>": obj_id,<EOL>"<STR_LIT>": edge["<STR_LIT:object>"]["<STR_LIT>"],<EOL>"<STR_LIT:source>": source,<EOL>"<STR_LIT:version>": version,<EOL>},<EOL>)<EOL>arango_edge = {<EOL>"<STR_LIT>": f"<STR_LIT>",<EOL>"<STR_LIT>": f"<STR_LIT>",<EOL>"<STR_LIT>": bel.utils._create_hash(f"<STR_LIT>"),<EOL>"<STR_LIT:type>": "<STR_LIT>",<EOL>"<STR_LIT:source>": source,<EOL>"<STR_LIT:version>": version,<EOL>}<EOL>yield (arangodb.ortholog_edges_name, arango_edge)<EOL><DEDENT><DEDENT><DEDENT>
Ortholog node and edge iterator