<!--- 
PROGENYPEDIGREE is the document element within which all the subelements should be contained.
When generating an XML document and you wish to have validation done against the DTD, include the following line

<!DOCTYPE PROGENYPEDIGREE  SYSTEM "drive:/path/ProgenyAnywhereJ.dtd">

where drive:/path/ is the absolutepath to the location of the DTD.

Or to use the centrally located DTD on Progeny website, use

<!DOCTYPE PROGENYPEDIGREE  SYSTEM "http://www.progenygenetics.com/anywhere_doc/doc/ProgenyAnywhereJ.dtd">

-->
<!ELEMENT PROGENYPEDIGREE (LEGEND?, FAMILY+, PROPERTIES?, DICTIONARY?, MARKERLEGEND*, CHECKSUM?, DATABASE?, SUBTEXTLEGEND?)>
<!ATTLIST PROGENYPEDIGREE
	versionnumber CDATA #REQUIRED
	createdby CDATA "1.0.0"
	creationdate CDATA ""
    source CDATA "progeny"
>


<!--
LEGEND element describes the legend that is used to map text descriptions of conditions being tracked on the pedigree to the color icons that will be used
 to designate them. A legend can be positioned on the pedigree by specifying the legendx, legendy, legendwidth and legendheight values.
-->
<!ELEMENT LEGEND (LEGENDITEM*)>
<!ATTLIST LEGEND
	legendx CDATA "30"
	legendy CDATA "70"
	legendheight CDATA "1000"
	legendwidth CDATA "10"
>


<!ELEMENT CHECKSUM EMPTY>
<!ATTLIST CHECKSUM
	value CDATA ""
>



<!--
SUBTEXTLEGEND element describes the subtext legend is specified
-->
<!ELEMENT SUBTEXTLEGEND (SUBTEXTLEGENDITEM*)>

<!--
SUBTEXTLEGENDITEM element describes the subtext legend items
-->
<!ELEMENT SUBTEXTLEGENDITEM (SUBTEXTLEGENDITEMWHERE*)>
<!ATTLIST SUBTEXTLEGENDITEM
    fieldid CDATA #REQUIRED
    itemorder CDATA #REQUIRED
	legendtext CDATA ""
>



<!--
SUBTEXTLEGENDITEMWHERE element describes conditions
-->
<!ELEMENT SUBTEXTLEGENDITEMWHERE EMPTY>
<!ATTLIST SUBTEXTLEGENDITEMWHERE
	fieldid CDATA #REQUIRED
    operator CDATA #REQUIRED
	value CDATA ""
>

<!--
LEGENDITEM element describes the text that desribes the conditions being tracked while the LEGENDSYMBOL and LEGENDQUADRANTS determine the colors that will be used to
designate this condition when used on an INDIVIDUAL icon
-->
<!ELEMENT LEGENDITEM (LEGENDSYMBOL?, LEGENDQUADRANT*, LEGENDITEMWHERE*)>
<!ATTLIST LEGENDITEM
	legendid CDATA #REQUIRED
	legendtext CDATA ""
>

<!--
LEGENDSYMBOL element describes the quadrant colors using color descriptions e.g. red, green, blue, yellow etc. This as opposed to the more flexible RGB values used in
LEGENDQUADRANT's. Below is is an example of how to use a LEGENDSYMBOL and how to map it to a <SYMBOL> element under the <INDIVIDUAL> element.

<LEGENDITEM legendid='1' legendText='Breast Cancer'>

<LEGENDSYMBOL quadrant1='red' vline='yes'>
</LEGENDSYMBOL>
</LEGENDITEM>

With the legend item defined, an Individual who has Breast cancer will have a <SYMBOL> element with the following attributes

<SYMBOL quadrant1='red' vline='yes'>
</SYMBOL>

The icon for this person will be rendered with a red 1st quadrant and a vertical line, showing that the person has breast cancer.
-->
<!ELEMENT LEGENDSYMBOL EMPTY>
<!ATTLIST LEGENDSYMBOL
	quadrant1 (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	quadrant2 (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	quadrant3 (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	quadrant4 (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	centersquare (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	centerdot (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
    quadrant1DotColor (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
    quadrant2DotColor (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
    quadrant3DotColor (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
    quadrant4DotColor (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	vline (yes | no) "no"
	hline (yes | no) "no"
	quadrant1dot (yes | no) "no"
	quadrant2dot (yes | no) "no"
	quadrant3dot (yes | no) "no"
	quadrant4dot (yes | no) "no"
>

<!--
LEGENDQUADRANT element describes the RBG values that will be used to paint the Individual icons
-->
<!ELEMENT LEGENDQUADRANT EMPTY>

<!--
LEGENDQUADRANT element attributes defined below
quadnum - The quadrant number ranging from 1 to 9 where each number represents a quadrant as follows:
    Quad          Desc
    ....          ......................
    1             1st qudrant of the icon
    2             1st qudrant of the icon
    3             1st qudrant of the icon
    4             1st qudrant of the icon
    5             Center dot
    6             1st qudrant dot
    7             2nd qudrant dot
    8             3rd qudrant dot
    9             4th qudrant dot

color   - The RGB value representing the color for that quadrant when used to paint an icon
-->
<!ATTLIST LEGENDQUADRANT
	quadnum (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9) #REQUIRED
	color CDATA #REQUIRED
>



<!--
LEGENDITEMWHERE element describes conditions
-->
<!ELEMENT LEGENDITEMWHERE EMPTY>
<!ATTLIST LEGENDITEMWHERE
	fieldid CDATA #REQUIRED
        operator CDATA #REQUIRED
	value CDATA ""
>

<!ELEMENT FAMILY (INDIVIDUAL*)>
<!ATTLIST FAMILY
	javabean (yes | no) "no"
>

<!ELEMENT INDIVIDUAL (PARENTS?, SPOUSE*, SIBLING?, CHILD?, SYMBOL?, SUBTEXT*, PROGENYINTERNALINDIVIDUAL?, DATA?, MARKERDATA*)>

<!--
INDIVIDUAL element attributes defined below except the obvious ones
upn - The Unique person number of a person used to identify the person with Progeny
gender - The gender of an individual 0 - female, 1 - male, 2 - gender unknown
deceased  - 0 alive, 1 - deceased
proband  - 0 is not the proband, 1 - is proband. Only one person can have this property
noissue 0 - Not No Issue, 1 - is a no issue
adopt - 0 - not adopted in, 1 - adopted in from another family
sab  0 - not SAB, 1 - is SAB
infertile 0 - not infertile, 1 - is infertile

The following attributes are used to define the symbols that will be used to render this INDIVIDUAL's icon

	quadrant1RGB - RGB value for quadrant 1 color
	quadrant2RGB - RGB value for quadrant 2 color
	quadrant3RGB - RGB value for quadrant 3 color
	quadrant4RGB - RGB value for quadrant 4 color
    centerDotRGB - RGB value for center dot color
    quadrant1DotRGB - RGB value for quadrant 1 dot color
	quadrant2DotRGB - RGB value for quadrant 2 dot color
	quadrant3DotRGB - RGB value for quadrant 3 dot color
	quadrant4DotRGB - RGB value for quadrant 4 dot color


 The following attributes only make sense in the event that the "javabean" attributes of <FAMILY> element was set. Otherwise they must be skipped.
 The general suggestion from Progeny is that these attributes be ignored if you are generating your own XML string from a database source. Only use them if you know that
 the generation and tree values are correct, having been stored in a database from data generated by ProgenyAnywhere.

 generation - The generation of this Individual
 tree - The branch of the pedigree to which this person belongs in a multi-family pedigree. All connected perople in one family must have the same tree value
 dagger - The value for marked by can be any one of (+|-|*|0|1|2|3) where 0 means none, 1 means +, 2 means - and 3 means *
-->
<!ATTLIST INDIVIDUAL
	upn CDATA #REQUIRED
	gender (0 | 1 | 2) #REQUIRED
	icontext CDATA ""
	tag CDATA ""
	deceased (0 | 1) "0"
	proband (0 | 1) "0"
	hlight (0 | 1) "0"
	noissue (0 | 1 | 2) "0"
	adopt (0 | 1 | 2) "0"
	sab (0 | 1) "0"
	quadrant1RGB CDATA "-1"
	quadrant2RGB CDATA "-1"
	quadrant3RGB CDATA "-1"
	quadrant4RGB CDATA "-1"
    centerDotRGB CDATA "-1"
    quadrant1DotRGB CDATA "-1"
	quadrant2DotRGB CDATA "-1"
	quadrant3DotRGB CDATA "-1"
	quadrant4DotRGB CDATA "-1"
	changed (0 | 1) "0"
    infertile (0 | 1) "0"
    generation CDATA "0"
    tree CDATA "0"
    subtext CDATA ""
    indname CDATA ""
    dagger CDATA "0"
>
<!ELEMENT PARENTS (PROGENYINTERNALPARENTS?)>

<!--
PARENTS element attributes defined below
fatherid - The UPN of the INDIVIDUAL who is the father of this person. If not zero (0), there must be an <INDIVIDUAL> element whose upn attribute equals this value and that individuals's gender must be male
motherid - The UPN of the INDIVIDUAL who is the mother of this person. If not zero (0), there must be an <INDIVIDUAL> element whose upn attribute equals this value and that individuals's gender must be female
-->
<!ATTLIST PARENTS
	fatherid CDATA "0"
	motherid CDATA "0"
>

<!--
PROGENYINTERNALPARENTS element and attributes may be ignmored if generating own XML string
-->
<!ELEMENT PROGENYINTERNALPARENTS EMPTY>
<!ATTLIST PROGENYINTERNALPARENTS
	orientation (0 | 1 | 2 | 3) #REQUIRED
	parentx1 CDATA #REQUIRED
	parenty1 CDATA #REQUIRED
	parentx2 CDATA #REQUIRED
	parenty2 CDATA #REQUIRED
>

<!--
SPOUSE element and attributes may be ignmored if generating own XML string
Use the SPOUSE tag to described other individuals within the same XML document who are spouses of this individual. If If individual has 3 spouses then there will be
3 <SPOUSE> elements under the individual concerned.
-->
<!ELEMENT SPOUSE (PROGENYINTERNALSPOUSE?)>

<!--
SPOUSE element attributes described below
spousenumber - Number from 1 to n where n is the number of spouses this person has
spouseid - The UPN of the person who is the spouse. There must be an <INDIVIDUAL> element with a upn attribute with the same value
status  - The spouse relationship status can be any one of:
          casual - A casual relationship
          normal - A normal spouse relationship
          separated - Designates a spouse relationship for separated spouses
          divorced  - Designates a spouse relationship for divorced spouses

consanguineous  - yes if the spouse relationship is consanquineeous, no if not consanqineous
infertile  - - yes if the spouse relationship is infertile, no if not infertile

status (normal | separated | divorced | casual) "normal"
-->
<!ATTLIST SPOUSE
	spousenumber CDATA "0"
	spouseid CDATA "0"
	status (normal | separated | divorced | casual | none) "none"
        noissue  (yes | no) "no"
	consanguineous (yes | no) "no"
        infertile (yes | no) "no"
>

<!--
SUBTEXT element is optional. It can be used to designate subtext values that you may want shown on the pedigree.
Use one <SUBTEXT> element for each line of subtext you would want displayed
-->
<!ELEMENT SUBTEXT EMPTY>
<!ATTLIST SUBTEXT
	text CDATA ""
>

<!--
PROGENYINTERNALSPOUSE element and attributes may be ignmored if generating own XML string
-->
<!ELEMENT PROGENYINTERNALSPOUSE EMPTY>
<!ATTLIST PROGENYINTERNALSPOUSE
	orientation (0 | 1 | 2 | 3 | 4) #REQUIRED
	link CDATA #REQUIRED
	child CDATA #REQUIRED
	spousex1 CDATA #REQUIRED
	spousey1 CDATA #REQUIRED
	spousex2 CDATA #REQUIRED
	spousey2 CDATA #REQUIRED
	childx1 CDATA "0"
	childy1 CDATA "0"
	childx2 CDATA "0"
	childy2 CDATA "0"
>

<!--
SIBLING element describes the sibling relationships for this person. Only one <SIBLING> element must be used to point to this person's sibling.
The rest of the siblings will be defined by chaining <SIBLING> elements within the <INDIVIDUAL> elements of the other siblings. For instance, if there are 3
persons that are siblings, the first person will have a <SIBLING> element point to the 2nd person. The 2nd person will have a <SIBLING> element pointing to the
3rd sibling. The 3rd sibling will not have a sibling element since the chain would have been completed.
-->
<!ELEMENT SIBLING (PROGENYINTERNALSIBLING?)>

<!--
SIBLING element attributes described below
siblingid - Refers to the UPN of the person who is this person's sibling. There must be an <INDIVIDUAL> element with upn attribute with the same value
twinid    - Refers to the ID of the twin group to which this sibling belongs. Blank ("") means there is no twin status. All siblings who are twins or triplets share the same twinid
twinstyle - The twin relationship status can be any one of:
            monozygotic - Identical twins
            dizygotic   - Non identical twins
            unknown     - Not known whthere its monozygotic or disygotic
-->
<!ATTLIST SIBLING
	siblingid CDATA "0"
	twinid CDATA ""
	twinstyle (monozygotic | dizygotic | unknown) "dizygotic"
>

<!--
PROGENYINTERNALSIBLING element and attributes may be ignmored if generating own XML string
-->
<!ELEMENT PROGENYINTERNALSIBLING EMPTY>
<!ATTLIST PROGENYINTERNALSIBLING
	siblingx1 CDATA "0"
	siblingy1 CDATA "0"
	siblingx2 CDATA "0"
	siblingy2 CDATA "0"
>
<!ELEMENT CHILD (PROGENYINTERNALCHILD?)>
<!ATTLIST CHILD
	childid CDATA "0"
>

<!--
PROGENYINTERNALCHILD element and attributes may be ignmored if generating own XML string
-->
<!ELEMENT PROGENYINTERNALCHILD EMPTY>
<!ATTLIST PROGENYINTERNALCHILD
	childx1 CDATA #REQUIRED
	childx2 CDATA #REQUIRED
	childy1 CDATA #REQUIRED
	childy2 CDATA #REQUIRED
>




<!--
SYMBOL element describes the quadrant colors used to paint the Individual's icon if and when he has any one of the conditions defined in the <LEGEND>.
Below is is an example of how to use a LEGENDSYMBOL and how to map it to a <SYMBOL> element under the <INDIVIDUAL> element.

<LEGENDITEM legendid='1' legendText='Breast Cancer'>

<LEGENDSYMBOL quadrant1='red' vline='yes'>
</LEGENDSYMBOL>
</LEGENDITEM>

With the legend item defined, an Individual who has Breast cancer will have a <SYMBOL> element with the following attributes

<SYMBOL quadrant1='red' vline='yes'>
</SYMBOL>

The icon for this person will be rendered with a red 1st quadrant and a vertical line, showing that the person has breast cancer.
-->
<!ELEMENT SYMBOL EMPTY>
<!ATTLIST SYMBOL
	quadrant1 (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	quadrant2 (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	quadrant3 (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	quadrant4 (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	centersquare (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	centerdot (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
    quadrant1DotColor (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
    quadrant2DotColor (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
    quadrant3DotColor (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
    quadrant4DotColor (black | yellow | green | blue | red | gray | aqua | pink | none) "none"
	vline (yes | no) "no"
	hline (yes | no) "no"
	quadrant1dot (yes | no) "no"
	quadrant2dot (yes | no) "no"
	quadrant3dot (yes | no) "no"
	quadrant4dot (yes | no) "no"
>



<!--
DATA element used for custom data assigned to this individual. Use of this attribute assumes data coming out of a Progeny database so it generally should be ignored.
If you need to use this in conjuction with the <DICTIONARY> element and its subelements, you should contact Progeny for assistance because it is not fully documented
since there is a strong assumption that it is used when XML is generated out of Progeny database data.
-->
<!ELEMENT DATA ANY>


<!--
PROGENYINTERNALINDIVIDUAL element and attributes may generally be ignored if generating own XML string. If however data was save from Progeny and the XY positions were save into the
database, you can use this element to define the XY locations of the individual icons thus:

x - The X coordinate on which the individual icon must be rendered on the pedigree canvas
y - The Y coordinate on which the individual icon must be rendered on the pedigree canvas
generation - If defined the generation that this individual is on. This may be used ONLY if this data was created and saved from ProgenyAnywhere
tree       - If defined the tree that this individual is in in situations of multi-family pedigree. This may be used ONLY if this data was created and saved from ProgenyAnywhere

The <FAMILY> element javabean attribute would have to be set to NO for these values to be even cosidered for use in rendering icons after XML string is imported.
-->
<!ELEMENT PROGENYINTERNALINDIVIDUAL EMPTY>
<!ATTLIST PROGENYINTERNALINDIVIDUAL
	x CDATA #REQUIRED
	y CDATA #REQUIRED
	generation CDATA #REQUIRED
	tree CDATA #REQUIRED
	degree CDATA #REQUIRED
	degree2 CDATA #REQUIRED
	sibcount CDATA #REQUIRED
	gender CDATA #REQUIRED
	shadow CDATA "0"
>



<!--- Put your DTDDoc comment here. -->
<!ELEMENT MARKERDATA (MARRKER+)>

<!--
a1 - Paternal Allele
a2 - Maternal Allele
chromoid - Chromosome ID on which marker exists. This must correspond to the chromoid on MARKERITEM element under MARKERLEGEND
markerid - Marker ID. This must correspond to the fieldid on MARKERITEM element under MARKERLEGEND
-->
<!ELEMENT MARRKER EMPTY>
<!ATTLIST MARRKER
    a1 CDATA #IMPLIED
    a2 CDATA #IMPLIED
    chromoid CDATA #IMPLIED
    markerid CDATA #IMPLIED
>

<!ELEMENT PROPERTIES (PROGENYPROPERTIES?, FAMILYPROPERTIES?, DIMENSIONSPROPERTIES?)>


<!--
PROGENYPROPERTIES element describes the system wide properties used to render the pedigree. If not sure try to use the provided defaults
-->
<!ELEMENT PROGENYPROPERTIES EMPTY>
<!ATTLIST PROGENYPROPERTIES
	showgrid (0 | 1) "0"
	snapgrid (0 | 1) "0"
	showpagebreaks (0 | 1) "0"
	autodraw (0 | 1) "1"
	livedragging (0 | 1) "0"
	showlegend (0 | 1) "0"
	oneclickadd (0 | 1) "0"
	showheader (0 | 1) "1"
	showfooter (0 | 1) "1"
	importshadow (0 | 1) "0"
    standardprobandarrow (0|1) "1"
    showsubtextlegend (0|1) "0"
	smartsubtext (0|1) "0"
    probandarrowpos (UL|LL|LR|UR) "LL"
>


<!--
FAMILYPROPERTIES element describes the pedigree wide properties used to render the pedigree. If not sure try to use the provided defaults
-->
<!ELEMENT FAMILYPROPERTIES EMPTY>
<!ATTLIST FAMILYPROPERTIES
	font CDATA "Times New Roman"
	fontsize CDATA "8"
	linewidth CDATA "0"
	scale CDATA "100"
	horzgridspacing CDATA "7"
	vertgridspacing CDATA "27"
	hooks (0 | 1) "0"
	showid (0 | 1) "0"
	showdate (0 | 1) "1"
	header CDATA ""
	footer CDATA ""
>


<!--
DIMENSIONSPROPERTIES element describes the dimensions used by progeny to render the pedigree. If not sure try to use the provided defaults
Attribute subtextyvaluebean must have no default since there any other value will override the actual value provide by RHINO if the data is coming out of Progeny
Attribute childlineheight must have default since there any other value will override the actual value provide by RHINO if the data is coming out of Progeny which is 0
-->
<!ELEMENT DIMENSIONSPROPERTIES EMPTY>
<!ATTLIST DIMENSIONSPROPERTIES
	pheight CDATA "115"
	pwidth CDATA "55"
	iconheight CDATA "27"
	iconwidth CDATA "27"
	iconyvalue CDATA "39"
	subtextyvalue CDATA "52"
        subtextyvaluebean CDATA ""
	sibnumxvalue CDATA "2"
	sibnumyvalue CDATA "17"
        childlineheight CDATA ""
>

<!--
DICTIONARY element may be used to define a local and limited database with tables and fields that you can use to map back to your database.  A dictionary may contain
one or more tables
-->
<!ELEMENT DICTIONARY (TABLE+)>

<!--
TABLE element may be used to define a local database table with fields that you can use to map back to your database.  A table may contain
one or more fields
-->
<!ELEMENT TABLE (FIELD+)>

<!--
TABLE element attributes below
tableid   - A  unique ID used to identify a local table
tablename - The name of the local table in a dictionary
-->
<!ATTLIST TABLE
	tableid CDATA #REQUIRED
	tablename CDATA #REQUIRED
>

<!--
FIELD element may be used to define a local database fields that you can use to map back to your database.  A complex field may contain
one or more subfields
-->
<!ELEMENT FIELD (SUBFIELD*)>


<!--
FIELD element attributes below
fieldid   - A  unique ID used to identify a local table
fieldname - The name of the local table in a dictionary
fieldtype - The field type can be any one of Text for text data, Number for number data, Boolean for boolean data, Date for Date data
-->
<!ATTLIST FIELD
	fieldid CDATA ""
	fieldname CDATA #REQUIRED
	fieldtype (text | number | yesno | boolean | date | marker) #REQUIRED
>
<!ELEMENT SUBFIELD EMPTY>

<!--
SUBFIELD element attributes below
fieldid   - A  unique ID used to identify a local table
fieldname - The name of the local table in a dictionary
fieldtype - The field type can be any one of Text for text data, Number for number data, Boolean for boolean data, Date for Date data
-->
<!ATTLIST SUBFIELD
	fieldid CDATA #REQUIRED
	fieldname CDATA #REQUIRED
	fieldtype (Text | Number | YesNo | Boolean | Date | Marker) #REQUIRED
>

<!--
The marker legend defines marker details that will be drawn as legend for the markers data on haplotypes
-->
<!ELEMENT MARKERLEGEND (MARKERITEM)*>

<!--
 chromoid   - The chromosomeid for the chromosome on which this marker is located
 chromoname - The chromosomeid for the chromosome on which this marker is located
 sequence   - The order in which marker will appear on haplotype.
 type       - Either marker for Microsatellites or SNP for SNPs
 fieldid    - Markerid
 markername - Marker name
 -->
<!ELEMENT MARKERITEM EMPTY>
<!ATTLIST MARKERITEM
    chromoid CDATA #IMPLIED
    chromoname CDATA #IMPLIED
    sequence CDATA #IMPLIED
    type (marker | snp) #REQUIRED
    fieldid CDATA #IMPLIED
    markername CDATA #IMPLIED
>

<!ELEMENT DATABASE (FIELD*)>


