<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.0 U (http://www.xmlspy.com) by Fabien Campagne (Mount Sinai School of Medicine) -->
<!--W3C Schema generated by XML Spy v3.5 NT (http://www.xmlspy.com)-->
<!--Change  log:
    Jan 22nd 2008 Allow definition of shape (geometry) per residue
    Sep 24th 2004  Allow one to specify at what number the protein numbering should start.
    Mar 11th 2003  Include spacers for Nand C terms for tm-bundles
    Mar 3rd  2003  Corrected NTermDomain naming.
	Feb 21st 2003. Added support for default and linked residue shapes.
	Feb 21st 2003. Fixed problem with required number of define colors (at least 1). Now minimum is zero.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xsd:element name="color-scheme">
		<xsd:annotation>
			<xsd:documentation>Selects the color-scheme. Can be either GPCRDB or monotonous.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="residue-background" minOccurs="0"/>
			</xsd:sequence>
			<xsd:attribute name="name" type="xsd:string" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="residue-background">
		<xsd:annotation>
			<xsd:documentation>Fill color for the background of a residue</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="color" type="xsd:string" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="colors">
		<xsd:annotation>
			<xsd:documentation>Groups color-related options</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="define" minOccurs="0" maxOccurs="unbounded"/>
				<xsd:element ref="color-scheme"/>
				<xsd:element ref="residue-color" minOccurs="0" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="shapes">
		<xsd:annotation>
			<xsd:documentation>Groups shape-related options</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="residue-geometry" minOccurs="0" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="define">
		<xsd:annotation>
			<xsd:documentation>Define a new color. Defined colors can be referenced by name throughout the input file. </xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="color" type="xsd:string" use="required"/>
			<xsd:attribute name="red" type="xsd:int" use="required"/>
			<xsd:attribute name="green" type="xsd:int" use="required"/>
			<xsd:attribute name="blue" type="xsd:int" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="diagram">
		<xsd:annotation>
			<xsd:documentation>Groups the main sections that determine how the diagram will appear.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="colors" minOccurs="0"/>
				<xsd:element ref="shapes" minOccurs="0"/>
				<xsd:element ref="elipses" minOccurs="0"/>
				<xsd:element ref="links" minOccurs="0"/>
				<xsd:element ref="options" minOccurs="0"/>
				<xsd:element ref="output" minOccurs="0"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="options">
		<xsd:annotation>
			<xsd:documentation>Groups options that can affect how the diagram is rendered.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="residue-shape" minOccurs="0" maxOccurs="unbounded">
					<xsd:annotation>
						<xsd:documentation>Determines how individual residues will be rendered. Attributes determine when and what type of shape is used to render a residue. When can be either linked or nothing. "linked" selects residues that are hyperlinked. "other" select all the other residues. Three shapes are supported: rectangular, circular, and octagonal</xsd:documentation>
					</xsd:annotation>
					<xsd:complexType>
						<xsd:attribute name="when" type="xsd:string" use="required">
							<xsd:annotation>
								<xsd:documentation>When to use the shape. Values can be linked (when residue is linked), or nothing (when residue is not linked).</xsd:documentation>
							</xsd:annotation>
						</xsd:attribute>
						<xsd:attribute name="shape" type="xsd:string" use="required">
							<xsd:annotation>
								<xsd:documentation>Must be "circular", "rectangular", or "octagonal"',</xsd:documentation>
							</xsd:annotation>
						</xsd:attribute>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="elipses">
		<xsd:annotation>
			<xsd:documentation>Groups elipses related options</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="exclude" minOccurs="0" maxOccurs="unbounded"/>
				<xsd:element ref="include" minOccurs="0" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="exclude">
		<xsd:annotation>
			<xsd:documentation>Excludes elipses from a range of residues.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="residueRange" use="required">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:minLength value="1"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="include">
		<xsd:annotation>
			<xsd:documentation>Allows elipses to be included in a range of residues.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="residueRange" use="required">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:minLength value="1"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="diagram-layout">
		<xsd:annotation>
			<xsd:documentation>Describes the graphical arrangement of secondary structure units on the 2D page. </xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:annotation>
					<xsd:documentation>Defines the graphical subunits of the diagram.</xsd:documentation>
				</xsd:annotation>
				<xsd:choice>
					<xsd:element name="tm-bundle" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Use the bundle to layout integral membrane proteins. Specify the number of transmembrane (TM) segment to display, and the bundle will automatically calculate the layout of the diagram. Attributes of the bundle include the direction the N-term will take (up or down). Ids must also be generated for each subunit the tm-bundle contains, so that subunits can be referenced by the secondary -structure section of the diagram. The N and C-term X and Y attributes relate to the spacer values that can be used when drawing the diagram.</xsd:documentation>
						</xsd:annotation>
						<xsd:complexType>
							<xsd:attribute name="tm-number" type="xsd:int" use="required"/>
							<xsd:attribute name="tm-id-prefix" type="xsd:string" use="optional" default="TM"/>
							<xsd:attribute name="nterm-id" type="xsd:string" use="optional" default="N-term"/>
							<xsd:attribute name="cterm-id" type="xsd:string" use="optional" default="C-term"/>
							<xsd:attribute name="direction" type="xsd:string" use="optional" default="up"/>
							<xsd:attribute name="N-termX" type="xsd:int" use="optional"/>
							<xsd:attribute name="N-termY" type="xsd:int" use="optional"/>
							<xsd:attribute name="C-termX" type="xsd:int" use="optional"/>
							<xsd:attribute name="C-termY" type="xsd:int" use="optional"/>
						</xsd:complexType>
					</xsd:element>
					<xsd:element ref="subunit" maxOccurs="unbounded"/>
				</xsd:choice>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="direction">
		<xsd:annotation>
			<xsd:documentation>Direction is a vector(x,y) which indicates the orientation of a subunit (helix or loop) within the plane.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="x" type="xsd:int" use="required"/>
			<xsd:attribute name="y" type="xsd:int" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="image">
		<xsd:annotation>
			<xsd:documentation>Select options for an image output of the diagram.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="format" use="required">
				<xsd:simpleType>
					<xsd:restriction base="xsd:NMTOKEN">
						<xsd:enumeration value="GIF"/>
						<xsd:enumeration value="JPG"/>
						<xsd:enumeration value="SVG"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:attribute>
			<xsd:attribute name="filename" type="xsd:string" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="image-map">
		<xsd:annotation>
			<xsd:documentation>Output an image map document. Currently not supported. (maps are embedded in the XML produced.)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="filename" type="xsd:string" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="links">
		<xsd:annotation>
			<xsd:documentation>Describes hyperlinks attached to various components of the diagram.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="residue" minOccurs="0" maxOccurs="unbounded"/>
				<xsd:element name="subunitRef" id="subunit" minOccurs="0" maxOccurs="unbounded">
					<xsd:annotation>
						<xsd:documentation>Links a subunit to a URL. The subunit is referenced by id. The url attribute provides the URL. For non-SVG outputs, only subunits of type edu.mssm.crover.domain2d.ProteinSegmentDomain can be linked to a URL. the SVG export supports this feature for any type of subunit.  </xsd:documentation>
					</xsd:annotation>
					<xsd:complexType>
						<xsd:attribute name="id" type="xsd:string" use="required"/>
						<xsd:attribute name="url" type="xsd:string" use="required"/>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="name" type="xsd:string">
		<xsd:annotation>
			<xsd:documentation>Name of the protein</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="output">
		<xsd:annotation>
			<xsd:documentation>Groups options related to the diagram output. </xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="image" maxOccurs="unbounded"/>
				<xsd:element ref="page"/>
				<xsd:element ref="image-map"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="page">
		<xsd:annotation>
			<xsd:documentation>Generates an XML document that describes one diagram. This document will contain information suitable to generate HTML pages that embed the diagram images. When provided, the template attribute names an XSL stylesheet that will be set in the document.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="template" type="xsd:string" use="optional"/>
			<xsd:attribute name="filename" type="xsd:string" use="required"/>
			<xsd:attribute name="diagram-name" type="xsd:string" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="protein">
		<xsd:annotation>
			<xsd:documentation>Describes the protein to be rendered.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="name"/>
				<xsd:element ref="residue-codes"/>
				<xsd:element ref="secondary-structure"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="rbde-diagram">
		<xsd:annotation>
			<xsd:documentation>Input file for construction of one diagram.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="diagram-layout"/>
				<xsd:element ref="protein"/>
				<xsd:element ref="diagram"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="residue">
		<xsd:annotation>
			<xsd:documentation>Links a residue to a URL. This feature is supported for all types of export (GIF,JPG, SVG, etc). Residue position numbering starts at 1.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="position" type="xsd:int" use="required"/>
			<xsd:attribute name="url" type="xsd:string" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="residue-codes" type="xsd:string">
		<xsd:annotation>
			<xsd:documentation>Residues of the protein</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="residue-color">
		<xsd:annotation>
			<xsd:documentation>Color one residue on the sequence. Residue position numbering starts at 1.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="position" type="xsd:int" use="required"/>
			<xsd:attribute name="color" type="xsd:string" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="residue-geometry">
		<xsd:annotation>
			<xsd:documentation>Define the shape of one residue on the sequence. Residue position numbering starts at 1.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="position" type="xsd:int" use="required"/>
			<xsd:attribute name="shape" type="xsd:string" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="secondary-structure">
		<xsd:annotation>
			<xsd:documentation>Defines the secondary structure for this protein. The start-residue-numbering is used when the protein sequence that is being represented is only a partial sequence of the whole protein.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="start-residue-numbering" type="xsd:int" default="1" minOccurs="0"/>
				<xsd:element ref="segment" maxOccurs="unbounded"/>
				<xsd:element name="disulfide-bridge" minOccurs="0" maxOccurs="unbounded">
					<xsd:annotation>
						<xsd:documentation>Describes a disulfide bridge. A yellow line is drawn on the diagram between the to and from residues. </xsd:documentation>
					</xsd:annotation>
					<xsd:complexType>
						<xsd:attribute name="to" type="xsd:int" use="required"/>
						<xsd:attribute name="from" type="xsd:int" use="required"/>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="segment">
		<xsd:annotation>
			<xsd:documentation>Defines the limits of of segment of secondary structure. Segments should span non overlapping parts of the sequence.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="start" type="xsd:int" use="required"/>
			<xsd:attribute name="end" type="xsd:int" use="required"/>
			<xsd:attribute name="mapto" type="xsd:string" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="spacer">
		<xsd:annotation>
			<xsd:documentation>The separation between the first residue of the subunit and the last, on the page.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="x" type="xsd:int" use="required"/>
			<xsd:attribute name="y" type="xsd:int" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="subunit">
		<xsd:annotation>
			<xsd:documentation>Each subunit is located on the page according to the location and spacer of the subunit that preceeds it. The location of the first subunit is determined so that the complete diagram is visible. At the time of writing, the following types of subunits are available (all types should be entered starting with edu.mssm.crover.domain2d): FreeLoop, ExtremityDomain (for N-terms), CtermDomain,  HelicalDomain, BetaStrandDomain, ProteinSegmentDomain</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:all>
				<xsd:element ref="direction" minOccurs="0"/>
				<xsd:element ref="spacer" minOccurs="0"/>
				<xsd:element ref="control-points" minOccurs="0"/>
				<xsd:element name="parameter-search" minOccurs="0">
					<xsd:annotation>
						<xsd:documentation>Defines the bound of the parameter search that scales loops when not enough residues can fit in the path. Increase the max attribute to allow loops to grow larger before ellipses are inserted in the sequence. Rendering is appear incorrect if this parameter does not allow the loop to be enlarged, and ellipsis have been restricted  the sequence of this subunit.</xsd:documentation>
					</xsd:annotation>
					<xsd:complexType>
						<xsd:attribute name="max" type="xsd:float" use="optional" default="2"/>
					</xsd:complexType>
				</xsd:element>
			</xsd:all>
			<xsd:attribute name="id" type="xsd:string" use="required"/>
			<xsd:attribute name="type" type="xsd:string" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="control-points">
		<xsd:annotation>
			<xsd:documentation>Use only when subunit type is FreeLoop, Nterm or Cterm. Provides control points for the shape of the loop (Bezier control points). Control points are defined in a 2D space centered on the position of the first residue of the subunit. Thus, the first control point must have position (0,0). The last control point should be placed such that it matches the spacer of the subunit. The other control points can be placed to control the shape of the path along which residues of the subunit will be laid out.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="cpoint" minOccurs="4" maxOccurs="unbounded">
					<xsd:annotation>
						<xsd:documentation>A control point. x and y coordinates are doubles.</xsd:documentation>
					</xsd:annotation>
					<xsd:complexType>
						<xsd:attribute name="x" type="xsd:double" use="required"/>
						<xsd:attribute name="y" type="xsd:double" use="required"/>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>
