<?xml version="1.0"?>

        <xsd:schema elementFormDefault="qualified"
                    targetNamespace="http://www.ebi.ac.uk/WSsas/Schema"
                    xmlns:tns="http://www.ebi.ac.uk/WSsas/Schema"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

            <xsd:complexType name="atomic_contact">
                <xsd:sequence>
                    <xsd:element name="contact_name" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Type of atomic contact: donor hydrogen bond; acceptor hydrogen bond; non-bonded contact (mainly vdw)</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="ref_atom" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Atom from the Reference Structure involved in the bond</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="partner_atom" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Atom binding to the ref_atom</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="partner_compound" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Compound binding to the structure. If ligand is a peptide, it will be one amino acid name</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>
            
            <xsd:complexType name="atomic_contacts">
                <xsd:sequence>
                    <xsd:element name="atomic_contact" type="tns:atomic_contact" minOccurs="1" maxOccurs="unbounded" />
                </xsd:sequence>
            </xsd:complexType>
            
            <xsd:complexType name="annotations">
                <xsd:sequence>
                    <xsd:element name="annotation" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Relevant information for the function: binding compound or EC code for catalytic sites</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>

            <xsd:complexType name="reference">
                <xsd:sequence>
                    <xsd:element name="ref_name" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>PDB code of reference structure used to annotate this residue</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="ref_chain" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>PDB chain of reference structure used to annotate this residue</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="ref_index" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Residue index of reference structure used in the annotation. In the majority of cases this index is an integer, but sometimes can contain an insertion code. Consequently, this index is unequivocally diferent for each residue in the reference structure</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="ref_residue" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Residue name of reference structure used in the annotation</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="annotations" type="tns:annotations" minOccurs="0" maxOccurs="unbounded" />
                    <xsd:element name="atomic_contacts" type="tns:atomic_contacts" minOccurs="0" maxOccurs="unbounded" />
                </xsd:sequence>
            </xsd:complexType>

            <xsd:complexType name="sourceref">
                <xsd:sequence>
                    <xsd:element name="reference" type="tns:reference" minOccurs="0" maxOccurs="unbounded" />
                </xsd:sequence>
            </xsd:complexType>

            <xsd:complexType name="residue">
                <xsd:sequence>
                    <xsd:element name="residue_index" type="xsd:integer" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Index of the annotated amino acid</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="residue_name" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Name of the annotated amino acid</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="sourceref" type="tns:sourceref" minOccurs="1" />
                </xsd:sequence>
            </xsd:complexType>

            <xsd:complexType name="residues">
                <xsd:sequence>
                    <xsd:element name="residue" type="tns:residue" minOccurs="0" maxOccurs="unbounded" />
                </xsd:sequence>
            </xsd:complexType>
            <xsd:complexType name="feature">
                <xsd:sequence>
                    <xsd:element name="feature_name" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Name of the features WSsas provides annotation for: Ligand (ligand-binding residues); Metal (metal-binding residues); Dna (Nucleic acid-binding residues); Catalytic (catalytic sites); Interaction (amino acids involved in protein-protein interactions)</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="residues" type="tns:residues" minOccurs="0" maxOccurs="unbounded" />
                </xsd:sequence>
            </xsd:complexType>

            <xsd:complexType name="features">
                <xsd:sequence>
                    <xsd:element name="feature" type="tns:feature" minOccurs="0" maxOccurs="unbounded" />
                </xsd:sequence>
            </xsd:complexType>

            <xsd:complexType name="source">
                <xsd:sequence>
                    <xsd:element name="source_name" type="xsd:string" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>PDB code of structure used in the annotation</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="ref_identity" type="xsd:decimal" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Percentage of local identity between the annotated sequence and the amino acids sequence of the structure</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="ref_overlap" type="xsd:integer" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Length of the local alignment as calculated by FASTA</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="ref_evalue" type="xsd:float" minOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>Expected value to find the structure by chance in the FASTA search</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="ref_pmid" type="xsd:string" minOccurs="0" maxOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>PubMed ID for the key publication on that structure</xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>

            <xsd:complexType name="sources">
                <xsd:sequence>
                    <xsd:element name="source" type="tns:source" minOccurs="0" maxOccurs="unbounded" />
                </xsd:sequence>
            </xsd:complexType>

            <xsd:complexType name="sas_residue_annotation">
                <xsd:sequence>
                    <xsd:element name="features" type="tns:features" minOccurs="1" />
                    <xsd:element name="sources" type="tns:sources" minOccurs="1" />
                </xsd:sequence>
            </xsd:complexType>

            <xsd:element name="sas_residue_annotation" type="tns:sas_residue_annotation" />
            
        </xsd:schema>

