<?xml version="1.0" encoding="ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Bio.Cluster.Record</title> <link rel="stylesheet" href="epydoc.css" type="text/css" /> <script type="text/javascript" src="epydoc.js"></script> </head> <body bgcolor="white" text="black" link="blue" vlink="#204080" alink="#204080"> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <th class="navbar" width="100%"></th> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"> <span class="breadcrumbs"> <a href="Bio-module.html">Package Bio</a> :: <a href="Bio.Cluster-module.html">Package Cluster</a> :: Class Record </span> </td> <td> <table cellpadding="0" cellspacing="0"> <!-- hide/show private --> <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" onclick="toggle_private();">hide private</a>]</span></td></tr> <tr><td align="right"><span class="options" >[<a href="frames.html" target="_top">frames</a >] | <a href="Bio.Cluster.Record-class.html" target="_top">no frames</a>]</span></td></tr> </table> </td> </tr> </table> <!-- ==================== CLASS DESCRIPTION ==================== --> <h1 class="epydoc">Class Record</h1><p class="nomargin-top"><span class="codelink"><a href="Bio.Cluster-pysrc.html#Record">source code</a></span></p> <pre class="base-tree"> object --+ | <strong class="uidshort">Record</strong> </pre> <hr /> <pre class="literalblock"> Store gene expression data. A Record stores the gene expression data and related information contained in a data file following the file format defined for Michael Eisen's Cluster/TreeView program. A Record has the following members: data: a matrix containing the gene expression data mask: a matrix containing only 1's and 0's, denoting which values are present (1) or missing (0). If all elements of mask are one (no missing data), then mask is set to None. geneid: a list containing a unique identifier for each gene (e.g., ORF name) genename: a list containing an additional description for each gene (e.g., gene name) gweight: the weight to be used for each gene when calculating the distance gorder: an array of real numbers indicating the preferred order of the genes in the output file expid: a list containing a unique identifier for each experimental condition eweight: the weight to be used for each experimental condition when calculating the distance eorder: an array of real numbers indication the preferred order in the output file of the experimental conditions uniqid: the string that was used instead of UNIQID in the input file. </pre> <!-- ==================== INSTANCE METHODS ==================== --> <a name="section-InstanceMethods"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Instance Methods</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-InstanceMethods" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Bio.Cluster.Record-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">handle</span>=<span class="summary-sig-default">None</span>)</span><br /> Read gene expression data from the file handle and return a Record.</td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.__init__">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Bio.Cluster.Record-class.html#treecluster" class="summary-sig-name">treecluster</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">transpose</span>=<span class="summary-sig-default">0</span>, <span class="summary-sig-arg">method</span>=<span class="summary-sig-default">'m'</span>, <span class="summary-sig-arg">dist</span>=<span class="summary-sig-default">'e'</span>)</span><br /> Apply hierarchical clustering and return a Tree object.</td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.treecluster">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Bio.Cluster.Record-class.html#kcluster" class="summary-sig-name">kcluster</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">nclusters</span>=<span class="summary-sig-default">2</span>, <span class="summary-sig-arg">transpose</span>=<span class="summary-sig-default">0</span>, <span class="summary-sig-arg">npass</span>=<span class="summary-sig-default">1</span>, <span class="summary-sig-arg">method</span>=<span class="summary-sig-default">'a'</span>, <span class="summary-sig-arg">dist</span>=<span class="summary-sig-default">'e'</span>, <span class="summary-sig-arg">initialid</span>=<span class="summary-sig-default">None</span>)</span><br /> Apply k-means or k-median clustering.</td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.kcluster">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Bio.Cluster.Record-class.html#somcluster" class="summary-sig-name">somcluster</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">transpose</span>=<span class="summary-sig-default">0</span>, <span class="summary-sig-arg">nxgrid</span>=<span class="summary-sig-default">2</span>, <span class="summary-sig-arg">nygrid</span>=<span class="summary-sig-default">1</span>, <span class="summary-sig-arg">inittau</span>=<span class="summary-sig-default">0.02</span>, <span class="summary-sig-arg">niter</span>=<span class="summary-sig-default">1</span>, <span class="summary-sig-arg">dist</span>=<span class="summary-sig-default">'e'</span>)</span><br /> Calculate a self-organizing map on a rectangular grid.</td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.somcluster">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Bio.Cluster.Record-class.html#clustercentroids" class="summary-sig-name">clustercentroids</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">clusterid</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">method</span>=<span class="summary-sig-default">'a'</span>, <span class="summary-sig-arg">transpose</span>=<span class="summary-sig-default">0</span>)</span><br /> Calculate the cluster centroids and return a tuple (cdata, cmask).</td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.clustercentroids">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Bio.Cluster.Record-class.html#clusterdistance" class="summary-sig-name">clusterdistance</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">index1</span>=<span class="summary-sig-default">[0]</span>, <span class="summary-sig-arg">index2</span>=<span class="summary-sig-default">[0]</span>, <span class="summary-sig-arg">method</span>=<span class="summary-sig-default">'a'</span>, <span class="summary-sig-arg">dist</span>=<span class="summary-sig-default">'e'</span>, <span class="summary-sig-arg">transpose</span>=<span class="summary-sig-default">0</span>)</span><br /> Calculate the distance between two clusters.</td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.clusterdistance">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Bio.Cluster.Record-class.html#distancematrix" class="summary-sig-name">distancematrix</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">transpose</span>=<span class="summary-sig-default">0</span>, <span class="summary-sig-arg">dist</span>=<span class="summary-sig-default">'e'</span>)</span><br /> Calculate the distance matrix and return it as a list of arrays</td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.distancematrix">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Bio.Cluster.Record-class.html#save" class="summary-sig-name">save</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">jobname</span>, <span class="summary-sig-arg">geneclusters</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">expclusters</span>=<span class="summary-sig-default">None</span>)</span><br /> Save the clustering results.</td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.save">source code</a></span> </td> </tr> </table> </td> </tr> <tr class="private"> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="_savekmeans"></a><span class="summary-sig-name">_savekmeans</span>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">filename</span>, <span class="summary-sig-arg">clusterids</span>, <span class="summary-sig-arg">order</span>, <span class="summary-sig-arg">transpose</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Cluster-pysrc.html#Record._savekmeans">source code</a></span> </td> </tr> </table> </td> </tr> <tr class="private"> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="_savedata"></a><span class="summary-sig-name">_savedata</span>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">jobname</span>, <span class="summary-sig-arg">gid</span>, <span class="summary-sig-arg">aid</span>, <span class="summary-sig-arg">geneindex</span>, <span class="summary-sig-arg">expindex</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Cluster-pysrc.html#Record._savedata">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: <code>__delattr__</code>, <code>__format__</code>, <code>__getattribute__</code>, <code>__hash__</code>, <code>__new__</code>, <code>__reduce__</code>, <code>__reduce_ex__</code>, <code>__repr__</code>, <code>__setattr__</code>, <code>__sizeof__</code>, <code>__str__</code>, <code>__subclasshook__</code> </p> </td> </tr> </table> <!-- ==================== PROPERTIES ==================== --> <a name="section-Properties"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Properties</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-Properties" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: <code>__class__</code> </p> </td> </tr> </table> <!-- ==================== METHOD DETAILS ==================== --> <a name="section-MethodDetails"></a> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Method Details</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-MethodDetails" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> </table> <a name="__init__"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, <span class="sig-arg">handle</span>=<span class="sig-default">None</span>)</span> <br /><em class="fname">(Constructor)</em> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.__init__">source code</a></span> </td> </tr></table> <p>Read gene expression data from the file handle and return a Record.</p> <p>The file should be in the format defined for Michael Eisen's Cluster/TreeView program.</p> <dl class="fields"> <dt>Overrides: object.__init__ </dt> </dl> </td></tr></table> </div> <a name="treecluster"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">treecluster</span>(<span class="sig-arg">self</span>, <span class="sig-arg">transpose</span>=<span class="sig-default">0</span>, <span class="sig-arg">method</span>=<span class="sig-default">'m'</span>, <span class="sig-arg">dist</span>=<span class="sig-default">'e'</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.treecluster">source code</a></span> </td> </tr></table> <pre class="literalblock"> Apply hierarchical clustering and return a Tree object. The pairwise single, complete, centroid, and average linkage hierarchical clustering methods are available. transpose: if equal to 0, genes (rows) are clustered; if equal to 1, microarrays (columns) are clustered. dist : specifies the distance function to be used: dist=='e': Euclidean distance dist=='b': City Block distance dist=='c': Pearson correlation dist=='a': absolute value of the correlation dist=='u': uncentered correlation dist=='x': absolute uncentered correlation dist=='s': Spearman's rank correlation dist=='k': Kendall's tau method : specifies which linkage method is used: method=='s': Single pairwise linkage method=='m': Complete (maximum) pairwise linkage (default) method=='c': Centroid linkage method=='a': Average pairwise linkage See the description of the Tree class for more information about the Tree object returned by this method. </pre> <dl class="fields"> </dl> </td></tr></table> </div> <a name="kcluster"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">kcluster</span>(<span class="sig-arg">self</span>, <span class="sig-arg">nclusters</span>=<span class="sig-default">2</span>, <span class="sig-arg">transpose</span>=<span class="sig-default">0</span>, <span class="sig-arg">npass</span>=<span class="sig-default">1</span>, <span class="sig-arg">method</span>=<span class="sig-default">'a'</span>, <span class="sig-arg">dist</span>=<span class="sig-default">'e'</span>, <span class="sig-arg">initialid</span>=<span class="sig-default">None</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.kcluster">source code</a></span> </td> </tr></table> <pre class="literalblock"> Apply k-means or k-median clustering. This method returns a tuple (clusterid, error, nfound). nclusters: number of clusters (the 'k' in k-means) transpose: if equal to 0, genes (rows) are clustered; if equal to 1, microarrays (columns) are clustered. npass : number of times the k-means clustering algorithm is performed, each time with a different (random) initial condition. method : specifies how the center of a cluster is found: method=='a': arithmetic mean method=='m': median dist : specifies the distance function to be used: dist=='e': Euclidean distance dist=='b': City Block distance dist=='c': Pearson correlation dist=='a': absolute value of the correlation dist=='u': uncentered correlation dist=='x': absolute uncentered correlation dist=='s': Spearman's rank correlation dist=='k': Kendall's tau initialid: the initial clustering from which the algorithm should start. If initialid is None, the routine carries out npass repetitions of the EM algorithm, each time starting from a different random initial clustering. If initialid is given, the routine carries out the EM algorithm only once, starting from the given initial clustering and without randomizing the order in which items are assigned to clusters (i.e., using the same order as in the data matrix). In that case, the k-means algorithm is fully deterministic. Return values: clusterid: array containing the number of the cluster to which each gene/microarray was assigned in the best k-means clustering solution that was found in the npass runs; error: the within-cluster sum of distances for the returned k-means clustering solution; nfound: the number of times this solution was found. </pre> <dl class="fields"> </dl> </td></tr></table> </div> <a name="somcluster"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">somcluster</span>(<span class="sig-arg">self</span>, <span class="sig-arg">transpose</span>=<span class="sig-default">0</span>, <span class="sig-arg">nxgrid</span>=<span class="sig-default">2</span>, <span class="sig-arg">nygrid</span>=<span class="sig-default">1</span>, <span class="sig-arg">inittau</span>=<span class="sig-default">0.02</span>, <span class="sig-arg">niter</span>=<span class="sig-default">1</span>, <span class="sig-arg">dist</span>=<span class="sig-default">'e'</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.somcluster">source code</a></span> </td> </tr></table> <pre class="literalblock"> Calculate a self-organizing map on a rectangular grid. The somcluster method returns a tuple (clusterid, celldata). transpose: if equal to 0, genes (rows) are clustered; if equal to 1, microarrays (columns) are clustered. nxgrid : the horizontal dimension of the rectangular SOM map nygrid : the vertical dimension of the rectangular SOM map inittau : the initial value of tau (the neighborbood function) niter : the number of iterations dist : specifies the distance function to be used: dist=='e': Euclidean distance dist=='b': City Block distance dist=='c': Pearson correlation dist=='a': absolute value of the correlation dist=='u': uncentered correlation dist=='x': absolute uncentered correlation dist=='s': Spearman's rank correlation dist=='k': Kendall's tau Return values: clusterid: array with two columns, while the number of rows is equal to the number of genes or the number of microarrays depending on whether genes or microarrays are being clustered. Each row in the array contains the x and y coordinates of the cell in the rectangular SOM grid to which the gene or microarray was assigned. celldata: an array with dimensions (nxgrid, nygrid, number of microarrays) if genes are being clustered, or (nxgrid, nygrid, number of genes) if microarrays are being clustered. Each element [ix][iy] of this array is a 1D vector containing the gene expression data for the centroid of the cluster in the SOM grid cell with coordinates (ix, iy). </pre> <dl class="fields"> </dl> </td></tr></table> </div> <a name="clustercentroids"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">clustercentroids</span>(<span class="sig-arg">self</span>, <span class="sig-arg">clusterid</span>=<span class="sig-default">None</span>, <span class="sig-arg">method</span>=<span class="sig-default">'a'</span>, <span class="sig-arg">transpose</span>=<span class="sig-default">0</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.clustercentroids">source code</a></span> </td> </tr></table> <pre class="literalblock"> Calculate the cluster centroids and return a tuple (cdata, cmask). The centroid is defined as either the mean or the median over all elements for each dimension. data : nrows x ncolumns array containing the expression data mask : nrows x ncolumns array of integers, showing which data are missing. If mask[i][j]==0, then data[i][j] is missing. transpose: if equal to 0, gene (row) clusters are considered; if equal to 1, microarray (column) clusters are considered. clusterid: array containing the cluster number for each gene or microarray. The cluster number should be non-negative. method : specifies how the centroid is calculated: method=='a': arithmetic mean over each dimension. (default) method=='m': median over each dimension. Return values: cdata : 2D array containing the cluster centroids. If transpose==0, then the dimensions of cdata are nclusters x ncolumns. If transpose==1, then the dimensions of cdata are nrows x nclusters. cmask : 2D array of integers describing which elements in cdata, if any, are missing. </pre> <dl class="fields"> </dl> </td></tr></table> </div> <a name="clusterdistance"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">clusterdistance</span>(<span class="sig-arg">self</span>, <span class="sig-arg">index1</span>=<span class="sig-default">[0]</span>, <span class="sig-arg">index2</span>=<span class="sig-default">[0]</span>, <span class="sig-arg">method</span>=<span class="sig-default">'a'</span>, <span class="sig-arg">dist</span>=<span class="sig-default">'e'</span>, <span class="sig-arg">transpose</span>=<span class="sig-default">0</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.clusterdistance">source code</a></span> </td> </tr></table> <pre class="literalblock"> Calculate the distance between two clusters. index1 : 1D array identifying which genes/microarrays belong to the first cluster. If the cluster contains only one gene, then index1 can also be written as a single integer. index2 : 1D array identifying which genes/microarrays belong to the second cluster. If the cluster contains only one gene, then index2 can also be written as a single integer. transpose: if equal to 0, genes (rows) are clustered; if equal to 1, microarrays (columns) are clustered. dist : specifies the distance function to be used: dist=='e': Euclidean distance dist=='b': City Block distance dist=='c': Pearson correlation dist=='a': absolute value of the correlation dist=='u': uncentered correlation dist=='x': absolute uncentered correlation dist=='s': Spearman's rank correlation dist=='k': Kendall's tau method : specifies how the distance between two clusters is defined: method=='a': the distance between the arithmetic means of the two clusters method=='m': the distance between the medians of the two clusters method=='s': the smallest pairwise distance between members of the two clusters method=='x': the largest pairwise distance between members of the two clusters method=='v': average of the pairwise distances between members of the clusters transpose: if equal to 0: clusters of genes (rows) are considered; if equal to 1: clusters of microarrays (columns) are considered. </pre> <dl class="fields"> </dl> </td></tr></table> </div> <a name="distancematrix"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">distancematrix</span>(<span class="sig-arg">self</span>, <span class="sig-arg">transpose</span>=<span class="sig-default">0</span>, <span class="sig-arg">dist</span>=<span class="sig-default">'e'</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.distancematrix">source code</a></span> </td> </tr></table> <pre class="literalblock"> Calculate the distance matrix and return it as a list of arrays transpose: if equal to 0: calculate the distances between genes (rows); if equal to 1: calculate the distances beteeen microarrays (columns). dist : specifies the distance function to be used: dist=='e': Euclidean distance dist=='b': City Block distance dist=='c': Pearson correlation dist=='a': absolute value of the correlation dist=='u': uncentered correlation dist=='x': absolute uncentered correlation dist=='s': Spearman's rank correlation dist=='k': Kendall's tau Return value: The distance matrix is returned as a list of 1D arrays containing the distance matrix between the gene expression data. The number of columns in each row is equal to the row number. Hence, the first row has zero elements. An example of the return value is matrix = [[], array([1.]), array([7., 3.]), array([4., 2., 6.])] This corresponds to the distance matrix [0., 1., 7., 4.] [1., 0., 3., 2.] [7., 3., 0., 6.] [4., 2., 6., 0.] </pre> <dl class="fields"> </dl> </td></tr></table> </div> <a name="save"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">save</span>(<span class="sig-arg">self</span>, <span class="sig-arg">jobname</span>, <span class="sig-arg">geneclusters</span>=<span class="sig-default">None</span>, <span class="sig-arg">expclusters</span>=<span class="sig-default">None</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="Bio.Cluster-pysrc.html#Record.save">source code</a></span> </td> </tr></table> <pre class="literalblock"> Save the clustering results. The saved files follow the convention for the Java TreeView program, which can therefore be used to view the clustering result. Arguments: jobname: The base name of the files to be saved. The filenames are jobname.cdt, jobname.gtr, and jobname.atr for hierarchical clustering, and jobname-K*.cdt, jobname-K*.kgg, jobname-K*.kag for k-means clustering results. geneclusters=None: For hierarchical clustering results, geneclusters is a Tree object as returned by the treecluster method. For k-means clustering results, geneclusters is a vector containing ngenes integers, describing to which cluster a given gene belongs. This vector can be calculated by kcluster. expclusters=None: For hierarchical clustering results, expclusters is a Tree object as returned by the treecluster method. For k-means clustering results, expclusters is a vector containing nexps integers, describing to which cluster a given experimental condition belongs. This vector can be calculated by kcluster. </pre> <dl class="fields"> </dl> </td></tr></table> </div> <br /> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <th class="navbar" width="100%"></th> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> Generated by Epydoc 3.0.1 on Thu Aug 18 18:19:24 2011 </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" >http://epydoc.sourceforge.net</a> </td> </tr> </table> <script type="text/javascript"> <!-- // Private objects are initially displayed (because if // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. checkCookie(); // --> </script> </body> </html>