Skip to content

Commit

Permalink
only keep NCBIGene or UniProtKB subjects/objects from biogrid
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaper committed Jan 2, 2024
1 parent 3d1b0a8 commit cfee8c4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
25 changes: 14 additions & 11 deletions src/monarch_ingest/ingests/biogrid/biogrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@

publications = get_publication_ids(row['Publication Identifiers'])

association = PairwiseGeneToGeneInteraction(
id="uuid:" + str(uuid.uuid1()),
subject=gid_a,
predicate="biolink:interacts_with",
object=gid_b,
has_evidence=evidence,
publications=publications,
primary_knowledge_source="infores:biogrid",
aggregator_knowledge_source=["infores:monarchinitiative"]
)
# Only keep interactions using NCBIGene or UniProtKB identifiers, could also filter on taxid
if gid_a.startswith("NCBIGene:") or gid_a.startswith("UniProtKB:") \
and gid_b.startswith("NCBIGene:") or gid_b.startswith("UniProtKB:"):
association = PairwiseGeneToGeneInteraction(
id="uuid:" + str(uuid.uuid1()),
subject=gid_a,
predicate="biolink:interacts_with",
object=gid_b,
has_evidence=evidence,
publications=publications,
primary_knowledge_source="infores:biogrid",
aggregator_knowledge_source=["infores:monarchinitiative"]
)

koza_app.write(association)
koza_app.write(association)
5 changes: 4 additions & 1 deletion src/monarch_ingest/ingests/biogrid/biogrid_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def get_gene_id(raw_id: str) -> str:
:param raw_id: str, raw BioGRID input string (a pseudo-CURIE)
:return:
"""
gid = raw_id.replace("entrez gene/locuslink", "NCBIGene")
gid = (raw_id
.replace("entrez gene/locuslink:", "NCBIGene:")
.replace("uniprot/swiss-prot:", "UniProtKB:"))

return gid


Expand Down

0 comments on commit cfee8c4

Please sign in to comment.