Giter Site home page Giter Site logo

tom-and-the-toothfairies / pathways Goto Github PK

View Code? Open in Web Editor NEW
5.0 6.0 0.0 1.27 MB

:older_woman: :hospital: :pill: :pill:

Home Page: https://tomandthetoothfairies.info/

Python 7.82% JavaScript 16.08% Elixir 51.35% CSS 1.91% HTML 3.88% Erlang 7.85% Ruby 6.40% Gherkin 3.45% Shell 1.26%
process-modeling health healthcare peos pml care-bear flask phoenix merging ddi

pathways's People

Contributors

22a avatar ajenner avatar c-brenn avatar houli avatar laurmurclar avatar shawa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pathways's Issues

DDI display

At the moment we show the raw JSON for DDIs to the user. We should come up with a nice way to display these:

we identified an interaction between drug_a and drug_b "link_to_interaction_thing"

Is the kind of thing I had in mind

fix deprecation warning

test/controllers/pml_controller_test.exs:9 the :name option in form_for/inputs_for is deprecated, please use :as instead (phoenix_html) lib/phoenix_html/form_data.ex:53: Phoenix.HTML.FormData.Plug.Conn.to_form/2 (phoenix_html) lib/phoenix_html/form.ex:238: Phoenix.HTML.Form.form_for/4 (panacea) web/templates/page/index.html.eex:1: Panacea.PageView."index.html"/1 (panacea) web/templates/layout/app.html.eex:29: Panacea.LayoutView."app.html"/1

Conflicting drugs in asclepius response

{
  "label": "abacavir/ganciclovir DDI",
  "uri": "http://purl.obolibrary.org/obo/DINTO_05759",
  "drug_a": "dinto_db123123",
  "drug_b": "chebi_1234124112"
}

or something like that so that the frontend can explain the cause of such a DDI

Drugs should be represented within PML by their English Labels

At the moment if a clinician wants to represent a drug in their PML file they must use dinto:db123 or chebi:124 which, as raised in the meeting, is not very friendly. There'll be two changes required to accommodate this

Representation in PML

After some investigation, every Drug URI in DINTO has a corresponding english label, as seen when calling Asclepius' /all_drugs endpoint:

[
  {
    "label": "6-propyl-2-thiouracil",
    "uri": "http://purl.obolibrary.org/obo/CHEBI_8502"
  },
  {
    "label": "drospirenone",
    "uri": "http://purl.obolibrary.org/obo/CHEBI_50838"
  },
  {
    "label": "mefenamic acid",
    "uri": "http://purl.obolibrary.org/obo/DINTO_DB00784"
  },
  {
    "label": "dicloxacillin",
    "uri": "http://purl.obolibrary.org/obo/CHEBI_4511"
  },
  {
    "label": "amprenavir",
    "uri": "http://purl.obolibrary.org/obo/CHEBI_40050"
  },
  {
    "label": "norethisterone",
    "uri": "http://purl.obolibrary.org/obo/CHEBI_7627"
  },
  {
    "label": "avanafil",
    "uri": "http://purl.obolibrary.org/obo/CHEBI_66876"
  }
]

A simple way to allow these representations would be to add a drugs block to the requires block in a PML, at the moment we have:

process foo {
  task bar {
    action baz {
      tool { "pills" }
      script { "eat the pills" }
      agent { "patient" }
      requires { quux, "chebi:66876", "dinto:DB00784" }
      provides { "a cured patient" }
    }
  }
}

Which would be replaced by:

process foo {
  task bar {
    action baz {
      tool { "pills" }
      script { "eat the pills" }
      agent { "patient" }
      requires { quux, drugs {"avanafil", "mefenamic acid"} }
      provides { "a cured patient" }
    }
  }
}

Other suggestions are:

  • plain strings with a prefix"drug:mefenamic acid",
  • python-style prefixed strings: d"mefenamic acid"
  • special quotes: <<mefenamic acid>>

Querying DINTO

As far as DINTO queries go, the simplest solution that comes to mind is:

  1. On startup, Panacea calls /all_drugs and and builds a label -> uri hash.
  2. After parsing the PML file, resolves parsed drug labels to URIs
  • At this point we can highlight labels that don't exist
  1. Truncate the URIs to generate the corresponding dinto:db123/chebi:123 identifiers to send to Asclepius

The DDIs come back with drug URIs and a DDI label. This creeps into the other issue of how to display the DDIs in the file, and is outside the scope of this issue.

pml controller breaks when given non txt file

When passing any non text file the controller complains about encoding and spits out a 500

[info] POST /api/pml
[debug] Processing by Panacea.PmlController.upload/2
  Parameters: %{"_csrf_token" => "RxdHWDk+R0gDUQ4pAHYKPANdbwAIEAAA1M44ngr8FiOaz4kSje8MGw==", "_utf8" => "โœ“", "file" => %Plug.Upload{content_type: "image/png", filename: "panacea_vial.png", path: "/var/folders/5p/95qqd109569dftcb4yd0dwbc0000gn/T//plug-1487/multipart-698596-812190-3"}}
  Pipelines: [:browser]
[info] Sent 500 in 114ms
[error] #PID<0.315.0> running Panacea.Endpoint terminated
Server: localhost:4000 (http)
Request: POST /api/pml
** (exit) an exception was raised:
    ** (UnicodeConversionError) invalid encoding starting at <<137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 10, 214, 0, 0, 10, 213, 8, 6, 0, 0, 0, 109, 168, 9, 74, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 11, 19, 0, 0, 11, 19, 1, ...>>
        (elixir) lib/string.ex:1801: String.to_charlist/1
        (panacea) lib/panacea/pml/parser.ex:9: Panacea.Pml.Parser.parse/1
        (panacea) web/controllers/pml_controller.ex:7: Panacea.PmlController.upload/2
        (panacea) web/controllers/pml_controller.ex:1: Panacea.PmlController.action/2
        (panacea) web/controllers/pml_controller.ex:1: Panacea.PmlController.phoenix_controller_pipeline/2
        (panacea) lib/panacea/endpoint.ex:1: Panacea.Endpoint.instrument/4
        (panacea) lib/phoenix/router.ex:261: Panacea.Router.dispatch/2
        (panacea) web/router.ex:1: Panacea.Router.do_call/2
        (panacea) lib/panacea/endpoint.ex:1: Panacea.Endpoint.phoenix_pipeline/1
        (panacea) lib/plug/debugger.ex:123: Panacea.Endpoint."call (overridable 3)"/2
        (panacea) lib/panacea/endpoint.ex:1: Panacea.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) /Users/peter/Desktop/pathways/panacea/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

Badges don't link to CI page

@houli didn't properly review the README commit, the badge does not link to the CI page, this should be remedied with a link to the CI dashboard

Feature Points finalisation

Your average bids per feature are in the attached CSV file (with a .txt extension).

Revise as you see fit and use this issue tracker for clarification regarding the features
Opening5.txt

PML controller should not be querying asclepius for ddi's

PMLController probably should't be doing anything related to DDIs.

This should be two requests in my opinion.

The file should be parsed and the drugs returned to the front-end. Depending on the number of drugs found (and perhaps user input), the front-end should then send a request for DDIs to a different endpoint ("POST /api/ddis" drugs=[...]").

Make it obvious that ajax stuff is happening

when you press submit, it takes a second or two for the response to come back.
It'd be nice if the submit button was disabled during this time, and perhaps if a spinner or something similar was displayed where the result panels show up.

Iteration 1 feedback

Sending me off to the docker site to install it is risky. For example, should I do the procedure that edits /etc/apt/sources.list to add the word testing after main on the "appropriate line" of the file? What is the appropriate line? Should I have both stable and unstable repos? Should I treat the project as a "production system"?

Docker hello-world worked ok.

I setup the docker group as pointed out by your other link. You should all read the comment by Chris Foster, April 22nd 2015. Now, how do I undo this?

I run docker with 0.1 - it can't find it locally, even though I have already checked out 0.1.
Some tests run. But where is my app?

README needs to be organised by feature name. All test instructions should give an indication of what to expect if tests succeed.

Panacea PML Controller breaks when given valid pml with no drugs

The pml controller breaks when given a valid pml file with no drugs( such as the no_drugs.pml file in the fixtures directory ) as it sends an empty list to asclepius and matches on the response being {:ok, _} but asclepius will return an error if there aren't at least two drugs present.

screen shot 2017-03-06 at 20 14 57

This controller logic is probably also broken for files with only one identifiable drug, but I haven't tested that.

Iteration 3 Feedback

Group 5 - Iteration 3 - Feedback

The README is almost un-readable using a text editor.

Please put all install/update instructions inline,
and stop referring off to other websites

All I want to know is how to install your stuff - not have to wade through general instructions about a wide range of install options.

Even when I look at the README on github (hoping it is 0.3's readme)
it is not clear what to do.

What is this "Happy Path" stuff?

Here is a transcript of what happens when I try to follow these instructions

part 1 -----
butrfeld@CS4098:~/CS4098/pathways$ docker-compose up -d
The program 'docker-compose' is currently not installed. You can install it by typing:
sudo apt install docker-compose
end of part 1----------

I ignore that advice and do what you suggested earlier

part 2 -------
butrfeld@CS4098: tilde /CS4098/pathways$ sudo curl -o /usr/local/bin/docker-compose -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s-uname -m`
[sudo] password for butrfeld:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 600 0 600 0 0 597 0 --:--:-- 0:00:01 --:--:-- 597
100 8066k 100 8066k 0 0 1338k 0 0:00:06 0:00:06 --:--:-- 1696k
butrfeld@CS4098:~/CS4098/pathways$ sudo chmod +x /usr/local/bin/docker-compose
end of part 2--------

So far, so good!

I then try:

part 3 ------
butrfeld@CS4098:~/CS4098/pathways$ docker-compose up -d
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
butrfeld@CS4098:~/CS4098/pathways$
end of part 3------

now I'm puzzled

If I follow the "Docker Hub" link I get a page with lists using Greek names - all very classical, but which one of these, if any, is 0.3 ??????

Looking at one suggests I need all three!!!

Then I see "Tags" ! This is getting very complicated.

The README should state clearly exactly what needs to be loaded from here.
How about some command-line stuff or a script that collects precisely the right stuff?

Your instructions regarding checking out 0.3 don't work - same problem as above.

Building manually.

OK - you need to provide scripts to do the DNS fixup/revert

It fails for me:

butrfeld@CS4098:/CS4098/pathways$ echo "{"dns": ["134.226.251.200", "134.226.251.100"]}" | sudo tee -a /etc/docker/daemon.json
[sudo] password for butrfeld:
{"dns": ["134.226.251.200", "134.226.251.100"]}
butrfeld@CS4098:
/CS4098/pathways$ sudo service docker restart
butrfeld@CS4098:~/CS4098/pathways$ docker build -t tomtoothfairies/asclepius asclepius
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=tomtoothfairies%2Fasclepius&ulimits=null: dial unix /var/run/docker.sock: connect: permission denied

I am unable to get this going in any kind of reasonable time - the README needs a complete rewrite to have a clear approach to installing the software..

PmlController should not return 200 for errors

Atm errors in parsing/validating a pml file result in a 200 with status: :errror. This should probably be changed to just return some 4XX error. Should make things a bit easier on the Javascript side too - we can remove status from the responses and just handle 200's and non-200's separately

waiting page

until asclepius has started up, panacea should render a nice waiting page that refreshes automatically

UI updates

#107 - now that we have a chain of requests we can make some changes to the UI.

Opening this so we can discuss what these changes should entail.

[Panacea] custom pipeline for `/api` requests

At the moment we're using the browser pipeline for API requests - which means that phoenix is doing a bunch of unnecessary work on each request. It also means that post requests need CSRF tokens.

A minimal custom pipeline would probably be better - one that just accepts json and does some basic Phoenix.Token access control.

When a new file is chosen, the page should update the current analysis

Currently the page only updates when a new file is submitted which contains drugs or invalid pml. If an empty file is submitted then no update of the page occurs.
When a new file is selected, the page should reset back to a clean slate and wipe all previously displayed analysis. This should happen when the file is selected not just when it is submitted.

integration tests

how should we do this?

some phantomjs type thing in a container perhaps?

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.