Simple XML Schema for the genotype and family data
The schemas can be found in the CVS repository
Java code for reading the data files can be downloaded from the CVS repository. Here is info how to do it.
Genotypes
Example XML input file for basic genotypes:
<?xml version="1.0" encoding="UTF-8"?>
<genotypes>
<genotype created="2003-10-11" sampleId="xxxx" markerId="yyyyyy01" >
<alleles>
<allele id="A" />
<allele id="G" />
</alleles>
</genotype>
<genotype created="2003-10-11" sampleId="xxxx" markerId="yyyyyy02" >
<alleles>
<allele id="A" />
<allele id="A" />
</alleles>
</genotype>
</genotypes>
The XML Schema:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="genotypes" type="GenotypeList"/>
<xsd:complexType name="GenotypeList">
<xsd:sequence>
<xsd:element name="genotype" type="Genotype" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="AlleleList">
<xsd:sequence>
<xsd:element name="allele" type="Allele" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="Identifier">
<xsd:restriction base="xsd:NCName">
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="SNPIdentifier">
<xsd:restriction base="xsd:NCName">
<xsd:enumeration value="A" />
<xsd:enumeration value="T" />
<xsd:enumeration value="G" />
<xsd:enumeration value="C" />
<xsd:enumeration value="I" />
<xsd:enumeration value="D" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="MicrosatIdentifier">
<xsd:restriction base="xsd:positiveInteger">
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="AlleleIdentifier">
<xsd:union memberTypes="MicrosatIdentifier SNPIdentifier" />
</xsd:simpleType>
<xsd:complexType name="Allele">
<xsd:attribute name="id" type="AlleleIdentifier" use="required"/>
</xsd:complexType>
<xsd:complexType name="Genotype">
<xsd:sequence>
<xsd:element name="alleles" type="AlleleList"/>
</xsd:sequence>
<xsd:attribute name="created" type="xsd:date" use="required"/>
<xsd:attribute name="sampleId" type="Identifier" use="required"/>
<xsd:attribute name="markerId" type="Identifier" use="required"/>
</xsd:complexType>
</xsd:schema>
Subject and group (family) data
Example XML input data for subjects:
<?xml version="1.0" encoding="UTF-8"?>
<!-- SUBJECT AND FAMILY DATA -->
<subjectData>
<subjects>
<subject id="xxxxx01" >
<sex>male</sex>
<birth date_missing="day">1960-10-15</birth> -- Day not known (From the eutwin spec)
</subject>
<subject id="xxxxx02" >
<sex>female</sex>
<birth>1963-10-10</birth>
</subject>
<subject id="xxxxx11" >
<sex>male</sex>
<birth>2003-10-10</birth>
</subject>
<subject id="xxxxx12" >
<sex>male</sex>
<birth>2003-10-10</birth>
</subject>
<subject id="xxxxx13" >
<sex>female</sex>
<birth>2003-10-10</birth>
</subject>
<subject id="xxxxx00" >
<sex>male</sex>
<birth>1987-10-10</birth>
</subject>
</subjects>
<groups>
<group id="zzzzz1" type="family">
<rolePlayers>
<rolePlayer subjectId="xxxxx01">father</rolePlayer>
<rolePlayer subjectId="xxxxx02">mother</rolePlayer>
<rolePlayer subjectId="xxxxx11">child</rolePlayer>
<rolePlayer subjectId="xxxxx12">child</rolePlayer>
<rolePlayer subjectId="xxxxx13">child</rolePlayer>
<rolePlayer subjectId="xxxxx00">child</rolePlayer>
</rolePlayers>
</group>
<group id="aaaaa1" type="twins">
<rolePlayers>
<rolePlayer subjectId="xxxxx11">sibling</rolePlayer>
<rolePlayer subjectId="xxxxx12">sibling</rolePlayer>
<rolePlayer subjectId="xxxxx13">sibling</rolePlayer>
</rolePlayers>
</group>
<group id="yyyyy1" type="monozygotes">
<rolePlayers>
<rolePlayer subjectId="xxxxx11">sibling</rolePlayer>
<rolePlayer subjectId="xxxxx12">sibling</rolePlayer>
</rolePlayers>
</group>
</groups>
</subjectData>
Sample XML schema for subjects:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
>
<xsd:element name="subjectData" type="SubjectDataList" />
<xsd:complexType name="SubjectDataList">
<xsd:sequence>
<xsd:element name="subjects" type="SubjectList"/>
<xsd:element name="groups" type="GroupList"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SubjectList">
<xsd:sequence>
<xsd:element name="subject" type="Subject" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<!-- from base.xsd -->
<xsd:simpleType name="Identifier">
<xsd:restriction base="xsd:NCName">
</xsd:restriction>
</xsd:simpleType>
<!-- DEFINITIONS FOR THE BASIC PERSON DATA -->
<!-- See the GENOMEUTWIN spec. 3.1 note "-" replaced by "_" -->
<!-- Attributes for the "questionary" data elements -->
<xsd:simpleType name="QMissingValue">
<xsd:restriction base="xsd:NCName">
<xsd:enumeration value="non_participant" />
<xsd:enumeration value="non_response" /> <!-- no answer -->
<xsd:enumeration value="unknown" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="QDateMissingValue">
<xsd:restriction base="xsd:NCName">
<xsd:enumeration value="day" /> <!-- coded as 15 (add check) -->
<xsd:enumeration value="day_and_month" /> <!-- coded as 0701 -->
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="QRelevancyValue">
<xsd:restriction base="xsd:NCName">
<xsd:enumeration value="irrelevant" />
<xsd:enumeration value="structural" /> <!-- ? -->
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="QSourceValue">
<xsd:restriction base="xsd:NCName">
<xsd:enumeration value="self_reported" />
<xsd:enumeration value="not_self_reported" />
</xsd:restriction>
</xsd:simpleType>
<xsd:attributeGroup name="questionaryAttributes">
<xsd:attribute name="missing" type="QMissingValue" />
<xsd:attribute name="relevancy" type="QRelevancyValue" />
<xsd:attribute name="source" type="QSourceValue" />
</xsd:attributeGroup>
<xsd:attributeGroup name="questionaryDateAttributes">
<xsd:attributeGroup ref="questionaryAttributes" />
<xsd:attribute name="date_missing" type="QDateMissingValue" />
</xsd:attributeGroup>
<xsd:complexType name="QDate">
<xsd:simpleContent>
<xsd:extension base="xsd:date" >
<xsd:attributeGroup ref="questionaryDateAttributes" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="QSexValue">
<xsd:restriction base="xsd:NCName">
<xsd:enumeration value="male" />
<xsd:enumeration value="female" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="QSex">
<xsd:simpleContent>
<xsd:extension base="QSexValue" >
<xsd:attributeGroup ref="questionaryDateAttributes" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- SUBJECTS AND GROUPS -->
<xsd:complexType name="Subject">
<xsd:sequence>
<xsd:element name="sex" type="QSex" />
<xsd:element name="birth" type="QDate" />
</xsd:sequence>
<xsd:attribute name="id" type="Identifier" use="required"/>
</xsd:complexType>
<xsd:simpleType name="FamilyGroupValue">
<xsd:restriction base="xsd:NCName">
<xsd:enumeration value="family" />
<xsd:enumeration value="twins" />
<xsd:enumeration value="monozygotes" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="FamilyGroupMissingValue">
<xsd:restriction base="xsd:NCName">
<xsd:enumeration value="father" />
<xsd:enumeration value="mother" />
<xsd:enumeration value="parents" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="FamilyRoleValue">
<xsd:restriction base="xsd:NCName">
<xsd:enumeration value="father" />
<xsd:enumeration value="mother" />
<xsd:enumeration value="child" />
<xsd:enumeration value="sibling" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="RolePlayer">
<xsd:simpleContent>
<xsd:extension base="FamilyRoleValue" >
<xsd:attribute name="subjectId" type="Identifier" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType >
<xsd:complexType name="RolePlayerList">
<xsd:sequence>
<xsd:element name="rolePlayer" type="RolePlayer" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="GroupList">
<xsd:sequence>
<xsd:element name="group" type="Group" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Group">
<xsd:sequence>
<xsd:element name="rolePlayers" type="RolePlayerList"/>
</xsd:sequence>
<xsd:attribute name="id" type="Identifier" use="required"/>
<xsd:attribute name="type" type="FamilyGroupValue" use="required"/>
<xsd:attribute name="missing" type="FamilyGroupMissingValue"/>
</xsd:complexType>
</xsd:schema>