Giter VIP home page Giter VIP logo

chaste / appredict Goto Github PK

View Code? Open in Web Editor NEW
6.0 7.0 4.0 39.38 MB

Cardiac Action Potential Prediction (ApPredict) under drug-induced block of ion channels. This is a Chaste extension/bolt-on project.

Home Page: https://chaste.cs.ox.ac.uk/trac/wiki/ApPredict

License: Other

C++ 98.48% CMake 1.18% MATLAB 0.34%
chaste ion-channel electrophysiology drug-discovery drug-safety mathematical-modelling biophysics cardiac

appredict's Introduction

ApPredict - Action Potential Prediction

This project is an extension of Chaste that is intended to be used for simulation of drug action in cardiac electrophysiology models.

Prerequisites

Before using this code you will need to download and install Chaste's dependencies and the Chaste source code itself.

Please see Getting Started for details of how to do this (follow instructions for "Development Code User" to keep up to date with the latest code, or a release version if you want longer-term stability).

Installation

This repo must be cloned into the Chaste source projects folder:

$ cd <chaste source directory>/projects
$ git clone https://github.com/Chaste/ApPredict.git

so that all the file paths can be picked up correctly (replacing <chaste source directory> with the place you have put the Chaste source code). Alternatively, you can put a sim link from the above folder to wherever you clone this repo.

This ApPredict project should be used with the current develop branch of Chaste. If instead you want a version that works with a released version of Chaste, then please select the relevant Tag of this github repository.

(In the past we had a git submodule with CellML files from www.github.com/Chaste/CellML, but this is now pulled in by a cmake file download)

appredict's People

Contributors

fcooper8472 avatar kwabenantim avatar mauricehendrix avatar mirams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

appredict's Issues

Provide a `--version` option

Which just prints the commit hashes for Chaste and ApPredict that the executable was compiled with.

These are currently printed to std::out, but be nice to put them in a special call.

Maybe also print the dependency versions (TestChasteBuildInfo.hpp style).

Ensure qNet.txt contains correct number of rows if we have APD evaluation failures

Hi @gary, I'm noticing that there's an inconsistency between data being written to voltage_results.dat and q_net.txt.
In voltage_results.dat, if there are "NoActionPotential_X" values at concentrations, then it's appearing as :
23.1013 79.5776 27.5461 512.202 621.956 114.61 81.1131 NoActionPotential_1 NoActionPotential_1 NoActionPotential_1 NoActionPotential_1 NoActionPotential_1
In q_net.txt, it's just :
23.1013 -0.0296737
i.e. for q_net.txt I'd be expecting 81.1131 NoActionPotential_1
Observed with: --model 8 --pacing-freq 0.5 --pacing-max-time 5 --pic50-cal 5 --hill-cal 1 --saturation-cal 0 --pic50-herg 5 --hill-herg 1 --saturation-herg 0 --pic50-iks 6 --hill-iks 1 --saturation-iks 0 --pic50-na 6 --hill-na 1 --saturation-na 0 --plasma-conc-high 1000 --plasma-conc-low 0 --plasma-conc-count 10 --plasma-conc-logscale true

Warning appearing: A high-performance Open MPI point-to-point messaging module ...

I'm seeing the following (seemingly inconsequential, as the simulation seems to complete) "warning" appearing in ApPredict https://github.com/Chaste/ApPredict/releases/tag/v2021.1 stderr in a container.

--------------------------------------------------------------------------
[[60025,1],0]: A high-performance Open MPI point-to-point messaging module
was unable to find any relevant network interfaces:

Module: OpenFabrics (openib)
  Host: 466e13a9963f

Another transport will be used instead, although this may result in
lower performance.

NOTE: You can disable this warning by setting the MCA parameter
btl_base_warn_component_unused to 0.
--------------------------------------------------------------------------

Simulation was run using :

* model = shannon_wang_puglisi_weber_bers_2004_model_updated
* na: no drug effect
* cal: no drug effect
* herg IC50s = 100  uM, Hills = 1, Saturation levels = 0  %.
* iks: no drug effect
* ik1: no drug effect
* ito: no drug effect
* nal: no drug effect
* max free plasma concentration = 100 uM
* min free plasma concentration = 0 uM
* number of plasma concentrations = 13

It'd be an improvement if this wasn't appearing in the logs, so are there any suggestions for adjusting https://github.com/CardiacModelling/appredict-docker/blob/master/appredict-no-emulators/Dockerfile#L40-L47 to include that btl_base_warn_component_unused instruction?

EXPECT0 output going to stderr

When doing the following I seem to end up with wget output from EXPECT0 going to stderr, whereas I'd have hoped for it to go to stdout.

--model 8 --pacing-freq 1.0 --pacing-max-time 5 --pic50-herg 1 --hill-herg 1 --saturation-herg 0 --pic50-spread-herg 0.21 --plasma-conc-high 100 --plasma-conc-low 0 --plasma-conc-count 4 --plasma-conc-logscale true  --credible-intervals 2> stderr

Invalid args are quietly ignored

I can invoke ApPredict with nonsensical args like --fish chips and it ignores them. Would be helpful to to have something like ...

  • simply fail on invalid args, or,
  • add another arg, e.g. --strict-args {true|false}, which defaults to false if not supplied (so ApPredict behaves as it's always done), but if --strict-args true it'll fail to run on bad args.

Output version information

It goes into the provenance file, but would be nice to have it on std::out along with Chaste version too.

Always fetch missing CellML files

Description
FetchContent currently skips downloading CellML files if configuration has already been done once. This fix was added in #26 and prevents FetchContent from throwing errors when it can't overwrite existing files, which can happen when cmake is called twice or ccmake is used.

The current behaviour means that CellML files which have been accidentally removed after the inital configuration will not be replaced when cmake is called again.

Steps To Reproduce

cd /path/to/Chaste/build
cmake ..
rm /path/to/Chaste/projects/ApPredict/src/cellml
cmake ..
make ApPredict

Error

[ 82%] Building CXX object projects/ApPredict/CMakeFiles/chaste_project_ApPredict.dir/src/stats/BayesianInferer.cpp.o
/home/runner/_work/ApPredict/ApPredict/Chaste/projects/ApPredict/src/single_cell/CipaQNetCalculator.cpp:42:10: fatal error: ohara_rudy_cipa_v1_2017Cvode.hpp: No such file or directory
   42 | #include "ohara_rudy_cipa_v1_2017Cvode.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [projects/ApPredict/CMakeFiles/chaste_project_ApPredict.dir/build.make:258: projects/ApPredict/CMakeFiles/chaste_project_ApPredict.dir/src/single_cell/CipaQNetCalculator.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
[ 82%] Building CXX object projects/ApPredict/CMakeFiles/chaste_project_ApPredict.dir/src/stats/LinearDiscriminantAnalysis.cpp.o
make[2]: *** [CMakeFiles/Makefile2:22324: projects/ApPredict/CMakeFiles/chaste_project_ApPredict.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:2327: CMakeFiles/project_ApPredict.dir/rule] Error 2
make: *** [Makefile:314: project_ApPredict] Error 2

To Do

  • Try to force overwrites (delete and re-fetch), or check for missing files and fetch only those.

minor fixes to allow appredict to be compilled with c++11 and pycml

It would be nice that ApPredict still work with older installations of chaste that are still using c++11 and pycml, I would like to make the following changes if there are no objections?

diff --git a/SConscript b/SConscript
index e111a1d..e7125c8 100644
--- a/SConscript
+++ b/SConscript
@@ -48,6 +48,9 @@ chaste_libs_used = ['heart']
 # Change some flags just for this project
 env = SConsTools.CloneEnv(env)
 env['Chaste_CODEGEN_EXTRA_ARGS'] = ['--use-model-factory']
+env['PYCML_EXTRA_ARGS'] = ['--expose-annotated-variables']
+
+

 # Do the build magic
 result = SConsTools.DoProjectSConscript(project_name, chaste_libs_used, globals())
diff --git a/src/fortests/ModelFactory.cpp b/src/fortests/ModelFactory.cpp
index 02a3e2f..2b90129 100644
--- a/src/fortests/ModelFactory.cpp
+++ b/src/fortests/ModelFactory.cpp
@@ -41,7 +41,7 @@ ModelFactory::TModelMapping ModelFactory::getModelRegistry()
 {
     if (ModelFactory::mpModelRegistry == nullptr)
     {
-        ModelFactory::mpModelRegistry = std::make_unique<std::map<std::pair<std::string, std::string>, ModelFactory::TCreateMethod>>();
+        ModelFactory::mpModelRegistry = std::make_shared<std::map<std::pair<std::string, std::string>, ModelFactory::TCreateMethod> >();
     }
     return ModelFactory::mpModelRegistry;
 }

Methods to provide access to a custom selection of CellML files

Things to consider:

  • Create a new branch of www.github.com/Chaste/cellml which contains only the files needed by ApPredict, so that compilation is faster and easier.
  • By setting some global bash variable specify a folder of CellML files which we can use as additional --model s, either at compile time (by treating it as a source folder) or at run time (by reading contents and dynamically loading them).

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.