<?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>
		
			
		</list>
		</property>
  </bean>
</beans>
