Coder Social home page Coder Social logo

seattleflu / id3c Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 5.0 1.78 MB

Data logistics system enabling real-time pathogen surveillance. Built for the Seattle Flu Study.

License: MIT License

Python 45.50% Shell 0.19% HTML 0.77% PLpgSQL 53.53% Makefile 0.01%
cli data-distribution etl fhir id3c infectious-disease plpgsql postgres postgresql python redcap rest-api scan-study seattle-flu-study sqitch sql

id3c's People

Contributors

bencap avatar cooperqmarshall avatar davereinhart avatar dependabot[bot] avatar hajya avatar joverlee521 avatar kairstenfay avatar kschwabefry avatar sallybg avatar seidelma avatar truong97 avatar trvrb avatar tsibley avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

id3c's Issues

Cannot run `sqitch revert` past `warehouse/organism`

When running sqitch revert on a recent copy of the seattleflu db from production, I get the following error:

Change "warehouse/target/organism @2019-07-12" required by currently deployed change: seattleflu/id3c-customizations:warehouse/target/data

Truncating warehouse.organism produces this error:

seattleflu=# truncate warehouse.organism;
ERROR:  cannot truncate a table referenced in a foreign key constraint
DETAIL:  Table "target" references "organism".
HINT:  Truncate table "target" at the same time, or use TRUNCATE ... CASCADE.

Running sqitch revert warehouse/kit works, though.

How should we upsert genomic sequences?

In the current consensus genome etl process we have the function upsert_genomic_sequences that will update a genomic sequence when there's a conflict on genomic_sequence.identifier. However, this identifier is not unique between sequence read sets, which will lead to consensus genomes without genomic sequences linked to them.

Hypothetical situation:

  1. sample1, organism1, sequence-read-set1 creates consensus-genome1
    - creates genomic_sequence_1 with identifier sample1-organism1-segment

  2. sample1, organism1, sequence-read-set2 creates consensus-genome2
    - the genomic sequence will have the same identifier sample1-organism1-segment so
    will perform update on genomic_sequence_1, which is still linked to consensus-genome1

Writing this all out made me realize that the easiest fix might not be to change the upsert process but to make the genomic sequence identifiers more unique.

Thoughts @tsibley @kairstenfay ?

Postgresql 12 upgrade

Hi!

I have some free time this week and would like to attempt upgrading postgresql.

Is this a good idea and time to do this?

Also, should I go for postgresql 12?

Improve error handling when passing unknown token name

I encountered this issue when attempting to run redcap-det generate locally.

I have the following REDCap tokens declared in my environment:

REDCAP_API_URL='https://redcap.iths.org/api/'
REDCAP_SFS_KIOSK_ENROLLMENTS_TOKEN='...'
REDCAP_SFS_HOUSEHOLD_OBSERVATIONAL_TOKEN='...'
REDCAP_SWAB_N_SEND_TOKEN='...'
REDCAP_SINGLE_SWAB_AND_SEND_TOKEN='...'
REDCAP_HOUSEHOLD_INTERVENTION_STUDY_TOKEN='...'

The root of my problem is that I was providing the wrong token name: specifically, I was passing REDCAP_SWAB_AND_SEND_TOKEN instead of REDCAP_SINGLE_SWAB_AND_SEND_TOKEN.

i experienced two different results based on two attempts I made to run the command.

First I ran:

$ REDCAP_API_TOKEN=$REDCAP_SWAB_AND_SEND_TOKEN PGDATABASE=seattleflu pipenv run id3c redcap-det generate --project-id 17561

and received an error of:

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://redcap.iths.org/api/

Second, I ran:

$ pipenv run id3c redcap-det generate --token-name REDCAP_SWAB_AND_SEND_TOKEN --project-id 17561 > redcap-records.ndjson

and received an error of :

KeyError: 'REDCAP_SWAB_AND_SEND_TOKEN'

I think we could improve the error handling with better messaging here, similar to what @tsibley has already done at https://github.com/seattleflu/id3c/blob/redcap-etl/lib/id3c/cli/redcap.py#L42.

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.