<?xml version="1.0" encoding="UTF-8"?>
<maxdQL version="0.1" name="GeneHunterXHTMLCoreOutput" >
	
	<description>Will take a list of Gene names, a list of Measurement names and a list of Column Types and produce a table. All values are coloured in relation to the a reference. In the list of Measurement names, the first Measurement listed is taken to be the reference. Formatted as text.</description>
	
	<unitTest>
		php run.php -file=../../sequences/geneHunterPHP.xml -display=last -profile="The mouse microarray experiment" -GeneNames="Affy:Mouse430_2:1415670_at,Affy:Mouse430_2:1415671_at,Affy:Mouse430_2:1415672_at,Affy:Mouse430_2:1415673_at" -ColumnType="RMA Normalised" -MeasurementIDs="0,1"
	</unitTest>
	
	<xfunction id="getGeneIds" comment="take a list of genes and make a geneids tag from their ids">
		<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
			<xsl:output method="text" encoding="ISO-8859-1" indent="no" omit-xml-declaration="yes" media-type="text/html"/>
			<xsl:strip-space elements="entries Gene"/>
			<xsl:template match="/">
				<xsl:for-each select="entries/browse/Gene"><xsl:value-of select="@ID"/>,</xsl:for-each>
			</xsl:template>
		</xsl:stylesheet>
	</xfunction>
	
	
	
	<arguments type="user" >
		<var name="GeneNames" comment="the names of the genes you want, *for all"/>
		<var name="ColumnTypes" comment="the column names, comma-separated, * for all" />
		<var name="MeasurementNames" comment="the measurement names, * for all. The first Measurement listed is taken to be the reference." />
	</arguments>
	
	<query id="1" name="SearchGene" comment="search table Gene" type="maxdBrowse" >
		<names uref="user" name="GeneNames" />
		
		<action>browse</action>
		<table>Gene</table>
		<attributes>no</attributes>
	</query>
	
	<query id="2" name="EnumerateGenesForDesiredMeasurements" comment="enumerate some Genes" type="maxdBrowse">
		<geneids xref="getGeneIds" processResultID="1"/>
		
		<types uref="user" name="ColumnTypes"/>
		<names uref="user" name="MeasurementNames"/>
		
		<action>enumerate</action>
		<table>Measurement</table>
		<spots>Feature,Reporter,Gene</spots>
		<format>xml</format>
	</query>
	
	
</maxdQL>
