Skip to content

Command Line Interface

s.ciccolella edited this page Jun 25, 2020 · 3 revisions

Once installed the tool can be used directly from the command line using the command mp3treesim with the following arguments:

usage: mp3treesim [-h] [-i | -u | -g] [-c CORES] [--labeled-only]
                  [--exclude [EXCLUDE [EXCLUDE ...]]]
                  TREE TREE

MP3 tree similarity measure

positional arguments:
  TREE                  Paths to the trees

optional arguments:
  -h, --help            show this help message and exit
  -i                    Run MP3-treesim in Intersection mode.
  -u                    Run MP3-treesim in Union mode.
  -g                    Run MP3-treesim in Geometric mode.
  -c CORES, --cores CORES
                        Number of cores to be used in computation.
  --labeled-only        Ingore nodes without "label" attribute. The trees will
                        be interpred as partially-label trees.
  --exclude [EXCLUDE [EXCLUDE ...]]
                        String(s) of comma separated labels to exclude from
                        computation. If only one string is provided the labels
                        will be excluded from both trees. If two strings are
                        provided they will be excluded from the respective
                        tree. E.g.: --exclude "A,D,E" will exclude labels from
                        both trees; --exclude "A,B" "C,F" will exclude A,B
                        from Tree 1 and C,F from Tree 2; --exclude "" "C" will
                        exclude C from Tree 2 and nothing from Tree 1

The necessary arguments are the two trees which must be one of the input formats described in this section.

Optional arguments

Computational arguments

By default mp3treesim is run using the sigmoid fuction which combines the similarities computed on both the intersection and union of labels of the two input trees, as described in the paper.

It is possible to modify this behaviour and obtain the value computed on the intersection only (flag -i), on the union only (flag -u) or to use a geometric mean as combination of the two values (flag -g). We advise the user to use the default sigmoid function.

Partially-labeld trees

It is possible to consider the input trees as partially labeld trees, as described in the Input Formats section, by using the flag --labeled-only. With this flag both input trees will be considered partially-labeled trees.

Parallel execution

The tool scale to hundreds of mutation quite fast (200 mutations in ~30 seconds), however to decrease run times it is possible to compute the measure in parallel by using the argument -c CORES by default it is set to 1, if a value of 0 (or less) is specified the program will use all the cores available on the machine.

Exclude mutations

It is possible to exclude a set of mutations from the computation, to avoid rewriting the trees manually by using the --exclude option. This argument takes one or two strings as input; each string must contain the labels that should be ignored in the computation separated by a comma.

If only one string is passed then the labels will be ignored from both trees, if two strings are passed they will be ingored from the first and second tree respectively.

Examples:

  • --exclude "A,D,E" will exclude labels frm both trees
  • --exclude "A,B" "C,F" will exclude A,B from Tree 1 and C,F from Tree 2
  • --exclude "" "C" will exclude C from Tree 2 and nothing from Tree 1