Git Product home page Git Product logo

detection_of_markers_for_discrete_phenotypes's Introduction

About

This repo contains the unformatted tex document for the publication "Detection of Markers for Discrete Phenotypes". The paper was published and is available at

A video of the presentation at CSBio21 is available here

If you have questions, want to discuss ideas or report errors and typos in the manuscript please open an issue or contact

The repo also contains a Python CLI tool, called biomarkers, that can be used to compute the markers for a given Boolean network and phenotype components.

Installation

To install the master branch use:

pip3 install pip --upgrade
pip3 install --force-reinstall git+https://github.com/hklarner/detection_of_markers_for_discrete_phenotypes

To install a tagged version use the @:

pip3 install pip --upgrade
pip3 install git+https://github.com/hklarner/[email protected]

The biomarkers tool

If the installation was successful you should be able to see the help menu for the biomarkers tool:

$ biomarkers -h
Usage: biomarkers [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

Options:
  -v, --version  Display version.
  -h, --help     Show this message and exit.

Commands:
  control-create             Create a control file.
  control-export             Export a control file.
  json-info                  Reads json file and prints summary.
  markers-export             Exports markers as CSV.
  markers-factorize          Factorizes a marker set.
  markers-count              Creates a marker count graph.
  markers-info               Prints info about a markers file.
  markers-validate           Validates a marker set.
  problem-create             Creates a marker detection problem.
  problem-info               Displays info about a problem file.
  problem-solve              Solves a marker detection problem.
  repo                       Access to the pyboolnet repository.
  steady-state-correlation   Computes the blocks of the steady state correlation.
  steady-state-matrix        Prints the steady state matrix.

To see the help text and available options of a command call the command with the option -h. E.g., to see the help text for the command markers-create call biomarks markers-create -h.

Use case 1: Marker detection

The computation of the markers is a two-step process. First, define a problem file by specifying a Boolean network and the phenotype subspace using the command problem-create:.

$ biomarkers problem-create --problem emt_problem.json --bnet selvaggio_emt --phenotype AJ_b1=0,AJ_b2=0

created json file: fname=emt_problem.json
n_steady_states: 1452
component_names: {0: 'AJ_b1', 1: 'AJ_b2'}
phenotype_subspace: {0: 0, 1: 0}
   phenotype_index         phenotype  n_steady_states
0                0  not {0: 0, 1: 0}              184
1                1      {0: 0, 1: 0}             1268

Instead of specifying a phenotype subspace you may specify the phenotype components:

$ biomarkers problem-create --problem emt_problem.json --bnet selvaggio_emt --phenotype AJ_b1,AJ_b2

created json file: fname=emt_problem.json
n_steady_states: 1452
component_names: {0: 'AJ_b1', 1: 'AJ_b2'}
phenotype_components: [0, 1]
   phenotype_index      phenotype  n_steady_states
0                0   {0: 0, 1: 0}             1268
1                1   {0: 1, 1: 1}              148
2                2   {0: 1, 1: 0}               36

The command creates a problem file in json format. To compute the markers for a problem file use the command problem-solve:

$ biomarkers problem-solve --problem emt_problem.json --forbidden AJ_b1,AJ_b2 --marker-size-max 5 --markers emt_markers.json

created tmp_program.asp
clingo --models=0 --opt-mode=optN --enum-mode=domRec --heuristic=Domain --dom-mod=5,16
cpu time: 0:02:09.400305
n_marker_sets=116
first 3 marker sets: [[4, 54], [4, 53], [4, 44]]
created json file: fname=emt_markers.json

The command creates a markers file in json format. To export a marker set in csv format use the command biomarkers markers-export:

$ biomarkers markers-export --markers emt_markers.json --csv emt_markers.csv

 index        name  count  likelihood
     2         AKT      8        0.07
     4     BCat_AJ      4        0.03
     9         ECM      8        0.07
    10        ECad     29        0.25
 ...
created emt_markers_counts.pdf
created emt_markers_counts.tex

The command markers-count counts how often network components appear as markers. The option --pdf maps the counts onto an interaction graph and --tex export the data as a tex table.

$ biomarkers markers-count -m emt_markers.json --pdf emt_markers_counts.pdf --tex emt_markers_counts.tex

To factorize a marker set use the command biomarkers markers-factorize and specify the markers file. The option --pdf creates, for each row in the table, a plot of the interaction graph with the marker subsets that make up the factorization highlighted:

$ biomarkers markers-factorize --markers emt_markers.json --pdf emt_markers_factorization

 n_components  n_markers                                          factorization  n_factors_used  n_factors_available
            2         16                         S(4,11,12,31) * S(10,44,53,54)               2                    2
            3         76                           S(10,44,53,54) * L(n=2,k=19)               2                    2
            4         24  S(42,43) * S(10,44,53,54) * {{24,13},{25,13},{24,14}}               3                    3
created emt_markers_factorization_n2.pdf
created emt_markers_factorization_n3.pdf
created emt_markers_factorization_n4.pdf

Developers

detection_of_markers_for_discrete_phenotypes's People

Contributors

hklarner avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

detection_of_markers_for_discrete_phenotypes's Issues

Example fails

biomarkers problem-create --problem emt_problem.json --bnet selvaggio_emt --phenotype AJ_b1=0,AJ_b2=0 fails for me with following error message
/home/td/.local/lib/python3.10/site-packages/pydantic/_internal/_config.py:334: UserWarning: Valid config keys have changed in V2: 'keep_untouched' has been renamed to 'ignored_types' warnings.warn(message, UserWarning) failed to create marker detection problem: error=1 validation error for Problem phenotype_components Field required [type=missing, input_value={'primes': {'AJ_b1': [[{'...subspace': {0: 0, 1: 0}}, input_type=dict] For further information visit https://errors.pydantic.dev/2.7/v/missing

Markers-factorize throws error

Hello I encountered another error,

Calculating a marker set factorization throws an error (See screenshot). The factorization is still being done (I think) but the program does not exit properly but instead throws an error. The documentation shows that pdfs should get created. This is not happening.

Thanks again for your time.

Boolean net in bnet format (Its the toy example from the markers paper)

x1, x2
x2, x1
x3, x4
x4, x3
x5, x2 & x4
x6, x2 | (!x2 & !x3)

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.