Help - XTG format

From TreeGraph help
(Redirected from Xtg)

The XTG format (extensible TreeGraph format) is the native tree format of TreeGraph 2. It describes all document elements including their formats and values as well as the document formats as XML tags.

Besides XTG TreeGraph 2 is also able to read and write Newick, Nexus, phyloXML and text files. (See Open files or Importing node/branch data for details.)

XTG is defined by a XML Schema file you can find under http://bioinfweb.info/xmlns/xtg/1.1.xsd. Additionally a detailed description can be found in the development section.

Different versions

The current version of XTG is 1.1, which is the first version formally describes with a XML Schema document and is used since TreeGraph 2.0.42. Older versions of TreeGraph 2 read and write XML documents with the same XML elements (the older the version the less elements are supported) but do not declare the XTG namespace and the location of the XSD file.

Documents created with version 2.0.42 or later can not be opened with older versions the the attributes of the TreeGraphDocument tag are present. It is recommended to use the latest version but if you need to open a newer file with a version before 2.0.42 you can do that by manually removing the namespace attributes (e.g. with any text editor) before opening the XTG document.

Example

The following example contains all document elements as well as a hidden node data (ID2) and hidden branch data (ID3) entry at the same position as the text label (ID1).

XTGExample.png

<?xml version="1.0" encoding="UTF-8"?>
<TreegraphDocument xmlns="http://bioinfweb.info/xmlns/xtg"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://bioinfweb.info/xmlns/xtg 
                          http://bioinfweb.info/xmlns/xtg/1.1.xsd">
                          
  <GlobalFormats BgColor="#FFFFFF" BranchLengthScale="0.1" ShowScaleBar="true"
        ShowRooted="false" AlignToSubtree="true" LabelsLeft="true">
    <DocMargin Left="2.0" Top="2.0" Right="2.0" Bottom="2.0"></DocMargin>
  </GlobalFormats>
  
  <Tree>
    <Node Text="Internal1" IsDecimal="false" UniqueName="qy07eczjbe" 
          TextColor="#000000" TextHeight="6.0" TextStyle="" FontFamily="Arial"
          DecimalFormat="#0.0#####" LocaleLang="en" LocaleCountry="" 
          LocaleVariant="" LineColor="#000000" LineWidth="0.3" EdgeRadius="1.0">
      <LeafMargin Left="1.0" Top="0.3" Right="1.0" Bottom="0.3"></LeafMargin>
      <Branch Length="2.0" LineColor="#000000" LineWidth="0.3" 
            ConstantWidth="false" MinLength="4.0" MinSpaceAbove="0.0" 
            MinSpaceBelow="0.0">
      </Branch>
      
      <Node Text="Internal2" IsDecimal="false" UniqueName="3gozymvt9n" 
            TextColor="#000000" TextHeight="6.0" TextStyle="" FontFamily="Arial"
            DecimalFormat="#0.0#####" LocaleLang="en" LocaleCountry="" 
            LocaleVariant="" LineColor="#000000" LineWidth="0.3" 
            EdgeRadius="1.0">
        <LeafMargin Left="1.0" Top="0.3" Right="1.0" Bottom="0.3"></LeafMargin>
        <Branch LineColor="#000000" LineWidth="0.3" ConstantWidth="false" 
              MinLength="4.0" MinSpaceAbove="0.0" MinSpaceBelow="0.0">
          <TextLabel Text="18.3" IsDecimal="true" TextColor="#000000" 
                TextHeight="4.0" TextStyle="" FontFamily="Arial" 
                DecimalFormat="#0.0#####" LocaleLang="en" LocaleCountry="" 
                LocaleVariant="" Id="ID1" Above="true" LineNo="0" LinePos="0">
            <LabelMargin Left="1.0" Top="1.0" Right="1.0" Bottom="1.0">
            </LabelMargin>
          </TextLabel>
          <IconLabel LineColor="#FF6633" LineWidth="0.3" Icon="Star" 
                IconWidth="5.0" IconHeight="5.0" IconFilled="false" Id="ID1" 
                Above="true" LineNo="1" LinePos="0">
            <LabelMargin Left="1.0" Top="1.0" Right="1.0" Bottom="1.0">
            </LabelMargin>
          </IconLabel>
          <InvisibleData Id="ID3" Text="18.3" IsDecimal="true"></InvisibleData>
        </Branch>
        <InvisibleData Id="ID2" Text="18.3" IsDecimal="true"></InvisibleData>
      
        <Node Text="A" IsDecimal="false" UniqueName="09q8i4x4s6" 
              TextColor="#000000" TextHeight="6.0" TextStyle="" 
              FontFamily="Arial" DecimalFormat="#0.0#####" LocaleLang="en" 
              LocaleCountry="" LocaleVariant="" LineColor="#000000" 
              LineWidth="0.3" EdgeRadius="1.0">
          <LeafMargin Left="1.0" Top="0.3" Right="1.0" Bottom="0.3">
          </LeafMargin>
          <Branch Length="5.0" LineColor="#000000" LineWidth="0.3" 
                ConstantWidth="false" MinLength="4.0" MinSpaceAbove="0.0" 
                MinSpaceBelow="0.0">
          </Branch>
        </Node>
        
        <Node Text="B" IsDecimal="false" UniqueName="rggkem0ajy" 
              TextColor="#000000" TextHeight="6.0" TextStyle="" 
              FontFamily="Arial" DecimalFormat="#0.0#####" LocaleLang="en" 
              LocaleCountry="" LocaleVariant="" LineColor="#000000" 
              LineWidth="0.3" EdgeRadius="1.0">
          <LeafMargin Left="1.0" Top="0.3" Right="1.0" Bottom="0.3">
          </LeafMargin>
          <Branch Length="3.0" LineColor="#000000" LineWidth="0.3" 
                ConstantWidth="false" MinLength="4.0" MinSpaceAbove="0.0" 
                MinSpaceBelow="0.0">
          </Branch>
        </Node>
      </Node>
      
      <Node Text="C" IsDecimal="false" UniqueName="iq80ulayeq" 
            TextColor="#000000" TextHeight="6.0" TextStyle="" FontFamily="Arial"
            DecimalFormat="#0.0#####" LocaleLang="en" LocaleCountry="" 
            LocaleVariant="" LineColor="#000000" LineWidth="0.3" 
            EdgeRadius="1.0">
        <LeafMargin Left="1.0" Top="0.3" Right="1.0" Bottom="0.3"></LeafMargin>
        <Branch Length="7.0" LineColor="#000000" LineWidth="0.3" 
              ConstantWidth="false" MinLength="4.0" MinSpaceAbove="0.0" 
              MinSpaceBelow="0.0">
        </Branch>
      </Node>
    </Node>
    
    <ScaleBar LineColor="#000000" LineWidth="0.3" TextColor="#000000" 
          TextHeight="4.0" TextStyle="" FontFamily="Arial" 
          DecimalFormat="#0.0#####" LocaleLang="en" LocaleCountry="" 
          LocaleVariant="" Align="left" TreeDistance="3.0" Width="20.0mm" 
          Height="3.0" SmallInterval="10.0" LongInterval="10" StartLeft="true" 
          Increasing="true">
    </ScaleBar>
    
    <Legend Text="L" IsDecimal="false" Anchor0="rggkem0ajy" Anchor1="iq80ulayeq"
          LegendPos="0" MinTreeDistance="0.0" LegendSpacing="1.0" 
          LegendStyle="bracket" Orientation="horizontal" LineColor="#000000" 
          LineWidth="0.3" EdgeRadius="1.0" TextColor="#000000" TextHeight="6.0"
          TextStyle="" FontFamily="Arial" DecimalFormat="#0.0#####" 
          LocaleLang="en" LocaleCountry="" LocaleVariant="">
      <LegendMargin Left="1.0" Top="0.0" Right="1.0" Bottom="0.0">
      </LegendMargin>
    </Legend>
  </Tree>
</TreegraphDocument>

See also