MedAssociates to CSV file
- 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
Table of Contents
About The Project
This program parses MedAssociates data files and transforms them into tidy csv files, containing the information selected by the user
Built With
Getting Started
To get a local copy up and running follow these simple steps.
Prerequisites
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
Installation
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
Make Executable
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
Example
Graphical User Interface
Run the application and follow the steps on the interface
./main_gui
Command Line Interface
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_file
Config file
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
Roadmap
- 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 []
Contributing
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
License
Distributed under the GPL v3.0 License. See LICENSE.txt
for more information.
Contact
- Jean-Emmanuel Longueville - [email protected]
- Myriam Hanna - [email protected]
- Marcello Solinas
Project Link: https://github.com/hedjour/med_to_csv