> For the complete documentation index, see [llms.txt](https://cgps.gitbook.io/data-flo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cgps.gitbook.io/data-flo/reference-guide/rename-newick-leaf-labels.md).

# rename-newick-leaf-labels

## Description

<mark style="color:purple;">`rename-newick-leaf-labels`</mark> *adaptor renames the leaf labels from a newick-format file.*

The newick data can either be pasted directly in as an input, or a file can be uploaded. To upload a newick file, use the [<mark style="color:purple;">`import-text-from-file`</mark>](/data-flo/reference-guide/import-text-from-file.md) adaptor as the newick input.

## Inputs

**`newick`**\
Type: `text`\
Required: Yes\
A tree in Newick format.

**`mapping`**\
Type: `dictionary`\
Required: Yes\
A mapping of existing labels (dictionary keys) with new labels (dictionary values).

## Outputs

**`newick`**\
Type: `text`\
A tree with renamed labels in Newick format.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`newick:`

```
(Bovine:0.69395,(Gibbon:0.0,(Orangutan:0.0,(Gorilla:0.0,(Chimp:0.0,Human:0.0)123:0.0)test:0.06124):0.0):0.54939,Mouse:1.21460);
```

`mapping:`

| KEY     | VALUE      |
| ------- | ---------- |
| Mouse   | Mice       |
| Gorilla | Silverback |

#### Outputs:

`newick`:

```
(Bovine:0.69395,(Gibbon:0.0,(Orangutan:0.0,(Silverback:0.0,(Chimp:0.0,Human:0.0)123:0.0)test:0.06124):0.0):0.54939,Mice:1.21460);
```

-> Renamed the leaf labels `Mouse` and `Gorilla` as `Mice` and `Silverback` respectively.

## Use Cases

* Provide more descriptive leaf labels prior to visualising the tree in Microreact.
* Rename labels to match information in a metadata file.
