Skip to content

Commit

Permalink
Merge pull request #1 from dyaus-dev/develop
Browse files Browse the repository at this point in the history
Update files
  • Loading branch information
Hiroaki Imoto committed Apr 2, 2021
2 parents 2c95366 + d3af964 commit e3c7168
Show file tree
Hide file tree
Showing 289 changed files with 38,416 additions and 136 deletions.
76 changes: 76 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at himoto@protein.osaka-u.ac.jp. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Tests

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

jobs:
build:

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

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install biomass tqdm pytest
- name: Test with pytest
run: |
pytest
31 changes: 10 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ figure/

# fit_param
out/
!/training/erbb_network_jl/dat2npy/out/

# patient-specific models
TCGA_*
!/models/breast/TCGA_3C_AALK_01A

# sensitivity array
sensitivity_coefficients/
Expand All @@ -21,7 +26,7 @@ optimization_results/
errout/

# transcriptomic data
transcriptomic_data/
transcriptomic_data/*.csv

# Python ---

Expand Down Expand Up @@ -82,22 +87,6 @@ cover/
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/
Expand Down Expand Up @@ -142,12 +131,12 @@ vignettes/*.pdf
.httr-oauth

# knitr and R markdown default cache directories
*_cache/
/cache/
*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md
*.utf8.md
*.knit.md

# R Environment Variables
.Renviron
Expand Down
88 changes: 49 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# dyaus_breast
# breast_cancer

[![License](https://img.shields.io/badge/License-Apache%202.0-brightgreen.svg)](https://opensource.org/licenses/Apache-2.0)
[![Actions Status](https://github.com/dyaus-dev/breast_cancer/workflows/Tests/badge.svg)](https://github.com/dyaus-dev/breast_cancer/actions)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://github.com/dyaus-dev/breast_cancer/blob/master/LICENSE)

Workflow for classifying breast cancer subtypes based on intracellular signaling dynamics.

Expand All @@ -12,13 +13,7 @@ Workflow for classifying breast cancer subtypes based on intracellular signaling
| Julia >= 1.5 | [BioMASS.jl](https://github.com/himoto/BioMASS.jl) |
| R | [TODO] Write dependent packages here. |

## Individualization of the mechanistic model

### Integrate TCGA and CCLE data

[TODO] Write analysis procedure here.

### Build an executable model of the ErbB signaling network
## An executable model of the ErbB network dynamics

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

Expand All @@ -28,10 +23,12 @@ Workflow for classifying breast cancer subtypes based on intracellular signaling
Text2Model("models/erbb_network.txt").to_biomass()
```

1. Rename **erbb_network/** to CCLE_name or TCGA_ID
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 (`'w_XXX'`)

- Add weighting factors for each gene (prefix: `"w_"`)

1. Edit **set_search_param.py**

- Import `dyaus.Individualization`
Expand Down Expand Up @@ -86,22 +83,30 @@ Workflow for classifying breast cancer subtypes based on intracellular signaling
for i, j in enumerate(self.idx_initials):
y0[j] = indiv[i + len(self.idx_params)]

x[C.V291] = incorporating_gene_expression_levels.as_maximal_transcription_rate(
# As maximal transcription rate
x[C.V291] = incorporating_gene_expression_levels.as_reaction_rate(
__path__[0].split(os.sep)[-1], x, "V291", "DUSP"
)
x[C.V310] = incorporating_gene_expression_levels.as_maximal_transcription_rate(
x[C.V310] = incorporating_gene_expression_levels.as_reaction_rate(
__path__[0].split(os.sep)[-1], x, "V310", "cMyc"
)
y0 = incorporating_gene_expression_levels.as_initial_condition(
# As initial conditions
y0 = incorporating_gene_expression_levels.as_initial_conditions(
__path__[0].split(os.sep)[-1], x, y0
)

...
```

### Train model parameters against time-course datasets obtained from breast cancer cell lines
## Individualization of the mechanistic model

### Integrate TCGA and CCLE data

[TODO] Write analysis procedure here.

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

1. Use `biomass.Text2Model` to build a mechanistic model for parameter estimation with BioMASS.jl
1. Build a mechanistic model for parameter estimation with BioMASS.jl

```python
from biomass import Text2Model
Expand All @@ -120,17 +125,38 @@ Workflow for classifying breast cancer subtypes based on intracellular signaling
$ cd training
$ mkdir errout
$ sh optimize_parallel.sh
$ cd ..
```

When finished, run:

```julia
using BioMASS

param2biomass(".")
param2biomass("training")
```

And you will get **dat2npy/out/**. This is the optimized parameter sets that biomass can load. Copy **out/** to each biomass model folder.
And you will get **dat2npy/out/**. This is the optimized parameter sets that biomass can load.
Copy **out/** to each biomass model folder via:

```python
import os
import shutil

models = []
path_to_models = os.path.join("models", "breast")
for f in os.listdir(path_to_models):
if os.path.isdir(os.path.join(path_to_models, f)) and (
f.startswith("TCGA_") or f.endswith("_BREAST")
):
models.append(f)
# Set optimized parameter sets
for model in models:
shutil.copytree(
os.path.join("training", "dat2npy", "out"),
os.path.join(path_to_models, f"{model}", "out"),
)
```

### Execute patient-specific models

Expand All @@ -143,33 +169,17 @@ Workflow for classifying breast cancer subtypes based on intracellular signaling
from dyaus import PatientModelSimulations


with open (
os.path.join(
"models",
"breast",
"sample_names.txt",
), mode="r"
) as f:
with open (os.path.join("models", "breast", "sample_names.txt"), mode="r") as f:
TCGA_ID = f.read().splitlines()

# Create patient-specific models
for patient in TCGA_ID:
if patient != "TCGA_3C_AALK_01A":
shutil.copytree(
os.path.join(
"models",
"breast",
"TCGA_3C_AALK_01A",
),
os.path.join(
"models",
"breast",
f"{patient}",
)
os.path.join("models", "breast", "TCGA_3C_AALK_01A"),
os.path.join("models", "breast", f"{patient}"),
)

# Execute patient-specific models
simulations = PatientModelSimulations("models.breast", TCGA_ID)

simulations.run()
```

Expand All @@ -179,4 +189,4 @@ Workflow for classifying breast cancer subtypes based on intracellular signaling

## License

[Apache-2.0 License](https://opensource.org/licenses/Apache-2.0)
[Apache License 2.0](LICENSE)
10 changes: 10 additions & 0 deletions dyaus_dev/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Dynamics-driven automatic subtyping"""

__author__ = ", ".join(["Hiroaki Imoto", "Sawa Yamashiro"])
__maintainer__ = "Hiroaki Imoto"
__email__ = "himoto@protein.osaka-u.ac.jp"
__version__ = "0.0.1"


from .individualization import Individualization
from .patient_model import PatientModelAnalyses, PatientModelSimulations
Loading

0 comments on commit e3c7168

Please sign in to comment.