<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
  <bean id="inputHandler" class="calhoun.analysis.crf.io.InputHandlerOrderedDirectory">
	<property name="inputReaders">
		<list>
			<value>all_genes.fasta</value>
			<bean class="calhoun.analysis.crf.io.FastaInput">
				<property name="header" value="name"/>
				<property name="sequence" value="ref"/>
			</bean>
			<value>exonerate.fasta</value>
			<bean class="fmph.io.IntWithHeaderInput">
				<property name="name" value="exonerate"/>
			</bean>
			<value>introns.fasta</value>
			<bean class="fmph.io.IntWithHeaderInput">
				<property name="name" value="introns"/>
			</bean>
			<value>tree.tre</value>
			<bean class="fmph.io.AlignmentTreeMultipleRef">
				<property name="component" value="aln"/>
			</bean>
			<value>alignments.faa</value>
			<bean class="calhoun.analysis.crf.io.FastaAlignmentInput">
				<property name="component" value="aln"/>
			</bean>
		</list>
	</property>
	<property name="hiddenSequenceFile" value="all_genes.gtf" />
	<property name="hiddenStateReader">
	  	<bean class="calhoun.analysis.crf.io.GTFInputInterval13"/>
	</property>
  </bean>
  <bean id="outputHandler" class="fmph.io.OutputHandlerGeneCallStats">
		<property name="inputHandler" ref="inputHandler"/>
		<property name="manager" ref="model"/>
  </bean>
  <bean id="inference" class="calhoun.analysis.crf.solver.SemiMarkovViterbi">
	<property name="cacheProcessor" ref="cache"/>
  </bean>
  <bean id="optimizer" class="calhoun.analysis.crf.solver.StandardOptimizer">
	<property name="objectiveFunction">
		<bean class="calhoun.analysis.crf.solver.MaximumLikelihoodSemiMarkovGradient" >
			<property name="cacheProcessor" ref="cache"/>
		</bean>
	</property>
  </bean>
    <bean id="cache" class="calhoun.analysis.crf.solver.CacheProcessorDeluxe">
	<property name="lookbackArraySize" value="5000"/>
	<property name="lookbackArrayFeatureSize" value="5"/>
	<property name="ignoreInvalidTrainingData" value="true"/>
	<property name="semiMarkovSetup">
	<bean id="lengths" class="calhoun.analysis.crf.SemiMarkovSetup">
		<property name="ignoreSemiMarkovSelfTransitions" value="true"/>
		<property name="maxLengths">
			<list>
				<value>3500</value>
				<value>2200</value>
				<value>2200</value>
				<value>2200</value>
				<value>3500</value>
				<value>3500</value>
				<value>3500</value>
				<value>2200</value>
				<value>2200</value>
				<value>2200</value>
				<value>3500</value>
				<value>3500</value>
				<value>3500</value>
			</list>
		</property>
				<property name="minLengths">
			<list>
				<value>18</value>
				<value>9</value>
				<value>9</value>
				<value>9</value>
				<value>15</value>
				<value>15</value>
				<value>15</value>
				<value>9</value>
				<value>9</value>
				<value>9</value>
				<value>15</value>
				<value>15</value>
				<value>15</value>
			</list>
		</property>
	  </bean>
	</property>
  </bean>
  <bean id="model" class="fmph.features.mitochondrion1.Mitochondrion1Model">
        <property name="narrowBoundaries" value="false"/>
	<property name="componentFeatures">
	  <list>
	  	  <!-- First, compute probability of hidden state sequences -->
			<bean class="fmph.features.mitochondrion1.StateTransitionsMitochondrion1">
				<property name="inputComponent" value="ref"/>
			</bean>
			<bean class="fmph.features.mitochondrion1.StateLengthLogprobMitochondrion1">
				<property name="inputComponent" value="ref"/>
				<property name="multipleFeatures" value="true"/>
			</bean>

			<!-- Second, restict to hidden state sequences that, given reference sequence observations, are legal -->
			<bean class="fmph.features.mitochondrion1.GeneConstraintsMitochondrion1">
				<property name="inputComponent" value="ref"/>
			</bean>
			<!-- Third, copmute the probability of emitted ref sequenc egiven hidden state -->
			<bean class="fmph.features.mitochondrion1.ReferenceBasePredictorMitochondrion1">
				<property name="inputComponent" value="ref"/>
				<property name="multipleFeatures" value="true"/>
			</bean>
			<bean class="fmph.features.mitochondrion1.PWMMitochondrion1" >
				<property name="inputComponent" value="ref"/>
				<property name="multipleFeatures" value="true"/>
			</bean>
			<bean class="fmph.features.mitochondrion1.ExonerateMitochondrion1">
				<property name="inputComponent" value="exonerate"/>
			</bean>
			<bean class="fmph.features.mitochondrion1.IntronHitsMitochondrion1">
				<property name="inputComponent" value="introns"/>
			</bean>
			<bean class="fmph.features.mitochondrion1.PhylogeneticLogprobMitochondrion1">
				<property name="inputComponent" value="aln"/>
				<property name="multipleFeatures" value="true"/>
				<property name="emodelIntergenicParams">
					<list>
						<value>9.027941760821149</value>
						<value>4.033718455425241</value>
						<value>0.44448760556490713</value>
						<value>0.06946919299912885</value>
						<value>0.05551239443509287</value>
					</list>
				</property>
				<property name="emodelIntronicParams">
					<list>
						<value>7.1637616103302575</value>
						<value>3.975049018330243</value>
						<value>0.43914528597477975</value>
						<value>0.08378919793512597</value>
						<value>0.1197832395921617</value>
					</list>
				</property>
				<property name="emodelExonic0Params">
					<list>
						<value>2.3728814207126065</value>
						<value>1.425772860742017</value>
						<value>0.337173765122421</value>
						<value>0.09340437555501736</value>
						<value>0.2211996447888916</value>
					</list>
				</property>
				<property name="emodelExonic1Params">
					<list>
						<value>1.7390188901730215</value>
						<value>1.2445736320384442</value>
						<value>0.24048632499336725</value>
						<value>0.19082719082719082</value>
						<value>0.12942519984773507</value>
					</list>
				</property>
				<property name="emodelExonic2Params">
					<list>
						<value>6.682136848355302</value>
						<value>2.7266919623589505</value>
						<value>0.5036354823073195</value>
						<value>0.05671352399418323</value>
						<value>0.04398356531172818</value>
					</list>
				</property>
			</bean>
		</list>
		</property>
  </bean>
</beans>
