- A simple way to parse MedAssociate output file in tidy data :
- 1 row = 1 observation
- 1 col = 1 var
View Demo · Report Bug · Request Feature
This program parses MedAssociates data files and transforms them into tidy csv files, containing the information selected by the user
To get a local copy up and running follow these simple steps.
This is an example of how to list things you need to use the software and how to install them.
pip
pip install numpy argparse pyaml pandas pip install Gooey #For graphical interface
Clone the repository
git clone https://sourcesup.renater.fr/anonscm/git/medanalysis/medanalysis.git
Install the required packages
pip install numpy argparse yaml pandas pip install Gooey #For graphical interface cd path/to/directory_of_git_clone
- and one of the two lines below :
python setup.py install python setup.py install --user #For windows users
- or
pip install .
To make a gui onefile executable run these commands in terminal.
cd path/to/directory_of_git_clone pyinstaller build_gui.spec
To make a cli onefile executable run these commands in terminal.
cd path/to/directory_of_git_clone pyinstaller build_cli.spec
The file is just an output of MedAssociate software. The path directorie can contains the sub_directories of sessions that containing the raw data files, or just Medassociate files.
Warning
Your raw data directories must only contain med output files.
Note
Experiment directorie/ └── dir 01
├── file_med_associates_to_compil ├── file_med_associates_to_compil └── file_med_associates_to_compil
- └── dir 02
- ├── file_med_associates_to_compil ├── file_med_associates_to_compil └── file_med_associates_to_compil
or
Experiment directorie/ ├── file_med_associates_to_compil ├── file_med_associates_to_compil └── file_med_associates_to_compil
Run the application and follow the steps on the interface
./main_gui
The software runs on the experiment directory that contains the directories containing the raw data files or on the file itself and returns a csv file
./main_cli.py path_to_medassociate_file config_file.yml output_csv_fileWarning
Your path must contain only ASCII characters (No : éèàï)
The config file is a necessary file that specifies the setup of your data to the software. You can find as an example the config.yml which contains all possibilities of setup. You can mix 1 col file dir and annotated directory file in experiment dir.
- There are three types of parameters:
- info_col : One column file
- info_lab : annotated file
- options : further options
- For the first two types of parameters.
You need to indicate the information in this format: "Key : Value"
- Keys are the column names that you want in the output file
- Values are:
- for infos_col: row number - 1 (Start index :0)
- for infos_lab: letters used in medAssociate exercise
- for infos_opt: (see next point)
- Options:
- remove_zero_ending : True or False to keep or remove Zeros at the end of arrays
- Cut : for cutting an output on a special character usually a dot into 2 columns. The value must be a list of list of 4 elements :
- key to cut
- separator usually the dot character
- Col names of first sub-element
- Col names of second sub-element
- Eval : for some columns the values must be the result of a Python command line (e.g to get information in a path). It must be a python dictionary with Key as column name and value a short command line as a string.
- The following Keys are med associate keywords only usable with annotated file :
- Start Date (automatically added)
- End Date
- Subject
- Experiment
- Group
- Box
- Start Time (automatically added)
- End Time
- MSN: Medassociate exercice names
Note
Templates are available in the config.yml file
- Add possibility for annotated file to not specify the YAML file and use YAML in parameter path with the same names as MPC name obtained from MSN []
- If you get the
A problem has occured while processing the data : local variable 'lab_folder' referenced before assignment
Have you filled your sub_directories with med associates output files ?
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have any suggestion that would improve this software, please fork the repository and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GPL v3.0 License. See LICENSE.txt
for more information.
- Jean-Emmanuel Longueville - [email protected]
- Myriam Hanna - [email protected]
- Marcello Solinas
Project Link: https://github.com/hedjour/med_to_csv
- IRESP: This work was supported by a grant from the IRESP « IRESP-19-ADDICTIONS-20 » to MS
- LNEC
- Université de Poitiers
- INSERM
- Logo FreeVector.com
- Thanks to our old contributors as Ekter, Myriam Hanna.