<HTML>
<HEAD>
<TITLE>GenPerl Tutorial</TITLE>
<LINK REV="made" HREF="mailto:mathias@genomica.com">
</HEAD>
<BODY text="#000000" bgcolor="#FFFFFF" link="seagreen" alink="lightseagreen" vlink="firebrick">
<h1 align="center"><font face="Arial, Helvetica, sans-serif" color="seagreen" size="7">GenPerl Tutorial</font></h1>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#intro">Introduction</A></LI>
<LI><A HREF="#objects">Overview of GenPerl Objects</A></LI>
<LI><A HREF="#apiover">Overview of the GenPerl API</A></LI>
<LI><A HREF="#database">The GenPerl Database</A></LI>
<LI><A HREF="#use_gp">Using GenPerl</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="intro">Introduction</A></H1>
<p> GenPerl consists of a collection of OO Perl modules and an API for
interacting with GenPerl objects. Functionality currently implemented in the
GenPerl API is mainly related to managing the persistence of GenPerl objects
in a relational database. This includes simple create, read, update and
delete operations as well as more complex querying functionality. There is
also a small amount of analysis functionality implemented including the
formatting of files for analysis by commonly used genetic analysis software.
<p> GenPerl is designed to facilitate the development of Perl scripts for
applications related to genetic analysis. As such, it does not include ready
to use programs or friendly graphical user interfaces (GUIs). Instead,
GenPerl provides reusable Perl modules that facilitate writing Perl scripts
for the storage, formatting and analysis of a wide range of genetic data.
GenPerl enables the development applications which can process and analyze
large quantities of data in customized ways that are typically difficult or
impossible with large GUI-based systems.
<p>The original version of GenPerl was developed in the Research Department of
Genomica Corp. where it was used to produce research protytypes and to manage
and analyze data related to research projects with which Genomica was
involved.
<p>GenPerl should be considered <b><i>alpha software</i></b>.
<h3>License</h3>
<p> This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
<p> This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
<p> You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
<h3>Feedback</h3>
Please send all feedback, comments, etc. to:
<p>
<a href="mailto:mathias@genomica.com">Steve Mathias</a><br>
Genomica Corporation<br>
1745 38th Street<br>
Boulder, CO 80301<br></p>
<HR>
<HR>
<H1><A NAME="objects">Overview of GenPerl Objects</A></H1>
<P>The following convention is observed in the naming of the attributes and
relationships of genperl objects:
<ul>
<li> Attributes with names beginning with a lower case letter have simple
scalar values.
<li> Attributes with names beginning with an upper case letter have values
which are pointers to more complicated data structures.
<li> Attributes with names that are singular have zero or one value.
<li> Attributes with names that are plural may have multiple values.
</ul>
<P>The tables below detail the internal structure of the GenPerl object. When creating and updating objects, there are many instances where it is necessary to reference other objects. This is done in a general way via IDs or importIDs. IDs can only be used to reference objects that have already been saved to the database, and have thus been given a database ID. Otherwise, importIDs must be used. Basically, if you want to reference an object that already exists in the database, use ids; if you are making references to objects that are being imported together as part of the same import session, use importIDs.
<p>Internally, all <font size="+1"><b><a name="refs">object references</a></b></font> are anonymous hashes with the following key/value structure:
<p>
{ <font face="Courier New, Courier, mono" color="maroon" > name </font> => String <br>
<font face="Courier New, Courier, mono" color="#000080" > id/importID </font> => Integer/String }
<p>
The name is optional and is allowed for convenience. Either an id or an importID is required and identifies the referenced object. See the methods in Genetics::API::DB::Insert for details on how importIDs are saved and used.
</P>
<P>Keep in mind that genperl objects may be instantiated and used without necessarily being stored in a genperl database. Therefore, Genetics::Object and its subclasses do not enforce the data type and format constraints required if the objects are to be saved to the genperl schema via the API. Any additional format or size requirements of the API are noted parenthetically in the tables below.</P>
<P><a href="#obj">Genetics::Object</a> is the abstract superclass for all GenPerl objects.</P>
<P>The GenPerl objects with which one interacts directly are:
<ul>
<li><a href="#cluster">Cluster</a> representing groupings of objects, by reference.
<li><a href="#dnasample">DNASample</a> representing laboratory samples of DNA.
<li> <a href="#freqsource">FrequencySource</a> representing observed allele and/or haplotype frequencies.
<li> <a href="#genotype">Genotype</a> representing the observed allele(s) an individual has at a polymorphic locus. In GenPerl terms, this is the alleles a given Subject has for a given Marker or SNP.
<li> <a href="#haplotype">Haplotype</a> representing a specific combination of alleles known or predicted to be segregating together.
<li> <a href="#htmarkercoll">HtMarkerCollection</a> representing a set of Markers/SNPs from which Haplotypes can be constructed.
<li> <a href="#kindred">Kindred</a> representing groups of Subjects related genetically or by mariage.
<li> <a href="#map">Map</a> representing an ordered set of chromosomal loci.
<li> <a href="#marker">Marker</a> representing polymorphic genetic loci.
<li> <a href="#phenotype">Phenotype</a> representing the observable properties - genetic and/orenvironmental - of an individual. In GenPerl terms, this is the value a given Subject has for a given StudyVariable.
<li> <a href="#snp">SNP</a> representing single nucleotide polymorphisms.
<li> <a href="#studyvar">StudyVariable</a> representing definitions of physical traits, affection status, environmental exposure, drug treatments, etc.
<li> <a href="#subject">Subject</a> representing the individuals being studied.
<li> <a href="#tissuesample">TissueSample</a> representing laboratory tissue samples.
</ul>
<HR>
<H2><a name="obj"></a>Genetics::Object</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" >name</font></td>
<td width="45%"> String (<= 120 characters) </td>
<td width="40%"> The name of the object.</td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" >id</font></td>
<td width="45%"> Integer</td>
<td width="40%"> A database generated id. This should only be used for updating and deleting objetcs </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> OR </font></td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" >importID</font></td>
<td width="45%"> String</td>
<td width="40%"> An identifier that should be unique within an import session. These get stored in the database as keywords.</td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > dateCreated</font></td>
<td width="45%"> String (``YYYY-MM-DD'')</td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > dateModified</font></td>
<td width="45%"> String (``YYYY-MM-DD'')</td>
<td width="40%"> This field is maintained by the database and is ignored on import and update.</td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > url</font></td>
<td width="45%"> String (< 65638 bytes)</td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > comment</font></td>
<td width="45%"> String (< 65638 bytes)</td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" >NameAliases</font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" >name</font> => String (<= 120 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" >comment</font> => String (< 120 characters)</td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Contact</font></td>
<td width="45%"> Hash pointer. The referenced hash should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" >name</font> => String (<= 120 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" >organization</font> => String (<= 120 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" >comment</font> => String (< 65638 bytes)</td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > DBXReferences</font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" >accessionNumber</font> => String (<= 32 characters) <br>
<font face="Courier New, Courier, mono" color="#000080" >databaseName</font> => String (<= 32 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" >schemaName</font> => String (<= 120 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" >comment</font> => String (< 65638 bytes)</td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Keywords</font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" >name</font> => String (<= 32 characters) <br>
<font face="Courier New, Courier, mono" color="#000080" >dataType</font> => String (<= 32 characters) <br>
<font face="Courier New, Courier, mono" color="#000080" >value</font> => String (<= 32 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" >description</font> => String (<= 255 characters)</td>
<td width="40%"> </td>
</tr>
</table>
<HR>
<H2><a name="cluster"></a>Genetics::Object::Cluster</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > clusterType </font></td>
<td width="45%"> String ("Mixed", "Subject", "Kindred", "Marker", "SNP", "Genotype", "StudyVariable", "Phenotype", "HaplotypeMarkerCollection", "Haplotype", "Map", "FrequencySource", "DNASample", or "TissueSample") </td>
<td width="40%"> The type of object the Cluster references. </td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Contents </font></td>
<td width="45%"> Array pointer to a list of <a href="#refs">object references</a>. </td>
<td width="40%"> These are the references to the Cluster's contents. Be careful when making references by importID to objects already saved to the database. This will likely have unpredictable results unless all the ImportID Keywords in the database are unique.</td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$cluster = new Genetics::Cluster(name => 'All Subjects',
importID => 271,
dateCreated => $today,
clusterType => "Subject",
comment => "All Subjects imported from DMs Study JX",
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
Contents=> [ {name => "JXPed1-1", importID => 12},
{name => "JXPed1-2", importID => 32},
{name => "JXPed1-3", importID => 22},
{name => "JXPed2-1", importID => 42},
{name => "JXPed2-2", importID => 43},
{name => "JXPed2-3", importID => 44},
],
) ;
</pre>
<HR>
<H2><a name="dnasample"></a>Genetics::Object::DNASample</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > dateCollected </font></td>
<td width="45%"> String ("YYYY-MM-DD") </td>
<td width="40%"> Date the sample was collected/prepared. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > amount </font></td>
<td width="45%"> Float (6,3) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > amountUnits </font></td>
<td width="45%"> String ("g", "mg", "ug", or "ng") </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > concentration </font></td>
<td width="45%"> Float (6,3) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > concUnits </font></td>
<td width="45%"> String ("mg/ml", "ug/ml", "ug/ul", or "ng/ul") </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Subject </font></td>
<td width="45%"> <a href="#refs">Subject reference</a> </td>
<td width="40%"> Reference to the Subject from which the Sample is derived. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Genotypes </font></td>
<td width="45%"> Array pointer to a list of <a href="#refs">Genotype references</a></td>
<td width="40%"> Reference(s) to Genotype(s) derived from the Sample. </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$sample = new Genetics::DNASample(name => 'SM20.1-3',
importID => 272,
dateCreated => $today,
comment => "Third attempt to get DNA from this Sample",
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
dateCollected => "2001-01-18",
amount => 3.26,
amountUnits => "mg",
concentration => 1.1,
concUnits => "mg/ml",
Subject => {name => 'EAPed20.1',
importID => 12},
Genotypes => [ {name => '1-D12S91',
importID => 13},
{name => '1-EAEx1.1',
importID => 14},
],
) ;
</pre>
<HR>
<H2><a name="freqsource"></a>Genetics::Object::FrequencySource</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > ObsAlleleFrequencies </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > Allele </font> => { <font face="Courier New, Courier, mono" color="#000080">Marker</font> => <a href="#refs">Marker Reference</a>, <br>
<font face="Courier New, Courier, mono" color="#000080"> name </font> => String (<= 4 characters), <br>
<font face="Courier New, Courier, mono" color="#000080"> type </font> => String ("Code", "Size", "RepeatNumber", "Nucleotide", or "Undefined") } <br>
<font face="Courier New, Courier, mono" color="#000080" > frequency </font> => Float </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > ObsHtFrequencies </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > Haplotype </font> => <a href="#refs">Haplotype Reference</a> <br>
<font face="Courier New, Courier, mono" color="#000080" > frequency </font> => Float </td>
<td width="40%"> </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$fs = new Genetics::FrequencySource(name => 'WICGR SNP Freqs',
importID => 270,
dateCreated => $today,
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
ObsAlleleFrequencies => [ {Allele => {Marker => {name => "EAEx1.1",
importID => 265},
name => "T",
type => "nucleotide"},
frequency => "0.64",
},
{Allele => {Marker => {name => "EAEx1.1",
importID => 265},
name => "C",
type => "nucleotide"},
frequency => "0.36",
}
],
ObsHtFrequencies => [ {Haplotype => {name => '12pEA1.2',
importID => 269,},
frequency => 1.00,
}
]
) ;
</pre>
<HR>
<H2><a name="genotype"></a>Genetics::Object::Genotype</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > isActive </font></td>
<td width="45%"> Boolean (1 or 0) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > Subject </font></td>
<td width="45%"> <a href="#refs">Subject Reference</a> </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > Marker </font></td>
<td width="45%"> <a href="#refs">Marker Reference</a> </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > AlleleCalls </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > alleleName </font> => String (<= 4 characters) <br>
<font face="Courier New, Courier, mono" color="#000080" > alleleType </font> => String ("Code", "Size", "RepeatNumber", "Nucleotide", or "Undefined") <br>
<font face="Courier New, Courier, mono" color="#000080" > phase </font> => String ("Unknown", "Maternal", or "Paternal") <br>
<font face="Courier New, Courier, mono" color="#000080" > AssayAttrs </font> => Array pointer to a list of <a href="#assayattrs">AssayAttribute hash pointers.</a> </td>
<td width="40%"> The AssayAttributes in here apply to individual AlleleCalls.</td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > icResult </font></td>
<td width="45%"> String ("Pass", "Fail", "Ambiguous", or "Unknown") </td>
<td width="40%"> Inheritance check result. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > dateCollected </font></td>
<td width="45%"> String ("YYYY-MM-DD") </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Sample </font></td>
<td width="45%"> <a href="#refs">DNASample Reference</a> </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > AssayAttrs </font></td>
<td width="45%"> Array pointer to a list of <a href="#assayattrs">AssayAttribute hash pointers.</a> </td>
<td width="40%"> These are AssayAttributes that apply to the Genotype as a whole. </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$gt = new Genetics::Genotype(name => '1-D12S91',
importID => 13,
dateCreated => $today,
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
isActive => 1,
icResult => "Pass",
dateCollected => "1993-11-13",
Subject => {name => "EAPed20.1", importID => 12},
Marker => {name => "D12S91", importID => 1},
AssayAttrs => [ {name => "lab",
dataType=> "string",
value => "Lab 6"},
{name => "machineID",
dataType => "String",
value => "ABC1234"}
],
AlleleCalls => [ {alleleName => 3,
alleleType => "Code",
phase => "Maternal",
AssayAttrs => [ {name => "peakHeight",
dataType => "Number",
value => 367} ]
},
{alleleName => 1,
alleleType => "Code",
phase => "Paternal",
AssayAttrs => [ {name => "peakHeight",
dataType => "Number",
value => 435} ]
},
]
) ;
</pre>
<HR>
<H2><a name="haplotype"></a>Genetics::Object::Haplotype</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > MarkerCollection </font></td>
<td width="45%"> <a href="#refs">HtMarkerCollection Reference</a> </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > Alleles </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > name </font> => String (<= 4 characters) <br>
<font face="Courier New, Courier, mono" color="#000080" > type </font> => String ("Code", "Size", "RepeatNumber", "Nucleotide", or "Undefined") </td>
<td width="40%"> </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$ht = new Genetics::Haplotype(name => '12pEA1.1',
importID => 268,
dateCreated => $today,
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
MarkerCollection => {name => "12pEA1", importID => 267},
Alleles => [ {name => 2, type => "code"},
{name => "C", type => "nucleotide"} ],
) ;
</pre>
<HR>
<H2><a name="htmarkercoll"></a>Genetics::Object::HtMarkerCollection</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > Markers </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > Marker </font> => <a href="#refs">Marker References</a> <br>
<font face="Courier New, Courier, mono" color="maroon" > distToNext </font> => Float (10,5) </td>
<td width="40%"> The order of the Marker references should reflect the map order of the markers, and thus the corresponding allele order in the haplotypes derived from the marker collection. </td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > distanceUnits </font></td>
<td width="45%"> String ("cM", "bp", "Kb", "Mb", "cR", "cR3000", "cR10000", or "Theta") </td>
<td width="40%"> </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$hmc = new Genetics::HtMarkerCollection(name => '12pEA1',
importID => 267,
dateCreated => $today,
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
Markers => [ {Marker => {name => "D12S91",
importID => 1},
distToNext => "1.2"},
{Marker => {name => "EAEx1.1",
importID => 265},
}
],
distanceUnits => "cM",
) ;
</pre>
<HR>
<H2><a name="kindred"></a>Genetics::Object::Kindred</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > isDerived </font></td>
<td width="45%"> Boolean (1 or 0) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Subjects </font></td>
<td width="45%"> Array pointer to a list of <a href="#refs">Subject References</a> </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > DerivedFrom </font></td>
<td width="45%"> <a href="#refs">Kindred Reference</a> </td>
<td width="40%"> </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$kindred = new Genetics::Kindred(name => 'JXPed2',
importID => 45,
dateCreated => $today,
comment => "Litt et. al. (1994)",
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
{name => "Disease",
dataType => "String",
value => "Episodic Ataxia"} ],
NameAliases => [ {name => "Ped20",
contactName => "J.P. Morgan"}, ],
Subjects => [ {name => "EAPed20.1", importID => 42},
{name => "EAPed20.1000", importID => 43},
{name => "EAPed20.1001", importID => 44},
],
) ;
</pre>
<HR>
<H2><a name="map"></a>Genetics::Object::Map</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > orderingMethod </font></td>
<td width="45%"> String ("Relative" or "Global") </td>
<td width="40%"> Default value is Relative. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > distanceUnits </font></td>
<td width="45%"> String ("cM", "bp", "Kb", "Mb", "cR", "cR3000", "cR10000", or "Theta") </td>
<td width="40%"> Default value is cM </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > OrderedMapElements </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should ahve the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > Marker </font> => <a href="#refs">Marker References</a> <br>
<font face="Courier New, Courier, mono" color="maroon" > distance </font> => Float (10,5) </td>
<td width="40%"> The order of the OME/Marker references should reflect the map order of the markers. </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$map = new Genetics::Map(name => 'Chr12 2 PO',
importID => 121,
dateCreated => $today,
comment => "Stupid 2-marker map.",
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
chromosome => "12",
orderingMethod => "Relative",
distanceUnits => "cM",
Organism => {genusSpecies => "Pongo pongo"},
OrderedMapElements => [ {SeqObj => {name => "D12S91", importID => 1},
distance => 1.3},
{SeqObj => {name => "EAEx1.1", importID => 265}}
],
) ;
</pre>
<HR>
<H2><a name="marker"></a>Genetics::Object::Marker</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > malePloidy </font></td>
<td width="45%"> Integer (<= 99) </td>
<td width="40%"> Default value = 2. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > femalePloidy </font></td>
<td width="45%"> Integer (<= 99) </td>
<td width="40%"> Default value = 2. </td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > chromosome </font></td>
<td width="45%"> String (<= 8 characters) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > polymorphismType </font></td>
<td width="45%"> String () </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > polymorphismIndex1 </font></td>
<td width="45%"> Integer (<= 16777215) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > polymorphismIndex2 </font></td>
<td width="45%"> Integer (<= 16777215) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > repeatSequence </font></td>
<td width="45%"> String (<= 8 characters) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Alleles </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > name </font> => String (<= 4 characters) <br>
<font face="Courier New, Courier, mono" color="#000080" > type </font> => String ("Code", "Size", "RepeatNumber", "Nucleotide", or "Undefined") </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Sequence </font></td>
<td width="45%"> Hash pointer. The referenced hash should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > sequence </font> => String (<= 65535 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > length </font> => Integer (<= 16777215) <br>
<font face="Courier New, Courier, mono" color="maroon" > lengthUnits </font> => String ("bp", "Kb", or "Mb") </td>
<td width="40%"> This is the DNA sequence associated with the marker. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > ISCNMapLocations </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > chrNumber </font> => String (<= 8 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > chrArm </font> => String (<= 8 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > band </font> => String (<= 16 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > bandingMethod </font> => String (<= 32 characters) </td>
<td width="40%"> These represent cytogenetic map locations associated with the marker. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Organism </font></td>
<td width="45%"> Hash pointer. The referenced hash should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > genusSpecies </font> => String (<= 255 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > subspecies </font> => String (<= 120 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > strain </font> => String (<= 120 characters) </td>
<td width="40%"> </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$marker = new Genetics::Marker(name => 'D12S91',
importID => 1,
dateCreated => $today,
comment => "Marker in EA critical region",
NameAliases => [ {name => "d12s6666"}
],
Contact => {name => "Jean Weissenbach",
organization => "Genethon"},
DBXReferences => [ {accessionNumber => "NT_009758.3",
databaseName => "GenBank"}
],
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
chromosome => "12",
malePloidy => 2,
femalePloidy => 2,
polymorphismType => "Repeat",
polymorphismIndex1 => 7,
polymorphismIndex2 => 11,
repeatSequence => "CA",
Organism => {genusSpecies => "Homo sapiens"},
Alleles => [ {name => 1, type => "Code"},
{name => 2, type => "Code"},
{name => 3, type => "Code"},
{name => 4, type => "Code"},
{name => 5, type => "Code"},
{name => 6, type => "Code"} ],
ISCNMapLocations => [ {chrNumber => "12",
chrArm => "p",
band => "12.2.1",
bandingMethod => "Geimsa"}, ],
Sequence => {lengthUnits => "bp",
length => 17,
sequence => "ACGTUMRCACAWSYKVHDBXN"},
) ;
</pre>
<HR>
<H2><a name="phenotype"></a>Genetics::Object::Phenotype</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > value </font></td>
<td width="45%"> Float (12,5) OR String ("YYYY-MM-DD") OR Integer (<= 99)</td>
<td width="40%"> The datatype of the value depends on the format of the StudyVariable with which the Phenotype is associated. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > isActive </font></td>
<td width="45%"> Boolean (0 or 1) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > Subject </font></td>
<td width="45%"> <a href="#refs">Subject Reference</a></td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > StudyVariable </font></td>
<td width="45%"> <a href="#refs">StudyVariable Reference</a></td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > dateCollected </font></td>
<td width="45%"> String ("YYYY-MM-DD") </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > AssayAttrs </font></td>
<td width="45%"> Array pointer to a list of <a href="#assayattrs">AssayAttribute hash pointers.</a> </td>
<td width="40%"> </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$pt = new Genetics::Phenotype(name => 'JXPed1-1-Age',
importID => 266,
dateCreated => $today,
dateCollected => "1987-03-17",
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
Subject => {name => "JXPed1-1", importID => 12},
StudyVariable => {name => "Age", importID => 444},
AssayAttrs => [ {name => "Clinic Name",
dataType => "String",
value => "Sister of Gracious Mercy and Hope"},
],
value => 12,
isActive => 1,
) ;
</pre>
<HR>
<H2><a name="snp"></a>Genetics::Object::SNP</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > snpType </font></td>
<td width="45%"> String () </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > functionClass </font></td>
<td width="45%"> String () </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > isConfirmed </font></td>
<td width="45%"> Boolean (0 or 1)</td>
<td width="40%"> Default value = 1. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > malePloidy </font></td>
<td width="45%"> Integer (<= 99) </td>
<td width="40%"> Default value = 2. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > femalePloidy </font></td>
<td width="45%"> Integer (<= 99) </td>
<td width="40%"> Default value = 2. </td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > chromosome </font></td>
<td width="45%"> String (<= 8 characters) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > snpIndex </font></td>
<td width="45%"> Integer (<= 16777215) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > confirmMethod </font></td>
<td width="45%"> String (<= 255 characters) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Alleles </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > name </font> => String (<= 4 characters) <br>
<font face="Courier New, Courier, mono" color="#000080" > type </font> => String ("Code", "Size", "RepeatNumber", "Nucleotide", or "Undefined") </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Sequence </font></td>
<td width="45%"> Hash pointer. The referenced hash should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > sequence </font> => String (<= 65535 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > length </font> => Integer (<= 16777215) <br>
<font face="Courier New, Courier, mono" color="maroon" > lengthUnits </font> => String ("bp", "Kb", or "Mb") </td>
<td width="40%"> This is the DNA sequence associated with the marker. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > ISCNMapLocations </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > chrNumber </font> => String (<= 8 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > chrArm </font> => String (<= 8 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > band </font> => String (<= 16 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > bandingMethod </font> => String (<= 32 characters) </td>
<td width="40%"> These represent cytogenetic map locations associated with the marker. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Organism </font></td>
<td width="45%"> Hash pointer. The referenced hash should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > genusSpecies </font> => String (<= 255 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > subspecies </font> => String (<= 120 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > strain </font> => String (<= 120 characters) </td>
<td width="40%"> </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$snp = new Genetics::SNP(name => 'EAEx1.1',
importID => 265,
dateCreated => $today,
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
chromosome => "12",
malePloidy => 2,
femalePloidy => 2,
snpType => "Substitution",
functionClass => "Synonymous",
snpIndex => 2,
isConfirmed => 1,
confirmMethod => "Resequencing",
comment => "Highly expressed in muscle",
Organism => {genusSpecies => "Homo sapiens"},
Alleles => [ {name => "C", type => "Nucleotide"},
{name => "T", type => "Nucleotide"} ],
Sequence => {lengthUnits => "bp",
length => 17,
sequence => "ACGTUMRWSYKVHDBXN"},
ISCNMapLocations => [ {chrNumber => "12",
chrArm => "p",
band => "12.2",
bandingMethod => "Geimsa"},
],
) ;
</pre>
<HR>
<H2><a name="studyvar"></a>Genetics::Object::StudyVariable</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > category </font></td>
<td width="45%"> String ("Trait", "StaticAffectionStatus", "StaticLiabilityClass", "DynamicAffectionStatus", "Environment", or "Treatment") </td>
<td width="40%"> Default value = "Trait" <br> DynamicAffectionStatus variables are not yet implemented.</td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > format </font></td>
<td width="45%"> String ("Number", "Code", "Date", "DerivedNumber", or "DerivedCode") </td>
<td width="40%"> The value of format determines the datatype of the Phenotype values associated with the StudyVariable. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > isXLinked </font></td>
<td width="45%"> Boolean (1 or 0) </td>
<td width="40%"> Default value = 0 </td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > description </font></td>
<td width="45%"> String (<= 255 characters) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > lowerBound </font></td>
<td width="45%"> Float (12,5) OR String ("YYYY-MM-DD") </td>
<td width="40%"> Only appropriate for StudyVariables with a format of Number or Date. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > upperBound </font></td>
<td width="45%"> Float (12,5) OR String ("YYYY-MM-DD") </td>
<td width="40%"> Only appropriate for StudyVariables with a format of Number or Date. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Codes </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > code </font> => Integer (<= 99) <br>
<font face="Courier New, Courier, mono" color="maroon" > description </font> => String (<= 255 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > formula </font> => String (<= 65535 characters) </td>
<td width="40%"> Only appropriate for StudyVariables with a format of Code or DerivedCode. A formula is required for each Code definition if the format is DerivedCode</td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > AffStatDef </font></td>
<td width="45%"> Hash pointer. The referenced hash should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > name </font> => String (<= 120 characters) <br>
<font face="Courier New, Courier, mono" color="#000080" > diseaseAlleleFreq </font> => Float (7,6) <br>
<font face="Courier New, Courier, mono" color="#000080" > pen11 </font> => Float (7,6) <br>
<font face="Courier New, Courier, mono" color="#000080" > pen12 </font> => Float (7,6) <br>
<font face="Courier New, Courier, mono" color="#000080" > pen22 </font> => Float (7,6) <br>
<font face="Courier New, Courier, mono" color="maroon" > AffStatElements </font> => Array reference to a list of anonymous hashes (see Example).</td>
<td width="40%"> Only appropriate for StudyVariables with a format of DynamicAffectionStatus. DynamicAffectionStatus variables are not yet implemented; the data in this field is stored in the database, but it is not used for anything. <p> When DynamicAffectionStatus variables are implemented, the AffStatDef will automatically map phenotype values onto a trait locus for genetic linkage analysis.</td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > LCDef </font></td>
<td width="45%"> Hash pointer. The referenced hash should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > name </font> => String (<= 120 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > LiabilityClasses </font> => Array reference to a list of anonymous hashes (see Example).</td>
<td width="40%"> Only appropriate for StudyVariables with a category of DynamicAffectionStatus. DynamicAffectionStatus variables are not yet implemented; the data in this field is stored in the database, but it is not used for anything. <p> When DynamicAffectionStatus variables are implemented, the LCDef will automatically map phenotype values into liability classes for genetic linkage analysis.</td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$sv = new Genetics::StudyVariable(name => 'EA Aff Stat',
importID => 445,
dateCreated => $today,
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
description => "EA Trait Locus",
category => "AffectionStatus",
format => "Code",
isXLinked => 0,
Codes => [ {code => 0,
description => "Unknown EA Status"},
{code => 1,
description => "EA Unaffected"},
{code => 2,
description => "EA Affected"},
],
AffStatDef => {name => 'EA',
diseaseAlleleFreq => 0.001,
pen11 => 0.0,
pen12 => 0.0,
pen22 => 1.0,
AffStatElements => [ {code => 0,
type => "Unknown",
formula => "'EA Aff Stat' = 0"},
{code => 1,
type => "Unaffected",
formula => "'EA Aff Stat' = 1"},
{code => 2,
type => "Affected",
formula => "'EA Aff Stat' = 2"},
],
},
LCDef => {name => 'EA Default LC',
LiabilityClasses => [ {code => 0,
description => "Unknown Age",
pen11 => 0.0,
pen12 => 0.0,
pen22 => 1.0,
formula => "'Age' = ''"},
{code => 1,
description => "Age less than 40",
pen11 => 0.0,
pen12 => 0.2,
pen22 => 1.0,
formula => "'Age' < 40"},
{code => 2,
description => "Age less than 50",
pen11 => 0.0,
pen12 => 0.3,
pen22 => 1.0,
formula => "'Age' < 50"},
{code => 3,
description => "Age grater than or equal to 60",
pen11 => 0.0,
pen12 => 0.4,
pen22 => 1.0,
formula => "'Age' >= 60"},
],
},
) ;
</pre>
<HR>
<H2><a name="subject"></a>Genetics::Object::Subject</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > gender </font></td>
<td width="45%"> String ("Unknown", "Male", "Female", or "Both") </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > dateOfBirth </font></td>
<td width="45%"> String ("YYYY-MM-DD") </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > dateOfDeath </font></td>
<td width="45%"> String ("YYYY-MM-DD") </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > isProband </font></td>
<td width="45%"> Boolean (1 or 0) </td>
<td width="40%"> Default value = 0. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Mother </font></td>
<td width="45%"> <a href="#refs">Subject Reference</a></td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Father </font></td>
<td width="45%"> <a href="#refs">Subject Reference</a></td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Kindred </font></td>
<td width="45%"> <a href="#refs">Kindred Reference</a></td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Organism </font></td>
<td width="45%"> Hash pointer. The referenced hash should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > genusSpecies </font> => String (<= 255 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > subspecies </font> => String (<= 120 characters) <br>
<font face="Courier New, Courier, mono" color="maroon" > strain </font> => String (<= 120 characters) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Haplotypes </font></td>
<td width="45%"> Array pointer to a list of hash pointers. The referenced hashes should have the following key/value structure: <br>
<font face="Courier New, Courier, mono" color="#000080" > Haplotype </font> => <a href="#refs">Haplotype References</a> <br>
<font face="Courier New, Courier, mono" color="maroon" > phase </font> => String ("Unknown", "Maternal", or "Paternal") </td>
<td width="40%"> Haplotype assignments. </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$subject = new Genetics::Subject(name => 'JXPed1-1',
importID => 12,
dateCreated => $today,
NameAliases => [ {name => "jb2002",
contactName => "Gregor Mendel"}
],
Contact => {name => "J.P. Morgan, II",
comment => "Referring physican"},
DBXReferences => [ {accessionNumber => "abc123",
databaseName => "Clinical Land",
schemaName => "Master",
comment => "Internal Clinical DB"}
],
Keywords => [ {name => "Study Population",
dataType => "String",
description => "Internal study identifier.",
value => "Test"},
{name => "Foo",
dataType => "String",
description => "Crap",
value => "Bar"},
{name => "Test Data",
dataType => "Boolean",
value => 1},
],
gender => "Male",
dateOfBirth => "1937-08-18",
dateOfDeath => "1997-02-15",
isProband => 1,
Mother => {name => "JXPed1-2", importID => 32},
Father => {name => "JXPed1-3", importID => 22},
Kindred => {name => "JXPed1", importID => 264},
Organism => {genusSpecies => "Homo sapiens"},
) ;
</pre>
<HR>
<H2><a name="tissuesample"></a>Genetics::Object::TissueSample</H2>
<table border="0" width="99%" cellspacing="1" cellpadding="2">
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="#000080" size="5">Required Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="#000080" > tissue </font></td>
<td width="45%"> String (<= 120 characters) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<th width="99%" colspan="3" align="Left"><font face="Courier New, Courier, mono" color="maroon" size="5">Optional Attributes</font></th>
</tr>
<tr bgcolor="#d9d5d5">
<th width="14%">Name</th>
<th width="45%">Data type and Format</th>
<th width="40%">Description</th>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > dateCollected </font></td>
<td width="45%"> String ("YYYY-MM-DD") </td>
<td width="40%"> Date the sample was collected/prepared. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > amount </font></td>
<td width="45%"> Float (6,3) </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > amountUnits </font></td>
<td width="45%"> String ("g", "mg", "ug", or "ng") </td>
<td width="40%"> </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Subject </font></td>
<td width="45%"> <a href="#refs">Subject reference</a> </td>
<td width="40%"> Reference to the Subject from which the Sample is derived. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > Genotypes </font></td>
<td width="45%"> Array pointer to a list of <a href="#refs">Genotype references</a></td>
<td width="40%"> Reference(s) to Genotype(s) derived from the Sample. </td>
</tr>
<tr bgcolor="#d9d5d5">
<td width="14%"> <font face="Courier New, Courier, mono" color="maroon" > DNASamples </font></td>
<td width="45%"> Array pointer to a list of <a href="#refs">DNASample references</a></td>
<td width="40%"> Reference(s) to DNASample(s) derived from the TissueSample. </td>
</tr>
</table>
<p>
<b>Example:</b>
<pre>
$sample = new Genetics::TissueSample(name => 'SM20.1',
importID => 273,
dateCreated => $today,
comment => "Hard to make DNA from this",
Keywords => [ {name => "Test Data",
dataType => "Boolean",
value => 1},
],
tissue => "Muscle",
dateCollected => "2001-01-18",
amount => 150,
amountUnits => "g",
Subject => {name => 'EAPed20.1',
importID => 12},
DNASamples => [ {name => 'SM20.1-3',
importID => 272},
]
) ;
</pre>
<HR>
<HR>
<H1><A NAME="apiover">Overview of the GenPerl API</A></H1>
<p>The GenPerl API functionality is separated into the following packages.
<ul>
<li> <a href="#api">Genetics::API</a>. This package contains general API methods that don't fit anywhere else right now. This is the only package that needs to be imported into your programs.
<li> The Genetics::API::DB packages contain methods for managing the persistance of GenPerl objects in a relational database.
<ul>
<li> <a href="#create">Genetics::API::DB::Insert</a>.
<li> <a href="#read">Genetics::API::DB::Read</a>.
<li> <a href="#update">Genetics::API::DB::Update</a>.
<li> <a href="#delete">Genetics::API::DB::Delete</a>.
<li> <a href="#query">Genetics::API::DB::Query</a>.
</ul>
<li> <a href="#analysis">Genetics::API::Analysis</a>. This package contains methods for the analysis of data contained in GenPerl objects.
<ul>
<li>
</ul>
</ul>
<HR>
<H2><a name="api"></a>Genetics::API</H2>
<p>An instance of Genetics::API must be instantiated in order to interact with GenPerl objects in a database (or to access any other API methods, for that matter). If the initialization parameters include a 'DSN' value, the Genetics::API constructor will use these values to construct a <i>data source name</i> string. This <i>data source name</i>, along with the user and password parameters are passed directly to DBI->connect for the creation of a database handle. It is possible to instantiate an API instance without the creation of a database connection (just ommit the DSN attribute from the arguments passed to the constructor). In this case the user and password are igored, however this may be changed in the future.
<p>
<b>Example:</b>
<pre>
$api = new Genetics::API(DSN => {driver => "mysql",
host => $Host,
database => $Database},
user => $UserName,
password => $Password) ;
</pre>
<HR>
<H2><a name="create"></a>Genetics::API::DB::Insert</H2>
<p>When saving new objects, references between object may be made either via importIDs (saved as Keywords) or by absolute object IDs. IDs can only be used to reference objects that have already
been saved to the database, and have thus been given a database ID. Otherwise, importIDs must be used.
<p>When a new object identified with an importID is saved to the database, an id is generated for that object. However, it's importID is also saved as a Keyword (w/ keywordTypeID = 1). These keywords are the mechanism the API uses to make connections between objects being imported with importIDs. In theory, an object could always be referenced via the importID with which it was identified when it was first imported. The API supports this. However, unless the importIDs you use are unique amongst all objects ever imported into a given schema, this approach will eventually lead to trouble.
<p>Thus, the best plan is to stick with the following rule. If you want to reference an object that already exists in the database, use ids; if you are making references to objects that are being imported concurrently as part of the same import session, use importIDs.
<p>The various save methods return the database id of the saved object.
<p>
<b>Example:</b>
<p>The following code will create a new SNP. It also creates a new Genotype. The new Genotype references the new SNP, but a Subject that has previously been saved to the database.
<pre>
$snp = new Genetics::SNP(name => 'SNPxyz',
importID => 121,
dateCreated => $today,
chromosome => "X",
malePloidy => 1,
femalePloidy => 2,
snpType => "Substitution",
functionClass => "Synonymous",
snpIndex => 2,
isConfirmed => 1,
confirmMethod => "Resequencing",
Organism => {genusSpecies => "Homo sapiens"},
Alleles => [ {name => "C", type => "Nucleotide"},
{name => "T", type => "Nucleotide"} ],
) ;
$gt = new Genetics::Genotype(name => '1-SNPxyz',
importID => 122,
dateCreated => $today,
isActive => 1,
dateCollected => $today,
Subject => {name => "EAPed20.1", id => 1},
Marker => {name => "SNPxyz", importID => 121},
AlleleCalls => [ {alleleName => "C",
alleleType => "Nucleotide",
phase => "Unknown"
},
{alleleName => "T",
alleleType => "Nucleotide",
phase => "Unknown"
]
) ;
$id = $api->insertSNP($snp) ;
$id = $api->insertGenotype($gt) ;
</pre>
<HR>
<H2><a name="read"></a>Genetics::API::DB::Read</H2>
<p>Currently, objects can be retrieved from the databse by id and by name.
<p>
<b>Example:</b>
<p>This code will retrieve and print the Subject with id = 1.
<pre>
$subject = $api->getSubject(1) ;
$subject->print() ;
</pre>
<HR>
<H2><a name="update"></a>Genetics::API::DB::Update</H2>
<p>Objects in the database are identified for update by id only.
<p>The following describes the update behavior implemented by the methods in this package:
- The data in each object field will completely replace the data in the
database for that field.
- Data for fields not present in an object will not be affected.
- In order to delete data for a particular field, the value of that field
should be set to "DELETE" (irrespective of the normal datatype of thet field).
- In order to add to existing data for a particular field, use an appropriate
method in Genetics::API or handle it manually.
<p>
<b>Examples:</b>
<p>The following code will retrieve the Subject with id = 3, change its name, and then re-save the Subject with its new name back to the databse.
<pre>
$subject = $api->getSubject(3) ;
$subject->field("name", "foo") ;
$api->updateSubject($subject) ;
</pre>
<p>The following code will completely replace the set of alleles associated with the SNP with id = 11:
<pre>
@alleles = ( {name => "A", type => "Nucleotide"},
{name => "C", type => "Nucleotide"} ) ;
$snp = $api->getSNP(11) ;
$snp->field("Alleles", \@alleles) ;
$api->updateSNP($snp) ;
</pre>
<p>The following code will add an allele to those associated with the SNP with id = 11:
<pre>
$snp = $api->getSNP(11) ;
$alleleListPtr = $snp->field("Alleles") ;
push( @$alleleListPtr, {name => "A", type => "Nucleotide"} ) ;
$snp->field("Alleles", $alleleListPtr) ;
$api->updateSNP($snp) ;
</pre>
<HR>
<H2><a name="delete"></a>Genetics::API::DB::Delete</H2>
<p>Currently, objects can be deleted from the databse by id only.
<p>
<b>Example:</b>
<p>The following code will delete Genotypes:
<pre>
foreach $id ( @badGenotypeIDs ) {
$rv = $api->deleteGenotype($id) ;
defined $rv or print "Error deleting Genotype w/ ID $id\n" ;
}
</pre>
<HR>
<H2><a name="query"></a>Genetics::API::DB::Query</H2>
<p>
<p>
<b>Example:</b>
<p>The following code ...
<pre>
</pre>
<HR>
<H2><a name="analysis"></a>Genetics::API::Analysis</H2>
<p>
<p>
<b>Example:</b>
<p>The following code...
<pre>
</pre>
<HR>
<HR>
<H1><A NAME="database">The GenPerl Database</A></H1>
<p>In order to manage the persistance of GenPerl objects, the GenPerl API requires a relational database instance in which to store the data. All database interaction in the API is implemented using DBI, and thus the API could, in theory, support the use of any RDBMS for which a DBI driver module exists. However, right now, the API will only work with <a href="http://www.mysql.com/">MySQL</a>. I chose MySQL mainly because it's free, fast, and relatively simple to administrate. The API takes advantage of a couple of MySQL features - mainly AUTOINCREMENT - which are not present in all RDBMSs. The API code would probably need to be changed in order to use any database. Of course, a suitable schema must be created within the database instance in which the data will be stored and the DDL (see below) would need to be altered such that the column data types are something that the other database will understand.
<p>The <a href="/GenPerl/gp_mysql_ddl.sql">DDL in this script</a> can be used to create an appropriate schema in MySQL.
<HR>
<HR>
<H1><A NAME="use_gp">Using GenPerl</A></H1>
<p>The sections below contain example code with <font color="blueviolet">comments</font> explaining what the code is doing.
<ul>
<li> <a href="#chi-sq">Create affected and unaffected Subject Clusters and do a simple chi-square association test</a>
<li> <a href="#graph">Graph allele frequencies in affected and unaffected Subjects</a>
<li> <a href="#linkage">Write linkage format files</a>
</ul>
<hr>
<a name="chi-sq"></a><h3>Create affected and unaffected Subject Clusters and do a simple chi-square association test.</h3>
<pre>
#!/usr/local/bin/perl -w
<font color="blueviolet"># Create an API instance</font>
use Genetics::API ;
$api = new Genetics::API(DSN => {driver => "mysql",
host => $Host,
database => $Database},
user => slm,
password => GetMysqlPassword()) ;
</pre>
<font color="blueviolet"># Get the StudyVariable on which the Clusters will be based</font>
<pre>
$sv = $api->getObjectByName("Aff") ;
</pre>
<font color="blueviolet"># Get affected Subjects and create a Cluster</font>
<pre>
@affSubjects = $api->getSubjectsByPhenotype($sv, 2) ;
$affCluster = $api->createCluster("HT Affecteds", \@affSubjects) ;
</pre>
<font color="blueviolet"># Get unaffected Subjects and create a Cluster</font>
<pre>
@unaffSubjects = $api->getSubjectsByPhenotype($sv, 1) ;
$unaffCluster = $api->createCluster("Normals", \@unaffSubjects) ;
</pre>
<font color="blueviolet"># Get the Marker whose allele distributions will be tested</font>
<pre>
$marker = $api->getObjectByName("agtT174M") ;
</pre>
<font color="blueviolet"># Do the test</font>
<pre>
$api->chiSquareAssocTest($marker, "Nucleotide",
$affCluster, $unaffCluster) ;
</pre>
<font color="blueviolet"># This will print something along the lines of:</font>
<pre>
Allele counts:
C T
HT_Affecteds 873 125
Normals 736 64
The Chi-Square value is 9.66582997149079, with 1 degrees of freedom
The probability that the difference in agtT174M allele distributions between
HT_Affecteds and Normals is due to chance is less than 0.01.
</pre>
<HR>
<a name="graph"></a><h3>Graph allele frequencies in affected and unaffected Subjects.</h3>
<pre>
#!/usr/local/bin/perl -w
<font color="blueviolet">#Create an API instance</font>
use Genetics::API ;
$api = new Genetics::API(DSN => {driver => "mysql",
host => $Host,
database => $Database},
user => slm,
password => GetMysqlPassword()) ;
<font color="blueviolet"># Get the Clusters containing the Subjects whose allele frequencies will be graphed</font>
$affCluster = $api->getObjectByName("HT Affecteds") ;
$unaffCluster = $api->getObjectByName("Normals") ;
<font color="blueviolet"># Get the Marker whose allele frequencies will be graphed</font>
$marker = $api->getObjectByName("agtT174M") ;
<font color="blueviolet"># Graph the frequencies</font>
$api->graphAlleleFreqs(
MARKER => $marker,
FREQSOURCES => [ $affCluster, $unaffCluster ],
ALLELETYPE => "Nucleotide"
) ;
<font color="blueviolet"># This will display a graph along the lines of:</font>
</pre>
<img src="/GenPerl/gp_graph.png"></img>
<hr>
<a name="linkage"></a><h3>Write linkage format files</h3>
<pre>
#!/usr/local/bin/perl -w
<font color="blueviolet">#Create an API instance</font>
use Genetics::API ;
$api = new Genetics::API(DSN => {driver => "mysql",
host => $Host,
database => $Database},
user => slm,
password => GetMysqlPassword()) ;
<font color="blueviolet"># Get a Kindred to be used</font>
$kindred = $api->getObjectByName("Ped20") ;
<font color="blueviolet"># Get the founder Subjects in the Kindred. These will be used as the allele frequency source</font>
push(@founders, $api->getFounders($kindred)) ;
<font color="blueviolet"># Get the Markers to be used</font>
@markers = $api->getObjectsByType("Marker") ;
<font color="blueviolet"># Get the StudyVariable to be used as the trait locus</font>
$sv = $api->getObjectByName("Aff") ;
<font color="blueviolet"># Get the StudyVariable the defines liability classes assocoated with the trait locus</font>
$lc = $api->getObjectByName("Aff LC") ;
open(DAT, "> ea20.dat") or die "Can't write file: $!" ;
open(PRE, "> ea20.pre") or die "Can't write file: $!" ;
<font color="blueviolet"># Write the files</font>
$api->writeLinkageFiles(
KINDREDS => [ $kindred ],
MARKERS => \@markers,
AFS => \@founders,
TRAIT => $sv,
LC => $lc,
DATFILE => \*DAT,
PEDFILE => \*PRE,
) ;
close DAT ;
close PRE ;
<font color="blueviolet"># This will produce the following:</font>
</pre>
<b>Locus file:</b>
<pre>
10 0 0 5
0 0.0 0.0 0
1 2 3 4 5 6 7 8 9 10
1 2 << affection status
0.9999 0.000100 << allele frequencies
5 << number of liability classes
0.000000 0.000000 0.000000 << penetrance values
0.020000 0.020000 1.000000 << penetrance values
0.040000 0.040000 1.000000 << penetrance values
0.050000 0.050000 1.000000 << penetrance values
0.100000 0.100000 1.000000 << penetrance values
3 6 # D12S91
0.5 0.1667 0.3333 0.0001 0.0001 0.0001 << allele frequencies
3 6 # D12S100
0.0833 0.0833 0.5 0.25 0.0001 0.0833 << allele frequencies
3 7 # CACNL1A1
0.0001 0.0714 0.5 0.0714 0.0714 0.2857 0.0001 << allele frequencies
3 5 # D12S372
0.0001 0.3571 0.3571 0.2143 0.0714 << allele frequencies
3 7 # pY2/1
0.0001 0.25 0.0833 0.0001 0.0001 0.1667 0.5 << allele frequencies
3 9 # pY21/1
0.0001 0.0001 0.1429 0.3571 0.0714 0.2143 0.0001 0.1429 0.0714 << allele frequencies
3 5 # KCNA5
0.3333 0.1667 0.25 0.25 0.0001 << allele frequencies
3 8 # D12S99
0.0714 0.0714 0.0714 0.2857 0.1429 0.2143 0.0714 0.0714 << allele frequencies
3 7 # D12S93
0.1 0.1 0.1 0.2 0.2 0.0001 0.3 << allele frequencies
0 0
0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 << map
1 0.10000 0.45000
</pre>
<b>Pedigree file:</b>
<pre>
Ped20 1 1001 1000 1 2 3 3 1 3 6 9 10 5 3 6 2 3 7 3 2 1 3 6 4
Ped20 1001 0 0 1 1 4 3 1 3 3 9 9 5 4 6 6 4 3 4 3 5 1 6 6
Ped20 1000 2002 2001 2 2 4 1 3 4 6 10 10 2 3 1 2 7 7 3 2 6 3 4 7
Ped20 100 1001 1000 1 1 3 1 1 3 4 9 10 5 2 6 1 4 7 3 3 1 6 6 7
Ped20 2002 0 0 1 1 4 1 1 1 4 9 10 2 2 1 5 5 7 3 4 4 6 4 7
Ped20 2001 0 0 2 2 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Ped20 1002 2002 2001 1 1 4 1 2 4 5 10 7 2 2 1 1 7 10 3 4 6 5 4 7
Ped20 1006 2002 2001 2 2 4 1 3 4 6 10 10 2 3 1 2 7 7 3 2 6 3 4 7
Ped20 1007 0 0 1 1 3 3 3 4 6 1 8 2 3 0 0 4 7 2 4 3 6 3 4
Ped20 1008 2002 2001 2 2 4 1 3 1 6 9 10 2 3 5 2 5 7 4 2 4 3 4 4
Ped20 1009 0 0 1 1 4 1 2 3 3 2 9 2 3 1 1 4 5 1 2 2 5 1 2
Ped20 199 0 0 2 1 3 0 0 0 0 9 10 3 4 2 5 4 9 0 0 4 4 0 0
Ped20 1010 2002 2001 2 2 4 1 3 1 6 9 10 2 3 5 2 5 7 4 2 4 3 4 4
Ped20 1011 0 0 1 1 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Ped20 102 1001 1000 1 2 2 3 3 3 6 9 10 4 3 6 2 4 7 4 2 5 3 6 4
Ped20 103 0 0 2 1 2 2 1 3 2 10 10 4 3 6 6 4 3 3 1 6 4 0 0
Ped20 104 0 0 2 1 3 3 1 4 3 9 9 3 2 6 6 10 5 1 1 8 7 6 3
Ped20 113 1007 1006 2 2 2 3 3 6 4 1 10 3 2 6 1 4 7 2 3 6 3 4 7
Ped20 114 1007 1006 2 2 2 3 3 6 6 8 10 3 3 6 2 4 7 2 2 3 3 4 4
Ped20 115 1009 1008 1 2 2 1 3 3 6 9 10 3 2 1 2 4 7 2 2 5 3 1 4
Ped20 116 1011 1010 1 2 3 3 3 2 6 9 10 3 3 1 2 4 7 1 2 3 3 4 4
Ped20 117 1011 1010 2 1 3 1 3 4 1 8 9 2 3 6 5 5 5 4 4 4 4 4 4
Ped20 9099 100 199 1 1 2 0 0 0 0 9 9 5 3 6 2 4 4 0 0 1 4 0 0
Ped20 9098 100 199 2 0 2 0 0 0 0 10 10 2 4 1 5 7 9 0 0 6 4 0 0
Ped20 9097 100 199 1 1 1 0 0 0 0 9 9 5 3 6 2 4 4 0 0 1 4 0 0
Ped20 9003 102 103 1 2 1 3 2 6 2 10 10 4 3 2 6 7 4 2 3 3 4 4 6
Ped20 9004 102 103 1 1 1 3 1 6 3 10 10 3 3 6 6 4 3 4 1 5 6 4 6
Ped20 9005 1 104 2 2 1 3 1 6 4 10 9 3 3 2 6 7 5 2 1 3 7 4 6
Ped20 9006 1 104 1 0 1 1 1 3 4 9 9 5 3 6 6 3 5 3 1 0 0 0 0
</pre>
<hr>
</BODY>
</HTML>