Skip to content

Commit

Permalink
Merge pull request #2 from dyaus-dev/develop
Browse files Browse the repository at this point in the history
Update parameter sets
  • Loading branch information
Hiroaki Imoto committed Apr 27, 2021
2 parents e3c7168 + cedd83d commit 7416d7a
Show file tree
Hide file tree
Showing 171 changed files with 19,092 additions and 1,399 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@

name: Tests

on:
push:
branches: [master]
pull_request:
branches: [master]
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2
Expand Down
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,38 @@ Workflow for classifying breast cancer subtypes based on intracellular signaling

## Requirements

| Language | Dependent packages |
| ------------- | ---------------------------------------------------------------------------------------------- |
| Python >= 3.7 | [biomass](https://github.com/okadalabipr/biomass), [dyaus](https://github.com/dyaus-dev/dyaus) |
| Julia >= 1.5 | [BioMASS.jl](https://github.com/himoto/BioMASS.jl) |
| R | [TODO] Write dependent packages here. |
| Language | Dependent packages |
| ------------- | -------------------------------------------------- |
| Python >= 3.7 | [dyaus](https://github.com/dyaus-dev/dyaus) |
| Julia >= 1.5 | [BioMASS.jl](https://github.com/himoto/BioMASS.jl) |
| R >= 4.0 | TCGAbiolinks, sva, biomaRt, edgeR |

## An executable model of the ErbB network dynamics
## Table of contents

1. Use `biomass.Text2Model` to build a mechanistic model
- [Construction](#construction-of-a-comprehensive-model-of-the-ErbB-signaling-network)

- [Integration](#integration-of-tcga-and-ccle-data)

- [Individualization](#individualization-of-the-mechanistic-model)

- [Classification](#subtype-classification-based-on-the-ErbB-signaling-dynamics)

## Construction of a comprehensive model of the ErbB signaling network

1. Use `dyaus.Text2Model` to build a mechanistic model

```python
from biomass import Text2Model
from dyaus import Text2Model

Text2Model("models/erbb_network.txt").to_biomass()
Text2Model("models/erbb_network.txt").to_biomass_model()
```

1. Rename **erbb_network/** to CCLE_name or TCGA_ID, e.g., **MCF7_BREAST** or **TCGA_3C_AALK_01A**

1. Edit **name2idx/parameters.py**

- Add weighting factors for each gene (prefix: `"w_"`)
1. Add weighting factors for each gene (prefix: `"w_"`) to **name2idx/parameters.py**

1. Edit **set_search_param.py**

- Import `dyaus.Individualization`

```python
import os

Expand Down Expand Up @@ -98,20 +104,20 @@ Workflow for classifying breast cancer subtypes based on intracellular signaling
...
```

## Individualization of the mechanistic model

### Integrate TCGA and CCLE data
## Integration of TCGA and CCLE data

[TODO] Write analysis procedure here.

## Individualization of the mechanistic model

### Use time-course datasets to train kinetic constants and weighting factors

1. Build a mechanistic model for parameter estimation with BioMASS.jl

```python
from biomass import Text2Model
from dyaus import Text2Model

Text2Model("models/erbb_network.txt", lang="julia").to_biomass()
Text2Model("models/erbb_network.txt", lang="julia").to_biomass_model()
```

1. Add time-series data to **experimental_data.jl**
Expand Down Expand Up @@ -189,4 +195,4 @@ Workflow for classifying breast cancer subtypes based on intracellular signaling

## License

[Apache License 2.0](LICENSE)
[Apache License 2.0](https://github.com/dyaus-dev/dyaus/blob/master/LICENSE)
16 changes: 14 additions & 2 deletions dyaus_dev/individualization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass, field
from typing import Dict, List
from typing import Dict, List, Optional

import pandas as pd

Expand All @@ -23,6 +23,9 @@ class Individualization(object):
structure : Dict[str, List[str]]
Pairs of proteins and their related genes.
read_csv_kwargs : dict, optional
Arguments to pandas.read_csv.
prefix : str (default: "w_")
Prefix of weighting factors on gene expression levels.
"""
Expand All @@ -31,10 +34,16 @@ class Individualization(object):
species: List[str]
tpm_values: str
structure: Dict[str, List[str]]
read_csv_kwargs: Optional[dict] = field(default=None)
prefix: str = field(default="w_", init=False)

def __post_init__(self) -> None:
self._tpm_rle_postComBat: pd.DataFrame = pd.read_csv(self.tpm_values, index_col=2)
kwargs = self.read_csv_kwargs
if kwargs is None:
kwargs = {}
kwargs.setdefault("index_col", 2)
self._tpm_rle_postComBat: pd.DataFrame = pd.read_csv(self.tpm_values, **kwargs)
del kwargs

@property
def tpm_rle_postComBat(self):
Expand Down Expand Up @@ -87,6 +96,9 @@ def as_reaction_rate(
id : str
CCLE_ID or TCGA_ID.
x : List[float]
List of parameter values.
param_name : str
Parameter incorporating gene_expression_data.
Expand Down
46 changes: 23 additions & 23 deletions dyaus_dev/patient_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ class PatientModelSimulations(InSilico):
Attributes
----------
biomass_options : dict, optional
Arguments of biomass.run_simulation.
biomass_kwargs : dict, optional
Arguments to biomass.run_simulation.
"""

biomass_options: Optional[dict] = field(default=None)
biomass_kwargs: Optional[dict] = field(default=None)

def _run_single_patient(self, patient: str) -> None:
"""
Expand All @@ -107,17 +107,17 @@ def _run_single_patient(self, patient: str) -> None:
Name (ID) of each patient.
"""

options = self.biomass_options
if options is None:
options = {}
options.setdefault("viz_type", "average")
options.setdefault("show_all", False)
options.setdefault("stdev", True)
options.setdefault("save_format", "pdf")
options.setdefault("param_range", None)
kwargs = self.biomass_kwargs
if kwargs is None:
kwargs = {}
kwargs.setdefault("viz_type", "average")
kwargs.setdefault("show_all", False)
kwargs.setdefault("stdev", True)
kwargs.setdefault("save_format", "pdf")
kwargs.setdefault("param_range", None)

biomass_model = self.import_model_package(patient.strip())
run_simulation(ModelObject(biomass_model.create()), **options)
run_simulation(ModelObject(biomass_model.create()), **kwargs)

def run(self, n_proc: int = multiprocessing.cpu_count() - 1) -> None:
"""
Expand All @@ -139,11 +139,11 @@ class PatientModelAnalyses(InSilico):
Attributes
----------
biomass_options : dict, optional
Arguments of biomass.run_analysis.
biomass_kwargs : dict, optional
Arguments to biomass.run_analysis.
"""

biomass_options: Optional[dict] = field(default=None)
biomass_kwargs: Optional[dict] = field(default=None)

def _run_single_patient(self, patient: str) -> None:
"""
Expand All @@ -155,16 +155,16 @@ def _run_single_patient(self, patient: str) -> None:
Name (ID) of each patient.
"""

options = self.biomass_options
if options is None:
options = {}
options.setdefault("target", "initial_condition")
options.setdefault("metric", "integral")
options.setdefault("style", "barplot")
options.setdefault("options", None)
kwargs = self.biomass_kwargs
if kwargs is None:
kwargs = {}
kwargs.setdefault("target", "initial_condition")
kwargs.setdefault("metric", "integral")
kwargs.setdefault("style", "barplot")
kwargs.setdefault("options", None)

biomass_model = self.import_model_package(patient.strip())
run_analysis(ModelObject(biomass_model.create()), **options)
run_analysis(ModelObject(biomass_model.create()), **kwargs)

def run(self, n_proc: int = multiprocessing.cpu_count() - 1) -> None:
"""
Expand Down
4 changes: 2 additions & 2 deletions models/erbb_network.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ E11P_Grb2_Gab1P_RasGAP_RasGTP is degraded |268|
E11P_ShcP_Grb2_Gab1P_RasGAP_RasGTP is degraded |268|
E11P_Grb2_Gab1P_PI3K is degraded |268|
E11P_ShcP_Grb2_Gab1P_PI3K is degraded |268|
ERKPP transcribes PreduspmRNA | n = 1
ERKPP transcribes PreduspmRNA | const n = 1
PreduspmRNA is translocated from nucleus into cytoplasm (0.22, 0.94) --> duspmRNA | kr = 0
duspmRNA is translated into DUSP
duspmRNA is degraded
Expand All @@ -307,7 +307,7 @@ DUSPP_ERKP is dissociated into ERK and DUSPP |301|
ERK binds DUSPP --> DUSPP_ERK |302|
AktP phosphorylates GSK3b --> GSK3bP || GSK3b = 1
GSK3bP is dephosphorylated --> GSK3b
ERKPP transcribes PrecmycmRNA, repressed by cMycP | n = 1
ERKPP transcribes PrecmycmRNA, repressed by cMycP | const n = 1
PrecmycmRNA is translocated from nucleus into cytoplasm (0.22, 0.94) --> cmycmRNA | kr = 0
cmycmRNA is degraded
cmycmRNA is translated into cMyc
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 7416d7a

Please sign in to comment.