anchor.diff:  }
   
   
  -###################################################################
  -# 			   Deftasks                               #
  -###################################################################
  -
  -
  -###################################################################
  +#################################################################
  +#
  +# 							Deftasks							
  +#
  +#################################################################
  +
  +
  +#################################################################
   #
   # 			Run Algorithms
   #
  
positive.code: }*
  
  deftask makeDecoyDB(db_fasta_decoy(File):db_fasta(File)) in bash *{
  	DecoyDatabase -in $db_fasta -out decoy.fasta
  	db_fasta_decoy=decoy.fasta
  }*
  
negative.code: //db_fasta=cat(file:gunzip(gz:fa_gz));
  mzMLFiles=convertSpectraFiles(spectraFile:spectraFiles);
  #mzMLFiles; #Remove the hashtag at the beginning of the line to store the converted spectra.
  db_fasta_app=appendDecoyDB(db_fasta:db_fasta);
  db_blastDB_tar=makeBlastDB(db_fasta:db_fasta_app idx_name:blast_index_name);
  db_msgfDB_tar=makeMsgfDB(db_fasta:db_fasta_app);
  db_TandemDB=makeTandemDB(db_fasta:db_fasta_app);
  
  idxml_results=perSpectraFile(mzMLFiles:mzMLFiles 
  	db_fasta:db_fasta db_blastDB_tar:db_blastDB_tar
  	db_msgfDB_tar:db_msgfDB_tar db_TandemDB:db_TandemDB
  	omssa_mods:omssa_mods omssa_usermods:omssa_usermods
  	blast_index_name:blast_index_name numthreads:numthreads
  	pmt:pmt fmt:fmt);
  csvResult=idxml2csv(idxml_results:idxml_results mzMLFile:mzMLFiles);
  idxml_results;
  csvResult;
  
  #Run the worflow once for each spectra file in spectra.tar
  deftask perSpectraFile(idxmlResults(File):mzMLFiles(File) 
  		[db_fasta db_blastDB_tar(File) db_msgfDB_tar(File) db_TandemDB(File)
  		omssa_mods omssa_usermods blast_index_name numthreads pmt fmt]) {
  
  # Run database search tools
  	OmssaRes=runOmssa(mzMLFile:mzMLFiles db_blastDB_tar:db_blastDB_tar blast_index_name:blast_index_name pmt:pmt fmt:fmt omssa_mods:omssa_mods omssa_usermods:omssa_usermods);
  	MsgfRes=runMsgf(mzMLFile:mzMLFiles db_fasta:db_fasta db_msgfDB_tar:db_msgfDB_tar pmt:pmt);
  	TandemRes=runTandem(mzMLFile:mzMLFiles db_TandemDB:db_TandemDB pmt:pmt fmt:fmt);
  # Calculate posterior error probability
  	OmssaPEP=calcPEP(idxml_results:OmssaRes);
  	MsgfPEP=calcPEP(idxml_results:MsgfRes);
  	TandemPEP=calcPEP(idxml_results:TandemRes);
  # Create consensus
  	PEPResMerged=OmssaPEP MsgfPEP TandemPEP;
  	ConsensusRes=runConsensus(idxml_results:PEPResMerged pmt:pmt fmt:fmt numthreads:numthreads);
  