Skip to content

merge-tsv - Gather BIDS and CAPS data into a single TSV file

BIDS and CAPS datasets are composed of multiple TSV files for the different subjects and sessions. While this has some advantages, it may not be convenient when performing statistical analyses (with external statistical software tools for instance). This command merges all the TSV files into a single larger TSV file and can be run with the following command line:

clinica iotools merge-tsv [OPTIONS] BIDS_DIRECTORY OUTPUT_TSV

where:

  • BIDS_DIRECTORY is the input folder containing the dataset in a BIDS hierarchy.
  • OUTPUT_TSV is the path of the output TSV file. If a directory is specified instead of a file name, the default name for the file created will be merge-tsv.tsv.

The optional arguments allow the user to also merge data from a CAPS directory, which will be concatenated to the BIDS summary. The main optional arguments are the following:

  • -caps: input folder of a CAPS compliant dataset

If a CAPS folder is given, data generated by the pipelines of Clinica (regional measures) will be merged to the output file, and a summary file containing the names of the atlases merged will be generated in the same folder.

  • -tsv: input list of subjects and sessions

If an input list of subjects and sessions is given, the merged file will only gather information from the pairs of subjects and sessions specified.

Example

clinica iotools merge-tsv /Home/ADNI_BIDS /Home/merge-tsv.tsv -caps /Home/ADNI_CAPS -tsv /Home/list_subjects.tsv

The output file will contain one row for each visit:

participant_id   session_id   date_of_birth   ...   ..._ROI-0   ..._ROI-1  ...
sub-01           ses-M000      25/04/41        ...   9.824750    0.023562
sub-01           ses-M018      25/04/41        ...   8.865353    0.012349
sub-02           ses-M000      09/01/91        ...   9.586342    0.027254
...

Note

The suffix "_intensity" is added systematically to the atlas statistics of t1-volume and pet-volume pipelines.

A complete list of optional arguments can be obtained with the command line clinica merge-tsv --help

Contact us !