Skip to content

Commit

Permalink
Moved code to write/edges for xref to Uniprot IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
justaddcoffee committed Jun 17, 2020
1 parent 134a62e commit 4afc529
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions kg_covid_19/transform_utils/string_ppi/string_ppi.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,25 +213,25 @@ def run(self, data_file: Optional[str] = None) -> None:
protein_node_type, "", "", self.source_name]
)

# if we have an equivalent Uniprot ID for this Ensembl protein
# ID make an xref edge, and a node for the Uniprot ID
if nat_string_id in string_to_uniprot_id_map:
uniprot_curie = \
f"UniprotKB:{string_to_uniprot_id_map[nat_string_id]}"
write_node_edge_item(
fh=node,
header=self.node_header,
data=[uniprot_curie, "",
protein_node_type, "", "", self.source_name])
write_node_edge_item(
fh=edge,
header=self.edge_header,
data=[f"ENSEMBL:{protein}",
"biolink:xrefs",
uniprot_curie,
"biolink:xrefs",
"uniprot",
] + self.extra_header)
# if we have an equivalent Uniprot ID for this Ensembl protein
# ID make an xref edge, and a node for the Uniprot ID
if nat_string_id in string_to_uniprot_id_map:
uniprot_curie = \
f"UniprotKB:{string_to_uniprot_id_map[nat_string_id]}"
write_node_edge_item(
fh=node,
header=self.node_header,
data=[uniprot_curie, "",
protein_node_type, "", "", self.source_name])
write_node_edge_item(
fh=edge,
header=self.edge_header,
data=[f"ENSEMBL:{protein}",
"biolink:xrefs",
uniprot_curie,
"biolink:xrefs",
"uniprot",
] + self.extra_header)

# write edge data
write_node_edge_item(
Expand Down

0 comments on commit 4afc529

Please sign in to comment.