Coder Social home page Coder Social logo

shapiromatron / hawc Goto Github PK

View Code? Open in Web Editor NEW
18.0 10.0 15.0 101.2 MB

Health Assessment Workspace Collaborative, a content management system for systematic reviews

License: Other

Python 50.65% CSS 16.35% JavaScript 25.09% HTML 5.73% Makefile 0.05% Shell 0.10% Dockerfile 0.02% Batchfile 0.05% Jupyter Notebook 1.93% PEG.js 0.03%
toxicology risk-assessment human-health-assessment python django

hawc's People

Contributors

anthonywillisinfotel avatar berkowitzmaxicf avatar bishwobhandari avatar caseyhans avatar dannypeterson avatar dependabot[bot] avatar dooktibs avatar joshaddington avatar lein-mckayla avatar melduous avatar munnsmunns avatar nlewycky avatar rabstejnek avatar ricerb avatar scott-8 avatar shanethacker avatar shapiromatron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hawc's Issues

bmds execution bugfixes

Fix bugs identified by bmds execution:

  • drop doses if no response data is available when setting up bmds sessions
  • handle cases where models are not executed b/c insufficient dose-groups
  • allow user to select and justify no best-fitting model
  • bugfix - BMR line should be the same for BMD and BMDL visualization
  • revise BMD view at endpoint level to include values and recommendation notes, even when no model is selected
  • fix broken dichotomous-hill plotting

Additional features wrapped into this release:

  • fixed bug where RIS import with leading newline couldn't be imported
  • added trend test value and result to endpoint and endpoint-group data pivots

Updated

I'm moving the goalpost a little bit so we can get this version out in a timely manner. Additional tasks which need to be developed are below; unfortunately they require more refactoring on the client side, since a main assumption baked in is you'll want one model for each model type, and that doesn't cover the case for polynomial/multistage 2 - (n-1) models

  • revise default bmd settings to use session.add_default_models()
  • add quantal linear (1st order multistage as a default model)
  • clarify when constant/non-constant variance is selected on model run
  • build bmds word report

Add endpoint filter to study RoB assignment screen

The user would like to be able to filter Study RoB assignments by the endpoints associated with those studies. That way they can assign the RoB forms to the correct people. Of course, you'd only be able to filter by the endpoints that have already been added in the assessment.

Associated with JIRA APPDEV-3858.

Prototype/wireframe of adding effects notes to Study RoB

The user would like to be able to add a list of endpoint effects when reviewing the questions about endpoints in the Study RoB. They want to have an autocomplete to choose from, akin to the effects autocomplete in the animal bioassay endpoint form, and they want to add multiple effects.

This would likely require adding some sort of data indicator as to whether or not an individual metric should have the effects field available.

This ticket is just about getting feedback from the user by means of a visual representation of our ideas for the tool. Do not build out a complete solution until we nail down the final requirements.

JIRA APPDEV-3857

contact us - login-required

To prevent spam to the contact-us email, make login required.

In the future, after codebases have been merged, we could do something more advanced such as adding a captcha, but this should be sufficient to prevent gross spam I've been receiving lately.

Add tags to Epi Results screen

In the Epi Outcome update screen, there is a field where you can add "tags." It's an autocomplete field that allows you to add multiple tags, and it has an interface to delete those tags as well.
https://v2626umcth922.rtord.epa.gov/epi/outcome/100001302/update/

The client wants the same kind of tag interface for the Epi Results update screen:
https://v2626umcth922.rtord.epa.gov/epi/result/100000017/update/

The will likely involve adding tags to the results model, but I haven't dug too deeply into how the outcome tags are set up. Take a look and see if you have any questions about it, and we'll figure it out.

JIRA APPDEV-3865

Errors in pandas excel exports

Having troubles consistently rendering Excel w/ invalid unicode errors. In production, we get an exception, but this isn't an issue locally.

v = ' test \x02 '

# this is consistent on mac/windows/ubuntu
from openpyxl import Workbook
wb = Workbook()
ws = wb.active
ws.cell(row=1,column=1,value=v) # raise IllegalCharacterError

# this is not - works on mac/windows, fails ubuntu
from io import BytesIO
import pandas as pd
df = pd.DataFrame(data=[[v]])
f = BytesIO()
writer=pd.ExcelWriter(f)

# on mac/windows, no error. on linux, throws IllegalCharacterError
df.to_excel(writer, index=False) 

# both return utf-8
import sys
sys.getdefaultencoding()

Pandas == 1.4.1
openpyxl == 3.0.9

update license to MIT

After discussions with future users of HAWC and the current copyright ownership, we have decided to change the license to a more standard MIT license, with an additional notice.

  1. Update license and license views on website
  2. Update HAWC user model to flag acceptance of license (v1), the prior license
  3. Update HAWC user model to flag acceptance of license (v2), the new license
  4. Add method for users to accept new license on login.

Add more concatenation fields to epi descriptive text columns in data pivot

There are some specially concatenated choices in the descriptive text dropdowns on the animal data pivot, such as Animal Description (With N). You can see that here:
https://v2626umcth922.rtord.epa.gov/summary/data-pivot/assessment/483/chloroform-birth-defect-epi/update/

The user wants to add some more concatenated fields to the epi data pivot.

  • Concatenate reference versus exposure group name for exposure comparison column, also add one with the number of exposed cases
  • Concatenate to get the exposure description
  • Concatenate to get estimate and 95%CI

Exposure description might already be there. I'll take a look at this one.

JIRA APPDEV-3871

remove BMD options for user-interface

We currently don't have a public BMD webserver for me to run jobs on, so for the time being, so comment-out the "run bmd analysis" options at the endpoint-level. Hopefully we'll have another server in the near future.

Add Animal Endpoint results notes field to the descriptive text dropdown on the Animal data pivot visualization

If you go to -- or create -- an Animal data pivot visualization, you can customize various features of the visualization using the update screen:
https://v2626umcth922.rtord.epa.gov/summary/data-pivot/assessment/483/chloroform-fetal-growth-crown-rump-length-animal/update/

Go to the Settings tab, and then Descriptive Text Columns. Here, you can add columns to the table. The column header dropdown allows you to choose fields from the Animal data to display.

The user wants to be able to select Results Notes data as a descriptive text column and have it shown in the table. The comments field can be found on this screen:
https://v2626umcth922.rtord.epa.gov/ani/endpoint/28089/edit/

JIRA APPDEV-3869

Prefiltering RoB Heatmap by Effect Subtype

In the setup for RoB heatmap visualizations, there are options to prefilter studies by associated endpoint data, such as system or effect. The user would like to be able to prefilter by Effect Subtype as well.

Associated with JIRA APPDEV-3856.

Add confounders to epi data pivot view

Add two columns to epi data pivot, both of which are semi-colon delimited.

The first is titled 'adjustment factors (applied)', the second 'adjustment factors (considered and/or applied)'.

Originally from email thread dated 1/8/18.

copy outcomes across studies

Investigate the possibility of allowing users to copy animal.Endpoint, epi.Outcome, or invitro.IVEndpoint across studies. May not be possible but a user-request.

Also investigate copying epi.Result across epi.Outcome within the same study.

selenium tests v3

Create branch selenium-tests-v3 to write the following new tests. If you're having a hard time writing stable selectors in selenium, feel free to ping @shapiromatron and we can work together to updating existing components to add css classes to make the selectors easier to grab onto.

To setup:

# load test database
export "DJANGO_SETTINGS_MODULE=hawc.main.settings.unittest"
createdb hawc-fixture-test
manage.py load_test_db

# start both environments
manage.py runserver
npm --prefix ./frontend run start

Individual tests below. I added a lot of detail for things to test, but feel free to adjust as necessary to get things working, hopefully the detail helps to describe the gist of what we want to test. Basically, we just want to make sure that things render without catastrophic errors:

  1. test_literature

    • /user/login/
    • /lit/assessment/2/
      • check that > 5 .nestedTag exist in #tag
    • /lit/assessment/2/references/
      • check that if you click "Human Study (2)", two #reference_detail_div exists
    • /lit/assessment/2/references/visualization/
      • ensure svg exists and 3 .tagnode exists in svg
    • /lit/assessment/2/references/search/
      • add "Kawana" to Authors and search, assert 1 #reference_detail_div exists
    • /lit/assessment/1/tag/untagged/
      • confirm that "References", "Tags for current reference", and "Available tags" exist
  2. test_study

    • /user/login/
    • /study/assessment/2/
      • confirm 4 rows exist in table tbody
    • /study/7/
      • confirm #study_details exists
      • confirm table exists in a column says Data type(s)
  3. test_bioassay

    • /user/login/
    • /ani/experiment/1/
      • confirm #objContainer > table > contains "2 year bioassay" in table
      • confirm "tester" exists under Available animal groups
    • /ani/animal-group/1/
      • confirm "sprague dawley" text exists in table
      • confirm "Oral diet" text exists in table
      • confirm "mg/kg/d" text exists
      • confirm "my outcome" test exists
    • /ani/endpoint/1/
      • ensure LOEL -> 100 mg/kg/d exists
      • ensure svg plot exists, and .d3 .dr_dots .dose_points == 3
      • ensure #dr-tbl exists and there are 4 rows in it
  4. test_rob

    • /user/login/
    • /rob/assessment/1/
      • check that "example domain Domain" and "final domain Domain" headers exist
      • check that "example metric" exists
    • /rob/assessment/1/study-assignments/
      • ensure there is 1 row with Foo et al. and 4 columns
    • /rob/3/edit/
      • ensure that there are 3 .score-form
  5. test_epi

    • /user/login/
    • /epi/study-population/1/
      • Ensure "Study design" and "Case series" exist
      • Ensure 1 bullet in each list of Outcome, comparison set, and exposure metric
    • /epi/exposure/1/
      • ensure "What was measured" and "Sarin" in table
    • /epi/comparison-set/1/
      • ensure exposure table exists
      • ensure 3 groups described in exposure set
    • /epi/outcome/4/
      • ensure "Name" and "partial PTSD" exist
      • ensure .nav .nav-tabs has 1 result
    • /epi/result/1/
      • ensure two tables in objContainer
        • ensure first has "Table 2" text in it
        • ensure second has 3 groups in tbody portion
  6. test_cleanup

    • /user/login/
    • /assessment/1/clean-extracted-data/
      • click "1 animal bioassay endpoints"
      • click "System"
      • add "test" to "system edit' and "submit bulk edit"
      • ensure "test (1)" is now shown
      • add "N/A" to "system edit' and "submit bulk edit"
      • ensure "N/A (1)" is now shown
    • /assessment/1/clean-study-metrics/
      • press "Load responses"
      • click the checkbox beside Foo et al.
      • Change "Probably low risk of bias" to "Not reported"
      • Press Bulk modify 1 item
      • ensure "Not reported" now shown
      • click the checkbox beside Foo et al.
      • Change "Not reported" to "Probably low risk of bias"
      • Press Bulk modify 1 item
      • ensure "Probably low risk of bias" now shown
  7. test_mgmt

    • /user/login/
    • /mgmt/assessment/1/
      • assert 6 svg of class .task-chart exist
    • /mgmt/assessment/1/edit/
      • assert 1 .taskStudy row exist
  8. test_heatmap_builtins

    • /user/login/
    • /assessment/2/endpoints/
      • ensure that the first two columns say "Bioassay" and "Epidemiology" and the table is 3x4
    • /ani/assessment/2/heatmap-study-design/
      • ensure an svg exists with class .d3
      • ensure that 4 exp_heatmap_cell exist
  9. test_visuals

    • /user/login/
    • /summary/visual/5/
      • ensure svg exists and .legend exists in svg
    • /summary/visual/4/
      • ensure svg exists and .crossview_path_group exists in svg
    • /summary/data-pivot/assessment/2/animal-bioassay-data-pivot-endpoint/
      • ensure svg exists and .x_gridliens and .y_gridlines exist
    • /summary/data-pivot/assessment/2/data-pivot-epi/
      • ensure svg exists and .x_gridliens and .y_gridlines exist
    • /summary/visual/7/
      • ensure iframe exists inside .tableauPlaceholder
    • /summary/visual/3/
      • ensure svg exists and .legend exists in svg
    • /summary/visual/6/
      • ensure svg exists and 4 .tagnode exists in svg

Add ability to hide modules from the public only

Currently, modules are either on or off in assessments, but there are occasions where we'll send out links to a public assessment that is still being worked on by HAWC team members. The concern is that some of the module names might be confusing/tempting to the general public. We should investigate adding another control to Update Enabled Modules to enable particular modules for team members only.

Change litter effects option

RE litter effects – can we change the drop down to “yes, statistical control” instead of “yes, statistical controls”

JIRA APPDEV-3872

Investigate moving HAWC to an organizational repository

Per previous conversations, we might move the primary HAWC repository to a new HAWC organization, giving greater granularity in permissions. This issue is to think about the strategy and any possible drawbacks. Might depend on #112 first, though.

data pivot tsv not parsing in Firefox

Steps to recreate.

  1. Save utf-8 Excel unicode text file, which includes a byte-order-mark at the beginning.
  2. Create data pivot with the data. It will work fine in Chrome but has issues in Firefox.

screen shot 2018-03-28 at 1 23 26 pm

Enable BMD as descriptive value for endpoint-group data pivot

BMD and BMDL are currently available as descriptive text columns in animal bioassay data pivots, but only if the pivot is set up with an export style of One row per endpoint/result. We need to enable them for One row per endpoint-group/result-group as well.

Add effects notes to Study RoB form

The user would like to be able to add a list of endpoint effects when reviewing the questions about endpoints in the Study RoB. They want to have an autocomplete to choose from, akin to the effects autocomplete in the animal bioassay endpoint form, and they want to add multiple effects.

Associated with APPDEV-3857, where we're going to do a mockup before developing anything.

copy as new for in vitro

Add the copy-as new features for invitro data; if possible try to allow copying across studies as many times the same chemicals are used across assessments. Requested by EBTC on 1/17/18.

Add Epi Results comments field to the descriptive text dropdown on the Epi data pivot visualization

If you go to -- or create -- an Epi data pivot visualization, you can customize various features of the visualization using the update screen:
https://v2626umcth922.rtord.epa.gov/summary/data-pivot/assessment/483/chloroform-birth-defect-epi/update/

Go to the Settings tab, and then Descriptive Text Columns. Here, you can add columns to the table. The column header dropdown allows you to choose fields from the Epi data to display.

The user wants to be able to select Epi Results Comments data as a descriptive text column and have it shown in the table. The comments field can be found on this screen:
https://v2626umcth922.rtord.epa.gov/epi/result/100000017/update/

JIRA APPDEV-3868

Put final confidence call in center of RoB donut

RoB has a donut graph that shows the domains as slices and the metrics as smaller segments around the outer edge. IRIS wants to make the center of the donut an indicator of the final confidence metric in the Risk of Bias questionnaire. You can use the usual colors and symbols.

Associated with JIRA APPDEV-3845.

Merging repositories

The EPA and NTP will investigate merging the teamhero/hawc fork back into the shapiromatron/hawc parent repository in order to share the same code base. Ideally we'll have the two merged by April, unless we run into any problems.

Add Epi Outcome tags to the descriptive text dropdown on the Epi data pivot visualization

If you go to -- or create -- an Epi data pivot visualization, you can customize various features of the visualization using the update screen:
https://v2626umcth922.rtord.epa.gov/summary/data-pivot/assessment/483/chloroform-birth-defect-epi/update/

Go to the Settings tab, and then Descriptive Text Columns. Here, you can add columns to the table. The column header dropdown allows you to choose fields from the Epi data to display.

The user wants to be able to select Epi Outcome Tag data as a descriptive text column and have it shown in the table. If you want to see an example of a similar field, Animal Data Pivot already has a descriptive text field option for tags.

JIRA APPDEV-3866

Add source field to RoB questionnaires

Each RoB metric currently has a dropdown for the score, and a description text field. Add a source text field, like the description field. It's for the user to be able to copy and paste the reference text they found the metric in for use in text mining later.

Associated by APPDEV-3859.

Need environment ID/settings flag for different HAWC installs

Per previous conversations, different HAWC installations for different clients might need to use flags to turn certain features on and off or modify them for particular client needs. We'd like to create both a setting that indicates which client the current installation belongs to, and an example of using that setting to set feature flags in response.

Add Epi Result tags to the descriptive text dropdown on the Epi data pivot visualization

If you go to -- or create -- an Epi data pivot visualization, you can customize various features of the visualization using the update screen:
https://v2626umcth922.rtord.epa.gov/summary/data-pivot/assessment/483/chloroform-birth-defect-epi/update/

Go to the Settings tab, and then Descriptive Text Columns. Here, you can add columns to the table. The column header dropdown allows you to choose fields from the Epi data to display.

The user wants to be able to select Epi Result Tag data as a descriptive text column and have it shown in the table. If you want to see an example of a similar field, Animal Data Pivot already has a descriptive text field option for tags.

On this one, it can't be done until the Results tags are added to the Results form, per APPDEV-3865. It's also similar to APPDEV-3866.

Related to #106

JIRA APPDEV-3867

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.