Pojdi na vsebino

Ta predloga se uporablja za prikazovanje drevesastih diagramov, kjer so oznake nodusov in baze delujoče povezave. Taka drevesa so posebej uporabna za predstavljanje evolucijskih dreves.

Glej {{Cladex}} za dve dodatni funkciji:

• Double lines leading to a node can be produced as easily as dotted lines.
• Brackets or bars of a chosen colour can be placed to the right of a set of leaf nodes in the cladogram, thus allowing paraphyletic groups to be identified.

## Osnovne funkcije

### Uporaba

```
|label1=Baza
|1=Nodus
}}
```

izpiše

 Baza Nodus

```
|label1=[[Poddrevo1]]
|1=Veja1
|label2=Poddrevo2
|2=[[Veja2]]
}}
}}
```

izpiše

 Poddrevo1 Veja1 Poddrevo2

```
|label1=Poddrevo1
|1=Veja1
|label2=Poddrevo2
|2=Veja2
}}
}}
```

izpiše

 Poddrevo1 Veja1 Poddrevo2 Veja2

Note that the order of the parameters does not matter. Exactly the same output is produced by

```
|2=Veja2
|1=Veja1
|label1=Poddrevo1
|label2=Poddrevo2
}}
}}
```

 Poddrevo1 Veja1 Poddrevo2 Veja2

```
|1=Veja1
|2=Veja2
}}
|2=Leaf3
}}
}}
```

izpiše

 Veja1 Veja2

Leaf3

To replace a solid line leading to the Nth child with a dashed line, use |stateN=dashed.

```
|1=Veja1|state1=dashed
|2=Veja2
}}
|2=Leaf3
}}
}}
```

izpiše

 Veja1 Veja2

Leaf3

### Tips

An easy way of creating larger cladograms is to use the Newick format and proceed to edit it using a suitable text editor to produce the markup.

3. Replace ")" with "}}"
4. Edit to replace commas with pipes and numbers
5. Edit clade labels if needed

```
|1=a
|2=b
}}
|1=c
|2=d
}}
}}

```

Example Perl script to automate the conversion:

```use constant N=>"\n";
use constant T=>"\t";

my \$tree='((a,b),(c,d));'; # get sequence
\$tree=~s/[\n\r]//g; # loose those spaces
\$tree=~ s/\:[\.\d]+//g; # loose those lengths
while (\$tree=~ m/\(/) {
foreach my \$clade (\$tree=~ m/\(([^\(\)]+)\)/g) {
s/(\t+)/\$1\t/g for @branches;
die 'ERROR: degenerate/empty node!'.N if \$#branches<1;
}
pos(\$tree)=0;
}
\$tree=~s/(\t*)\t\}\}/\$1\}\}/g; # lazy fix

print \$tree;
```

## Using a box

You can nest the templates and use links around the text. You may use non-breaking spaces (&nbsp;) to obtain spaces or to have labels that have spaces.

The entire cladogram can be placed in a box so that text flows nicely around it. You can use {{Cladogram}} to produce the box.

Example
Neornithes
Paleognathae

Neognathae

Other birds

Galloanserae

```{{cladogram|title=Example
|label1=[[Neornithes]]
|label1=[[Paleognathae]]
|1=
|label2= [[Neognathae]]
|1=Other birds
|label1=
|label2=[[Galloanserae]]
|1=[[Anseriformes]]
|label2=
|1=[[Galliformes]]
|2=[[Craciformes]]
}}
}}
}}
}}
}}
}}
```

## Controlling the layout of sisters

When one sister is represented as a leaf node and the other as a labelled subclade, they do not appear to be at the same level. Consider this cladogram:

Banksia subser. Sphaerocarpae (5 taxa)

Banksia subser. Leptophyllae
 (4 other taxa)

Although Banksia subser. Sphaerocarpae and Banksia subser. Leptophyllae are sisters, their names are not aligned in the cladogram. If this is considered undesirable, one solution is to use a label in both cases, as shown hereafter, which now shows the sisters at the same level.

Banksia subser. Sphaerocarpae

(5 taxa)

Banksia subser. Leptophyllae
 (4 other taxa)

Another 'trick' is to introduce a dummy clade. The dotted line hereafter shows where an extra clade has been inserted:

Banksia subser. Leptophyllae
 (4 other taxa)

```{{Klad
|1=Sister1
|label2=Sister2
...
}}
}}```

use

```{{Klad
|1=Sister1
|label1=Sister2
...
}}
}}
}}```

## Limitations

### Label length

Labels produced by |labelN=, where N is 1, 2, ..., can lead to poor layout of the resulting cladogram. (This does not apply to the text of leaves, i.e. text produced by |N=.) To avoid problems:

• Labels should be kept as short as possible, ideally a single word
• Any necessary spaces in labels should be represented as &nbsp; not as actual spaces.
• Line breaks (i.e. <br/>) should not be used.

### Browser differences

Cladograms are drawn by generating hidden tables. The horizontal and vertical lines making up the tree are actually the edges of table cells. The tables are then drawn by the browser or user agent using its internal algorithms. As these differ from browser to browser, the trees produced will not look the same on all browsers.

In particular, od april 2012 there are two algorithms for laying out tables with empty cells, used by two groups of browsers. Browsers like Internet Explorer and Firefox use one algorithm, producing cladograms like the two on the left in the diagram. Browsers like Safari, Chrome and Opera use another algorithm, producing cladograms like the two on the right in the diagram.

No automated "fix" for these differences exists at present.

If there is a choice over the ordering of the terminal nodes (leaves) of the tree, cladograms look best in the second group of browsers if as much branching as possible is at the bottom of the cladogram. Typically this is produced by arranging the terminal nodes downwards on the page in order of their evolutionary divergence. Compare the bottom row of the diagram to the top row.