<commit_before><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:batch="http://www.springframework.org/schema/batch"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jdbc="http://www.springframework.org/schema/jdbc"
	xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
		http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.2.xsd
		http://www.springframework.org/schema/data/neo4j http://www.springframework.org/schema/data/neo4j/spring-neo4j.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
	
	<import resource="classpath:launch-context.xml" />
	
	<!-- Properties  -->
	<context:property-placeholder location="classpath:InterBase.properties" />
	
	<!-- XML Marshalling -->
	<bean id="castorMarshaller" class="org.springframework.oxm.castor.CastorMarshaller" >
		<property name="mappingLocation" value="classpath:mapping.xml" />
	</bean>
	
	<bean id="XMLConverter" class="mpg.biochem.de.interbase.util.XMLConverter">
		<property name="marshaller" ref="castorMarshaller" />
		<property name="unmarshaller" ref="castorMarshaller" />
	</bean>
	
	<!-- ServiceHandler -->
	<bean id="serviceHandler" class="mpg.biochem.de.interbase.model.ServiceHandler" init-method="initIt" destroy-method="save">
		<property name="XMLConverter" ref="XMLConverter" />
		<property name="path" value="${path}services/services.xml" />
	</bean>
	
	<!-- PSICQUIC registry client -->
	<bean id="registryClient" class="org.hupo.psi.mi.psicquic.registry.client.registry.DefaultPsicquicRegistryClient"/>
	
	
	<!-- Parent steps -->
	<batch:step id="fetchIntParent">
		<batch:tasklet ref="fetchInteractions"/>
	</batch:step>
	
	<batch:step id="unifyPSMIFilesParent">
		<batch:tasklet>
			<batch:chunk reader="multiReaderWrapper" writer="BIWriter" commit-interval="30000"/>
		    <batch:listeners>
		    	<batch:listener ref="fileNameListener"/>
		    </batch:listeners>
		</batch:tasklet>
	</batch:step>
	
	<batch:step id="mappingsParent">
		<batch:tasklet ref="mapping"/>
	</batch:step>
	
	<batch:step id="createUniprotIndexParent">
		<batch:tasklet task-executor="taskExecutor" throttle-limit="50">
			<batch:chunk reader="gzipItemReader" writer="mappingIndexWriter" commit-interval="10000"></batch:chunk>
		</batch:tasklet>
	</batch:step>
	
	<batch:step id="createNcbiIndexParent">
		<batch:tasklet task-executor="taskExecutor" throttle-limit="50">
			<batch:chunk reader="ncbiGzipItemReader" processor="ncbiProcessor" writer="ncbiMappingIndexWriter" commit-interval="10000"></batch:chunk>
		</batch:tasklet>
	</batch:step>
	
	<batch:step id="mapIdsParent">
		<batch:tasklet>
			<batch:chunk reader="psimiReader" processor="interProcessor" writer="BIWriter2" commit-interval="30000"/>
		</batch:tasklet>
    </batch:step>
    
    <batch:step id="sortParent">
			<batch:tasklet ref="simpleSort"/>
	</batch:step>
	
	<batch:step id="clusterParent">
		<batch:tasklet ref="groupCluster"/>
	</batch:step>
	
	<batch:step id="interactomesParent">
		<batch:tasklet ref="interactomeBuilder"/>
	</batch:step>
	
	<!-- Jobs -->
	<batch:job id="interactions" job-repository="jobRepository">
		<batch:step id="interactions-s1" parent="fetchIntParent"/>
	</batch:job>
	
	<batch:job id="unify" job-repository="jobRepository">
		<batch:step id="unify-s1" parent="unifyPSMIFilesParent"/>
	</batch:job>
	
	<batch:job id="mappings" job-repository="jobRepository">
		<batch:step id="mappings-s1" parent="mappingsParent"/>
	</batch:job>
	
	<batch:job id="uniprotIndex" job-repository="jobRepository">
		<batch:step id="uniprotIndex-s1" parent="createUniprotIndexParent"/>
	</batch:job>
	
	<batch:job id="ncbiIndex" job-repository="jobRepository">
		<batch:step id="ncbiIndex-s1" parent="createNcbiIndexParent"/>
	</batch:job>
	
	<batch:job id="idMapping" job-repository="jobRepository">
		<batch:step id="idMapping-s1" parent="mapIdsParent"/>
	</batch:job>
	
	<batch:job id="sort" job-repository="jobRepository">
		<batch:step id="sort-s1" parent="sortParent"/>
	</batch:job>
	
	<batch:job id="cluster" job-repository="jobRepository">
		<batch:step id="cluster-s1" parent="clusterParent"/>
	</batch:job>
	
	<batch:job id="interactomes" job-repository="jobRepository">
		<batch:step id="interactomes-s1" parent="interactomesParent"/>
	</batch:job>
	
	<batch:job id="mainJob" job-repository="jobRepository">
    	<batch:split id="split1" task-executor="taskExecutor" next="mergeFiles">
	       <batch:flow>
		       <batch:step id="downloadInteractions" parent="fetchIntParent"/>
	       </batch:flow>
	       <batch:flow>
		       <batch:step id="downloadMappings" parent="mappingsParent" next="decision"/>
		       <batch:decision id="decision" decider="indexDecider">
					<batch:next on="CONTINUE" to="uniprotMappingIndex" />
					<batch:next on="SKIP" to="fakeTask" />
	  		   </batch:decision>
	  		   <batch:step id="uniprotMappingIndex" parent="createUniprotIndexParent" next="ncbiMappingIndex"/>
		       <batch:step id ="ncbiMappingIndex" parent="createNcbiIndexParent" next="fakeTask"/>
		       <batch:step id="fakeTask" next="push">
		           <batch:tasklet ref="fake"/>
		       </batch:step>
		       <batch:step id="push"> 
		           <batch:tasklet ref="pushover"/>
		       </batch:step>
	       </batch:flow>
       </batch:split>
      
       <batch:step id="mergeFiles" next="mapIds" parent="unifyPSMIFilesParent"/>
	   
	   <batch:step id="mapIds" parent="mapIdsParent" next="sortFile"/>   	
		
		<batch:step id="sortFile" parent="sortParent" next="clusterFile"/>
		
		<batch:step id="clusterFile" parent="clusterParent" next="createInteractomes"/>
		
		<batch:step id="createInteractomes" parent="interactomesParent"/>
    </batch:job>

    <!-- Tasklets -->
    <bean id="fetchInteractions" class="mpg.biochem.de.interbase.task.FetchInteractionsTasklet">
        <constructor-arg name="registryClient" ref="registryClient"/>
        <constructor-arg name="taskExecutor" ref="taskExecutor" />
		<constructor-arg name="serviceHandler" ref="serviceHandler"/>
    </bean>
	
	<bean id="mapping" class="mpg.biochem.de.interbase.task.DownloadMappingsTasklet"/>
	
	<bean id="fake" class="mpg.biochem.de.interbase.task.FakeTasklet"/>
	
	<bean id="biBeanIoFactory" class="mpg.biochem.de.interbase.batch.BinaryInteractionIoFactory" />
	
	<bean id="simpleSort" class="mpg.biochem.de.interbase.task.FlatFileSortTasklet" scope="step">
		<property name="inputResource">
			<bean class="org.springframework.core.io.FileSystemResource">
				<constructor-arg>
					<bean class="java.io.File"><commit_msg>Change a bad reference in iAtlasJob.xml<commit_after><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:batch="http://www.springframework.org/schema/batch"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jdbc="http://www.springframework.org/schema/jdbc"
	xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
		http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.2.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
	
	<import resource="classpath:launch-context.xml" />
	
	<!-- Properties  -->
	<context:property-placeholder location="classpath:InterBase.properties" />
	
	<!-- XML Marshalling -->
	<bean id="castorMarshaller" class="org.springframework.oxm.castor.CastorMarshaller" >
		<property name="mappingLocation" value="classpath:mapping.xml" />
	</bean>
	
	<bean id="XMLConverter" class="mpg.biochem.de.interbase.util.XMLConverter">
		<property name="marshaller" ref="castorMarshaller" />
		<property name="unmarshaller" ref="castorMarshaller" />
	</bean>
	
	<!-- ServiceHandler -->
	<bean id="serviceHandler" class="mpg.biochem.de.interbase.model.ServiceHandler" init-method="initIt" destroy-method="save">
		<property name="XMLConverter" ref="XMLConverter" />
		<property name="path" value="${path}services/services.xml" />
	</bean>
	
	<!-- PSICQUIC registry client -->
	<bean id="registryClient" class="org.hupo.psi.mi.psicquic.registry.client.registry.DefaultPsicquicRegistryClient"/>
	
	
	<!-- Parent steps -->
	<batch:step id="fetchIntParent">
		<batch:tasklet ref="fetchInteractions"/>
	</batch:step>
	
	<batch:step id="unifyPSMIFilesParent">
		<batch:tasklet>
			<batch:chunk reader="multiReaderWrapper" writer="BIWriter" commit-interval="30000"/>
		    <batch:listeners>
		    	<batch:listener ref="fileNameListener"/>
		    </batch:listeners>
		</batch:tasklet>
	</batch:step>
	
	<batch:step id="mappingsParent">
		<batch:tasklet ref="mapping"/>
	</batch:step>
	
	<batch:step id="createUniprotIndexParent">
		<batch:tasklet task-executor="taskExecutor" throttle-limit="50">
			<batch:chunk reader="gzipItemReader" writer="mappingIndexWriter" commit-interval="10000"></batch:chunk>
		</batch:tasklet>
	</batch:step>
	
	<batch:step id="createNcbiIndexParent">
		<batch:tasklet task-executor="taskExecutor" throttle-limit="50">
			<batch:chunk reader="ncbiGzipItemReader" processor="ncbiProcessor" writer="ncbiMappingIndexWriter" commit-interval="10000"></batch:chunk>
		</batch:tasklet>
	</batch:step>
	
	<batch:step id="mapIdsParent">
		<batch:tasklet>
			<batch:chunk reader="psimiReader" processor="interProcessor" writer="BIWriter2" commit-interval="30000"/>
		</batch:tasklet>
    </batch:step>
    
    <batch:step id="sortParent">
			<batch:tasklet ref="simpleSort"/>
	</batch:step>
	
	<batch:step id="clusterParent">
		<batch:tasklet ref="groupCluster"/>
	</batch:step>
	
	<batch:step id="interactomesParent">
		<batch:tasklet ref="interactomeBuilder"/>
	</batch:step>
	
	<!-- Jobs -->
	<batch:job id="interactions" job-repository="jobRepository">
		<batch:step id="interactions-s1" parent="fetchIntParent"/>
	</batch:job>
	
	<batch:job id="unify" job-repository="jobRepository">
		<batch:step id="unify-s1" parent="unifyPSMIFilesParent"/>
	</batch:job>
	
	<batch:job id="mappings" job-repository="jobRepository">
		<batch:step id="mappings-s1" parent="mappingsParent"/>
	</batch:job>
	
	<batch:job id="uniprotIndex" job-repository="jobRepository">
		<batch:step id="uniprotIndex-s1" parent="createUniprotIndexParent"/>
	</batch:job>
	
	<batch:job id="ncbiIndex" job-repository="jobRepository">
		<batch:step id="ncbiIndex-s1" parent="createNcbiIndexParent"/>
	</batch:job>
	
	<batch:job id="idMapping" job-repository="jobRepository">
		<batch:step id="idMapping-s1" parent="mapIdsParent"/>
	</batch:job>
	
	<batch:job id="sort" job-repository="jobRepository">
		<batch:step id="sort-s1" parent="sortParent"/>
	</batch:job>
	
	<batch:job id="cluster" job-repository="jobRepository">
		<batch:step id="cluster-s1" parent="clusterParent"/>
	</batch:job>
	
	<batch:job id="interactomes" job-repository="jobRepository">
		<batch:step id="interactomes-s1" parent="interactomesParent"/>
	</batch:job>
	
	<batch:job id="mainJob" job-repository="jobRepository">
    	<batch:split id="split1" task-executor="taskExecutor" next="mapIds">
	       <batch:flow>
		       <batch:step id="downloadInteractions" parent="fetchIntParent" next="mergeFiles"/>
		       <batch:step id="mergeFiles" parent="unifyPSMIFilesParent"/>
	       </batch:flow>
	       <batch:flow>
		       <batch:step id="downloadMappings" parent="mappingsParent" next="decision"/>
		       <batch:decision id="decision" decider="indexDecider">
					<batch:next on="CONTINUE" to="uniprotMappingIndex" />
					<batch:next on="SKIP" to="fakeTask" />
	  		   </batch:decision>
	  		   <batch:step id="uniprotMappingIndex" parent="createUniprotIndexParent" next="ncbiMappingIndex"/>
		       <batch:step id ="ncbiMappingIndex" parent="createNcbiIndexParent" next="fakeTask"/>
		       <batch:step id="fakeTask" next="push">
		           <batch:tasklet ref="fake"/>
		       </batch:step>
		       <batch:step id="push"> 
		           <batch:tasklet ref="pushover"/>
		       </batch:step>
	       </batch:flow>
       </batch:split>
	   
	   <batch:step id="mapIds" parent="mapIdsParent" next="sortFile"/>   	
		
		<batch:step id="sortFile" parent="sortParent" next="clusterFile"/>
		
		<batch:step id="clusterFile" parent="clusterParent" next="createInteractomes"/>
		
		<batch:step id="createInteractomes" parent="interactomesParent"/>
    </batch:job>

    <!-- Tasklets -->
    <bean id="fetchInteractions" class="mpg.biochem.de.interbase.task.FetchInteractionsTasklet">
        <constructor-arg name="registryClient" ref="registryClient"/>
        <constructor-arg name="taskExecutor" ref="taskExecutor" />
		<constructor-arg name="serviceHandler" ref="serviceHandler"/>
    </bean>
	
	<bean id="mapping" class="mpg.biochem.de.interbase.task.DownloadMappingsTasklet"/>
	
	<bean id="fake" class="mpg.biochem.de.interbase.task.FakeTasklet"/>
	
	<bean id="biBeanIoFactory" class="mpg.biochem.de.interbase.batch.BinaryInteractionIoFactory" />
	
	<bean id="simpleSort" class="mpg.biochem.de.interbase.task.FlatFileSortTasklet" scope="step">
		<property name="inputResource">
			<bean class="org.springframework.core.io.FileSystemResource">
				<constructor-arg>
					<bean class="java.io.File">
{'fraction_non_alphanumeric': 0.1728144060412431, 'fraction_numerical': 0.007769387162358408, 'mean_word_length': 5.1104702750665485, 'pattern_counts': {'":': 0, '<': 263, '<?xml version=': 2, '>': 263, 'https://': 0, 'lorem ipsum': 0, 'www.': 29, 'xml': 20}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2134018', 'n_tokens_mistral': 4853, 'n_tokens_neox': 4412, 'n_words': 607}