Skip to content

Commit

Permalink
Merge pull request #2 from MatthieuGG/cli
Browse files Browse the repository at this point in the history
v1.2.0
  • Loading branch information
MatthieuGG authored Oct 6, 2024
2 parents d017a32 + b1336ee commit 62162ea
Show file tree
Hide file tree
Showing 13 changed files with 382 additions and 58 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10086826.svg)](https://doi.org/10.5281/zenodo.10086826)

**Input: individual .csv files ([~/sample](https://github.com/MatthieuGG/GPAQ-scores/tree/main/sample))**
**Output: individual and comon .csv files ([~/results](https://github.com/MatthieuGG/GPAQ-scores/tree/main/results))**
**Script: [GPAQ-scores.ipynb](https://github.com/MatthieuGG/GPAQ-scores/blob/main/GPAQ-scores.ipynb)**
You can call the function in a terminal using ```python3 gpaq.py [-d input_path] [-o output_path] [--ind]```

`[-d]` is optional, default is ~/data/ in the same folder.
`[-o]` is optional, default is ~/results/ in the same folder.
`[--ind]` is optional and permits to save individual files. Default is one concatenated file.

Exemple: ```python3 gpaq.py -d /Users/Me/Desktop/gpaq/myData/ -o /Users/Me/Desktop/gpaq/myResults/ --ind```


GPAQ questionnaires assess the physical activity (PA) behavior during work, displacements or hobbies.
You can then obtain the number of minutes per week spend practicing moderate (MPA), vigorous (VPA), or no PA; then translate it into MET/min/week.

To do so, you need to:
* transpose your paper/pdf/online questionnaires into .csv files, and put them all in the same folder (see exemple of file structure in [~/sample](https://github.com/MatthieuGG/GPAQ-scores/tree/main/sample))
* use the code provided (**[GPAQ-scores.ipynb](https://github.com/MatthieuGG/GPAQ-scores/blob/main/GPAQ-scores.ipynb)**) on your transposed .csv files to obtain the energy expenditure over a week (see [~/results](https://github.com/MatthieuGG/GPAQ-scores/tree/main/results)). You can run the code as is if you keep the same path.
* transpose your paper/pdf/online questionnaires into .csv files, and put them all in the same folder (see exemple of file structure in [~/data/](https://github.com/MatthieuGG/GPAQ-scores/tree/main/data))
* call the software provided on your transposed .csv files to obtain the energy expenditure over a week (see [~/results/](https://github.com/MatthieuGG/GPAQ-scores/tree/main/results)). You can run the code as is if you keep the same path.
* This notebook imports the data, check for conditions (duplicates, missing data, inconsistancy), and calculates the different values of PA, then saves the results.
---
We based our calculation on the [GPAQ guides](https://www.who.int/docs/default-source/ncds/ncd-surveillance/gpaq-analysis-guide.pdf) and [ONAPS recommandations](https://onaps.fr/wp-content/uploads/2020/10/Interpre%CC%81tation-GPAQ.pdf).

**To cite this work:**
> Matthieu Gallou-Guyot. (2023). GPAQ-scores. Zenodo. https://doi.org/10.5281/zenodo.10060405
> Matthieu Gallou-Guyot. (2023). GPAQ-scores. Zenodo. https://doi.org/10.5281/zenodo.10060405
*(old version using a JupyterNootebook is still avaliable in [~/old/](https://github.com/MatthieuGG/GPAQ-scores/tree/main/old))*
2 changes: 2 additions & 0 deletions data/GPAQ - sample1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ID,P1,P2,P3a,P3b,P4,P5,P6a,P6b,P7,P8,P9a,P9b,P10,P11,P12a,P12b,P13,P14,P15a,P15b,P16a,P16b
sample1,2,,,,2,,,,1,6,1,,1,4,,30,2,,,,3,
2 changes: 2 additions & 0 deletions data/GPAQ - sample2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ID,P1,P2,P3a,P3b,P4,P5,P6a,P6b,P7,P8,P9a,P9b,P10,P11,P12a,P12b,P13,P14,P15a,P15b,P16a,P16b
sample2,1,1,1,20,2,,,,1,5,1,,1,5,,15,2,,,,5,
2 changes: 2 additions & 0 deletions data/GPAQ - sample3.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ID,P1,P2,P3a,P3b,P4,P5,P6a,P6b,P7,P8,P9a,P9b,P10,P11,P12a,P12b,P13,P14,P15a,P15b,P16a,P16b
sample3,,1,1,20,2,1,,,1,,,,1,-1,17,61,2,,,,5,
Loading

0 comments on commit 62162ea

Please sign in to comment.