Skip to content

Commit

Permalink
Moved code to write protein nodes out of block that write gene -> pro…
Browse files Browse the repository at this point in the history
…tein edges - I think that's a bug
  • Loading branch information
justaddcoffee committed Jun 17, 2020
1 parent 4afc529 commit 44e7df1
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions kg_covid_19/transform_utils/string_ppi/string_ppi.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,35 +203,35 @@ def run(self, data_file: Optional[str] = None) -> None:
] + self.extra_header
)

# write node data
if protein not in seen_proteins:
seen_proteins.add(protein)
write_node_edge_item(
fh=node,
header=self.node_header,
data=[f"ENSEMBL:{protein}", "",
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 data
if protein not in seen_proteins:
seen_proteins.add(protein)
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)
data=[f"ENSEMBL:{protein}", "",
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 protein in string_to_uniprot_id_map:
uniprot_curie = \
f"UniprotKB:{string_to_uniprot_id_map[protein]}"
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 44e7df1

Please sign in to comment.