Skip to content

Commit

Permalink
update vcell_pipeline download for pydantic and improved test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Feb 5, 2024
1 parent 7fb69ed commit e2b7145
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 11 deletions.
40 changes: 39 additions & 1 deletion python-utils/tests/citation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,47 @@ def test_citation() -> None:
citation: Optional[CitationInfo] = getCitation(pubmedid="35367415")
assert citation is not None
assert citation.author == "Nosbisch, Jamie L"
assert citation.title == "A kinetic model of phospholipase C-γ1 linking structure-based insights to dynamics of enzyme autoinhibition and activation"
assert citation.title == ("A kinetic model of phospholipase C-γ1 linking structure-based insights to dynamics of "
"enzyme autoinhibition and activation")
assert citation.year == 2022
assert citation.journal == "J Biol Chem"

suggestedProjectName = getSuggestedProjectName(bm_key="12345", pub_info=None, citation_info=citation)
assert suggestedProjectName == "VCDB_12345_Nosbisch_JBiolChem_2022"


def test_get_citation():
pubmdeid = "35367415"
expected_title = ("A kinetic model of phospholipase C-γ1 linking structure-based insights to dynamics of "
"enzyme autoinhibition and activation")
expected_year = 2022
expected_journal = "J Biol Chem"
expected_author = "Nosbisch, Jamie L"
expected_abstract = ("Phospholipase C-γ1 (PLC-γ1) is a receptor-proximal enzyme that promotes signal transduction "
"through PKC in mammalian cells. Because of the complexity of PLC-γ1 regulation, a two-state "
"(inactive/active) model does not account for the intricacy of activation and inactivation "
"steps at the plasma membrane. Here, we introduce a structure-based kinetic model of PLC-γ1, "
"considering interactions of its regulatory Src homology 2 (SH2) domains and perturbation of "
"those dynamics upon phosphorylation of Tyr783, a hallmark of activation. For PLC-γ1 "
"phosphorylation to dramatically enhance enzyme activation as observed, we found that high "
"intramolecular affinity of the C-terminal SH2 (cSH2) domain-pTyr783 interaction is critical, "
"but this affinity need not outcompete the autoinhibitory interaction of the cSH2 domain. "
"Under conditions for which steady-state PLC-γ1 activity is sensitive to the rate of Tyr783 "
"phosphorylation, maintenance of the active state is surprisingly insensitive to the "
"phosphorylation rate, since pTyr783 is well protected by the cSH2 domain while the enzyme is "
"active. In contrast, maintenance of enzyme activity is sensitive to the rate of PLC-γ1 "
"membrane (re)binding. Accordingly, we found that hypothetical PLC-γ1 mutations that either "
"weaken autoinhibition or strengthen membrane binding influence the activation kinetics "
"differently, which could inform the characterization of oncogenic variants. Finally, we used "
"this newly informed kinetic scheme to refine a spatial model of PLC/PKC polarization during "
"chemotaxis. The refined model showed improved stability of the polarized pattern while "
"corroborating previous qualitative predictions. As demonstrated here for PLC-γ1, this "
"approach may be adapted to model the dynamics of other receptor- and membrane-proximal "
"enzymes.")
citation = getCitation(pubmedid=pubmdeid)
assert citation is not None
assert citation.abstract == expected_abstract
assert citation.author == expected_author
assert citation.title == expected_title
assert citation.year == expected_year
assert citation.journal == expected_journal
12 changes: 6 additions & 6 deletions python-utils/vcutils/vcell_pipeline/datamodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class Publication(BaseModel):
title: str
authors: list[str]
year: int
citation: Optional[str]
pubmedid: Optional[str]
doi: Optional[str]
endnoteid: Optional[str]
url: Optional[str]
wittid: Optional[str]
citation: Optional[str] = None
pubmedid: Optional[str] = None
doi: Optional[str] = None
endnoteid: Optional[str] = None
url: Optional[str] = None
wittid: Optional[str] = None
biomodelReferences: list[BiomodelReference]
mathmodelReferences: list[MathmodelReference]
date: str
8 changes: 4 additions & 4 deletions python-utils/vcutils/vcell_pipeline/download_vcell_omex.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from pydantic import BaseModel

from vcutils.common.api_utils import download_file
from .citation import getCitation, CitationInfo, getSuggestedProjectName
from .datamodels import Publication
from vcutils.vcell_pipeline.citation import getCitation, CitationInfo, getSuggestedProjectName
from vcutils.vcell_pipeline.datamodels import Publication


class ExportStatus(BaseModel):
Expand All @@ -26,14 +26,14 @@ def write_log(entry: ExportStatus, log_path: Path) -> None:
def download_published_omex(api_base_url: str, out_dir: Path) -> None:
log_path = Path(out_dir, "export.log")

response = requests.get(f"{api_base_url}/publication", headers={'Accept': 'application/json'}, verify=False)
response = requests.get(f"{api_base_url}/publication", headers={'Accept': 'application/json'}, verify=True, timeout=600)
publication_json = response.json()
pubs = [Publication(**jsonDict) for jsonDict in publication_json]

for pub in pubs:
if len(pub.biomodelReferences) == 0:
continue

print(f"Processing {pub.pubKey}, title: {pub.title}, year: {pub.year}, bimodels: {pub.biomodelReferences}")
bmKey = pub.biomodelReferences[0].bmKey
pubmedId: Optional[str] = pub.pubmedid
citationInfo: Optional[CitationInfo] = None
Expand Down

0 comments on commit e2b7145

Please sign in to comment.