# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cgps.gitbook.io/data-flo/reference-guide/rename-newick-leaf-labels.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
