bep032tools.generator.BEP032Templater module
- class bep032tools.generator.BEP032Templater.BEP032TemplateData(sub_id, ses_id)
Bases:
BEP032Data
Representation of a BEP032 Data, as specified by in the [ephys BEP](https://bids.neuroimaging.io/bep032)
The BEP032Data object can track multiple realizations of split, run, task but only a single realization of session and subject, i.e. to represent multiple session folders, multiple BEP032Data objects are required. To include multiple realizations of tasks or runs, call the register_data method for each set of parameters separately.
- Parameters:
sub_id (str) – subject identifier, e.g. ‘0012’ or ‘j.s.smith’
ses-id (str) – session identifier, e.g. ‘20210101’ or ‘007’
tasks (str) – task identifier of data files
runs (str) – run identifier of data files
- generate_all_metadata_files()
- generate_metadata_file_channels(output)
- generate_metadata_file_contacts(output)
- generate_metadata_file_dataset_description(output)
- generate_metadata_file_ephys(output)
- generate_metadata_file_participants(output)
- generate_metadata_file_probes(output)
- generate_metadata_file_scans(output)
- generate_metadata_file_sessions(output)
- generate_metadata_file_tasks(output)
- validate()
Validate the generated structure using the BEP032 validator
- Parameters:
output_folder (str) – path to the folder to validate
- Returns:
True if validation was successful. False if it failed.
- Return type:
bool
- bep032tools.generator.BEP032Templater.create_file(source, destination, mode)
Create a file at a destination location
- Parameters:
source (str) – Source location of the file.
destination (str) – Destination location of the file.
mode (str) – File creation mode. Valid parameters are ‘copy’, ‘link’ and ‘move’.
- Raises:
ValueError – In case of invalid creation mode.
- bep032tools.generator.BEP032Templater.extract_structure_from_csv(csv_file)
Load csv file that contains folder structure information and return it as pandas.datafram.
- Parameters:
csv_file (str) – The file to be loaded.
- Returns:
A dataframe containing the essential columns for creating an BEP032 structure
- Return type:
pandas.dataframe
- bep032tools.generator.BEP032Templater.main()
Notes
Usage via command line: BEP032Generator.py [-h] pathToCsv pathToDir
- positional arguments:
pathToCsv Path to your csv file
pathToDir Path to your folder
- optional arguments:
- -h, --help
show this help message and exit