Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bioclean edit #51

Merged
merged 89 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
e1bc129
small edit
svittoz Nov 27, 2023
f599849
prepare_biology_relationship_table
svittoz Nov 30, 2023
8419d2f
prepare biology relationship
svittoz Nov 30, 2023
3645178
prepare_biology_relationship
svittoz Dec 4, 2023
ed2acb0
prepare_df fix
svittoz Dec 14, 2023
38dc899
processing refacto
svittoz Jan 10, 2024
aa64de8
small fix
svittoz Jan 10, 2024
4e54425
small fix
svittoz Jan 10, 2024
c3273bf
small fixes
svittoz Jan 10, 2024
268a895
new concept set
svittoz Jan 10, 2024
ff001d0
fix typo
svittoz Jan 10, 2024
ec4ca53
small fix
svittoz Jan 10, 2024
c02f724
solving issues
svittoz Jan 10, 2024
896b130
handling viz
svittoz Jan 11, 2024
37ed44f
doc
svittoz Jan 22, 2024
d1a00f8
remove cache for tests
svittoz Jan 23, 2024
5cb805e
solving units issue
svittoz Jan 23, 2024
4c50845
refacto
svittoz Jan 25, 2024
2217bf6
remove loggers
svittoz Jan 26, 2024
866d569
stats summary
svittoz Jan 30, 2024
0d1c8bd
aggregate file modif
svittoz Jan 30, 2024
1ba5d92
docstring
svittoz Jan 30, 2024
f8b3d7b
typo
svittoz Jan 30, 2024
3e6eb6d
typo
svittoz Jan 30, 2024
146d325
debug logging
svittoz Jan 31, 2024
6b0f847
remove unecessary functions
svittoz Jan 31, 2024
3ecebba
move some files
svittoz Jan 31, 2024
5dc298c
remove viz_other
svittoz Jan 31, 2024
1ceeec4
small changes
svittoz Jan 31, 2024
a788e1c
bioclean
svittoz Feb 2, 2024
9b4e5e3
bioclean
svittoz Feb 2, 2024
30614c3
doc
svittoz Feb 2, 2024
bcccee8
adapt documentation
svittoz Feb 2, 2024
63f45ef
new tuto
svittoz Feb 2, 2024
fa4fa2d
clean doc
svittoz Feb 2, 2024
afaa9c6
fix doc
svittoz Feb 2, 2024
0cc9536
remove viz_other
svittoz Feb 2, 2024
3425521
pre-commit
svittoz Feb 2, 2024
37ec77b
adapting tests
svittoz Feb 2, 2024
a50e5f5
Merge branch 'main' into edit-bioclean
svittoz Feb 5, 2024
64f4aed
precommit and changelog
svittoz Feb 5, 2024
77364ef
coverage
svittoz Feb 7, 2024
fb38d90
coverage
svittoz Feb 7, 2024
e01fd45
remove unused functions
svittoz Feb 7, 2024
08d4aba
precommit
svittoz Feb 7, 2024
071418d
correcting test
svittoz Feb 8, 2024
ad398a2
correcting test
svittoz Feb 8, 2024
1453a0c
fix test
svittoz Feb 8, 2024
33f7a0e
fix test
svittoz Feb 8, 2024
e30bb6c
fix test
svittoz Feb 8, 2024
c415802
remove unused functions
svittoz Feb 8, 2024
94558a4
fixing tests
svittoz Feb 8, 2024
766f485
pre-commit
svittoz Feb 9, 2024
5651bee
adding docstring to stats_summary
svittoz Feb 12, 2024
dd2aa9d
pre-commit
svittoz Feb 12, 2024
c40038b
coverage
svittoz Feb 12, 2024
0272dee
simplifying prepare_measurement
svittoz Feb 12, 2024
7e6d0e4
coverage
svittoz Feb 12, 2024
f671c72
coverage
svittoz Feb 12, 2024
e73ea44
Update logging.py
svittoz Feb 13, 2024
86846d2
Update plot.py
svittoz Feb 13, 2024
e15a7c7
update doc
svittoz Feb 13, 2024
72e2ff4
precommit
svittoz Feb 13, 2024
fe64062
chore: trigger CI on doc
Thomzoy Feb 15, 2024
41843cf
precommit
svittoz Feb 20, 2024
de3f71b
small modifications
svittoz Feb 20, 2024
ec226f7
tests
svittoz Feb 20, 2024
97b7cb8
better workflow
svittoz Feb 20, 2024
c33888e
cards menu in biology
svittoz Feb 20, 2024
8694634
preparing measurement panel
svittoz Feb 22, 2024
fdd79d4
doc
svittoz Feb 23, 2024
ff64bfa
remove imports
svittoz Feb 23, 2024
556bf10
doc logo
svittoz Feb 26, 2024
889c0c4
pre-commit
svittoz Feb 26, 2024
3439940
Merge branch 'main' into edit-bioclean
svittoz Feb 26, 2024
e19e2d1
changing mkdocs-material version
svittoz Feb 26, 2024
42dd8ea
adding plugin.py
svittoz Feb 26, 2024
98a74c8
adding regex
svittoz Feb 26, 2024
e456fa3
precommit
svittoz Feb 26, 2024
e4adc98
doc corrections
svittoz Feb 26, 2024
f1e2bab
rename
svittoz Feb 26, 2024
4a58742
adding cache trick before aggregation
svittoz Feb 27, 2024
d8e6bd3
bump mkdocs-glightbox-tables
Thomzoy Mar 5, 2024
22ec94c
cards renaming
svittoz Mar 6, 2024
958cf12
pre-commit
svittoz Mar 6, 2024
02a15d8
adding blacken-docs
svittoz Mar 12, 2024
53b9ea6
small modif
svittoz Mar 12, 2024
5bd684e
small modif
svittoz Mar 12, 2024
237b723
Update quick-use.md
svittoz Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/publish_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
pull_request:
paths:
- 'docs/**'
workflow_dispatch:

permissions:
Expand All @@ -24,7 +27,19 @@ jobs:
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
- run: |
- name: Delete existing doc
run: |
git fetch origin gh-pages
mike delete ${{ github.head_ref }}
continue-on-error: true
- name: Deploy main
if: github.event_name == 'push'
run: |
git fetch origin gh-pages
mike delete main
mike deploy --push main
- name: Deploy branch
if: github.event_name == 'pull_request'
run: |
git fetch origin gh-pages
mike deploy --push ${{ github.head_ref }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@ ENV/
!docs/functionalities/biology/Biology_summary/
Biology_summary/*
my_custom_config.csv
eds_scikit/biology/viz_other/
16 changes: 11 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
name: Check YAML (unsafe)
args: [--unsafe]
files: mkdocs.yml
- id: check-yaml
exclude: mkdocs.yml
- id: check-added-large-files
args: ["--maxkb", "5000"]
- repo: https://github.com/pycqa/isort
Expand All @@ -28,11 +33,12 @@ repos:
rev: 22.10.0
hooks:
- id: black
# - repo: https://github.com/asottile/blacken-docs
# rev: v1.10.0
# hooks:
# - id: blacken-docs
# exclude: notebooks/
- repo: https://github.com/asottile/blacken-docs
rev: v1.10.0
hooks:
- id: blacken-docs
additional_dependencies: [black==20.8b1]
exclude: notebooks/
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased
### Added
- biology module refacto
- load_koalas() not by default in __init__.py but called in the improve_performance function
- adding app_name in improve_performances to facilitate app monitoring

Expand Down
4 changes: 4 additions & 0 deletions docs/_static/biology/prepare_measurement_flowchart.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions docs/_static/cards.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.md-typeset .card-set {
grid-gap: .4rem;
display: grid;
grid-template-columns: repeat(auto-fit,minmax(16rem,1fr));
margin: 1em 0;
color: rgb(255, 255, 255); /* Set font color to white */
}
.md-typeset .card-set > .card-content {
/*background-color: rgba(0, 106, 182, 0.151); /* Set background color to blue (RGB: 0, 107, 182) */
background-color: rgba(0, 106, 182, 0.712);
color: initial;
color: rgb(255, 255, 255);
}

.md-typeset .card-set > .card-content,
.md-typeset .card-set > .card-content,
.md-typeset .grid > .card {
border: .05rem solid var(--md-default-fg-color--lightest);
border-radius: .1rem;
display: block;
margin: 0;
padding: .8rem;
transition: border .25s,box-shadow .25s;
}

.md-typeset .card-set > .card-content:focus-within,
.md-typeset .card-set > .card-content:hover,
.md-typeset .card-set > .card-content:focus-within,
.md-typeset .card-set > .card-content:hover,
.md-typeset .grid > .card:focus-within,
.md-typeset .grid > .card:hover {
border-color: #0000;
box-shadow: var(--md-shadow-z2);
}

.md-typeset .card-set > .card-content > hr,
.md-typeset .card-set > .card-content > hr,
.md-typeset .grid > .card > hr {
margin-bottom: 1em;
margin-top: 1em;
}

.md-typeset .card-set > .card-content > :first-child,
.md-typeset .card-set > .card-content > :first-child,
.md-typeset .grid > .card > :first-child {
margin-top: 0;
}

.md-typeset .card-set > .card-content > :last-child,
.md-typeset .card-set > .card-content > :last-child,
.md-typeset .grid > .card > :last-child {
margin-bottom: 0;
}

.md-typeset .card-set > *,
.md-typeset .card-set > .admonition,
.md-typeset .card-set > .highlight > *,
.md-typeset .card-set > .highlighttable,
.md-typeset .card-set > .md-typeset details,
.md-typeset .card-set > details,
.md-typeset .card-set > pre {
margin-bottom: 0;
margin-top: 0;
}

.md-typeset .card-set > .highlight > pre:only-child,
.md-typeset .card-set > .highlight > pre > code,
.md-typeset .card-set > .highlighttable,
.md-typeset .card-set > .highlighttable > tbody,
.md-typeset .card-set > .highlighttable > tbody > tr,
.md-typeset .card-set > .highlighttable > tbody > tr > .code,
.md-typeset .card-set > .highlighttable > tbody > tr > .code > .highlight,
.md-typeset .card-set > .highlighttable > tbody > tr > .code > .highlight > pre,
.md-typeset .card-set > .highlighttable > tbody > tr > .code > .highlight > pre > code {
height: 100%;
}
Empty file added docs/_static/trigger_CI.txt
Empty file.
33 changes: 0 additions & 33 deletions docs/datasets/biology-config.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/datasets/care-site-emergency.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Internally, the dataset is returned by calling the function `get_care_site_emerg

```python
from eds_scikit.resources import registry

df = registry.get("data", function_name="get_care_site_emergency_mapping")()
```

Expand Down
1 change: 1 addition & 0 deletions docs/datasets/care-site-hierarchy.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Internally, the dataset is returned by calling the function `get_care_site_hiera

```python
from eds_scikit.resources import registry

df = registry.get("data", function_name="get_care_site_hierarchy")()
```

Expand Down
22 changes: 13 additions & 9 deletions docs/datasets/synthetic-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ First, you can display all availables synthetic datasets:

```python
from eds_scikit import datasets

datasets.list_all_synthetics()
# Out: ['load_ccam', 'load_consultation_dates', 'load_hierarchy', 'load_icd10', 'load_visit_merging', 'load_stay_duration', 'load_suicide_attempt', 'load_tagging', 'load_biology_data', 'load_event_sequences']
```
Expand All @@ -32,15 +33,18 @@ For instance, tables are available as attributes:

```python
data.condition_occurrence
# Out: person_id condition_source_value condition_start_datetime condition_status_source_value visit_occurrence_id
0 1 C10 2010-01-01 DP 11
1 1 E112 2010-01-01 DAS 12
2 1 D20 2012-01-01 DAS 13
3 1 A20 2020-01-01 DP 14
4 1 A21 2000-01-01 DP 15
5 1 X20 2000-01-01 DP 16
6 1 C10 2010-01-01 DP 16
7 1 C10 2010-01-01 DP 17
```
| | person_id | condition_source_value | condition_start_datetime | condition_status_source_value | visit_occurrence_id |
|---|-----------|------------------------|--------------------------|-------------------------------|---------------------|
| 0 | 1 | C10 | 2010-01-01 | DP | 11 |
| 1 | 1 | E112 | 2010-01-01 | DAS | 12 |
| 2 | 1 | D20 | 2012-01-01 | DAS | 13 |
| 3 | 1 | A20 | 2020-01-01 | DP | 14 |
| 4 | 1 | A21 | 2000-01-01 | DP | 15 |
| 5 | 1 | X20 | 2000-01-01 | DP | 16 |
| 6 | 1 | C10 | 2010-01-01 | DP | 16 |
| 7 | 1 | C10 | 2010-01-01 | DP | 17 |



As shown in the [tutorial][using-icd-10-and-ccam], you can now try out the corresponding [`conditions_from_icd10()`][eds_scikit.event.icd10.conditions_from_icd10] function.
39 changes: 39 additions & 0 deletions docs/functionalities/biology/about_measurement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## About measurements table

The *BioClean* module focuses on three **OMOP** terms:

- [Measurement](https://www.ohdsi.org/web/wiki/doku.php?id=documentation:cdm:measurement) is a record obtained through the standardized testing or examination of a person or person's sample.
- [Concept](https://www.ohdsi.org/web/wiki/doku.php?id=documentation:cdm:concept) is a semantic notion that uniquely identify a clinical event. It can group several measurements.
- [Concept Relationship](https://www.ohdsi.org/web/wiki/doku.php?id=documentation:cdm:concept_relationship) is a semantic relation between terminologies, allowing to map codes from different terminologies.


A fourht term was created to ease the use of the two above:

- [concepts-set](../../datasets/concepts-sets.md) is a generic concept that has been deemed appropriate for most biological analyses. It is a group of several biological concepts representing the same biological entity.

**Example:** <br/>
Let's imagine the laboratory X tests the creatinine of Mister A and Mister B in mg/dL and the laboratory Y tests the creatinine of Mister C in µmol/L. In this context, the dataset will contain:

- 3 measurements (one for each conducted test)
- 2 concepts (one concept for the creatinine tested in mg/dL and another one for the creatinine tested in µmol/L)
- 1 concepts-set (it groups the 2 concepts because they are the same biological entity)


## Vocabulary

A vocabulary is a terminology system that associates a code to a specific clinical event. One may distinguish two types of vocabularies:

### Source vocabulary

The source vocabulary is the vocabulary used in the LIMS (Laboratory Information Management System) software. It is specific to the LIMS and may be different in each laboratory.

### Standard vocabulary

The standard vocabulary is a unified vocabulary that allows data analysis on a larger scale.

- It is classified in chapter.
- It has a bigger granularity than the source vocabulary, multiple source codes may be associated to one standard code.

### Vocabulary flowchart in OMOP

![Image title](../../_static/biology/vocabulary_flowchart.svg)
89 changes: 0 additions & 89 deletions docs/functionalities/biology/cleaning.md

This file was deleted.

Loading
Loading