datahipy.handlers.project module
Methods supporting the Collaborative Space of the HIP.
- datahipy.handlers.project.create_project(input_data: str, output_file: str)[source]
Create a new Collaborative Project on the HIP initialized with directory/file structure.
Parameters
- input_datastr
Path to input data JSON file sent by the HIP that contains all information about Project and corresponding BIDS dataset in the form:
{ "path": "/path/to/project/directory", "title": "Project Title", "description": "Project Description that would be put in the README.md file", "datasetDescription": { "Name": "BIDS Dataset Title", "BIDSVersion": "1.6.0", "License": "CC-BY-4.0", "Authors": ["Author 1", "Author 2"], "Acknowledgements": "Acknowledgement 1", "Funding": ["Funding 1"], "ReferencesAndLinks": ["Reference 1", "Reference 2"], "DatasetDOI": "10.18112/openneuro.ds000000.v1.0.0" } }
- output_filestr
Path to output file that will contain the JSON summary of the BIDS dataset of the project.
- datahipy.handlers.project.import_document(input_data: str)[source]
Import a new supporting document to the
documents/
folder of the HIP Collaborative Project.Parameters
- input_datastr
Path to input data JSON file sent by the HIP that contains all information about the document to import in the form:
{ "sourceDocumentAbsPath": "/path/to/source/document/file", "targetProjectAbsPath": "/path/to/target/project/directory", "sourceDocumentRelPath": "/project/relative/path/to/target/document/file", }
- datahipy.handlers.project.import_subject(input_data: str, output_file: str)[source]
Import a new subject from a BIDS dataset of the HIP Center space to the BIDS dataset of the HIP Collaborative Project.
Parameters
- input_datastr
Path to input data JSON file sent by the HIP that contains all information about the subject and files to import in the form:
{ "sourceDatasetPath": "/path/to/source/bids/dataset/directory", "participantId": "sub-01", "targetDatasetPath": "/path/to/target/bids/dataset/directory", }
- output_filestr
Path to output file that will contain the JSON summary of the BIDS dataset of the project.
- datahipy.handlers.project.initialize_project_structure(project_dir: Path, project_title: str, project_description: str)[source]
Initialize the directory structure of a Collaborative Project on the HIP.
Parameters
- project_dirpathlib.Path
Path to the project directory.
- project_titlestr
Title of the project.
- project_descriptionstr
Description of the project.
- datahipy.handlers.project.manage_project_with_datalad(project_dir: str)[source]
Create a Datalad dataset out of an existing project not Datalad-managed yet.
Parameters
- project_dirstr
Path to the project directory.
- datahipy.handlers.project.transfer_subject_participants_tsv_row(participant_id: str, source_participant_tsv: str, target_participants_tsv: str)[source]
Transfer subject row from the participants.tsv file of the source to the participants.tsv file of the target BIDS dataset.
Parameters
- participant_idstr
ID of the participant to transfer (e.g. “sub-01”).
- source_participant_tsvstr
Path to the participants.tsv file of the source BIDS dataset.
- target_participants_tsvstr
Path to the participants.tsv file of the target BIDS dataset.