API
API Documentation
ConfigWriter
Bases: ABC
Abstract base class for iTOL configuration file writers.
Source code in itol_config/interfaces/base_interface.py
__init__(data, label, colour_lookup=None)
Initialise a ConfigWriter object for a simple dictionary dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
dict
|
Dictionary containing the values to be coloured. |
required |
label |
str
|
Label for the colour strip. |
required |
colour_lookup |
Optional[dict]
|
Dictionary of colours for each unique value in the data. If not provided, it will be generated. |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in itol_config/interfaces/base_interface.py
write(outfile)
abstractmethod
Write the iTOL configuration file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
outfile |
str
|
Output file name. |
required |
Returns:
Type | Description |
---|---|
None
|
|
ConfigWriterMatrix
Bases: ABC
Abstract base class for iTOL configuration file writers.
Source code in itol_config/interfaces/base_interface.py
__init__(data, label, colour_lookup=None)
Initialise a ConfigWriter for a matrix-type dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
dict
|
Dictionary containing the values to be coloured. |
required |
label |
str
|
Label for the colour strip. |
required |
colour_lookup |
Optional[dict]
|
Dictionary of colours for each unique value in the data. If not provided, it will be generated. |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in itol_config/interfaces/base_interface.py
write(outfile)
abstractmethod
Write the iTOL configuration file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
outfile |
str
|
Output file name. |
required |
Returns:
Type | Description |
---|---|
None
|
|
Source code in itol_config/interfaces/base_interface.py
ColourStripConfigWriter
Bases: ConfigWriter
Source code in itol_config/interfaces/colour_strip.py
write(outfile)
Parse the data to be coloured.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
outfile |
str
|
Output file name. |
required |
Returns:
Type | Description |
---|---|
None
|
|
Source code in itol_config/interfaces/colour_strip.py
TextLabelConfigWriter
Bases: ConfigWriter
Source code in itol_config/interfaces/text_label.py
write(outfile)
Parse the data to be coloured.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
outfile |
str
|
Output file name. |
required |
Returns:
Type | Description |
---|---|
None
|
|
Source code in itol_config/interfaces/text_label.py
BinaryDataConfigWriter
Bases: ConfigWriterMatrix
Source code in itol_config/interfaces/binary_data.py
__init__(data, label, colour_lookup=None, shape=2)
Initialise a ConfigWriter object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
dict
|
Dictionary containing the values to be coloured. |
required |
label |
str
|
Label for the colour strip. |
required |
colour_lookup |
Optional[dict]
|
Dictionary of colours for each unique value in the data. If not provided, it will be generated. |
None
|
shape |
int
|
Shape of the field. |
2
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in itol_config/interfaces/binary_data.py
write(outfile)
Write the iTOL configuration file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
outfile |
str
|
Output file name. |
required |
Returns:
Type | Description |
---|---|
None
|
|