<?xml version="1.0" encoding="UTF-8"?>

<gating:Gating-ML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:gating="http://www.isac-net.org/std/Gating-ML/v2.0/gating"
    xmlns:transforms="http://www.isac-net.org/std/Gating-ML/v2.0/transformations"
    xmlns:data-type="http://www.isac-net.org/std/Gating-ML/v2.0/datatypes"
    xsi:schemaLocation="
        http://www.isac-net.org/std/Gating-ML/v2.0/gating ../../XSD/Gating-ML.v2.0.xsd
        http://www.isac-net.org/std/Gating-ML/v2.0/transformations ../../XSD/Transformations.v2.0.xsd
        http://www.isac-net.org/std/Gating-ML/v2.0/datatypes ../../XSD/DataTypes.v2.0.xsd">
    <data-type:custom_info>
        This Gating-ML 2.0 file is small Gating-ML example.
        <author>
            <name>Josef Spidlen</name>
            <email>jspidlen@bccrc.ca</email>
        </author>
    </data-type:custom_info>
    <gating:RectangleGate gating:id="Range1">
        <gating:dimension gating:compensation-ref="uncompensated" gating:min="100">
            <data-type:fcs-dimension data-type:name="FSC-H" />
        </gating:dimension>
    </gating:RectangleGate>

    <gating:RectangleGate gating:id="Rectangle1">
        <gating:dimension gating:compensation-ref="uncompensated" gating:min="20" gating:max="80">
            <data-type:fcs-dimension data-type:name="SSC-H" />
        </gating:dimension>
        <gating:dimension gating:compensation-ref="uncompensated" gating:min="70" gating:max="200">
            <data-type:fcs-dimension data-type:name="FL1-H" />
        </gating:dimension>
    </gating:RectangleGate>

    <gating:PolygonGate gating:id="Polygon1">
        <gating:dimension gating:compensation-ref="FCS">
            <data-type:fcs-dimension data-type:name="FL2-H" />
        </gating:dimension>
        <gating:dimension gating:compensation-ref="FCS">
            <data-type:fcs-dimension data-type:name="FL3-H" />
        </gating:dimension>
        <gating:vertex>
            <gating:coordinate data-type:value="5" />
            <gating:coordinate data-type:value="5" />
        </gating:vertex>
        <gating:vertex>
            <gating:coordinate data-type:value="500" />
            <gating:coordinate data-type:value="5" />
        </gating:vertex>
        <gating:vertex>
            <gating:coordinate data-type:value="500" />
            <gating:coordinate data-type:value="500" />
        </gating:vertex>
        <gating:vertex>
            <gating:coordinate data-type:value="499.999999" />
            <gating:coordinate data-type:value="500" />
        </gating:vertex>
        <gating:vertex>
            <gating:coordinate data-type:value="5" />
            <gating:coordinate data-type:value="5.000001" />
        </gating:vertex>
    </gating:PolygonGate>
    
    <gating:EllipsoidGate gating:id="Ellipse1">
        <gating:dimension gating:compensation-ref="MySpill">
            <data-type:fcs-dimension data-type:name="FITC" />
        </gating:dimension>
        <gating:dimension gating:compensation-ref="MySpill">
            <data-type:fcs-dimension data-type:name="PE" />
        </gating:dimension>
        <gating:mean>
            <gating:coordinate data-type:value="12.99701" />
            <gating:coordinate data-type:value="16.22941" />
        </gating:mean>
        <gating:covarianceMatrix>
            <gating:row>
                <gating:entry data-type:value="62.5" />
                <gating:entry data-type:value="37.5" />
            </gating:row>
            <gating:row>
                <gating:entry data-type:value="37.5" />
                <gating:entry data-type:value="62.5" />
            </gating:row>
        </gating:covarianceMatrix>
        <gating:distanceSquare data-type:value="1" />
    </gating:EllipsoidGate>
    
    <gating:EllipsoidGate gating:id="Ellipsoid3D">
        <gating:dimension gating:compensation-ref="FCS">
            <data-type:fcs-dimension data-type:name="FL3-H" />
        </gating:dimension>
        <gating:dimension gating:compensation-ref="FCS">
            <data-type:fcs-dimension data-type:name="FL4-H" />
        </gating:dimension>
        <gating:dimension gating:compensation-ref="FCS">
            <data-type:fcs-dimension data-type:name="FL1-H" />
        </gating:dimension>
        <gating:mean>
            <gating:coordinate data-type:value="40.3" />
            <gating:coordinate data-type:value="30.6" />
            <gating:coordinate data-type:value="20.8" />
        </gating:mean>
        <gating:covarianceMatrix>
            <gating:row>
                <gating:entry data-type:value="2.5" />
                <gating:entry data-type:value="7.5" />
                <gating:entry data-type:value="17.5" />
            </gating:row>
            <gating:row>
                <gating:entry data-type:value="7.5" />
                <gating:entry data-type:value="7" />
                <gating:entry data-type:value="13.5" />
            </gating:row>
            <gating:row>
                <gating:entry data-type:value="15.5" />
                <gating:entry data-type:value="13.5" />
                <gating:entry data-type:value="4.3" />
            </gating:row>
        </gating:covarianceMatrix>
        <gating:distanceSquare data-type:value="1" />
    </gating:EllipsoidGate>
    
    <gating:QuadrantGate gating:id="Quadrant1">
        <gating:divider gating:id="FL2" gating:compensation-ref="FCS">
            <data-type:fcs-dimension data-type:name="FL2-H" />
            <gating:value>12.14748</gating:value>
        </gating:divider>
        <gating:divider gating:id="FL4" gating:compensation-ref="FCS">
            <data-type:fcs-dimension data-type:name="FL4-H" />
            <gating:value>14.22417</gating:value>
        </gating:divider>
        <gating:Quadrant gating:id="FL2P-FL4P">
            <gating:position gating:divider_ref="FL2" gating:location="15" />
            <gating:position gating:divider_ref="FL4" gating:location="15" />
        </gating:Quadrant>
        <gating:Quadrant gating:id="FL2N-FL4P">
            <gating:position gating:divider_ref="FL2" gating:location="5" />
            <gating:position gating:divider_ref="FL4" gating:location="15" />
        </gating:Quadrant>
        <gating:Quadrant gating:id="FL2N-FL4N">
            <gating:position gating:divider_ref="FL2" gating:location="5" />
            <gating:position gating:divider_ref="FL4" gating:location="5" />
        </gating:Quadrant>
        <gating:Quadrant gating:id="FL2P-FL4N">
            <gating:position gating:divider_ref="FL2" gating:location="15" />
            <gating:position gating:divider_ref="FL4" gating:location="5" />
        </gating:Quadrant>
    </gating:QuadrantGate>
    
    <transforms:transformation transforms:id="FL2Rat1">
        <transforms:fratio transforms:A="1" transforms:B="0" transforms:C="-1">
            <data-type:fcs-dimension data-type:name="FL2-H" />
            <data-type:fcs-dimension data-type:name="FL2-A" />
        </transforms:fratio>
    </transforms:transformation>

    <gating:RectangleGate gating:id="RatRange1">
        <gating:dimension gating:compensation-ref="uncompensated" gating:min="3" gating:max="16.4">
            <data-type:new-dimension data-type:transformation-ref="FL2Rat1" />
        </gating:dimension>
    </gating:RectangleGate>
    
    <transforms:transformation transforms:id="MyRatLog">
        <transforms:flog transforms:T="100" transforms:M="2" />
    </transforms:transformation>
    
    <gating:BooleanGate gating:id="And1">
        <gating:and>
            <gating:gateReference gating:ref="Polygon1" />
            <gating:gateReference gating:ref="Range1" />
        </gating:and>
    </gating:BooleanGate>
    
    <gating:BooleanGate gating:id="Or1">
        <gating:or>
            <gating:gateReference gating:ref="Range1" />
            <gating:gateReference gating:ref="Ellipse1" />
            <gating:gateReference gating:ref="Polygon1" />
        </gating:or>
    </gating:BooleanGate>

    <gating:BooleanGate gating:id="Not1">
        <gating:not>
            <gating:gateReference gating:ref="Ellipse1" />
        </gating:not>
    </gating:BooleanGate>
    
    <transforms:spectrumMatrix transforms:id="MySpill">
        <transforms:fluorochromes>
            <data-type:fcs-dimension data-type:name="FITC" />
            <data-type:fcs-dimension data-type:name="PE" />
            <data-type:fcs-dimension data-type:name="PerCP" />
        </transforms:fluorochromes>
        <transforms:detectors>
            <data-type:fcs-dimension data-type:name="FL1-H" />
            <data-type:fcs-dimension data-type:name="FL2-H" />
            <data-type:fcs-dimension data-type:name="FL3-H" />
        </transforms:detectors>
        <transforms:spectrum>
            <transforms:coefficient transforms:value="1" />
            <transforms:coefficient transforms:value="0.02" />
            <transforms:coefficient transforms:value="0.06" />
        </transforms:spectrum>
        <transforms:spectrum>
            <transforms:coefficient transforms:value="0.11" />
            <transforms:coefficient transforms:value="1" />
            <transforms:coefficient transforms:value="0.07" />
        </transforms:spectrum>
        <transforms:spectrum>
            <transforms:coefficient transforms:value="0.09" />
            <transforms:coefficient transforms:value="0.01" />
            <transforms:coefficient transforms:value="1" />
        </transforms:spectrum>
    </transforms:spectrumMatrix>
    
    <gating:BooleanGate gating:id="ParAnd" gating:parent_id="Polygon1">
        <gating:and>
            <gating:gateReference gating:ref="Range1" />
            <gating:gateReference gating:ref="Ellipse1" />
        </gating:and>
    </gating:BooleanGate>
   
</gating:Gating-ML>
