Previous changeset 31:0ab839023fe4 (2013-04-30) Next changeset 33:aa0420172fc6 (2013-04-30) |
Commit message:
Deleted selected files |
removed:
commons/launcher/BlatClusterLauncher.py commons/launcher/BlatProgramLauncher.py commons/launcher/LaunchBlastclust.py commons/launcher/LaunchLastZ.py commons/launcher/LaunchMCL.py commons/launcher/LaunchMap.py commons/launcher/LaunchMatcher.py commons/launcher/LaunchMummerPlot.py commons/launcher/LaunchNucmer.py commons/launcher/LaunchPhyML.py commons/launcher/LaunchPromer.py commons/launcher/LaunchRefAlign.py commons/launcher/LaunchRefalign_old.py commons/launcher/LaunchRepeatMasker.py commons/launcher/LaunchTRF.py commons/launcher/LaunchTallymer.py commons/launcher/MafftClusterLauncher.py commons/launcher/MafftProgramLauncher.py commons/launcher/MapClusterLauncher.py commons/launcher/MapProgramLauncher.py commons/launcher/NWalignProgramLauncher.py commons/launcher/RepeatMaskerClusterLauncher.py commons/launcher/RepeatMaskerProgramLauncher.py commons/launcher/YassClusterLauncher.py commons/launcher/YassProgramLauncher.py commons/launcher/__init__.py commons/launcher/launchBlasterMatcherPerQuery.py commons/launcher/launchMafft.py commons/launcher/launchMreps.py commons/launcher/launchPhyML.py commons/launcher/launchPrank.py commons/launcher/launchTCoffee.py commons/launcher/launchTEclass.py commons/launcher/tests/MockDataBankForBlat.py commons/launcher/tests/MockESTBankForBlat.py commons/launcher/tests/MockOutputForBlat.py commons/launcher/tests/Test_BlatClusterLauncher.py commons/launcher/tests/Test_BlatProgramLauncher.py commons/launcher/tests/Test_F_BlatProgramLauncher.py commons/launcher/tests/Test_F_LaunchBlastclust.py commons/launcher/tests/Test_F_LaunchLastZ.py commons/launcher/tests/Test_F_LaunchMCL.py commons/launcher/tests/Test_F_LaunchMap.py commons/launcher/tests/Test_F_LaunchMatcher.py commons/launcher/tests/Test_F_LaunchMummerPlot.py commons/launcher/tests/Test_F_LaunchNucmer.py commons/launcher/tests/Test_F_LaunchPhyML.py commons/launcher/tests/Test_F_LaunchPromer.py commons/launcher/tests/Test_F_LaunchRefAlign.py commons/launcher/tests/Test_F_LaunchRefalign.py commons/launcher/tests/Test_F_LaunchRepeatMasker.py commons/launcher/tests/Test_F_LaunchTRF.py commons/launcher/tests/Test_F_LaunchTallymer.py commons/launcher/tests/Test_LaunchBlastclust.py commons/launcher/tests/Test_LaunchTallymer.py commons/launcher/tests/Test_MafftClusterLauncher.py commons/launcher/tests/Test_MafftProgramLauncher.py commons/launcher/tests/Test_MapClusterLauncher.py commons/launcher/tests/Test_MapProgramLauncher.py commons/launcher/tests/Test_NWalignProgramLauncher.py commons/launcher/tests/Test_RepeatMaskerClusterLauncher.py commons/launcher/tests/Test_RepeatMaskerProgramLauncher.py commons/launcher/tests/Test_YassClusterLauncher.py commons/launcher/tests/Test_YassProgramLauncher.py commons/launcher/tests/Test_launchTEclass.py commons/launcher/tests/__init__.py commons/pyRepetUnit/__init__.py commons/pyRepetUnit/align/AlignList.py commons/pyRepetUnit/align/AlignListUtils.py commons/pyRepetUnit/align/__init__.py commons/pyRepetUnit/align/hmmOutputParsing/HmmpfamOutput2align.py commons/pyRepetUnit/align/hmmOutputParsing/HmmscanOutput2align.py commons/pyRepetUnit/align/hmmOutputParsing/__init__.py commons/pyRepetUnit/align/hmmOutputParsing/tests/HmmpfamOutput2AlignTestSuite.py commons/pyRepetUnit/align/hmmOutputParsing/tests/Test_F_Hmmerpfam2align.py commons/pyRepetUnit/align/hmmOutputParsing/tests/Test_F_HmmpfamOutput2align.py commons/pyRepetUnit/align/hmmOutputParsing/tests/Test_F_HmmscanOutput2align.py commons/pyRepetUnit/align/hmmOutputParsing/tests/__init__.py commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/ConsensusTestFile_nt.fsa commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/OutputHmmpfamTest commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/PostPostProcessTestFiltered.align commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/hmmscanTransformedExpected.align commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/repetHmmscan.fa commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/test_hmmpfam_output commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/test_hmmpfam_output.align commons/pyRepetUnit/align/tests/Test_AlignListUtils.py commons/pyRepetUnit/align/tests/__init__.py commons/pyRepetUnit/align/tests/hmmpfamOutputParsingTestSuite.py commons/pyRepetUnit/align/transformAACoordIntoNtCoord/TransformAACoordIntoNtCoordInAlignFormat.py commons/pyRepetUnit/align/transformAACoordIntoNtCoord/__init__.py commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/Test_F_TransformAACoordIntoNtCoordAndScoreFiltering.py commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/Test_TransformAACoordIntoNtCoordInAlignFormat.py commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/TransformAACoordIntoNtCoordTestSuite.py commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/__init__.py commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/ConsensusTestFile_nt.fsa commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/OutputHmmpfamTest.align commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/PostPostProcessTest.align commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/PostPostProcessTestFiltered.align commons/pyRepetUnit/blastnForClassifierStep1/RepbaseBLRnForClassifierStep1.py commons/pyRepetUnit/blastnForClassifierStep1/__init__.py commons/pyRepetUnit/blastnForClassifierStep1/tests/Test_RepbaseBLRnForClassifierStep1.py commons/pyRepetUnit/blastnForClassifierStep1/tests/__init__.py commons/pyRepetUnit/components/AbstractClusterLauncher.py commons/pyRepetUnit/components/AbstractProgramLauncher.py commons/pyRepetUnit/components/IClusterLauncher.py commons/pyRepetUnit/components/__init__.py commons/pyRepetUnit/components/blastx2GFF/__init__.py commons/pyRepetUnit/components/blastx2GFF/tests/__init__.py commons/pyRepetUnit/components/blastx2GFF/tests/blastx2GFFTestSuite.py commons/pyRepetUnit/components/blastx2GFF/tests/datas/dummy.align.match.path commons/pyRepetUnit/components/blastx2GFF/tests/datas/dummy.align.match.tab commons/pyRepetUnit/components/blastx2GFF/tests/datas/exp_dummy.gff commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align.match.map commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align.match.path commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align.match.tab commons/pyRepetUnit/convCoord/ConvMapChr2Chunk.py commons/pyRepetUnit/convCoord/ConvPathChr2Chunk.py commons/pyRepetUnit/convCoord/ConvSetChr2Chunk.py commons/pyRepetUnit/convCoord/PathChunkConnector.py commons/pyRepetUnit/convCoord/__init__.py commons/pyRepetUnit/convCoord/test/TestConvCoordWithOverlapps.py commons/pyRepetUnit/convCoord/test/Test_ConvMapChr2Chunk.py commons/pyRepetUnit/convCoord/test/Test_ConvPathChr2Chunk.py commons/pyRepetUnit/convCoord/test/Test_ConvSetChr2Chunk.py commons/pyRepetUnit/convCoord/test/Test_PathChunkConnector.py commons/pyRepetUnit/convCoord/test/__init__.py commons/pyRepetUnit/convCoord/test/convCoordTestSuite.py commons/pyRepetUnit/doc/__init__.py commons/pyRepetUnit/doc/api-objects.txt commons/pyRepetUnit/doc/class-tree.html commons/pyRepetUnit/doc/commons.Checker-module.html commons/pyRepetUnit/doc/commons.Checker-pysrc.html commons/pyRepetUnit/doc/commons.Checker.Checker-class.html commons/pyRepetUnit/doc/commons.Checker.CheckerException-class.html commons/pyRepetUnit/doc/commons.Checker.ConfigChecker-class.html commons/pyRepetUnit/doc/commons.Checker.ConfigException-class.html commons/pyRepetUnit/doc/commons.Checker.IChecker-class.html commons/pyRepetUnit/doc/commons.Checker._Logger-class.html commons/pyRepetUnit/doc/commons.IComponentWrapper-module.html commons/pyRepetUnit/doc/commons.IComponentWrapper-pysrc.html commons/pyRepetUnit/doc/commons.IComponentWrapper.IComponentWrapper-class.html commons/pyRepetUnit/doc/commons.IDataProcessor-module.html commons/pyRepetUnit/doc/commons.IDataProcessor-pysrc.html commons/pyRepetUnit/doc/commons.IDataProcessor.IDataProcessor-class.html commons/pyRepetUnit/doc/crarr.png commons/pyRepetUnit/doc/epydoc.css commons/pyRepetUnit/doc/epydoc.js commons/pyRepetUnit/doc/frames.html commons/pyRepetUnit/doc/help.html commons/pyRepetUnit/doc/identifier-index.html commons/pyRepetUnit/doc/index.html commons/pyRepetUnit/doc/module-tree.html commons/pyRepetUnit/doc/redirect.html commons/pyRepetUnit/doc/toc-commons.Checker-module.html commons/pyRepetUnit/doc/toc-commons.IComponentWrapper-module.html commons/pyRepetUnit/doc/toc-commons.IDataProcessor-module.html commons/pyRepetUnit/doc/toc-everything.html commons/pyRepetUnit/doc/toc.html commons/pyRepetUnit/fastaTranslation/__init__.py commons/pyRepetUnit/fastaTranslation/allFrames/TranslateInAllFramesAndReplaceStopByX.py commons/pyRepetUnit/fastaTranslation/allFrames/__init__.py commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_F_TranslateAfastaFileInAllFrameAndReplaceStopsByX.py commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_F_TranslateInAllFramesAndReplaceStopByX.py commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_TranslateAfastaFileInAllFrameAndReplaceStopsByX.py commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_TranslateInAllFramesAndReplaceStopByX.py commons/pyRepetUnit/fastaTranslation/allFrames/tests/__init__.py commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/ConsensusTestFile_aaWithoutStop.fsa commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/ConsensusTestFile_nt.fsa commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/__init__.py commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/test_input_aa.fa commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/test_input_nt.fa commons/pyRepetUnit/fastaTranslation/allFrames/translateAfastaFileInAllFrameAndReplaceStopsByX_script.py commons/pyRepetUnit/hmmer/HmmpfamClusterComponent.py commons/pyRepetUnit/hmmer/LaunchPreProcessHmmpfamPostProcessNotInParallel.py commons/pyRepetUnit/hmmer/__init__.py commons/pyRepetUnit/hmmer/check/OldDetectFeatureConfigChecker.py commons/pyRepetUnit/hmmer/check/__init__.py commons/pyRepetUnit/hmmer/check/test/Test_OldDetectFeaturesConfigChecker.py commons/pyRepetUnit/hmmer/check/test/__init__.py commons/pyRepetUnit/hmmer/check/test/detectFeatureConfigCheckerTestSuite.py commons/pyRepetUnit/hmmer/hmmOutput/HmmOutput.py commons/pyRepetUnit/hmmer/hmmOutput/HmmOutputProcessing.py commons/pyRepetUnit/hmmer/hmmOutput/HmmpfamOutputProcessing.py commons/pyRepetUnit/hmmer/hmmOutput/HmmscanOutputProcessing.py commons/pyRepetUnit/hmmer/hmmOutput/__init__.py commons/pyRepetUnit/hmmer/hmmOutput/tests/TestHmmOutputProcessing.py commons/pyRepetUnit/hmmer/hmmOutput/tests/TestHmmpfamOutputProcessing.py commons/pyRepetUnit/hmmer/hmmOutput/tests/TestHmmscanOutputProcessing.py commons/pyRepetUnit/hmmer/hmmOutput/tests/Test_HmmOutput.py commons/pyRepetUnit/hmmer/hmmOutput/tests/__init__.py commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/Outputhmmpfam commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput.align commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutputTab.txt commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/test_hmmpfam_output commons/pyRepetUnit/hmmer/hmmOutput/tests/hmmOutputTestSuite.py commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/ProfilesSearch.py commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/__init__.py commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/Test_ProfilesSearch.py commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/__init__.py commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/ConsensusFile_test.fa commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/DummyRepbase_aa.fa commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/DummyRepbase_nt.fa commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/hmmbank_test commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/hmmpfamOut.align.clean_match.path commons/pyRepetUnit/hmmer/tests/TestAcceptanceHmmpfamAndParse2alignInparallel.py commons/pyRepetUnit/hmmer/tests/TestFunctionalHmmpfamAndParse2alignLauncherInParallel.py commons/pyRepetUnit/hmmer/tests/TestFunctionalHmmpfamClusterComponent.py commons/pyRepetUnit/hmmer/tests/TestHmmpfamAndParse2alignLauncher.py commons/pyRepetUnit/hmmer/tests/TestHmmpfamClusterComponent.py commons/pyRepetUnit/hmmer/tests/TestHmmpfamLauncher.py commons/pyRepetUnit/hmmer/tests/TestLaunchPreProcessHmmpfamPostProcessNotInParallel.py commons/pyRepetUnit/hmmer/tests/TestProgramLauncher.py commons/pyRepetUnit/hmmer/tests/__init__.py commons/pyRepetUnit/hmmer/tests/datas/Outputhmmpfam commons/pyRepetUnit/hmmer/tests/datas/config.cfg commons/pyRepetUnit/hmmer/tests/datas/configTestAcceptanceHmmpfamAndParse2alignLauncherInparallel.cfg commons/pyRepetUnit/hmmer/tests/datas/configTestFunctionalHmmpfamLauncherInparallel.cfg commons/pyRepetUnit/hmmer/tests/datas/configTestLaunchPreProcessHmmpfamPostProcessNotInParallel.cfg commons/pyRepetUnit/hmmer/tests/datas/myhmms commons/pyRepetUnit/hmmer/tests/datas/test_input_aa.fa commons/pyRepetUnit/hmmer/tests/datas/test_input_nt.fa commons/pyRepetUnit/profilesDB/CompleteAProfilesDBFromAFileWithProfilesNamesOrAccNumber.py commons/pyRepetUnit/profilesDB/InsertProfilesMapFileInDB.py commons/pyRepetUnit/profilesDB/Profiles.py commons/pyRepetUnit/profilesDB/ProfilesDB2Map.py commons/pyRepetUnit/profilesDB/ProfilesDB4Repet.py commons/pyRepetUnit/profilesDB/ProfilesDatabank.py commons/pyRepetUnit/profilesDB/ProfilesDatabankUtils.py commons/pyRepetUnit/profilesDB/__init__.py commons/pyRepetUnit/profilesDB/tests/InsertProfilesMapFileInDBTestRessources.py commons/pyRepetUnit/profilesDB/tests/TestCompleteProfilesDBFromProfilesNameListOrAccNumber.py commons/pyRepetUnit/profilesDB/tests/TestInsertProfilesMapFileInDB.py commons/pyRepetUnit/profilesDB/tests/TestProfiles.py commons/pyRepetUnit/profilesDB/tests/TestProfilesDB2Map.py commons/pyRepetUnit/profilesDB/tests/TestProfilesDatabankUtils.py commons/pyRepetUnit/profilesDB/tests/Test_F_CompleteProfilDB.py commons/pyRepetUnit/profilesDB/tests/Test_F_ProfilesDB2Map.py commons/pyRepetUnit/profilesDB/tests/Test_F_ProfilesDB4Repet.py commons/pyRepetUnit/profilesDB/tests/Test_ProfilesDB4Repet.py commons/pyRepetUnit/profilesDB/tests/__init__.py commons/pyRepetUnit/profilesDB/tests/completeProfilesDBFromAFileWithProfilesList_script.py commons/pyRepetUnit/profilesDB/tests/datas/ListPfamProfilsInRepbase.txt commons/pyRepetUnit/profilesDB/tests/datas/ListpfamAccNumber.txt commons/pyRepetUnit/profilesDB/tests/datas/myhmms commons/pyRepetUnit/profilesDB/tests/datas/profilesDBTest.hmm commons/pyRepetUnit/profilesDB/tests/profilesDBTestSuite.py commons/tools/AlignTEOnGenomeAccordingToAnnotation.py commons/tools/AnnotationStats.py commons/tools/BenchmarkTEconsensus.py commons/tools/CalcCoordCumulLength.py commons/tools/ChangeSequenceHeaders.py commons/tools/CheckMysqlConnect.py commons/tools/CleanClusterNodesAfterRepet.py commons/tools/CorrelateTEageWithGCcontent.py commons/tools/FilterAlign.py commons/tools/GFF3Maker.py commons/tools/GameXmlMaker.py commons/tools/GetMultAlignAndPhylogenyPerTErefSeq.py commons/tools/GetSpecificTELibAccordingToAnnotation.py commons/tools/HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py commons/tools/LaunchBlaster.py commons/tools/LaunchBlasterInParallel.py commons/tools/LaunchMatcherInParallel.py commons/tools/ListAndDropTables.py commons/tools/MergeMatchsFiles.py commons/tools/MysqlConnect.py commons/tools/OrientSequences.py commons/tools/PostAnalyzeTELib.py commons/tools/PrepareBatches.py commons/tools/RetrieveInitHeaders.py commons/tools/RmvPairAlignInChunkOverlaps.py commons/tools/SpliceTEsFromGenome.py commons/tools/SplicerFromAnnotation.py commons/tools/TEclassifierPE.py commons/tools/TEclassifierPE_parallelized.py commons/tools/__init__.py commons/tools/blast2align.py commons/tools/dbBestLength.py commons/tools/dbConsensus.py commons/tools/dbShuffle.py commons/tools/dbSplit.py commons/tools/filterOutMatcher.py commons/tools/getCumulLengthFromTEannot.py commons/tools/pathnum2id.py commons/tools/refalign2fasta.py commons/tools/removeDescriptionInFastaHeaderProgramLauncher.py commons/tools/replaceGreaterThanSymbolInFastaHeaderProgramLauncher.py commons/tools/setnum2id.py commons/tools/srptBlasterMatcher.py commons/tools/srptCreateTable.py commons/tools/srptExportTable.py commons/tools/srptGameXmlMaker.py commons/tools/srptPhyML.py commons/tools/srptTableOverlap.py commons/tools/tabFileReader.py commons/tools/tests/MockFastaForReplaceGreaterThanSymbolInFastaHeader.py commons/tools/tests/Test_AlignTEOnGenomeAccordingToAnnotation.py commons/tools/tests/Test_CalcCoordCumulLength.py commons/tools/tests/Test_ChangeSequenceHeaders.py commons/tools/tests/Test_CorrelateTEageWithGCcontent.py commons/tools/tests/Test_F_AlignTEOnGenomeAccordingToAnnotation.py commons/tools/tests/Test_F_CheckMysqlConnect.py commons/tools/tests/Test_F_FilterAlign.py commons/tools/tests/Test_F_GFF3Maker.py commons/tools/tests/Test_F_GameXmlMaker.py commons/tools/tests/Test_F_GetMultiAlignAndPhylogenyPerTErefSeq.py commons/tools/tests/Test_F_GetSpecificTELibAccordingToAnnotation.py commons/tools/tests/Test_F_HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py commons/tools/tests/Test_F_LaunchBlaster.py commons/tools/tests/Test_F_LaunchBlasterInParallel.py commons/tools/tests/Test_F_LaunchMatcherInParallel.py commons/tools/tests/Test_F_MergeMatchsFiles.py commons/tools/tests/Test_F_PostAnalyzeTELib.py commons/tools/tests/Test_F_ReplaceGreaterThanSymbolInFastaHeader.py commons/tools/tests/Test_F_RetrieveInitHeaders.py commons/tools/tests/Test_F_SplicerFromAnnotation.py commons/tools/tests/Test_F_TEclassifierPE.py commons/tools/tests/Test_GetMultAlignAndPhylogenyPerTErefSeq.py commons/tools/tests/Test_GetSpecificTELibAccordingToAnnotation.py commons/tools/tests/Test_OrientSequences.py commons/tools/tests/Test_RmvPairAlignInChunkOverlaps.py commons/tools/tests/Test_SpliceTEsFromGenome.py commons/tools/tests/Test_getCumulLengthFromTEannot.py commons/tools/tests/Test_pathnum2id.py commons/tools/tests/Test_refalign2fasta.py commons/tools/tests/Test_srptTableOverlap.py commons/tools/tests/__init__.py |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/BlatClusterLauncher.py --- a/commons/launcher/BlatClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,74 +0,0 @@ -#!/usr/bin/env python - -##@file -# Launch BlatProgramLauncher on several files in parallel on a cluster. - - -from pyRepet.launcher.AbstractClusterLauncher import * -from commons.launcher.BlatProgramLauncher import BlatProgramLauncher -from commons.core.coord.AlignUtils import AlignUtils -from commons.tools import srptBlasterMatcher - - -class BlatClusterLauncher( AbstractClusterLauncher ): - """ - Launch Blat on several files in parallel on a cluster. - """ - - def __init__( self ): - """ - Constructor. - """ - AbstractClusterLauncher.__init__( self ) - AbstractClusterLauncher.setAcronym( self, "Blat" ) - - self._cmdLineSpecificOptions = "s:p:A" - - self._exeWrapper = "BlatProgramLauncher.py" - self._prgLauncher = BlatProgramLauncher() - self._prgLauncher.setInputFile( GENERIC_IN_FILE ) - self._prgLauncher.setClean() - self._prgLauncher.setVerbosityLevel( 1 ) - self._prgLauncher.setListFilesToKeep() - self._prgLauncher.setListFilesToRemove() - - - def getSpecificHelpAsString( self ): - """ - Return the specific help as a string. - """ - string = "" - string += "\nspecific options:" - string += "\n -s: name of the subject file (format='fasta')" - string += "\n -p: parameters for '%s'" % ( self._prgLauncher.getProgramName() ) - string += "\n -Z: concatenate output files" - string += "\n -A: same sequences (all-by-all)" - return string - - - def getSubjectFile( self ): - return self._prgLauncher.getSubjectFile() - - - def getProgramParameters( self ): - return self._prgLauncher.getProgramParameters() - - - def processOutputFile( self, tmpFile, outFile ): - sortFile = "%s.sort" % ( tmpFile ) - AlignUtils.sortAlignFile( tmpFile, sortFile ) - if self._prgLauncher.getAllByAll(): - srptBlasterMatcher.filterRedundantMatches( sortFile, - outFile ) - os.remove( sortFile ) - else: - os.rename( sortFile, outFile ) - - def setASpecificAttributeFromCmdLine( self, o, a="" ): - if o =="-s": - self._prgLauncher.setSubjectFile( a ) - -if __name__ == "__main__": - i = BlatClusterLauncher() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/BlatProgramLauncher.py --- a/commons/launcher/BlatProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,192 +0,0 @@ -#!/usr/bin/env python - -##@file -# Launch Blat (pairwise alignment). -# -# options: -# -h: this help -# -i: name of the input file (queries, format='fasta') -# -s: name of the subject file (format='fasta') -# -p: parameters for 'blat' (default='-d 2') -# -o: name of the output file (format='align', default=inFile+'.align') -# -c: clean -# -v: verbosity level (default=0/1) - - -import os -import sys - -from commons.pyRepetUnit.components.AbstractProgramLauncher import AbstractProgramLauncher - - -class BlatProgramLauncher( AbstractProgramLauncher ): - """ - Launch Blat (pairwise alignment). - """ - - def __init__( self ): - """ - Constructor. - """ - AbstractProgramLauncher.__init__( self ) - self._prgName = "blat" - self._formatInFile = "fasta" - self._sbjFile = "" - self._prgParam = "" - self._allByAll = False - - - def getHelpAsString( self ): - string = AbstractProgramLauncher.getHelpAsString(self) - string += "\nspecific options:" - string += "\n -s: name of the subject file (database, format='fasta')" - string += "\n -p: parameters for '%s'" % ( self.getProgramName() ) - string += "\n -A: same sequences (all-by-all)" - string += "\n -o: name of the output file (format='align', default=inFile+'.align')" - return string - - def getCmdLineOptions(self): - return AbstractProgramLauncher.getCmdLineOptions(self) + "s:p:Ao:" - - def setAttributesFromCmdLine( self, o, a = "" ): - AbstractProgramLauncher.setAttributesFromCmdLine(self, o, a) - if o == "-s": - self.setSubjectFile( a ) - elif o == "-p": - self.setProgramParameters( a ) - elif o == "-A": - self.setAllByAll() - elif o == "-o": - self.setOutputFile( a ) - - - def setSubjectFile( self, arg ): - self._sbjFile = arg - - - def getSubjectFile( self ): - return self._sbjFile - - - def setAllByAll( self ): - self._allByAll = True - - - def getAllByAll( self ): - return self._allByAll - - - def check( self ): - """ - Check the specific attributes before running the program. - """ - AbstractProgramLauncher.check(self) - if self._sbjFile == "": - string = "ERROR: missing subject file (-s)" - print string - print self.getHelpAsString() - sys.exit(1) - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - - - def setWrapperCommandLine( self ): - """ - Set the command-line of the wrapper. - Required for BlatClusterLauncher. - """ - self._wrpCmdLine = self.getWrapperName() - self._wrpCmdLine += " -i %s" % ( self.getInputFile() ) - self._wrpCmdLine += " -s %s" % ( self.getSubjectFile() ) - if self.getProgramParameters() != "": - self._wrpCmdLine += " -p '%s'" % ( self.getProgramParameters() ) - if self.getAllByAll(): - self._wrpCmdLine += " -A" - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - self._wrpCmdLine += " -o %s" % ( self.getOutputFile() ) - if self.getClean(): - self._wrpCmdLine += " -c" - self._wrpCmdLine += " -v %i" % ( self.getVerbosityLevel() ) - - - def setProgramCommandLine( self ): - """ - Set the command-line of the program. - """ - self._prgCmdLine = self.getProgramName() - self._prgCmdLine += " %s" % ( self.getSubjectFile() ) - self._prgCmdLine += " %s" % ( self.getInputFile() ) - if self.getProgramParameters() != "": - self._prgCmdLine += " %s" % ( self.getProgramParameters() ) - self._prgCmdLine += " -out=blast8" - self._prgCmdLine += " %s.blast" % ( self.getInputFile() ) - - - def setListFilesToKeep( self ): - """ - Set the list of files to keep. - """ - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - self.appendFileToKeep( self.getOutputFile() ) - - - def setListFilesToRemove( self ): - """ - Set the list of files to remove. - """ - self.appendFileToRemove( "%s.blast" % ( self.getInputFile() ) ) - - - def convertBlastIntoAlign( self ): - """ - Convert a 'blast' file into the 'align' format. - """ - cmd = os.environ["REPET_PATH"] + "/bin/blast2align.py" - cmd += " -i %s.blast" % ( self.getInputFile() ) - cmd += " -o %s" % ( self.getOutputFile() ) - exitStatus = os.system( cmd ) - if exitStatus != 0: - string = "ERROR while converting 'blast' file into 'align' format" - print string - sys.exit(1) - - - def setSummary( self ): - self._summary = "input file: %s" % ( self.getInputFile() ) - self._summary += "\nsubject file: %s" % ( self.getSubjectFile() ) - self._summary += "\nparameters: %s" % ( self.getProgramParameters() ) - if self.getAllByAll(): - self._summary += "\nall-by-all" - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - self._summary += "\noutput file: %s" % ( self.getOutputFile() ) - - - def run( self ): - """ - Run the program. - """ - self.start() - - self.setProgramCommandLine() - cmd = self.getProgramCommandLine() - if self.getVerbosityLevel() > 0: - print "LAUNCH: %s" % ( cmd ) - sys.stdout.flush() - exitStatus = os.system( cmd ) - if exitStatus != 0: - string = "ERROR: program '%s' returned exit status '%i'" % ( self.getProgramName(), exitStatus ) - print string - sys.exit(1) - - self.convertBlastIntoAlign() - - self.end() - - -if __name__ == "__main__": - i = BlatProgramLauncher() - i.checkAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchBlastclust.py --- a/commons/launcher/LaunchBlastclust.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,372 +0,0 @@\n-#!/usr/bin/env python\n-\n-"""\n-Launch Blastclust on nucleotide sequences and return a fasta file.\n-"""\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-import os\n-import sys\n-import subprocess\n-from commons.core.seq.BioseqDB import BioseqDB\n-from commons.core.seq.Bioseq import Bioseq\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders\n-\n-class LaunchBlastclust(object):\n- """\n- Launch Blastclust on nucleotide sequences and return a fasta file.\n- """\n- \n- def __init__(self, input = "", outFilePrefix = "", clean = False, verbose = 0):\n- """\n- Constructor.\n- """\n- self._inFileName = input\n- self._identityThreshold = 95\n- self._coverageThreshold = 0.9\n- self._bothSeq = "T"\n- self._filterUnclusteredSeq = False\n- self._outFilePrefix = outFilePrefix\n- self._isBlastToMap = False\n- self._isHeaderForTEdenovo = False\n- self._nbCPUs = 1\n- self._clean = clean\n- self._verbose = verbose\n- self._tmpFileName = ""\n- \n- def setAttributesFromCmdLine(self):\n- """\n- Set the attributes from the command-line.\n- """\n- \n- description = "Launch Blastclust on nucleotide sequences and return a fasta file."\n- usage = "LaunchBlastclust.py -i inputFileName [options]"\n- \n- examples = "\\nExample 1: launch Blastclust with default options, highest verbose and clean temporary files.\\n"\n- examples += "\\t$ python ./LaunchBlastclust.py -i MyBank.fa -v 2 -c"\n- examples += "\\n\\t"\n- examples += "\\t\\nExample 2: launch Blastclust with an identity threshold of 90%, rename output files and generate a map file corresponding to the fasta output.\\n"\n- examples += "\\t$ python ./LaunchBlastclust.py -i MyBank.fa -S 90 -o SpecialOutputName -m"\n- examples += "\\n\\tWARNING: Please refer to -m option limitations in the description above.\\n"\n- \n- #TODO: check if the optionParser can handle \'\\\' into strings for a better code readability in -m option\n- \n- parser = RepetOptionParser(description = description, usage = usage, version = "v1.0", epilog = examples)\n- parser.add_option("-i", "--input", dest = "inFileName", type = "string", help = "name of the input fasta file (nucleoti'..b'ine == "":\n- break\n- data = line.split("\\t")\n- dNew2Init[data[0]] = data[1]\n- line = linkFile.readline()\n- linkFile.close()\n- return dNew2Init\n- \n- \n- def retrieveInitHeaders(self, dNewH2InitH):\n- tmpFaFile = "%s.shortH_Blastclust.fa" % (self._inFileName)\n- tmpFaFileHandler = open(tmpFaFile, "r")\n- outFaFile = "%s_Blastclust.fa" % (self._outFilePrefix)\n- outFaFileHandler = open(outFaFile, "w")\n- while True:\n- line = tmpFaFileHandler.readline()\n- if line == "":\n- break\n- if line[0] == ">":\n- tokens = line[1:-1].split("_")\n- initHeader = dNewH2InitH[tokens[1]]\n- if self._isHeaderForTEdenovo:\n- classif = initHeader.split("_")[0]\n- consensusName = "_".join(initHeader.split("_")[1:])\n- clusterId = tokens[0].split("Cluster")[1].split("Mb")[0]\n- newHeader = "%s_Blc%s_%s" % (classif, clusterId, consensusName)\n- else:\n- newHeader = "%s_%s" % (tokens[0], initHeader)\n- outFaFileHandler.write(">%s\\n" % (newHeader))\n- else:\n- outFaFileHandler.write(line)\n- tmpFaFileHandler.close()\n- outFaFileHandler.close()\n- if self._clean:\n- os.remove(tmpFaFile)\n-\n-\n- def blastclustToMap(self, blastclustFastaOut):\n- """\n- Write a map file from blastclust fasta output.\n- Warning: only works if blastclust\'s fasta input headers are formated like LTRharvest fasta output.\n- """\n- fileDb = open(blastclustFastaOut , "r")\n- mapFilename = "%s.map" % (os.path.splitext(blastclustFastaOut)[0])\n- fileMap = open(mapFilename, "w")\n- seq = Bioseq()\n- numseq = 0\n- while 1:\n- seq.read(fileDb)\n- if seq.sequence == None:\n- break\n- numseq = numseq + 1\n- ID = seq.header.split(\' \')[0].split(\'_\')[0]\n- chunk = seq.header.split(\' \')[0].split(\'_\')[1]\n- start = seq.header.split(\' \')[-1].split(\',\')[0][1:]\n- end = seq.header.split(\' \')[-1].split(\',\')[1][:-1]\n- line= \'%s\\t%s\\t%s\\t%s\' % (ID, chunk, start, end)\n- fileMap.write(line + "\\n")\n- \n- fileDb.close()\n- fileMap.close()\n- print "saved in %s" % mapFilename \n- \n- \n- def start(self):\n- """\n- Useful commands before running the program.\n- """\n- self.checkAttributes()\n- if self._verbose > 0:\n- print "START %s" % (type(self).__name__)\n- \n- \n- def end(self):\n- """\n- Useful commands before ending the program.\n- """\n- if self._verbose > 0:\n- print "END %s" % (type(self).__name__)\n- \n- \n- def run(self):\n- """\n- Run the program.\n- """\n- self.start()\n- \n- iCSH = ChangeSequenceHeaders(inFile = self._inFileName, format = "fasta", step = 1, outFile = "%s.shortH" % self._inFileName, linkFile = "%s.shortHlink" % self._inFileName)\n- iCSH.run()\n- \n- self.launchBlastclust("%s.shortH" % (self._inFileName))\n- \n- self.getClusteringResultsInFasta("%s.shortH" % (self._inFileName))\n- \n- dNewH2InitH = self.getLinkInitNewHeaders()\n- self.retrieveInitHeaders(dNewH2InitH)\n- \n- if self._isBlastToMap:\n- blastclustFileName = "%s_Blastclust.fa" % (self._outFilePrefix)\n- self.blastclustToMap(blastclustFileName)\n- \n- if self._clean:\n- os.remove("%s.shortH" % (self._inFileName))\n- os.remove("%s.shortHlink" % (self._inFileName))\n- \n- self.end()\n- \n-if __name__ == "__main__":\n- i = LaunchBlastclust()\n- i.setAttributesFromCmdLine()\n- i.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchLastZ.py --- a/commons/launcher/LaunchLastZ.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,133 +0,0 @@ -#! /usr/bin/env python - -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import sys -import os -import optparse -from commons.core.checker.CheckerUtils import CheckerUtils -from commons.core.utils.FileUtils import FileUtils -from subprocess import Popen -from commons.core.utils.RepetOptionParser import RepetOptionParser -import subprocess -import tempfile - -class LaunchLastZ(object): - - def __init__(self,queryFileName="", refFileName ="", outputFileName=None,outputFileFormat="axt",noTransition=True, ambiguous=None, step=1,gfextend=False, chain=False, verbosity=1 ): - self.queryFileName = queryFileName - self.refFileName = refFileName - self.outputFileName = outputFileName - self.outputFileFormat = outputFileFormat - self.noTransition = noTransition - self.step = step - self.ambiguous = ambiguous - self.gfextend = gfextend - self.chain = chain - self.verbosity = verbosity - - def setAttributesFromCmdLine(self): - description = "LaunchLastZ runs the LastZ program ." - parser = RepetOptionParser(description = description) - parser.add_option("-q", "--query", dest="queryFileName", default = None, action="store", type="string", help="input query file [compulsory] [format: fasta]") - parser.add_option("-r", "--ref", dest="refFileName", default = None, action="store", type="string", help="input ref file [compulsory] [format: fasta]") - parser.add_option("-o", "--output", dest="outputFileName", default = None, action="store", type="string", help="output file [compulsory] ") - parser.add_option("-f", "--format", dest="outputFileFormat", default = "axt", action="store", type="string", help="output file format[optional] ") - parser.add_option("-n", "--notransition", dest="noTransition", action="store_false", default=True, help="noTransition (default True) [optional] ") - parser.add_option("-a", "--ambiguous", dest="ambiguous", action="store", type="string", help="ambiguous [optional] ") - parser.add_option("-s", "--step", dest="step", default = 1, action="store", type="int", help="stepsize (default 1) [optional] ") - parser.add_option("-g", "--gfextend", dest="gfextend", action="store_true", help="extend gf (default false)[optional] ") - parser.add_option("-c", "--chain", dest="chain", action="store_true", help="chain (default false)[optional] ") - parser.add_option("-v", "--verbosity", dest="verbosity", default = 1, action="store", type="int", help="verbosity [optional] ") - (self._options, args) = parser.parse_args() - self._setAttributesFromOptions(self._options) - - def _setAttributesFromOptions(self, options): - self.queryFileName = options.queryFileName - self.refFileName = options.refFileName - self.outputFileName = options.outputFileName - self.outputFileFormat = options.outputFileFormat - self.ambiguous = options.ambiguous - self.noTransition = options.noTransition - self.step = options.step - self.gfextend = options.gfextend - self.chain = options.chain - self.verbosity = options.verbosity - - def checkOptions(self): - if self.queryFileName != "": - if not FileUtils.isRessourceExists(self.queryFileName): - raise Exception("ERROR: Query file does not exist!") - else: - raise Exception("ERROR: No specified --query option!") - if self.refFileName != "": - if not FileUtils.isRessourceExists(self.refFileName): - raise Exception("ERROR: Ref file does not exist!") - else: - raise Exception("ERROR: No specified --ref option!") - if self.outputFileName == None: - self.outputFileName = "%s_%s.axt" % (os.path.basename(self.queryFileName), os.path.basename(self.refFileName)) - - def run(self): - if not CheckerUtils.isExecutableInUserPath("lastz") : - print ("ERROR: LastZ must be in your path") - else: - self.checkOptions() - - transition = "" - if self.noTransition: - transition = "--notransition" - ambiguous = "" - if self.ambiguous is not None: - ambiguous = "--ambiguous=%s" % self.ambiguous - - gfextend = "" - if self.gfextend: - gfextend = "--gfextend" - - chain = "" - if self.chain: - chain = "--chain" - - cmd = "lastz %s[format=fasta] %s[format=fasta] --output=%s --format=%s %s %s --step=%i %s %s" % (self.refFileName, self.queryFileName, self.outputFileName - , self.outputFileFormat, ambiguous, transition,self.step, gfextend, chain) - if self.verbosity>0: - print("Running LastZ with following commands : %s" %cmd) - sys.stdout.flush() - cmd = cmd.split() - process = subprocess.Popen(cmd) - process.wait() - return process.returncode - -if __name__ == "__main__": - iLaunchLastZ = LaunchLastZ() - iLaunchLastZ.setAttributesFromCmdLine() - iLaunchLastZ.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchMCL.py --- a/commons/launcher/LaunchMCL.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,239 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.seq.FastaUtils import FastaUtils\n-from commons.core.coord.MatchUtils import MatchUtils\n-import subprocess\n-import os\n-import time\n-import shutil\n-from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders\n-\n-LOG_DEPTH = "repet.base"\n-\n-##Launch MCL\n-#\n-class LaunchMCL(object):\n- \n- def __init__(self, fastaFileName = "", outFilePrefix = "", inflate = 1.5, covThres = 0.0, isJoined = False, isCluster2Map = False, isClusterConsensusHeaders = False, doClean = False, verbosity = 0):\n- self._fastaFileName = fastaFileName\n- self.setOutFilePrefix(outFilePrefix)\n- self._inflate = inflate\n- self._coverageThreshold = covThres\n- self._isJoined = isJoined\n- self._isCluster2Map = isCluster2Map\n- self._isClusterConsensusHeaders = isClusterConsensusHeaders\n- self._doClean = doClean\n- self._verbosity = verbosity\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def setAttributesFromCmdLine(self):\n- description = "Launch MCL clustering program."\n- epilog = "\\nExample: launch without verbosity and keep temporary files.\\n"\n- epilog += "\\t$ python LaunchMCL.py -i file.fa -v 0\\n"\n- parser = RepetOptionParser(description = description, epilog = epilog)\n- parser.add_option("-i", "--fasta", dest = "fastaFileName", action = "store", type = "string", help = "input fasta file name [compulsory] [format: fasta]", default = "")\n- parser.add_option("-o", "--out", dest = "outFilePrefix", action = "store", type = "string", help = "prefix of the output files [default=input fasta file name]", default = "")\n- parser.add_option("-I", "--inflate", dest = "inflate", action = "store", type = "float", help = "inflate parameter of MCL [optional] [default: 1.5]", default = 1.5)\n- parser.add_option("-T", "--coverage", dest = "coverageThreshold", action = "store", type = "float", help = "length coverage threshold (default=0.0, 0.0 <= value <= 1.0)", default = 0.0)\n- parser.add_option("-j", "--join", dest = "isJoined", actio'..b'= " -s %s" % linkToFastaFile\n- cmd += " -a"\n- cmd += " 1>&2 >> blasterMatcher.log"\n- process = subprocess.Popen(cmd, shell = True)\n- self._log.debug("Running : %s" % cmd)\n- process.communicate()\n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- outBlasterFileName = "%s.align" % fastaFileNameShorten\n- \n- cmd = "matcher"\n- cmd += " -m %s" % outBlasterFileName\n- cmd += " -q %s" % fastaFileNameShorten\n- cmd += " -s %s" % linkToFastaFile\n- cmd += " -a"\n- if self._isJoined:\n- cmd += " -j"\n- cmd += " 1>&2 >> blasterMatcher.log"\n- process = subprocess.Popen(cmd, shell=True)\n- self._log.debug("Running : %s" % cmd)\n- process.communicate()\n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- self._log.info("END Blaster-Matcher (%s)" % time.strftime("%Y-%m-%d %H:%M:%S"))\n- \n- outMatcherFileName = "%s.match.tab" % outBlasterFileName\n- inputABCFileName = "%s.shortH.abc" % os.path.splitext(fastaFileNameShorten)[0]\n- MatchUtils.convertMatchFileIntoABCFileOnQueryCoverage(outMatcherFileName, inputABCFileName, coverage = self._coverageThreshold)\n- outMCLPreprocessFileName = "MCLPreprocess.out"\n- \n- self._log.info("START MCL (%s)" % time.strftime("%Y-%m-%d %H:%M:%S"))\n- cmd = "mcxload"\n- cmd += " -abc %s" % inputABCFileName\n- cmd += " --stream-mirror"\n- cmd += " --stream-neg-log10"\n- cmd += " -stream-tf \'ceil(200)\'"\n- cmd += " -o %s" % outMCLPreprocessFileName\n- cmd += " -write-tab %s.tab" % outMCLPreprocessFileName\n- cmd += " 1>&2 > MCLpreprocess.log"\n- process = subprocess.Popen(cmd, shell = True)\n- self._log.debug("Running : %s" % cmd)\n- process.communicate()\n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- \n- outMCLFileName = "out.shortH.mcl"\n- cmd = "mcl"\n- cmd += " %s" % outMCLPreprocessFileName\n- cmd += " -I %s" % self._inflate\n- cmd += " -use-tab %s.tab" % outMCLPreprocessFileName\n- cmd += " -o %s" % outMCLFileName\n- cmd += " 1>&2 > MCL.log"\n- process = subprocess.Popen(cmd, shell = True)\n- self._log.debug("Running : %s" % cmd)\n- process.communicate()\n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- self._log.info("END MCL (%s)" % time.strftime("%Y-%m-%d %H:%M:%S"))\n-\n- outFastaFileNameShorten = "%s.fa" % os.path.splitext(outMCLFileName)[0]\n-\n- FastaUtils.convertClusterFileToFastaFile(outMCLFileName, fastaFileNameShorten, outFastaFileNameShorten, "MCL", verbosity = self._verbosity - 1)\n- \n- outFastaFileName = "%s_MCL.fa" % self._outFilePrefix\n- linkFileName = "%s.newHlink" % self._fastaFileName\n- headerStyle = "A"\n- if self._isClusterConsensusHeaders:\n- headerStyle = "B"\n- iChangeSequenceHeaders = ChangeSequenceHeaders(inFile=outFastaFileNameShorten, format="fasta", step=2, outFile=outFastaFileName, linkFile=linkFileName, whichCluster = headerStyle, verbosity=self._verbosity - 1)\n- iChangeSequenceHeaders.run()\n- \n- if self._isCluster2Map:\n- outMapFileName = "%s_MCL.map" % self._outFilePrefix\n- FastaUtils.convertClusteredFastaFileToMapFile(outFastaFileName, outMapFileName)\n- shutil.move(outMapFileName, "..")\n-\n- shutil.move(outFastaFileName, "..")\n- os.chdir("..")\n- if self._doClean:\n- self._log.warning("Working directory will be cleaned")\n- shutil.rmtree(workingDir)\n- self._log.info("END Launch MCL")\n-\n-if __name__ == "__main__":\n- iLaunch = LaunchMCL()\n- iLaunch.setAttributesFromCmdLine()\n- iLaunch.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchMap.py --- a/commons/launcher/LaunchMap.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,186 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.seq.AlignedBioseqDB import AlignedBioseqDB\n-from commons.core.seq.FastaUtils import FastaUtils\n-from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders\n-from commons.core.utils.FileUtils import FileUtils\n-import os\n-import subprocess\n-\n-LOG_DEPTH = "repet.tools"\n-\n-##Reference launcher implementation\n-#\n-class LaunchMap(object):\n- \n- def __init__(self, fastaFileName = "", outFileName = "", gapSize = 50, mismatchPenalty = -8, gapOpenPenalty = 16, gapExtendPenalty = 4, doClean = False, verbosity = 0):\n- self._fastaFileName = fastaFileName\n- self.setOutFileName(outFileName)\n- self._gapSize = gapSize\n- self._mismatchPenalty = mismatchPenalty\n- self._gapOpenPenalty = gapOpenPenalty\n- self._gapExtendPenalty = gapExtendPenalty\n- self._doClean = doClean\n- self._verbosity = verbosity\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def setAttributesFromCmdLine(self):\n-# description = "Launch template to create a launcher."\n-# epilog = "\\nExample 1: launch without verbosity and keep temporary files.\\n"\n-# epilog += "\\t$ python LaunchTemplate.py -i file.fa -v 0"\n-# epilog += "\\n\\t"\n-# epilog += "\\nExample 2: launch with verbosity to have errors (level 1) and basic information (level 2), and delete temporary files.\\n"\n-# epilog += "\\t$ python LaunchTemplate.py -i file.fa -c -v 2"\n-# parser = RepetOptionParser(description = description, epilog = epilog)\n- parser = RepetOptionParser(description = "", epilog = "")\n- parser.add_option("-i", "--fasta", dest = "fastaFileName", action = "store", type = "string", help = "input fasta file name [compulsory] [format: fasta]", default = "")\n- parser.add_option("-o", "--out", dest = "outFileName", action = "store", type = "string", help = "output file name [default: <input>.fa_aln]", default = "")\n- parser.add_option("-s", "--gapSize", dest = "gapSize", action = "store", type = "int", help = "size above which a gap is not penalized anymore [optional] [default: 50]", defaul'..b'elf.setGapOpenPenalty(options.gapOpen)\n- self.setGapExtendPenalty(options.gapExtend)\n- self.setDoClean(options.doClean)\n- self.setVerbosity(options.verbosity)\n-\n- def setFastaFileName(self, fastaFileName):\n- self._fastaFileName = fastaFileName\n- \n- def setOutFileName(self, outFileName):\n- if outFileName == "":\n- self._outFileName = "%s.fa_aln" % self._fastaFileName\n- else:\n- self._outFileName = outFileName\n- \n- def setGapSize(self, gapSize):\n- self._gapSize = gapSize\n-\n- def setMismatchPenalty(self, mismatchPenalty):\n- self._mismatchPenalty = mismatchPenalty\n- \n- def setGapOpenPenalty(self, gapOpenPenalty):\n- self._gapOpenPenalty = gapOpenPenalty\n- \n- def setGapExtendPenalty(self, gapExtendPenalty):\n- self._gapExtendPenalty = gapExtendPenalty\n- \n- def setDoClean(self, doClean):\n- self._doClean = doClean\n- \n- def setVerbosity(self, verbosity):\n- self._verbosity = verbosity\n- \n- def _checkOptions(self):\n- if self._fastaFileName == "":\n- self._logAndRaise("ERROR: Missing input fasta file name")\n- if not FileUtils.isRessourceExists(self._fastaFileName):\n- self._logAndRaise("ERROR: Input fasta file name %s doesn\'t exist." % self._fastaFileName)\n- \n- def _logAndRaise(self, errorMsg):\n- self._log.error(errorMsg)\n- raise Exception(errorMsg)\n- \n- def getMapCmd(self):\n- cmd = "rpt_map"\n- cmd += " %s.shortH" % self._fastaFileName\n- cmd += " %i" % self._gapSize\n- cmd += " %i" % self._mismatchPenalty\n- cmd += " %i" % self._gapOpenPenalty\n- cmd += " %i" % self._gapExtendPenalty\n- cmd += " > %s.shortH.fa_aln" % self._fastaFileName\n- return cmd\n- \n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- self._checkOptions()\n- self._log.info("START LaunchMap")\n- self._log.debug("Fasta file name: %s" % self._fastaFileName)\n- \n- lInitHeaders = FastaUtils.dbHeaders(self._fastaFileName, self._verbosity - 1)\n- \n- csh = ChangeSequenceHeaders()\n- csh.setInputFile(self._fastaFileName)\n- csh.setFormat("fasta")\n- csh.setStep(1)\n- csh.setPrefix("seq")\n- csh.setLinkFile("%s.shortHlink" % self._fastaFileName)\n- csh.setOutputFile("%s.shortH" % self._fastaFileName)\n- csh.setVerbosityLevel(self._verbosity - 1)\n- csh.run()\n- \n- cmd = self.getMapCmd()\n- process = subprocess.Popen(cmd, shell = True)\n- self._log.debug("Running : %s" % cmd)\n- process.communicate()\n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- \n- csh.setInputFile("%s.shortH.fa_aln" % self._fastaFileName)\n- csh.setFormat("fasta")\n- csh.setStep(2)\n- csh.setLinkFile("%s.shortHlink" % self._fastaFileName)\n- csh.setOutputFile("%s.shortH.fa_aln.initH" % self._fastaFileName)\n- csh.setVerbosityLevel(self._verbosity - 1)\n- csh.run()\n- \n- absDB = AlignedBioseqDB("%s.shortH.fa_aln.initH" % self._fastaFileName)\n- outFileHandler = open(self._outFileName, "w")\n- for header in lInitHeaders:\n- bs = absDB.fetch(header)\n- bs.upCase()\n- bs.write(outFileHandler)\n- outFileHandler.close()\n- if self._doClean:\n- os.remove("%s.shortH" % self._fastaFileName)\n- os.remove("%s.shortHlink" % self._fastaFileName)\n- os.remove("%s.shortH.fa_aln" % self._fastaFileName)\n- os.remove("%s.shortH.fa_aln.initH" % self._fastaFileName)\n- self._log.info("END Launch")\n-\n-if __name__ == "__main__":\n- iLaunch = LaunchMap()\n- iLaunch.setAttributesFromCmdLine()\n- iLaunch.run() \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchMatcher.py --- a/commons/launcher/LaunchMatcher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,168 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-import subprocess\n-\n-LOG_DEPTH = "repet.tools"\n-\n-##Launch MATCHER\n-#\n-class LaunchMatcher(object):\n-\n- def __init__(self, align="", queryFileName="", subjectFileName="", evalue="1e-10", doJoin=False, keepConflict=False, prefix="", doClean = False, verbosity = 0):\n- self._alignFileName = align\n- self._queryFileName = queryFileName\n- self.setSubjectFileName(subjectFileName)\n- self.setOutPrefix(prefix)\n- self._doJoin = doJoin\n- self._eValue = evalue\n- self._keepConflict = keepConflict\n- \n- self._doClean = doClean\n- self._verbosity = verbosity\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def setAttributesFromCmdLine(self):\n- description = "Launch Matcher."\n- epilog = "\\nExample 1: launch without verbosity and keep temporary files.\\n"\n- epilog += "\\t$ python LaunchMatcher.py -a in.align -v 0"\n- epilog += "\\n\\t"\n- epilog += "\\nExample 2: launch with verbosity to have errors (level 1) and basic information (level 2), and delete temporary files.\\n"\n- epilog += "\\t$ python LaunchMatcher.py -a in.align -q query.fa -s nr.fa -c -v 2"\n- parser = RepetOptionParser(description = description, epilog = epilog)\n- parser.add_option("-a", "--align", dest = "align", action = "store", type = "string", help = "input align file name [compulsory] [format: align]", default = "")\n- parser.add_option("-q", "--query", dest = "query", action = "store", type = "string", help = "query fasta file name [optional] [format: fasta]", default = "")\n- parser.add_option("-s", "--subject", dest = "subject", action = "store", type = "string", help = "subject fasta file name [optional] [format: fasta]", default = "")\n- parser.add_option("-e", "--evalue", dest = "evalue", action = "store", type = "string", help = "E-value filter [default: 1e-10]", default = "1e-10")\n- parser.add_option("-j", "--join", dest = "doJoin", action = "store_true", help = "j'..b' "string", help = "output file prefix [default: align file name]", default = "")\n- parser.add_option("-c", "--clean", dest = "doClean", action = "store_true", help = "clean temporary files [default: False]", default = False)\n- parser.add_option("-v", "--verbosity", dest = "verbosity", action = "store", type = "int", help = "verbosity [default: 1]", default = 1)\n- options = parser.parse_args()[0]\n- self._setAttributesFromOptions(options)\n- \n- def _setAttributesFromOptions(self, options):\n- self.setAlignFileName(options.align)\n- self.setQueryFileName(options.query)\n- self.setSubjectFileName(options.subject)\n- self.setEvalue(options.evalue)\n- self.setDoJoin(options.doJoin)\n- self.setKeepConflicts(options.keepConflict)\n- self.setOutPrefix(options.outPrefix)\n- self.setDoClean(options.doClean)\n- self.setVerbosity(options.verbosity)\n- \n- def setAlignFileName(self, alignFileName):\n- self._alignFileName = alignFileName\n- \n- def setQueryFileName(self, queryFileName):\n- self._queryFileName = queryFileName\n- \n- def setSubjectFileName(self, subjectFileName):\n- self._subjectFileName = subjectFileName\n- \n- def setEvalue(self, evalue):\n- self._eValue = evalue\n- \n- def setDoJoin(self, doJoin):\n- self._doJoin = doJoin\n- \n- def setKeepConflicts(self, keepConflict):\n- self._keepConflict = keepConflict\n- \n- def setOutPrefix(self, outPrefix):\n- if outPrefix == "":\n- self._outPrefix = self._alignFileName\n- else:\n- self._outPrefix = outPrefix\n- \n- def setDoClean(self, doClean):\n- self._doClean = doClean\n- \n- def setVerbosity(self, verbosity):\n- self._verbosity = verbosity\n- \n- def _checkOptions(self):\n- if self._alignFileName == "":\n- self._logAndRaise("ERROR: Missing input align file name")\n- \n- def _logAndRaise(self, errorMsg):\n- self._log.error(errorMsg)\n- raise Exception(errorMsg)\n-\n- def _getMatcherCmd(self):\n- lArgs = []\n- lArgs.append("-m %s" % self._alignFileName)\n- if self._queryFileName:\n- lArgs.append("-q %s" % self._queryFileName)\n- if self._subjectFileName:\n- lArgs.append("-s %s" % self._subjectFileName)\n- if self._doJoin:\n- lArgs.append("-j")\n- lArgs.append("-E %s" % self._eValue)\n- lArgs.append("-B %s" % self._outPrefix)\n- if self._keepConflict:\n- lArgs.append("-a")\n- lArgs.append("-v %i" % (self._verbosity - 1))\n- return self._getSystemCommand("matcher", lArgs)\n- \n- def _getSystemCommand(self, prg, lArgs):\n- systemCmd = prg \n- for arg in lArgs:\n- systemCmd += " " + arg\n- return systemCmd\n- \n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- self._checkOptions()\n- self._log.info("START LaunchMatcher")\n- self._log.debug("Align file name: %s" % self._alignFileName)\n- self._log.debug("Query file name: %s" % self._queryFileName)\n- self._log.debug("Subject file name: %s" % self._subjectFileName)\n- #TODO: clean files\n-# if self._doClean:\n-# self._log.warning("Files will be cleaned")\n- cmd = self._getMatcherCmd()\n- process = subprocess.Popen(cmd, shell = True)\n- self._log.debug("Running : %s" % cmd)\n- process.communicate()\n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- self._log.info("END LaunchMatcher")\n-\n-if __name__ == "__main__":\n- iLaunch = LaunchMatcher()\n- iLaunch.setAttributesFromCmdLine()\n- iLaunch.run() \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchMummerPlot.py --- a/commons/launcher/LaunchMummerPlot.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,150 +0,0 @@ -#! /usr/bin/env python - -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -from commons.core.checker.CheckerUtils import CheckerUtils -from commons.core.utils.FileUtils import FileUtils -from commons.core.utils.RepetOptionParser import RepetOptionParser -import subprocess -from commons.core.LoggerFactory import LoggerFactory -import os -import shutil - -LOG_DEPTH = "repet.tools" - -class LaunchMummerPlot(object): - - def __init__(self, inputFileName="", queryFileName="", refFileName ="", prefix = None, fat=False, filter=False,clean=False, verbosity=0): - self._inputFileName = inputFileName - self._queryFileName = queryFileName - self._refFileName = refFileName - self._prefix = prefix - self._fat = fat - self._filter = filter - self.doClean = clean - self.verbosity = verbosity - self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self.verbosity) - - def setAttributesFromCmdLine(self): - description = "LaunchMummerPlot runs the MummerPlot program (part of the mummer package) ." - parser = RepetOptionParser(description = description) - parser.add_option("-i", "--input", dest="inputFileName", default = None, action="store", type="string", help="input file[mandatory] [format: delta]") - parser.add_option("-q", "--Qfile", dest="queryFileName", default = None, action="store", type="string", help="Plot an ordered set of reference sequences from Qfile [optional] [format: fasta]") - parser.add_option("-r", "--Rfile", dest="refFileName", default = None, action="store", type="string", help="Plot an ordered set of reference sequences from Rfile [optional] [format: fasta]") - parser.add_option("-p", "--prefix", dest="prefix", default = None, action="store", type="string", help="prefix name [mandatory]") - parser.add_option("-o","--fat", dest="fat",action="store_true", help="Layout sequences using fattest alignment only[optional] ") - parser.add_option("-s","--filter", dest="filter",action="store_true", help="Only display .delta alignments which represent the 'best' hit [optional] ") - parser.add_option("-c", "--clean", dest = "clean", help = "clean temporary files", default = False, action="store_true") - parser.add_option("-v", "--verbosity", dest="verbosity", default = 0, action="store", type="int", help="verbosity [optional] ") - - (self._options, args) = parser.parse_args() - self._setAttributesFromOptions(self._options) - - def _setAttributesFromOptions(self, options): - self._inputFileName = options.inputFileName - self._queryFileName = options.queryFileName - self._refFileName = options.refFileName - self._prefix = options.prefix - self._fat = options.fat - self._filter = options.filter - self.verbosity = options.verbosity - - def _logAndRaise(self, errorMsg): - self._log.error(errorMsg) - raise Exception(errorMsg) - - def checkOptions(self): - if self._inputFileName != "": - if not FileUtils.isRessourceExists(self._inputFileName): - self._logAndRaise("ERROR: Query file: %s does not exist!" % self._inputFileName) - else: - self._logAndRaise("ERROR: No specified --query option!") - - if self._queryFileName != "": - if not FileUtils.isRessourceExists(self._queryFileName): - self._logAndRaise("ERROR: Query file: %s does not exist!" % self._queryFileName) - - if self._refFileName != "": - if not FileUtils.isRessourceExists(self._refFileName): - self._logAndRaise("ERROR: Ref file does not exist!"% self._refFileName) - - def clean(self): - try: - os.remove("%s.filter" % self._prefix) - except Exception as inst: - self._log.error(inst) - try: - os.remove("%s.fplot" % self._prefix) - except Exception as inst: - self._log.error(inst) - try: - os.remove("%s.rplot" % self._prefix) - except Exception as inst: - self._log.error(inst) - - def run(self): - if not CheckerUtils.isExecutableInUserPath("mummerplot") : - self._logAndRaise("ERROR: mummerplot must be in your path") - self.checkOptions() - - ref="" - if self._refFileName != "": - ref = "-R %s" % self._refFileName - - query="" - if self._queryFileName != "": - query = "-Q %s" % self._queryFileName - - fat = "" - if self._fat: - fat = "--fat" - - filter = "" - if self._filter: - filter = "-f" - - prefix = "" - if self._prefix is not None: - prefix = "--prefix=%s" %(self._prefix) - - cmd = "mummerplot %s %s %s %s %s %s --png" % (self._inputFileName, prefix, ref, query, fat, filter) - self._log.debug("Running mummerplot with following commands : %s" %cmd) - cmd = cmd.split() - process = subprocess.Popen(cmd) - process.wait() - - self.clean() - return process.returncode - -if __name__ == "__main__": - iLaunchNucmer = LaunchMummerPlot() - iLaunchNucmer.setAttributesFromCmdLine() - iLaunchNucmer.run() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchNucmer.py --- a/commons/launcher/LaunchNucmer.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,158 +0,0 @@\n-#! /usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-from commons.core.checker.CheckerUtils import CheckerUtils\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-import subprocess\n-from commons.core.LoggerFactory import LoggerFactory\n-import os\n- \n-LOG_DEPTH = "repet.tools" \n- \n-class LaunchNucmer(object):\n-\n- def __init__(self,queryFileName="", refFileName ="", prefix = None, genCoords=False, showCoords = False, mum=False, maxGaps=90, minMatch=20, nooptimize=False,mincluster=65, minIdentity=50, minLength=100, verbosity=0):\n- self._queryFileName = queryFileName\n- self._refFileName = refFileName\n- self._prefix = prefix\n- self._genCoords = genCoords\n- self._showCoords = showCoords\n- self._mum = mum\n- self._maxgaps = maxGaps\n- self._minMatch = minMatch\n- self._nooptimize = nooptimize\n- self._mincluster = mincluster\n- self._minIdentity = minIdentity\n- self._minLength = minLength\n- self.verbosity = verbosity\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self.verbosity)\n- \n- def setMincluster(self, value):\n- self._mincluster = value\n- def getMincluster(self):\n- return self._mincluster\n- \n- mincluster = property(getMincluster, setMincluster)\n- \n- def setAttributesFromCmdLine(self):\n- description = "LaunchNucmer runs the Nucmer program (part of the mummer package) ." \n- parser = RepetOptionParser(description = description)\n- parser.add_option("-q", "--query", dest="queryFileName", default = "", action="store", type="string", help="input query file [compulsory] [format: fasta]")\n- parser.add_option("-r", "--ref", dest="refFileName", default = "", action="store", type="string", help="input ref file [compulsory] [format: fasta]")\n- parser.add_option("-p", "--prefix", dest="prefix", default = None, action="store", type="string", help="prefix name [optional]")\n- parser.add_option("-o","--gencoords", dest="genCoords",action="store_true", help="generate coords file with minimal option (show-coords -r) [optional] ")\n- parser.add_option("-s","--showcoords", dest="showCoords",action="store_true", help="generate coords file with: show-coords -r -c -l -d -I 50 -L 10'..b'ize", dest="nooptimize", action="store_true", help="nooptimize (default --optimize) [optional] ") \n- parser.add_option("-j", "--mincluster", dest="mincluster", default = 65, action="store", type="int", help="Minimum length of a cluster of matches (default 65) [optional] ")\n- \n- parser.add_option("-i", "--minIdentity", dest="minIdentity", default = 50, action="store", type="int", help="Minimum identity for show_coords (default 50) [optional] ")\n- parser.add_option("-u", "--minLength", dest="minLength", default = 100, action="store", type="int", help="Minimum alignment length for show_coords (default 100) [optional] ")\n- parser.add_option("-v", "--verbosity", dest="verbosity", default = 0, action="store", type="int", help="verbosity [optional] ")\n- \n- (self._options, args) = parser.parse_args()\n- self._setAttributesFromOptions(self._options)\n-\n- def _setAttributesFromOptions(self, options):\n- self._queryFileName = options.queryFileName\n- self._refFileName = options.refFileName\n- self._prefix = options.prefix\n- self._genCoords = options.genCoords\n- self._showCoords = options.showCoords\n- self._mum = options.mum \n- self._maxgaps = options.maxgaps\n- self._minMatch = options.minMatch\n- self._nooptimize = options.nooptimize\n- self._mincluster = options.mincluster\n- \n- self._minIdentity = options.minIdentity\n- self._minLength = options.minLength\n- \n- self.verbosity = options.verbosity\n- \n- def _logAndRaise(self, errorMsg):\n- self._log.error(errorMsg)\n- raise Exception(errorMsg)\n- \n- def checkOptions(self): \n- if self._queryFileName != "":\n- if not FileUtils.isRessourceExists(self._queryFileName):\n- self._logAndRaise("ERROR: Query file: %s does not exist!" % self._queryFileName)\n- else:\n- self._logAndRaise("ERROR: No specified --query option!")\n- \n- if self._refFileName != "":\n- if not FileUtils.isRessourceExists(self._refFileName):\n- self._logAndRaise("ERROR: Ref file does not exist!"% self._refFileName)\n- else:\n- self._logAndRaise("ERROR: No specified --ref option!")\n- \n- def run(self):\n- LoggerFactory.setLevel(self._log, self.verbosity)\n- if not CheckerUtils.isExecutableInUserPath("nucmer") :\n- self._logAndRaise("ERROR: nucmer must be in your path")\n- self.checkOptions()\n- \n- genCoords = ""\n- if self._genCoords:\n- genCoords = "-o" \n- mum = ""\n- if self._mum:\n- mum = "--mum"\n- nooptimize = "--optimize"\n- if self._nooptimize:\n- nooptimize = "--nooptimize" \n- prefix = ""\n- if self._prefix is not None:\n- prefix = "--prefix=%s" %(self._prefix) \n- cmd = "nucmer %s %s %s %s %s -g=%d -l=%d %s -c=%d" % (self._refFileName,self._queryFileName, prefix, genCoords, mum, self._maxgaps, self._minMatch, nooptimize, self._mincluster)\n- self._log.debug("Running nucmer with following commands : %s" %cmd)\n- cmd = cmd.split()\n- process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n- process.wait()\n- \n- if self._showCoords:\n- #use of os.system because redirect on process is broken in python < 3.0\n- cmd = "show-coords -r -c -l -d -I %d -L %d -T %s.delta > %s.coords" % (self._minIdentity, self._minLength, self._prefix, self._prefix)\n- self._log.debug("Running show-coords with following commands : %s" %cmd)\n- os.system(cmd)\n-\n- \n- return process.returncode\n- \n-if __name__ == "__main__":\n- iLaunchNucmer = LaunchNucmer()\n- iLaunchNucmer.setAttributesFromCmdLine()\n- iLaunchNucmer.run()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchPhyML.py --- a/commons/launcher/LaunchPhyML.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,177 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders\n-import subprocess\n-import os\n-from commons.core.seq.Bioseq import Bioseq\n-import shutil\n-\n-LOG_DEPTH = "repet.core.launchers"\n-\n-\n-\n-class LaunchPhyML(object):\n- """\n- Launch \'PhyML\'\n- """\n- def __init__(self, inputFileName="", outFileName="",dataType= "nt", interleavedFormat= True, nbDataSets=1, nbBootDataSets=0, substModel="HKY85", ratioTsTv=4.0, propInvSites= 0.0, nbCat=1, gammaParam=1.0, startTree="BIONJ", paramOptimisation = "tlr", clean=False, verbosity=3 ):\n- self.inputFileName = inputFileName\n- self.outFileName=outFileName\n- self.dataType = dataType #"nt or aa"\n- self._setSeqFormat(interleavedFormat) #if False -q"\n- self.nbDataSets = nbDataSets\n- self.nbBootDataSets = nbBootDataSets\n- self.substModel = substModel\n- self.ratioTsTv = ratioTsTv\n- self.propInvSites = propInvSites # propInvSites="e" replaced by 0.0; should be in [0-1]\n- self.nbCat = nbCat # Number of categories less than four or higher than eight are not recommended.\n- self.gammaParam = gammaParam\n- self.startTree = startTree #by default is BIONJ used reformatedInputFileName+"_phyml_tree.txt" instead\n- self.paramOptimisation = paramOptimisation # used instead of self.optTopology="y", self.optBranchRate="y" \n- #This option focuses on specific parameter optimisation.\n- #tlr : tree topology (t), branch length (l) and rate parameters (r) are optimised.\n- #tl : tree topology and branch length are optimised.\n- #lr : branch length and rate parameters are optimised.\n- #l : branch length are optimised.\n- #r : rate parameters are optimised.\n- #n : no parameter is optimised.\n-\n- self._clean = clean\n- self._v'..b'ns(options)\n- \n- def _setAttributesFromOptions(self, options):\n- self.inputFileName = options.inputFileName\n- self.setOutFileName = options.outFileName\n- self._verbosity = options.verbosity\n-\n- def _checkOptions(self):\n- if self.inputFileName == "":\n- self._logAndRaise("ERROR: Missing input file name")\n- \n- if self.outFileName == "":\n- self.outFileName = "%s_phyml.newick" % (self.inputFileName)\n- \n- def _logAndRaise(self, errorMsg):\n- self._log.error(errorMsg)\n- raise Exception(errorMsg)\n- \n- def _shortenHeaders(self):\n- self.csh = ChangeSequenceHeaders()\n- self.csh.setInputFile(self.inputFileName)\n- self.csh.setFormat("fasta")\n- self.csh.setStep(1)\n- self.csh.setPrefix("seq")\n- self.csh.setLinkFile(self.inputFileName+".shortHlink")\n- self.csh.setOutputFile(self.inputFileName+".shortH")\n- self.csh.setVerbosityLevel(self._verbosity-1)\n- self.csh.run()\n- self.shortInputFileName = self.inputFileName+".shortH" \n- \n- def _renameHeaders(self):\n- self.csh.setInputFile(self.phyml_tree)\n- self.csh.setFormat("newick")\n- self.csh.setStep(2)\n- self.csh.setLinkFile(self.inputFileName+".shortHlink" )\n- self.csh.setOutputFile(self.outFileName)\n- self.csh.setVerbosityLevel(self._verbosity-1)\n- self.csh.run()\n- \n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- self._checkOptions()\n- self._log.info("START LaunchPhyML")\n- self._log.debug("building a multiple alignment from \'%s\'..." % ( self.inputFileName))\n- \n- inputFileName = "%s/%s" % (os.getcwd(), os.path.basename(self.inputFileName))\n- if not os.path.exists(inputFileName):\n- os.symlink(self.inputFileName, inputFileName)\n- self.inputFileName = inputFileName\n- \n- self._shortenHeaders()\n-\n- cmd = "sreformat phylip %s" % (self.shortInputFileName)\n- \n- with open (self.reformatedInputFileName, "w") as fPhylip :\n- \n- process = subprocess.Popen(cmd.split(\' \'), stdout= fPhylip , stderr=subprocess.PIPE)\n- self._log.debug("Running : %s" % cmd)\n- output = process.communicate()\n- self._log.debug("Output:\\n%s" % output[0])\n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- \n- self.reformatedInputFileName = "%s.phylip" % self.shortInputFileName\n- self.phyml_tree = "%s_phyml_tree.txt" %self.reformatedInputFileName \n- cpyPhyml_tree = "%s_cpy" %self.phyml_tree\n- shutil.copyfile(self.phyml_tree,cpyPhyml_tree)\n- \n- cmd = "phyml -i %s -d %s%s -n %d -b %d -m %s -t %f -v %f -c %d -a %f -u %s -o %s" % (self.reformatedInputFileName, self.dataType, self.seqFormat, self.nbDataSets,self.nbBootDataSets,self.substModel, self.ratioTsTv, self.propInvSites,self.nbCat,self.gammaParam, cpyPhyml_tree , self.paramOptimisation )\n- print cmd \n- process = subprocess.Popen(cmd.split(\' \'), stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n- self._log.debug("Running : %s" % cmd)\n- output = process.communicate()\n- self._log.debug("Output:\\n%s" % output[0])\n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- \n- self._renameHeaders()\n- \n- if self._clean:\n- for f in [ self.shortInputFileName, self.inputFileName+".shortHlink", self.inputFileName+".shortH.phylip",self.inputFileName+".shortH.phylip_phyml_lk.txt", self.phyml_tree ]:\n- os.remove(f)\n- os.system( "mv %s.phylip_phyml_stat.txt %s_phyml.txt" % ( self.shortInputFileName, self.inputFileName ) )\n- \n- self._log.info("Finished running LaunchPhyML")\n- \n- \n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchPromer.py --- a/commons/launcher/LaunchPromer.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,147 +0,0 @@ -#! /usr/bin/env python - -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -from commons.core.checker.CheckerUtils import CheckerUtils -from commons.core.utils.FileUtils import FileUtils -from commons.core.utils.RepetOptionParser import RepetOptionParser -import subprocess -from commons.core.LoggerFactory import LoggerFactory -import os - -LOG_DEPTH = "repet.tools" - -class LaunchPromer(object): - - def __init__(self,queryFileName="", refFileName ="", prefix = None, genCoords=False, showCoords = False, mum=False, maxGaps=30, minMatch=6, nooptimize=False,mincluster=20, verbosity=0): - self._queryFileName = queryFileName - self._refFileName = refFileName - self._prefix = prefix - self._genCoords = genCoords - self._showCoords = showCoords - self._mum = mum - self._maxgaps = maxGaps - self._minMatch = minMatch - self._nooptimize = nooptimize - self._mincluster = mincluster - self.verbosity = verbosity - self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self.verbosity) - - def setMincluster(self, value): - self._mincluster = value - def getMincluster(self): - return self._mincluster - - mincluster = property(getMincluster, setMincluster) - - def setAttributesFromCmdLine(self): - description = "LaunchPromer runs the Promer program (part of the mummer package) ." - parser = RepetOptionParser(description = description) - parser.add_option("-q", "--query", dest="queryFileName", default = "", action="store", type="string", help="input query file [compulsory] [format: fasta]") - parser.add_option("-r", "--ref", dest="refFileName", default = "", action="store", type="string", help="input ref file [compulsory] [format: fasta]") - parser.add_option("-p", "--prefix", dest="prefix", default = None, action="store", type="string", help="prefix name [optional]") - parser.add_option("-o","--gencoords", dest="genCoords",action="store_true", help="generate coords file with minimal option (show-coords -r) [optional] ") - parser.add_option("-s","--showcoords", dest="showCoords",action="store_true", help="generate coords file with: show-coords -r -c -l -d -I 50 -L 100 -T [optional] ") - parser.add_option("-m", "--mum", dest="mum", action="store_true", help="Use anchor matches that are unique in both the reference and query [optional] ") - parser.add_option("-g", "--maxgaps", dest="maxgaps", default = 30, action="store", type="int", help="Maximum gap between two adjacent matches in a cluster (default 30) [optional] ") - parser.add_option("-l", "--minmatch", dest="minMatch", default = 6, action="store", type="int", help="Minimum length of an maximal exact match (default 6) [optional] ") - parser.add_option("-n", "--nooptimize", dest="nooptimize", action="store_true", help="nooptimize (default --optimize) [optional] ") - parser.add_option("-j", "--mincluster", dest="mincluster", default = 20, action="store", type="int", help="Minimum length of a cluster of matches (default 20) [optional] ") - parser.add_option("-v", "--verbosity", dest="verbosity", default = 0, action="store", type="int", help="verbosity [optional] ") - - (self._options, args) = parser.parse_args() - self._setAttributesFromOptions(self._options) - - def _setAttributesFromOptions(self, options): - self._queryFileName = options.queryFileName - self._refFileName = options.refFileName - self._prefix = options.prefix - self._genCoords = options.genCoords - self._showCoords = options.showCoords - self._mum = options.mum - self._maxgaps = options.maxgaps - self._minMatch = options.minMatch - self._nooptimize = options.nooptimize - self._mincluster = options.mincluster - self.verbosity = options.verbosity - - def _logAndRaise(self, errorMsg): - self._log.error(errorMsg) - raise Exception(errorMsg) - - def checkOptions(self): - if self._queryFileName != "": - if not FileUtils.isRessourceExists(self._queryFileName): - self._logAndRaise("ERROR: Query file: %s does not exist!" % self._queryFileName) - else: - self._logAndRaise("ERROR: No specified --query option!") - - if self._refFileName != "": - if not FileUtils.isRessourceExists(self._refFileName): - self._logAndRaise("ERROR: Ref file does not exist!"% self._refFileName) - else: - self._logAndRaise("ERROR: No specified --ref option!") - - def run(self): - if not CheckerUtils.isExecutableInUserPath("promer") : - self._logAndRaise("ERROR: promer must be in your path") - self.checkOptions() - - genCoords = "" - if self._genCoords: - genCoords = "-o" - mum = "" - if self._mum: - mum = "--mum" - nooptimize = "--optimize" - if self._nooptimize: - nooptimize = "--nooptimize" - prefix = "" - if self._prefix is not None: - prefix = "--prefix=%s" %(self._prefix) - - cmd = "promer %s %s %s %s %s -g=%d -l=%d %s -c=%d" % (self._refFileName,self._queryFileName, prefix, genCoords, mum, self._maxgaps, self._minMatch, nooptimize, self._mincluster) - self._log.debug("Running promer with following commands : %s" %cmd) - cmd = cmd.split() - process = subprocess.Popen(cmd) - process.wait() - - if self._showCoords: - #use of os.system because redirect on process is broken in python < 3.0 - cmd = "show-coords -r -c -l -d -I 50 -L 100 -T %s.delta > %s.coords" % (self._prefix, self._prefix) - os.system(cmd) - - return process.returncode - -if __name__ == "__main__": - iLaunchPromer = LaunchPromer() - iLaunchPromer.setAttributesFromCmdLine() - iLaunchPromer.run() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchRefAlign.py --- a/commons/launcher/LaunchRefAlign.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,208 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.checker.ConfigChecker import ConfigRules\n-from commons.core.checker.ConfigChecker import ConfigChecker\n-import subprocess\n-import os\n-from commons.core.seq.Bioseq import Bioseq\n-\n-LOG_DEPTH = "repet.core.launchers"\n-\n-from commons.core.seq.BioseqDB import BioseqDB\n-from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders\n-\n-\n-class LaunchRefAlign(object):\n- """\n- Launch \'refalign\' to build a master-slave multiple sequence alignment.\n- """\n- def __init__(self, inputFileName="", outFileName="", gapSize=10, match=10, mismatch=8, gapOpen=16, gapExtend=4, refseqName="", keepRefseq =False, verbosity=3 ):\n- self.inputFileName = inputFileName\n- self.outFileName=outFileName\n- self.gapSize = gapSize\n- self.match = match\n- self.mismatch = mismatch\n- self.gapOpen = gapOpen\n- self.gapExtend = gapExtend\n- self.gapExtend = gapExtend\n- self.refseqName = refseqName\n- self.keepRefseq = keepRefseq\n- self._verbosity = verbosity\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def setAttributesFromCmdLine(self):\n- description = "usage: LaunchRefalign.py [ options ]"\n- epilog = "\\n -h: this help\\n"\n- epilog += "\\t -i: name of the input file (refseq is first, format=\'fasta\')"\n- epilog += "\\t -r: keep the reference sequence"\n- epilog += "\\t -o: name of the output file (default=inFileName+\'.fa_aln\')"\n- epilog += "\\t -v: verbosity (default=0)"\n- epilog += "\\n\\t"\n- parser = RepetOptionParser(description = description, epilog = epilog)\n- parser.add_option("-i", "--fasta", dest = "inputFileName", action = "store", type = "string", help = "input fasta file name [compulsory] [format: fasta]", default = "")\n- parser.add_option("-o", "--out", dest = "outFileName", action = "store", type = "string", help = "output file name [default: <input>.out]", default = "")\n- parser.add_option("-r", "--keepRefseq", dest = "keepRefseq", action = "store_true", help = "keep reference sequence [optional] [default: Fals'..b'rs(self):\n- self.csh = ChangeSequenceHeaders()\n- self.csh.setInputFile(self.inputFileName)\n- self.csh.setFormat("fasta")\n- self.csh.setStep(1)\n- self.csh.setPrefix("seq")\n- self.csh.setLinkFile(self.inputFileName+".shortHlink")\n- self.csh.setOutputFile(self.inputFileName+".shortH")\n- self.csh.setVerbosityLevel(self._verbosity-1)\n- self.csh.run()\n- \n- bsDB = BioseqDB(self.inputFileName+".shortH")\n- bsDB.upCase()\n- bsDB.save(self.inputFileName+".shortHtmp")\n- del bsDB\n- os.rename(self.inputFileName+".shortHtmp", self.inputFileName+".shortH")\n- \n- def _renameHeaders(self):\n- self.csh.setInputFile(self.inputFileName+".shortH.fa_aln")\n- self.csh.setFormat("fasta")\n- self.csh.setStep(2)\n- self.csh.setLinkFile(self.inputFileName+".shortHlink" )\n- self.csh.setOutputFile(self.outFileName)\n- self.csh.setVerbosityLevel(self._verbosity-1)\n- self.csh.run()\n- \n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- self._checkOptions()\n- self._log.info("START LaunchRefAlign")\n- self._log.debug("building a multiple alignment from \'%s\'..." % ( self.inputFileName))\n- \n- inputFileName = "%s/%s" % (os.getcwd(), os.path.basename(self.inputFileName))\n- if not os.path.exists(inputFileName):\n- os.symlink(self.inputFileName, inputFileName)\n- self.inputFileName = inputFileName\n- \n- self._shortenHeaders()\n- if self.keepRefseq:\n- self.refseqName="seq1"\n- self._prepareRefAlign()\n- \n- if self._numseq > 1:\n- cmd = "refalign %s %s -m %d -l %d -d %d -g %d -e %d" % (self.refFileName, self.cpyFileName, self.match, self.gapSize, self.mismatch, self.gapOpen, self.gapExtend)\n- \n- process = subprocess.Popen(cmd.split(\' \'), stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n- self._log.debug("Running : %s" % cmd)\n- output = process.communicate()\n- self._log.debug("Output:\\n%s" % output[0])\n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- refseqNameParam = ""\n- if self.refseqName != "":\n- refseqNameParam = "-r %s " % (self.refseqName)\n- outFileName = self.inputFileName+".shortH.fa_aln"\n- #self.cpyFileName = os.path.join(os.getcwd(),os.path.basename(self.cpyFileName))\n- \n- self._log.info("Copy file path %s " % self.cpyFileName)\n- print("Copy file path %s " % self.cpyFileName)\n- cmd = "refalign2fasta.py -i %s.aligner %s-g d -o %s -v 1" % (self.cpyFileName, refseqNameParam, outFileName)\n- self._log.debug("Running : %s" % cmd)\n- process = subprocess.Popen(cmd.split(\' \'), stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n- output = process.communicate()\n- self._log.debug("Output:\\n%s" % output[0])\n- \n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- \n- cmd = "rm -f "+ self.refFileName + " " + self.cpyFileName + " " + self.cpyFileName + ".aligner " + self.cpyFileName + ".oriented " + self.cpyFileName + ".refalign.stat"\n- os.system(cmd)\n- \n- else:\n- self._logAndRaise("Only one sequence available")\n- cmd = "echo empty"\n- \n- self._renameHeaders()\n- \n- for fileName in [self.inputFileName + ".shortH", self.inputFileName + ".shortHlink", self.inputFileName + ".shortH.fa_aln"]:\n- os.remove(fileName)\n- self._log.info("END LaunchRefAlign")\n- return 0\n- \n-\n-if __name__ == "__main__":\n- iLaunchRefAlign = LaunchRefAlign()\n- iLaunchRefAlign.setAttributesFromCmdLine()\n- iLaunchRefAlign.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchRefalign_old.py --- a/commons/launcher/LaunchRefalign_old.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,105 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import getopt - -import pyRepet.launcher.programLauncher -from commons.core.seq.BioseqDB import BioseqDB -from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders - - -def help(): - print "usage: launchRefalign.py [ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (refseq is first, format='fasta')" - print " -r: keep the reference sequence" - print " -o: name of the output file (default=inFileName+'.fa_aln')" - print " -v: verbose (default=0)" - - -def main(): - """ - Launch 'refalign' to build a master-slave multiple sequence alignment. - """ - inFileName = "" - keepRefseq = False - outFileName = "" - verbose = 0 - try: - opts,args=getopt.getopt(sys.argv[1:],"hi:ro:v:") - except getopt.GetoptError, err: - print str(err); help(); sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-r": - keepRefseq = True - elif o == "-o": - outFileName = a - elif o == "-v": - verbose = int(a) - if inFileName == "": - print "ERROR: missing compulsory options" - help() - sys.exit(1) - - if verbose > 0: - print "START %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - if verbose > 0: - print "build a multiple alignment from '%s'..." % ( inFileName ) - sys.stdout.flush() - - if outFileName == "": - outFileName = "%s.fa_aln" % ( inFileName ) - - csh = ChangeSequenceHeaders() - csh.setInputFile( inFileName ) - csh.setFormat( "fasta" ) - csh.setStep( 1 ) - csh.setPrefix( "seq" ) - csh.setLinkFile( inFileName+".shortHlink" ) - csh.setOutputFile( inFileName+".shortH" ) - csh.setVerbosityLevel( verbose - 1 ) - csh.run() - - bsDB = BioseqDB( inFileName+".shortH" ) - bsDB.upCase() - bsDB.save( inFileName+".shortHtmp" ) - del bsDB - os.rename( inFileName+".shortHtmp", inFileName+".shortH" ) - - pL = pyRepet.launcher.programLauncher.programLauncher( inFileName+".shortH" ) - if keepRefseq: - pL.launchRefalign( outFileName=inFileName+".shortH.fa_aln", refseqName="seq1", verbose=verbose ) - else: - pL.launchRefalign( outFileName=inFileName+".shortH.fa_aln", verbose=verbose ) - - csh.setInputFile( inFileName+".shortH.fa_aln" ) - csh.setFormat( "fasta" ) - csh.setStep( 2 ) - csh.setLinkFile( inFileName+".shortHlink" ) - csh.setOutputFile( outFileName ) - csh.setVerbosityLevel( verbose - 1 ) - csh.run() - - for f in [ inFileName+".shortH", inFileName+".shortHlink", inFileName+".shortH.fa_aln" ]: - os.remove( f ) - - if verbose > 0: - print "END %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchRepeatMasker.py --- a/commons/launcher/LaunchRepeatMasker.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,113 +0,0 @@ -#! /usr/bin/env python - -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -from commons.core.checker.CheckerUtils import CheckerUtils -from commons.core.utils.FileUtils import FileUtils -from commons.core.utils.RepetOptionParser import RepetOptionParser -import subprocess - -class LaunchRepeatMasker(object): - - def __init__(self,queryFileName="", libFileName ="",sensitivity="", engine="wu", cutOff=225, outputDir = ".",verbosity=0): - self._queryFileName = queryFileName - self._libFileName = libFileName - self._engine = engine - self._sensitivity = sensitivity - self._cutOff = cutOff - self._outputDir = outputDir - self._verbosity = verbosity - - def setAttributesFromCmdLine(self): - description = "LaunchRepeatMasker runs the RepeatMasker program ." - parser = RepetOptionParser(description = description) - parser.add_option("-q", "--query", dest="queryFileName", default = None, action="store", type="string", help="input query file [compulsory] [format: fasta]") - parser.add_option("-l", "--libFileName", dest="libFileName", default = None, action="store", type="string", help="custom library [optional]") - parser.add_option("-n", "--outputDir", dest="outputDir", default=".", action="store", type="string", help="outputDir (default : current directory) [optional] ") - parser.add_option("-c", "--cutOff", dest="cutOff", default=225, action="store", type="int", help="Sets cutoff score for masking repeats when using -lib (default 225) [optional] ") - parser.add_option("-e", "--engine", dest="engine", default = "wu", action="store", type="string", help="engine [optional] ") - parser.add_option("-u", "--sensitivity", dest="sensitivity", default = "", action="store", type="string", help="sensitivity can be s, q, qq[optional] ") - parser.add_option("-v", "--verbosity", dest="verbosity", default = 0, action="store", type="int", help="verbosity [optional] ") - - (options, args) = parser.parse_args() - self._setAttributesFromOptions(options) - - def _setAttributesFromOptions(self, options): - self._queryFileName = options.queryFileName - self._libFileName = options.libFileName - self._outputDir = options.outputDir - self._engine = options.engine - self._sensitivity = options.sensitivity - self._cutOff = options.cutOff - self._verbosity = options.verbosity - - def checkOptions(self): - if self._queryFileName != "": - if not FileUtils.isRessourceExists(self._queryFileName): - raise Exception("ERROR: Query file: %s does not exist!" % self._queryFileName) - else: - raise Exception("ERROR: No specified --query option!") - - def run(self): - if not CheckerUtils.isExecutableInUserPath("RepeatMasker") : - print "ERROR: RepeatMasker must be in your path" - else: - self.checkOptions() - - engine = "" - if self._engine == "wu": - engine = "-e wublast" - elif self._engine == "cm": - engine = "-e crossmatch" - sensitivity = "" - if self._sensitivity: - sensitivity = "-%s" % self._sensitivity - libFileName = "" - if self._libFileName != "": - libFileName = "-lib %s" % self._libFileName - - cmd = "RepeatMasker %s -dir %s -pa 1 -gccalc -no_is -nolow %s %s %s" % (self._queryFileName,self._outputDir,engine,sensitivity,libFileName) - cmd = cmd.split() - - if self._verbosity>0: - print("Running RepeatMasker with following commands : %s" %cmd) - - process = subprocess.Popen(cmd, stdout=subprocess.PIPE,stderr = subprocess.PIPE) -# process.wait() - output= process.communicate() - if self._verbosity>0: - print("".join(output)) - return process.returncode - -if __name__ == "__main__": - iLaunchRepeatMasker = LaunchRepeatMasker() - iLaunchRepeatMasker.setAttributesFromCmdLine() - iLaunchRepeatMasker.run() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchTRF.py --- a/commons/launcher/LaunchTRF.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,155 +0,0 @@ -#!/usr/bin/env python - -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -from commons.core.LoggerFactory import LoggerFactory -from commons.core.utils.RepetOptionParser import RepetOptionParser -from commons.core.checker.ConfigChecker import ConfigRules -from commons.core.checker.ConfigChecker import ConfigChecker -import subprocess -import glob -import os - -LOG_DEPTH = "repet.launchers" - -class LaunchTRF(object): - - def __init__(self, inFileName = "", outFileName = "", maxPeriod=15, doClean = False, verbosity = 0): - self.inFileName = inFileName - self.setOutFileName(outFileName) - self.maxPeriod=maxPeriod - self._doClean = doClean - self._verbosity = verbosity - self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity) - - def setAttributesFromCmdLine(self): - description = "Launch TRF to detect micro-satellites in sequences." - epilog = "\nExample 1: launch without verbosity and keep temporary files.\n" - epilog += "\t$ python LaunchTemplate.py -i file.fa -v 0" - epilog += "\n\t" - parser = RepetOptionParser(description = description, epilog = epilog) - parser.add_option("-i", "--in", dest = "inFileName", action = "store", type = "string", help = "input file name [compulsory] [format: fasta]", default = "") - parser.add_option("-o", "--out", dest = "outFileName", action = "store", type = "string", help = "output file name [default: <input>.TRF.set]", default = "") - parser.add_option("-m", "--maxPeriod", dest = "maxPeriod", action = "store", type = "int", help = " maximum period size to report [default: 15]", default = 15) - parser.add_option("-c", "--clean", dest = "doClean", action = "store_true", help = "clean temporary files [optional] [default: False]", default = False) - parser.add_option("-v", "--verbosity", dest = "verbosity", action = "store", type = "int", help = "verbosity [optional] [default: 1]", default = 1) - options = parser.parse_args()[0] - self._setAttributesFromOptions(options) - - def _setAttributesFromOptions(self, options): - self.setInFileName(options.inFileName) - self.setOutFileName(options.outFileName) - self.maxPeriod = options.maxPeriod - self.setDoClean(options.doClean) - self.setVerbosity(options.verbosity) - - def setInFileName(self, inFileName): - self.inFileName = inFileName - - def setOutFileName(self, outFileName): - if outFileName == "": - self._outFileName = "%s.TRF.set" % self.inFileName - else: - self._outFileName = outFileName - - def setDoClean(self, doClean): - self._doClean = doClean - - def setVerbosity(self, verbosity): - self._verbosity = verbosity - - def _checkOptions(self): - if self.inFileName == "": - self._logAndRaise("ERROR: Missing input file name") - - def _logAndRaise(self, errorMsg): - self._log.error(errorMsg) - raise Exception(errorMsg) - - - def _launchTRF(self): - cmd = "trf %s 2 3 5 80 10 20 %d -h -d" % (self.inFileName, self.maxPeriod) - self._log.debug("Running : %s" % cmd) - process = subprocess.Popen(cmd.split(' '), stdout=subprocess.PIPE, stderr=subprocess.PIPE) - output = process.communicate() - self._log.debug("Output:\n%s" % output[0]) - - def _parseTRF(self): - self._log.debug("Parsing TRF output") - with open( "%s.2.3.5.80.10.20.%d.dat" % (self.inFileName, self.maxPeriod),'r') as inFile: - with open(self._outFileName,'w') as outFile: - nbPatterns = 0 - nbInSeq = 0 - for line in inFile.readlines(): - if line == "": - break - data = line.split(" ") - if len(data) > 1 and "Sequence:" in data[0]: - nbInSeq += 1 - seqName = data[1][:-1] - if len(data) < 14: - continue - nbPatterns += 1 - consensus = data[13] - copyNb = int( float(data[3]) + 0.5 ) - start = data[0] - end = data[1] - outFile.write( "%i\t(%s)%i\t%s\t%s\t%s\n" % ( nbPatterns, consensus, copyNb, seqName, start, end ) ) - self._log.debug("Finished Parsing TRF output") - - def _clean(self): - try: - os.remove("%s.2.3.5.80.10.20.%d.dat" % (self.inFileName, self.maxPeriod)) - except:pass - - - def run(self): - """ - Launch TRF to detect micro-satellites in sequences. - """ - LoggerFactory.setLevel(self._log, self._verbosity) - self._checkOptions() - self._log.info("START Launch") - self._log.debug("Input file name: %s" % self.inFileName) - - self._launchTRF() - self._parseTRF() - - if self._doClean: - self._log.warning("Files will be cleaned") - self._clean() - self._log.info("END Launch") - -if __name__ == "__main__": - iLaunchTRF = LaunchTRF() - iLaunchTRF.setAttributesFromCmdLine() - iLaunchTRF.run() - |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/LaunchTallymer.py --- a/commons/launcher/LaunchTallymer.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,328 +0,0 @@\n-#!/usr/bin/env python\n-\n-"""\n-Launch Tallymer\'s sub programs, generate map file, and convert output to gff and wig, as well as visual (RPlot) data\n-"""\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-import os\n-import shutil\n-import subprocess\n-import time\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.LoggerFactory import LoggerFactory\n-from SMART.Java.Python.convertTranscriptFile import ConvertTranscriptFile\n-from commons.core.seq.BioseqUtils import BioseqUtils\n-from commons.core.seq.BioseqDB import BioseqDB\n-from Tallymer_pipe.PlotBenchMarkGFFFiles import PlotBenchMarkGFFFiles\n-\n-LOG_DEPTH = "repet.tools"\n-\n-\n-class LaunchTallymer(object):\n- """\n- Launch Tallymer\'s sub programs, generate map file, and convert output to\n- gff and wig, as well as visual (RPlot) data\n- """\n- \n- _lValidFormats = ["gff", "gff3", "wig", "bed", "map"]\n- \n- def __init__(self, inputFasta="", indexationFasta=None, merSize=20, minOccs=4, outputFormats="gff", nLargestScaffoldsToPlot=0, clean=False, verbosity=0):\n- self.inputFasta = inputFasta\n- self.indexationFasta = indexationFasta if indexationFasta != None else inputFasta \n- self.merSize = merSize\n- self.minOccs = minOccs\n- self.outputFormats = outputFormats\n- self.nLargestScaffoldsToPlot = nLargestScaffoldsToPlot\n- self.doClean = clean\n- self.verbosity = verbosity\n- \n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self.verbosity)\n- self._workdir = os.path.join(os.getcwd(), "launchTallymer_%s" % time.strftime("%Y%m%d%H%M%S"))\n- self._tmpSearchFileName = None\n- self._tmpMapFileName = None\n- self._tmpStatFileName = None \n- self._tmpPngFileName = None\n- self._plot_data = {}\n- self._plot_data2 = {}\n- \n- def setAttributesFromCmdLine(self):\n- description = "Generates stats from the results of the tallymer search ." \n- parser = RepetOptionParser(description=description)\n- parser.add_option("-i", "--inputFasta", dest="inputFasta", default = "", action="store", type="string", help="input fasta file [compulsory] [format: fasta]")\n- parser.add_option("-u", "--indexationFasta", dest="indexationFasta", default = "", action="store", type="string", help="input indexation fasta file used to generate'..b':\n- statFile.write("%s\\t%i\\t%.10f\\n" % (kmer, dKmer2Occ[kmer], dKmer2Occ[kmer] / float(totalNbOcc)))\n-\n- def _writeOutputFiles(self):\n- for format in self.outputFormats:\n- self._log.info("Generating %s file" % format)\n- outputFileName = "%s.tallymer.%s" % (os.path.splitext(self.inputFasta)[0], format)\n- try:\n- iConvertTranscriptFile = ConvertTranscriptFile(inputFileName=self._tmpMapFileName, name="Tallymer",\\\n- inputFormat="map", outputFileName=outputFileName, outputFormat=format,feature= "Match", featurePart="Match-part", verbosity=0) #self.verbosity\n- iConvertTranscriptFile.run()\n- except Exception as inst:\n- self._log.error("Error: %s - Failed to generate %s format ouput, skipping" % (inst, format))\n- shutil.copy2(outputFileName, "../.")\n-\n-\n-class ConvertUtils(object):\n- \n- def convertTallymerFormatIntoMapFormatAndGenerateData(fastaFileName, searchFileName, mapFileName):\n- dIndex2NameLengthList = ConvertUtils._createDictOfNameLengthAccordingToSeqOrder(fastaFileName)\n- plotData = {}\n- plotData2 = {}\n- with open(searchFileName, "r") as talFile:\n- with open(mapFileName, "w") as mapFile:\n- totalNbOcc = 0\n- dKmer2Occ = {}\n- line = talFile.readline()\n- while line:\n- data = line[:-1].split("\\t")\n- name = "%s_%s" % (data[3], data[2])\n- nbOccs = int(data[2])\n- chrname = dIndex2NameLengthList[int(data[0])][0]\n- if data[1][0] == "+":\n- start = int(data[1][1:]) + 1\n- end = start + len(data[3])\n- elif data[1][0] == "-":\n- start_revcomp = int(data[1][1:])\n- start = dIndex2NameLengthList[int(data[0])][1] - start_revcomp - 1\n- end = end - len(data[3]) + 1\n- mapLine = "%s\\t%s\\t%s\\t%s\\t%i\\n" % (name, chrname, start, end, nbOccs)\n- mapFile.write(mapLine)\n- \n- if plotData2.get(chrname,None) is None:\n- plotData2[chrname] = {}\n- if plotData2[chrname].get(start, None) is None:\n- plotData2[chrname][start]=0\n- plotData2[chrname][start] += nbOccs\n- \n- totalNbOcc += 1\n- if dKmer2Occ.has_key(data[3]):\n- dKmer2Occ[data[3]] += 1\n- else:\n- dKmer2Occ[data[3]] = 1\n- plotData[start] = nbOccs\n- line = talFile.readline()\n- return totalNbOcc, dKmer2Occ, plotData, plotData2\n- \n- convertTallymerFormatIntoMapFormatAndGenerateData = staticmethod(convertTallymerFormatIntoMapFormatAndGenerateData)\n- \n- def _createDictOfNameLengthAccordingToSeqOrder(fastaFileName):\n- with open(fastaFileName) as fastaFile:\n- line = fastaFile.readline()\n- i = 0\n- length = 0\n- dIndex2Name = {}\n- while line:\n- if line[0] == ">":\n- dIndex2Name[i] = [line[1:-1]]\n- if i > 0:\n- dIndex2Name[i - 1].append(length)\n- length = 0\n- i += 1\n- else:\n- length += len(line[:-1])\n- line = fastaFile.readline()\n- dIndex2Name[i - 1].append(length)\n- return dIndex2Name\n- \n- _createDictOfNameLengthAccordingToSeqOrder = staticmethod(_createDictOfNameLengthAccordingToSeqOrder)\n-\n-if __name__ == "__main__":\n- iLaunchTallymer = LaunchTallymer()\n- iLaunchTallymer.setAttributesFromCmdLine()\n- iLaunchTallymer.run() \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/MafftClusterLauncher.py --- a/commons/launcher/MafftClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,59 +0,0 @@ -#!/usr/bin/env python - -##@file -# Launch MafftProgramLauncher on several files in parallel on a cluster. - - -from pyRepet.launcher.AbstractClusterLauncher import * -from commons.launcher.MafftProgramLauncher import MafftProgramLauncher - - -class MafftClusterLauncher( AbstractClusterLauncher ): - """ - Launch Mafft on several files in parallel on a cluster. - """ - - def __init__( self ): - """ - Constructor. - """ - AbstractClusterLauncher.__init__( self ) - AbstractClusterLauncher.setAcronym( self, "Mafft" ) - - self._cmdLineSpecificOptions = "p:" - - self._exeWrapper = "MafftProgramLauncher.py" - self._prgLauncher = None - self._prgLauncher = self.getProgramLauncherInstance() - - - def getSpecificHelpAsString( self ): - """ - Return the specific help as a string. - """ - string = "" - string += "\nspecific options:" - string += "\n -p: parameters for 'mafft' (default='--auto')" - return string - - - def getProgramParameters( self ): - return self._prgLauncher.getProgramParameters() - - - def getProgramLauncherInstance( self ): - if self._prgLauncher == None: - self._prgLauncher = MafftProgramLauncher() - self._prgLauncher.setInputFile( GENERIC_IN_FILE ) - self._prgLauncher.setOutputFile( "%s.fa_aln" % ( GENERIC_IN_FILE ) ) - self._prgLauncher.setClean() - self._prgLauncher.setVerbosityLevel( 1 ) - self._prgLauncher.setListFilesToKeep() - self._prgLauncher.setListFilesToRemove() - return self._prgLauncher - - -if __name__ == "__main__": - i = MafftClusterLauncher() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/MafftProgramLauncher.py --- a/commons/launcher/MafftProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,188 +0,0 @@ -#!/usr/bin/env python - -##@file -# Launch Mafft (multiple alignment). -# -# options: -# -h: this help -# -i: name of the input file (format='fasta') -# -p: parameters for 'mafft' (default='--auto') -# -o: name of the output file (format='aligned fasta', default=inFile+'.fa_aln') -# -c: clean -# -v: verbosity level (default=0/1) - - -import os -import sys -import getopt -import exceptions - -from pyRepet.launcher.AbstractProgramLauncher import AbstractProgramLauncher -from pyRepet.seq.fastaDB import * -from commons.core.seq.FastaUtils import FastaUtils -from commons.core.seq.AlignedBioseqDB import AlignedBioseqDB -from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders - - -class MafftProgramLauncher( AbstractProgramLauncher ): - """ - Launch Mafft (multiple alignment). - """ - - - def __init__( self ): - """ - Constructor. - """ - AbstractProgramLauncher.__init__( self ) - self._prgName = "mafft" - self._formatInFile = "fasta" - self._prgParam = "--auto" - self._cmdLineSpecificOptions = "p:o:" - - - def getSpecificHelpAsString( self ): - """ - Return the specific help as a string. - """ - string = "" - string += "\nspecific options:" - string += "\n -p: parameters for '%s' (default='--auto')" % ( self.getProgramName() ) - string += "\n -o: name of the output file (format='aligned fasta', default=inFile+'.fa_aln')" - return string - - - def setASpecificAttributeFromCmdLine( self, o, a="" ): - """ - Set a specific attribute from the command-line arguments. - """ - if o == "-p": - self.setProgramParameters( a ) - elif o == "-o": - self.setOutputFile( a ) - - - def checkSpecificAttributes( self ): - """ - Check the specific attributes before running the program. - """ - if self.getOutputFile() == "": - self.setOutputFile( "%s.fa_aln" % ( self.getInputFile() ) ) - - - def setWrapperCommandLine( self ): - """ - Set the command-line of the wrapper. - Required for MafftClusterLauncher. - """ - self._wrpCmdLine = self.getWrapperName() - self._wrpCmdLine += " -i %s" % ( self.getInputFile() ) - self._wrpCmdLine += " -p '%s'" % ( self.getProgramParameters() ) - if self.getOutputFile() == "": - self.setOutputFile( "%s.fa_aln" % ( self.getInputFile() ) ) - self._wrpCmdLine += " -o %s" % ( self.getOutputFile() ) - if self.getClean(): - self._wrpCmdLine += " -c" - self._wrpCmdLine += " -v %i" % ( self.getVerbosityLevel() ) - - - def setProgramCommandLine( self ): - """ - Set the command-line of the program. - """ - self._prgCmdLine = self.getProgramName() - self._prgCmdLine += " %s" % ( self.getProgramParameters() ) - if self.getVerbosityLevel() == 0 and "--quiet" not in self._prgCmdLine: - self._prgCmdLine += " --quiet" - self._prgCmdLine += " %s.shortH" % ( self.getInputFile() ) - self._prgCmdLine += " > %s.shortH.fa_aln" % ( self.getInputFile() ) - if self._verbose < 2: - self._prgCmdLine += " 2> /dev/null" - - - def setListFilesToKeep( self ): - """ - Set the list of files to keep. - """ - if self.getOutputFile() == "": - self.setOutputFile( "%s.fa_aln" % ( self.getInputFile() ) ) - self.appendFileToKeep( self.getOutputFile() ) - - - def setListFilesToRemove( self ): - """ - Set the list of files to remove. - """ - self.appendFileToRemove( "%s.shortH" % ( self.getInputFile() ) ) - self.appendFileToRemove( "%s.shortH.fa_aln" % ( self.getInputFile() ) ) - self.appendFileToRemove( "%s.shortHlink" % ( self.getInputFile() ) ) - - - def setSummary( self ): - self._summary = "input file: %s" % ( self.getInputFile() ) - self._summary += "\nparameters: %s" % ( self.getProgramParameters() ) - if self.getOutputFile() == "": - self.setOutputFile( "%s.fa_aln" % ( self.getInputFile() ) ) - self._summary += "\noutput file: %s" % ( self.getOutputFile() ) - - - def run( self ): - """ - Run the program. - """ - self.start() - - lInitHeaders = FastaUtils.dbHeaders( self.getInputFile(), self.getVerbosityLevel()-1 ) - - csh = ChangeSequenceHeaders() - csh.setInputFile( self.getInputFile() ) - csh.setFormat( "fasta" ) - csh.setStep( 1 ) - csh.setPrefix( "seq" ) - csh.setLinkFile( "%s.shortHlink" % ( self.getInputFile() ) ) - csh.setOutputFile( "%s.shortH" % ( self.getInputFile() ) ) - csh.setVerbosityLevel( self.getVerbosityLevel() - 1 ) - csh.run() - - bsDB = BioseqDB( "%s.shortH" % ( self.getInputFile() ) ) - bsDB.upCase() - bsDB.save( "%s.shortHtmp" % ( self.getInputFile() ) ) - del bsDB - os.rename( "%s.shortHtmp" % ( self.getInputFile() ), - "%s.shortH" % ( self.getInputFile() ) ) - - self.setProgramCommandLine() - cmd = self.getProgramCommandLine() - if self.getVerbosityLevel() > 0: - print "LAUNCH: %s" % ( cmd ) - sys.stdout.flush() - exitStatus = os.system( cmd ) - if exitStatus != 0: - string = "ERROR: program '%s' returned exit status '%i'" % ( self.getProgramName(), exitStatus ) - print string - sys.exit(1) - - csh.setInputFile( "%s.shortH.fa_aln" % ( self.getInputFile() ) ) - csh.setFormat( "fasta" ) - csh.setStep( 2 ) - csh.setLinkFile( "%s.shortHlink" % ( self.getInputFile() ) ) - csh.setOutputFile( "%s.shortH.fa_aln.initH" % ( self.getInputFile() ) ) - csh.setVerbosityLevel( self.getVerbosityLevel() - 1 ) - csh.run() - - absDB = AlignedBioseqDB( "%s.shortH.fa_aln.initH" % ( self.getInputFile() ) ) - outFileHandler = open( self.getOutputFile(), "w" ) - for header in lInitHeaders: - bs = absDB.fetch( header ) - bs.upCase() - bs.write( outFileHandler ) - outFileHandler.close() - os.remove( "%s.shortH.fa_aln.initH" % ( self.getInputFile() ) ) - - self.end() - - -if __name__ == "__main__": - i = MafftProgramLauncher() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/MapClusterLauncher.py --- a/commons/launcher/MapClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,81 +0,0 @@ -#!/usr/bin/env python - -##@file -# Launch MapProgramLauncher.py on several files in parallel on a cluster. - - -import os -import sys -import getopt -import exceptions - -from pyRepet.launcher.AbstractClusterLauncher import * -from commons.launcher.MapProgramLauncher import MapProgramLauncher - - -class MapClusterLauncher( AbstractClusterLauncher ): - """ - Launch Map on several files in parallel on a cluster. - """ - - - def __init__( self ): - """ - Constructor. - """ - AbstractClusterLauncher.__init__( self ) - AbstractClusterLauncher.setAcronym( self, "Map" ) - - self._cmdLineSpecificOptions = "s:m:O:e:" - - self._exeWrapper = "MapProgramLauncher.py" - self._prgLauncher = None - self._prgLauncher = self.getProgramLauncherInstance() - - - def getSpecificHelpAsString( self ): - """ - Return the specific help as a string. - """ - string = "" - string += "\nspecific options:" - string += "\n -s: size above which a gap is not penalized anymore (default='%i')" % ( self.getGapSize() ) - string += "\n -m: penalty for a mismatch (default='%i')" % ( self.getMismatchPenalty() ) - string += "\n -O: penalty for a gap openning (default='%i')" % ( self.getGapOpenPenalty() ) - string += "\n -e: penalty for a gap extension (default='%i')" % ( self.getGapExtendPenalty() ) - return string - - - def getGapSize( self ): - return self._prgLauncher.getGapSize() - - - def getMismatchPenalty( self ): - return self._prgLauncher.getMismatchPenalty() - - - def getGapOpenPenalty( self ): - return self._prgLauncher.getGapOpenPenalty() - - - def getGapExtendPenalty( self ): - return self._prgLauncher.getGapExtendPenalty() - - - def getProgramLauncherInstance( self ): - if self._prgLauncher == None: - self._prgLauncher = MapProgramLauncher() - self._prgLauncher.setInputFile( GENERIC_IN_FILE ) - self._prgLauncher.setOutputFile( "%s.fa_aln" % ( GENERIC_IN_FILE ) ) - #TESt de SATannot verifier si clean est a vrai - #self._prgLauncher.setClean() - self._prgLauncher.setVerbosityLevel( 1 ) - self._prgLauncher.setListFilesToKeep() - self._prgLauncher.setListFilesToRemove() - return self._prgLauncher - - -if __name__ == "__main__": - i = MapClusterLauncher() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/MapProgramLauncher.py --- a/commons/launcher/MapProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,251 +0,0 @@\n-#!/usr/bin/env python\n-\n-##@file\n-# Launch Map (multiple alignment).\n-#\n-# options:\n-# -h: this help\n-# -i: name of the input file (format=\'fasta\')\n-# -s: size above which a gap is not penalized anymore (default=\'50\')\n-# -m: penalty for a mismatch (default=\'-8\')\n-# -O: penalty for a gap opening (default=\'16\')\n-# -e: penalty for a gap extension (default=\'4\')\n-# -o: name of the output file (format=\'aligned fasta\', default=inFile+\'.fa_aln\')\n-# -c: clean\n-# -v: verbosity level (default=0/1)\n-\n-\n-import sys\n-import os\n-\n-from pyRepet.launcher.AbstractProgramLauncher import AbstractProgramLauncher\n-from commons.core.seq.FastaUtils import FastaUtils\n-from commons.core.seq.AlignedBioseqDB import AlignedBioseqDB\n-from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders\n-\n-\n-class MapProgramLauncher( AbstractProgramLauncher ):\n- """\n- Launch Map (multiple alignment).\n- """\n- \n- \n- def __init__( self ):\n- """\n- Constructor.\n- """\n- AbstractProgramLauncher.__init__( self )\n- self._prgName = "rpt_map"\n- self._formatInFile = "fasta"\n- self._cmdLineSpecificOptions = "s:m:O:e:o:"\n- self._gapSize = 50\n- self._mismatchPenalty = -8\n- self._gapOpenPenalty = 16\n- self._gapExtendPenalty = 4\n- self._outFile = ""\n- \n- def getSpecificHelpAsString( self ):\n- """\n- Return the specific help as a string.\n- """\n- string = ""\n- string += "\\nspecific options:"\n- string += "\\n -s: size above which a gap is not penalized anymore (default=\'%i\')" % ( self.getGapSize() )\n- string += "\\n -m: penalty for a mismatch (default=\'%i\', match=10)" % ( self.getMismatchPenalty() )\n- string += "\\n -O: penalty for a gap opening (default=\'%i\')" % ( self.getGapOpenPenalty() )\n- string += "\\n -e: penalty for a gap extension (default=\'%i\')" % ( self.getGapExtendPenalty() )\n- string += "\\n -o: name of the output file (format=\'aligned fasta\', default=inFile+\'.fa_aln\')"\n- return string\n- \n- \n- def setASpecificAttributeFromCmdLine( self, o, a="" ):\n- """\n- Set a specific attribute from the command-line arguments.\n- """\n- if o == "-s":\n- self.setGapSize( a )\n- elif o == "-m":\n- self.setMismatchPenalty( a )\n- elif o == "-O":\n- self.setGapOpenPenalty( a )\n- elif o == "-e":\n- self.setGapExtendPenalty( a )\n- elif o == "-o":\n- self.setOutputFile( a )\n-\n- \n- def setGapSize( self, arg ):\n- self._gapSize = int(arg)\n- \n- \n- def setMismatchPenalty( self, arg ):\n- self._mismatchPenalty = int(arg)\n- \n- \n- def setGapOpenPenalty( self, arg ):\n- self._gapOpenPenalty = int(arg)\n- \n- \n- def setGapExtendPenalty( self, arg ):\n- self._gapExtendPenalty = int(arg)\n- \n- \n- def getGapSize( self ):\n- return self._gapSize\n- \n- \n- def getMismatchPenalty( self ):\n- return self._mismatchPenalty\n- \n- \n- def getGapOpenPenalty( self ):\n- return self._gapOpenPenalty\n- \n- \n- def getGapExtendPenalty( self ):\n- return self._gapExtendPenalty\n- \n- \n- def checkSpecificAttributes( self ):\n- """\n- Check the specific attributes before running the program.\n- """\n- if self.getGapSize() <= 0:\n- string = "ERROR: gap size should be > 0"\n- print string\n- print self.getHelpAsString()\n- sys.exit(1)\n- if self.getMismatchPenalty() >= 0:\n- string = "ERROR: mismatch penalty should be < 0"\n- print string\n- print self.getHelpAsString()\n- sys.exit(1)\n- if self.getGapOpenPenalty() < 0:\n- st'..b'_wrpCmdLine += " -c"\n- self._wrpCmdLine += " -v %i" % ( self.getVerbosityLevel() )\n- \n- \n- def setProgramCommandLine( self ):\n- """\n- Set the command-line of the program.\n- """\n- self._prgCmdLine = self.getProgramName()\n- self._prgCmdLine += " %s.shortH" % ( self.getInputFile() )\n- self._prgCmdLine += " %i" % ( self.getGapSize() )\n- self._prgCmdLine += " %i" % ( self.getMismatchPenalty() )\n- self._prgCmdLine += " %i" % ( self.getGapOpenPenalty() )\n- self._prgCmdLine += " %i" % ( self.getGapExtendPenalty() )\n- self._prgCmdLine += " > %s.shortH.fa_aln" % ( self.getInputFile() )\n- \n- \n- def setListFilesToKeep( self ):\n- """\n- Set the list of files to keep.\n- """\n- if self.getOutputFile() == "":\n- self.setOutputFile( "%s.fa_aln" % ( self.getInputFile() ) )\n- self.appendFileToKeep( self.getOutputFile() )\n- \n- \n- def setListFilesToRemove( self ):\n- """\n- Set the list of files to remove.\n- """\n- self.appendFileToRemove( "%s.shortH" % ( self.getInputFile() ) )\n- self.appendFileToRemove( "%s.shortH.fa_aln" % ( self.getInputFile() ) )\n- self.appendFileToRemove( "%s.shortHlink" % ( self.getInputFile() ) )\n- \n- \n- def setSummary( self ):\n- self._summary = "input file: %s" % ( self.getInputFile() )\n- self._summary += "\\ngap size: %i" % ( self.getGapSize() )\n- self._summary += "\\nmismatch penalty: %i" % ( self.getMismatchPenalty() )\n- self._summary += "\\ngap openning penalty: %i" % ( self.getGapOpenPenalty() )\n- self._summary += "\\ngap extension penalty: %i" % ( self.getGapExtendPenalty() )\n- if self.getOutputFile() == "":\n- self.setOutputFile( "%s.fa_aln" % ( self.getInputFile() ) )\n- self._summary += "\\noutput file: %s" % ( self.getOutputFile() )\n- \n- \n- def run( self ):\n- """\n- Run the program.\n- """\n- self.start()\n- \n- lInitHeaders = FastaUtils.dbHeaders( self.getInputFile(), self.getVerbosityLevel()-1 )\n- \n- csh = ChangeSequenceHeaders()\n- csh.setInputFile( self.getInputFile() )\n- csh.setFormat( "fasta" )\n- csh.setStep( 1 )\n- csh.setPrefix( "seq" )\n- csh.setLinkFile( "%s.shortHlink" % ( self.getInputFile() ) )\n- csh.setOutputFile( "%s.shortH" % ( self.getInputFile() ) )\n- csh.setVerbosityLevel( self.getVerbosityLevel() - 1 )\n- csh.run()\n- \n- self.setProgramCommandLine()\n- cmd = self.getProgramCommandLine()\n- if self.getVerbosityLevel() > 0:\n- print "LAUNCH: %s" % ( cmd )\n- sys.stdout.flush()\n- returnStatus = os.system( cmd )\n- if returnStatus != 0:\n- string = "ERROR: program \'%s\' returned status \'%i\'" % ( self.getProgramName(), returnStatus )\n- print string\n- sys.exit(1)\n- \n- csh.setInputFile( "%s.shortH.fa_aln" % ( self.getInputFile() ) )\n- csh.setFormat( "fasta" )\n- csh.setStep( 2 )\n- csh.setLinkFile( "%s.shortHlink" % ( self.getInputFile() ) )\n- csh.setOutputFile( "%s.shortH.fa_aln.initH" % ( self.getInputFile() ) )\n- csh.setVerbosityLevel( self.getVerbosityLevel() - 1 )\n- csh.run()\n- \n- absDB = AlignedBioseqDB( "%s.shortH.fa_aln.initH" % ( self.getInputFile() ) )\n- outFileHandler = open( self.getOutputFile(), "w" )\n- for header in lInitHeaders:\n- bs = absDB.fetch( header )\n- bs.upCase()\n- bs.write( outFileHandler )\n- outFileHandler.close()\n- if self.getClean():\n- os.remove( "%s.shortH.fa_aln.initH" % ( self.getInputFile() ) )\n- \n- self.end()\n- \n- \n-if __name__ == "__main__":\n- i = MapProgramLauncher()\n- i.setAttributesFromCmdLine()\n- i.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/NWalignProgramLauncher.py --- a/commons/launcher/NWalignProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,187 +0,0 @@ -#!/usr/bin/env python - -##@file -# Launch NWalign (pairwise alignment). -# -# options: -# -h: this help -# -i: name of the input file (queries, format='fasta') -# -s: name of the subject file (format='fasta') -# -p: parameters for 'NWalign' (default='-d 2') -# -o: name of the output file (format='align', default=inFile+'.align') -# -c: clean -# -v: verbosity level (default=0/1) - - -import os -import sys - -from pyRepet.launcher.AbstractProgramLauncher import AbstractProgramLauncher -from commons.core.seq.AlignedBioseqDB import AlignedBioseqDB -from commons.core.coord.AlignUtils import AlignUtils - - -class NWalignProgramLauncher( AbstractProgramLauncher ): - """ - Launch NWalign (pairwise alignment). - """ - - def __init__( self ): - """ - Constructor. - """ - AbstractProgramLauncher.__init__( self ) - self._prgName = "NWalign" - self._formatInFile = "fasta" - self._sbjFile = "" - self._prgParam = "" - self._cmdLineSpecificOptions = "s:p:o:" - - - def getSpecificHelpAsString( self ): - """ - Return the specific help as a string. - """ - string = "" - string += "\nspecific options:" - string += "\n -s: name of the subject file (format='fasta')" - string += "\n -p: parameters for '%s'" % ( self.getProgramName() ) - string += "\n -o: name of the output file (format='align', default=inFile+'.align')" - return string - - - def setASpecificAttributeFromCmdLine( self, o, a="" ): - """ - Set a specific attribute from the command-line arguments. - """ - if o =="-s": - self.setSubjectFile( a ) - elif o == "-p": - self.setProgramParameters( a ) - elif o == "-o": - self.setOutputFile( a ) - - - def setSubjectFile( self, arg ): - self._sbjFile = arg - - - def getSubjectFile( self ): - return self._sbjFile - - - def checkSpecificAttributes( self ): - """ - Check the specific attributes before running the program. - """ - if self._sbjFile == "": - string = "ERROR: missing subject file (-s)" - print string - print self.getHelpAsString() - sys.exit(1) - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - - - def setWrapperCommandLine( self ): - """ - Set the command-line of the wrapper. - Required for NWalignClusterLauncher. - """ - self._wrpCmdLine = self.getWrapperName() - self._wrpCmdLine += " -i %s" % ( self.getInputFile() ) - self._wrpCmdLine += " -s %s" % ( self.getSubjectFile() ) - if self.getProgramParameters() != "": - self._wrpCmdLine += " -p '%s'" % ( self.getProgramParameters() ) - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - self._wrpCmdLine += " -o %s" % ( self.getOutputFile() ) - if self.getClean(): - self._wrpCmdLine += " -c" - self._wrpCmdLine += " -v %i" % ( self.getVerbosityLevel() ) - - - def setProgramCommandLine( self ): - """ - Set the command-line of the program. - """ - self._prgCmdLine = self.getProgramName() - if self.getProgramParameters() != "": - self._prgCmdLine += " %s" % ( self.getProgramParameters() ) - self._prgCmdLine += " -o %s.afa" % ( self.getInputFile() ) - self._prgCmdLine += " -v %i" % ( self.getVerbosityLevel() ) - self._prgCmdLine += " %s" % ( self.getSubjectFile() ) - self._prgCmdLine += " %s" % ( self.getInputFile() ) - - - def setListFilesToKeep( self ): - """ - Set the list of files to keep. - """ - if self.getOutputFile() == "": - self.setOutputFile( "%s.afa" % ( self.getInputFile() ) ) - self.appendFileToKeep( self.getOutputFile() ) - - - def postprocess( self ): - absDB = AlignedBioseqDB( "%s.afa" % ( self.getInputFile() ) ) - lHeaders = absDB.getHeaderList() - queryHeader = lHeaders[0] - subjectHeader = lHeaders[1] - queryLength = absDB.fetch( queryHeader ).getLength() - subjectLength = absDB.fetch( subjectHeader ).getLength() - lAligns = absDB.getAlignList( queryHeader, subjectHeader ) - for i in lAligns: - if "re-oriented" in i.getQueryName(): - i.setQueryName( queryHeader.replace(" re-oriented","") ) - start = i.getQueryStart() - end = i.getQueryEnd() - i.setQueryStart( queryLength - end + 1 ) - i.setQueryEnd( queryLength - start + 1 ) - if "re-oriented" in i.getSubjectName(): - i.setSubjectName( subjectHeader.replace(" re-oriented","") ) - start = i.getSubjectStart() - end = i.getSubjectEnd() - i.setSubjectEnd( subjectLength - end + 1 ) - i.setSubjectStart( subjectLength - start + 1 ) - if not i.isQueryOnDirectStrand(): - i.reverse() - AlignUtils.writeListInFile( lAligns, self.getOutputFile() ) - os.remove( "%s.afa" % ( self.getInputFile() ) ) - - - def setSummary( self ): - self._summary = "input file: %s" % ( self.getInputFile() ) - self._summary += "\nsubject file: %s" % ( self.getSubjectFile() ) - self._summary += "\nparameters: %s" % ( self.getProgramParameters() ) - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - self._summary += "\noutput file: %s" % ( self.getOutputFile() ) - - - def run( self ): - """ - Run the program. - """ - self.start() - - self.setProgramCommandLine() - cmd = self.getProgramCommandLine() - if self.getVerbosityLevel() > 0: - print "LAUNCH: %s" % ( cmd ) - sys.stdout.flush() - exitStatus = os.system( cmd ) - if exitStatus != 0: - string = "ERROR: program '%s' returned exit status '%i'" % ( self.getProgramName(), exitStatus ) - print string - sys.exit(1) - - self.postprocess() - - self.end() - - -if __name__ == "__main__": - i = NWalignProgramLauncher() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/RepeatMaskerClusterLauncher.py --- a/commons/launcher/RepeatMaskerClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,77 +0,0 @@ -#!/usr/bin/env python - -##@file -# Launch RepeatMaskerProgramLauncher on several files in parallel on a cluster. - - -import os -import sys -import getopt -import exceptions - -from pyRepet.launcher.AbstractClusterLauncher import * -from commons.launcher.RepeatMaskerProgramLauncher import RepeatMaskerProgramLauncher - - -class RepeatMaskerClusterLauncher( AbstractClusterLauncher ): - """ - Launch RepeatMasker on several files in parallel on a cluster. - """ - - def __init__( self ): - """ - Constructor. - """ - AbstractClusterLauncher.__init__( self ) - AbstractClusterLauncher.setAcronym( self, "RM" ) - - self._cmdLineSpecificOptions = "s:n:gbl" - - self._exeWrapper = "RepeatMaskerProgramLauncher.py" - self._prgLauncher = RepeatMaskerProgramLauncher() - self._prgLauncher.setInputFile( GENERIC_IN_FILE ) - self._prgLauncher.setOutputFile( GENERIC_IN_FILE ) - self._prgLauncher.setClean() - self._prgLauncher.setVerbosityLevel( 1 ) - self._prgLauncher.setListFilesToKeep() - self._prgLauncher.setListFilesToRemove() - - - def getSpecificHelpAsString( self ): - """ - Return the specific help as a string. - """ - string = "" - string += "\nspecific options:" - string += "\n -s: name of the subject file (repeats, format='fasta')" - string += "\n -n: nb of processors to use in parallel (default=1)" - string += "\n -g: calculate the GC content" - string += "\n -b: skip bacterial insertion element check" - string += "\n -l: mask low-complexity DNA or simple repeats" - return string - - - def getSubjectFile( self ): - return self._prgLauncher.getSubjectFile() - - - def getNbProcessors( self ): - return self._prgLauncher.getNbProcessors() - - - def getCalculateGCcontent( self ): - return self._prgLauncher.getCalculateGCcontent() - - - def getSkipBacterialIsCheck( self ): - return self._prgLauncher.getSkipBacterialIsCheck() - - - def getMaskSsr( self ): - return self._prgLauncher.getMaskSsr() - - -if __name__ == "__main__": - i = RepeatMaskerClusterLauncher() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/RepeatMaskerProgramLauncher.py --- a/commons/launcher/RepeatMaskerProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,286 +0,0 @@\n-#!/usr/bin/env python\n-\n-##@file\n-# Launch RepeatMasker (pairwise alignment for repeat detection).\n-\n-\n-import os\n-import sys\n-\n-from pyRepet.launcher.AbstractProgramLauncher import AbstractProgramLauncher\n-\n-\n-class RepeatMaskerProgramLauncher( AbstractProgramLauncher ):\n- """\n- Launch RepeatMasker (pairwise alignment for repeat detection).\n- """\n- \n- def __init__( self ):\n- """\n- Constructor.\n- """\n- AbstractProgramLauncher.__init__( self )\n- self._prgName = "RepeatMasker"\n- self._formatInFile = "fasta"\n- self._sbjFile = ""\n- self._nbProc = 1\n- self._calcGc = False\n- self._skipIs = False\n- self._maskSsr = True\n- self._onlySsr = False\n- self._cmdLineSpecificOptions = "s:n:gblmo:"\n- \n- \n- def getSpecificHelpAsString( self ):\n- """\n- Return the specific help as a string.\n- """\n- string = ""\n- string += "\\nspecific options:"\n- string += "\\n -s: name of the subject file (repeats, format=\'fasta\')"\n- string += "\\n -n: nb of processors to use in parallel (default=\'%i\')" % ( self.getNbProcessors() )\n- string += "\\n -g: calculate the GC content"\n- string += "\\n -b: skip bacterial insertion element check"\n- string += "\\n -l: does not mask low-complexity DNA or simple repeats"\n- string += "\\n -m: only masks low complex/simple repeats (no interspersed repeats)"\n- string += "\\n -o: name of the output file"\n- string += "\\n with -s: format=\'align\', default=inFile+\'.cat.align\')"\n- string += "\\n with -m: format=\'path\', default=inFile+\'.cat.path\')"\n- return string\n- \n- \n- def setASpecificAttributeFromCmdLine( self, o, a="" ):\n- """\n- Set a specific attribute from the command-line arguments.\n- """\n- if o =="-s":\n- self.setSubjectFile( a )\n- elif o == "-n":\n- self.setNbProcessors( a )\n- elif o == "-g":\n- self.setCalculateGCcontent()\n- elif o == "-b":\n- self.setSkipBacterialIsCheck()\n- elif o == "-l":\n- self.unsetMaskSsr()\n- elif o == "-m":\n- self.setOnlySsr()\n- elif o == "-o":\n- self.setOutputFile( a )\n- \n- \n- def setSubjectFile( self, arg ):\n- self._sbjFile = arg\n- \n- \n- def setNbProcessors( self, arg ):\n- self._nbProc = int(arg)\n- \n- \n- def setCalculateGCcontent( self ):\n- self._calcGc = True\n- \n- \n- def setSkipBacterialIsCheck( self ):\n- self._skipIs = True\n- \n- \n- def unsetMaskSsr( self ):\n- self._maskSsr = False\n- \n- \n- def setOnlySsr( self ):\n- self._onlySsr = True\n- \n- \n- def getSubjectFile( self ):\n- return self._sbjFile\n- \n- \n- def getNbProcessors( self ):\n- return self._nbProc\n- \n- \n- def getCalculateGCcontent( self ):\n- return self._calcGc\n- \n- \n- def getSkipBacterialIsCheck( self ):\n- return self._skipIs\n- \n- \n- def getMaskSsr( self ):\n- return self._maskSsr\n- \n- \n- def getOnlySsr( self ):\n- return self._onlySsr\n- \n- \n- def checkSpecificAttributes( self ):\n- """\n- Check the specific attributes before running the program.\n- """\n- if ( self.getSubjectFile() == "" and not self.getOnlySsr() ) \\\n- or ( self.getSubjectFile() != "" and self.getOnlySsr() ):\n- string = "ERROR: need to specify -s or -m"\n- print string\n- print self.getHelpAsString()\n- sys.exit(1)\n- if self.getOutputFile() == "":\n- if not self.getOnlySsr():\n- self.setOutputFile( "%s.cat.align" % ( self.getInputFile() ) )\n- else:\n- self.s'..b'OutputFile() == "":\n- if not self.getOnlySsr():\n- self.setOutputFile( "%s.cat.align" % ( self.getInputFile() ) )\n- else:\n- self.setOutputFile( "%s.cat.path" % ( self.getInputFile() ) )\n- self.appendFileToKeep( self.getOutputFile() )\n- self.appendFileToKeep( "%s.cat" % ( self.getInputFile() ) )\n- \n- \n- def setListFilesToRemove( self ):\n- """\n- Set the list of files to remove.\n- """\n- self.appendFileToRemove( "%s.stderr" % ( self.getInputFile() ) )\n- self.appendFileToRemove( "%s.tbl" % ( self.getInputFile() ) )\n- self.appendFileToRemove( "%s.ori.out" % ( self.getInputFile() ) )\n- self.appendFileToRemove( "%s.masked" % ( self.getInputFile() ) )\n- self.appendFileToRemove( "%s.out" % ( self.getInputFile() ) )\n- self.appendFileToRemove( "%s.log" % ( self.getInputFile() ) )\n- self.appendFileToRemove( "%s.ref" % ( self.getInputFile() ) )\n- \n- \n- def convertCatIntoAlign( self ):\n- """\n- Convert a \'cat\' file into the \'align\' format.\n- """\n- cmd = os.environ["REPET_PATH"] + "/bin/RMcat2align.py"\n- cmd += " -i %s.cat" % ( self.getInputFile() )\n- cmd += " -o %s.cat.align" % ( self.getInputFile() )\n- exitStatus = os.system( cmd )\n- if exitStatus != 0:\n- string = "ERROR while converting \'cat\' file into \'align\' format"\n- print string\n- sys.exit(1)\n- \n- \n- def convertCatIntoPath( self ):\n- """\n- Convert a \'cat\' file into the \'path\' format.\n- """\n- cmd = os.environ["REPET_PATH"] + "/bin/RMcat2path.py"\n- cmd += " -i %s.cat" % ( self.getInputFile() )\n- cmd += " -o %s.cat.path" % ( self.getInputFile() )\n- exitStatus = os.system( cmd )\n- if exitStatus != 0:\n- string = "ERROR while converting \'cat\' file into \'path\' format"\n- print string\n- sys.exit(1)\n- \n- \n- def setSummary( self ):\n- self._summary = "input file: %s" % ( self.getInputFile() )\n- if self.getSubjectFile() != "":\n- self._summary += "\\nsubject file: %s" % ( self.getSubjectFile() )\n- self._summary += "\\nnb processors: %i" % ( self.getNbProcessors() )\n- if self.getCalculateGCcontent():\n- self._summary += "\\ncalculate the GC content"\n- if self.getSkipBacterialIsCheck():\n- self._summary += "\\nskip bacterial insertion element check"\n- if self.getMaskSsr():\n- self._summary += "\\nmask low-complexity DNA or simple repeats"\n- if self.getOnlySsr():\n- self._summary = "\\nonly masks low complex/simple repeats (no interspersed repeats)"\n- if self.getOutputFile() == "":\n- if not self.getMaskSsr():\n- self.setOutputFile( "%s.cat.align" % ( self.getInputFile() ) )\n- else:\n- self.setOutputFile( "%s.cat.path" % ( self.getInputFile() ) )\n- self._summary += "\\noutput file: %s" % ( self.getOutputFile() )\n- \n- \n- def run( self ):\n- """\n- Run the program.\n- """\n- self.start()\n- \n- self.setProgramCommandLine()\n- cmd = self.getProgramCommandLine()\n- if self.getVerbosityLevel() > 0:\n- print "LAUNCH: %s" % ( cmd )\n- sys.stdout.flush()\n- exitStatus = os.system( cmd )\n- if exitStatus != 0:\n- string = "ERROR: program \'%s\' returned exit status \'%i\'" % ( self.getProgramName(), exitStatus )\n- print string\n- sys.exit(1)\n- \n- if not self.getOnlySsr():\n- self.convertCatIntoAlign()\n- else:\n- self.convertCatIntoPath()\n- \n- self.end()\n- \n- \n-if __name__ == "__main__":\n- i = RepeatMaskerProgramLauncher()\n- i.setAttributesFromCmdLine()\n- i.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/YassClusterLauncher.py --- a/commons/launcher/YassClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,78 +0,0 @@ -#!/usr/bin/env python - -##@file -# Launch YassProgramLauncher on several files in parallel on a cluster. - - -from pyRepet.launcher.AbstractClusterLauncher import * -from commons.core.coord.AlignUtils import AlignUtils -from commons.launcher.YassProgramLauncher import YassProgramLauncher -from commons.tools import srptBlasterMatcher - - -class YassClusterLauncher( AbstractClusterLauncher ): - """ - Launch Yass on several files in parallel on a cluster. - """ - - def __init__( self ): - """ - Constructor. - """ - AbstractClusterLauncher.__init__( self ) - AbstractClusterLauncher.setAcronym( self, "Yass" ) - - self._cmdLineSpecificOptions = "s:p:A" - - self._exeWrapper = "YassProgramLauncher.py" - self._prgLauncher = None - self._prgLauncher = self.getProgramLauncherInstance() - - - def getSpecificHelpAsString( self ): - """ - Return the specific help as a string. - """ - string = "" - string += "\nspecific options:" - string += "\n -s: name of the subject file (format='fasta')" - string += "\n -p: parameters for 'yass'" - string += "\n -Z: concatenate output files" - string += "\n -A: same sequences (all-by-all)" - return string - - - def getSubjectFile( self ): - return self._prgLauncher.getSubjectFile() - - - def getProgramParameters( self ): - return self._prgLauncher.getProgramParameters() - - - def getProgramLauncherInstance( self ): - if self._prgLauncher == None: - self._prgLauncher = YassProgramLauncher() - self._prgLauncher.setInputFile( GENERIC_IN_FILE ) - self._prgLauncher.setClean() - self._prgLauncher.setVerbosityLevel( 1 ) - self._prgLauncher.setListFilesToKeep() - self._prgLauncher.setListFilesToRemove() - return self._prgLauncher - - - def processOutputFile( self, tmpFile, outFile ): - sortFile = "%s.sort" % ( tmpFile ) - AlignUtils.sortAlignFile( tmpFile, sortFile ) - if self._prgLauncher.getAllByAll(): - srptBlasterMatcher.filterRedundantMatches( sortFile, - outFile ) - os.remove( sortFile ) - else: - os.rename( sortFile, outFile ) - - -if __name__ == "__main__": - i = YassClusterLauncher() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/YassProgramLauncher.py --- a/commons/launcher/YassProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,195 +0,0 @@ -#!/usr/bin/env python - -##@file -# Launch Yass (pairwise alignment). -# -# options: -# -h: this help -# -i: name of the input file (queries, format='fasta') -# -s: name of the subject file (format='fasta') -# -p: parameters for 'yass' (default='-d 2') -# -o: name of the output file (format='align', default=inFile+'.align') -# -c: clean -# -v: verbosity level (default=0/1) - - -import os -import sys - -from pyRepet.launcher.AbstractProgramLauncher import AbstractProgramLauncher - - -class YassProgramLauncher( AbstractProgramLauncher ): - """ - Launch Yass (pairwise alignment). - """ - - def __init__( self ): - """ - Constructor. - """ - AbstractProgramLauncher.__init__( self ) - self._prgName = "yass" - self._formatInFile = "fasta" - self._sbjFile = "" - self._prgParam = "" - self._allByAll = False - self._cmdLineSpecificOptions = "s:p:Ao:" - - - def getSpecificHelpAsString( self ): - """ - Return the specific help as a string. - """ - string = "" - string += "\nspecific options:" - string += "\n -s: name of the subject file (format='fasta')" - string += "\n -p: parameters for '%s'" % ( self.getProgramName() ) - string += "\n -A: same sequences (all-by-all)" - string += "\n -o: name of the output file (format='align', default=inFile+'.align')" - return string - - - def setASpecificAttributeFromCmdLine( self, o, a="" ): - """ - Set a specific attribute from the command-line arguments. - """ - if o =="-s": - self.setSubjectFile( a ) - elif o == "-p": - self.setProgramParameters( a ) - elif o == "-A": - self.setAllByAll() - elif o == "-o": - self.setOutputFile( a ) - - - def setSubjectFile( self, arg ): - self._sbjFile = arg - - - def getSubjectFile( self ): - return self._sbjFile - - - def setAllByAll( self ): - self._allByAll = True - - - def getAllByAll( self ): - return self._allByAll - - - def checkSpecificAttributes( self ): - """ - Check the specific attributes before running the program. - """ - if self._sbjFile == "": - string = "ERROR: missing subject file (-s)" - print string - print self.getHelpAsString() - sys.exit(1) - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - - - def setWrapperCommandLine( self ): - """ - Set the command-line of the wrapper. - Required for YassClusterLauncher. - """ - self._wrpCmdLine = self.getWrapperName() - self._wrpCmdLine += " -i %s" % ( self.getInputFile() ) - self._wrpCmdLine += " -s %s" % ( self.getSubjectFile() ) - if self.getProgramParameters() != "": - self._wrpCmdLine += " -p '%s'" % ( self.getProgramParameters() ) - if self.getAllByAll(): - self._wrpCmdLine += " -A" - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - self._wrpCmdLine += " -o %s" % ( self.getOutputFile() ) - if self.getClean(): - self._wrpCmdLine += " -c" - self._wrpCmdLine += " -v %i" % ( self.getVerbosityLevel() ) - - - def setProgramCommandLine( self ): - """ - Set the command-line of the program. - """ - self._prgCmdLine = self.getProgramName() - self._prgCmdLine += " -d 2" - if self.getProgramParameters() != "": - self._prgCmdLine += " %s" % ( self.getProgramParameters() ) - self._prgCmdLine += " -o %s.blast" % ( self.getInputFile() ) - self._prgCmdLine += " %s" % ( self.getInputFile() ) - self._prgCmdLine += " %s" % ( self.getSubjectFile() ) - - - def setListFilesToKeep( self ): - """ - Set the list of files to keep. - """ - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - self.appendFileToKeep( self.getOutputFile() ) - - - def setListFilesToRemove( self ): - """ - Set the list of files to remove. - """ - pass - - - def convertBlastIntoAlign( self ): - """ - Convert a 'blast' file into the 'align' format. - """ - cmd = os.environ["REPET_PATH"] + "/bin/blast2align.py" - cmd += " -i %s.blast" % ( self.getInputFile() ) - cmd += " -o %s" % ( self.getOutputFile() ) - exitStatus = os.system( cmd ) - if exitStatus != 0: - string = "ERROR while converting 'blast' file into 'align' format" - print string - sys.exit(1) - - - def setSummary( self ): - self._summary = "input file: %s" % ( self.getInputFile() ) - self._summary += "\nsubject file: %s" % ( self.getSubjectFile() ) - self._summary += "\nparameters: %s" % ( self.getProgramParameters() ) - if self.getAllByAll(): - self._summary += "\nall-by-all" - if self.getOutputFile() == "": - self.setOutputFile( "%s.align" % ( self.getInputFile() ) ) - self._summary += "\noutput file: %s" % ( self.getOutputFile() ) - - - def run( self ): - """ - Run the program. - """ - self.start() - - self.setProgramCommandLine() - cmd = self.getProgramCommandLine() - if self.getVerbosityLevel() > 0: - print "LAUNCH: %s" % ( cmd ) - sys.stdout.flush() - exitStatus = os.system( cmd ) - if exitStatus != 0: - string = "ERROR: program '%s' returned exit status '%i'" % ( self.getProgramName(), exitStatus ) - print string - sys.exit(1) - - self.convertBlastIntoAlign() - - self.end() - - -if __name__ == "__main__": - i = YassProgramLauncher() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/launchBlasterMatcherPerQuery.py --- a/commons/launcher/launchBlasterMatcherPerQuery.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,196 +0,0 @@ -#!/usr/bin/env python - -""" -This program splits the input fasta file in a given number of files, launch Blaster and/or Matcher on them in parallel and collect the results afterwards. -""" - -import os -import sys -import getopt -import exceptions -import logging -import ConfigParser - -if not os.environ.has_key( "REPET_PATH" ): - print "*** Error: no environment variable REPET_PATH" - sys.exit(1) -sys.path.append( os.environ["REPET_PATH"] ) - -import pyRepet.launcher.programLauncher -import pyRepet.seq.fastaDB - -#----------------------------------------------------------------------------- - -def help(): - - """ - Give the list of the command-line options. - """ - - print "usage:",sys.argv[0]," [ options ]" - print "options:" - print " -h: this help" - print " -q: fasta filename of the queries" - print " -s: fasta filename of the subjects (same as queries if not specified)" - print " -Q: queue name on the cluster" - print " -d: absolute path to the temporary directory" - print " -C: configuration file" - print " -n: max. number of jobs (default=10,given a min. of 1 query per job)" - print " -m: mix of Blaster and/or Matcher" - print " 1: launch Blaster only" - print " 2: launch Matcher only (on '*.align' query files)" - print " 3: launch Blaster+Matcher in the same job (default)" - print " -B: parameters for Blaster (e.g. \"-a -n tblastx\")" - print " -M: parameters for Matcher (e.g. \"-j\")" - print " -Z: collect all the results into a single file (format 'align', 'path' or 'tab')" - print " -c: clean" - print " -v: verbose (default=0/1/2)" - -#----------------------------------------------------------------------------- - -def main(): - - """ - This program splits the input fasta file in a given number of files, launch Blaster and/or Matcher on them in parallel and collect the results afterwards. - """ - - qryFileName = "" - sbjFileName = "" - queue = "" - tmpDir = "" - configFileName = "" - maxNbJobs = 10 - minQryPerJob = 1 - mix = "3" - paramBlaster = "" - paramMatcher = "" - collectFormat = "" - clean = False - verbose = 0 - - try: - opts, args = getopt.getopt(sys.argv[1:],"hq:s:Q:d:C:n:m:B:M:Z:cv:") - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-q": - qryFileName = a - elif o == "-s": - sbjFileName = a - elif o == "-Q": - queue = a - elif o == "-d": - tmpDir = a - elif o == "-C": - configFileName = a - elif o == "-n": - maxNbJobs = int(a) - elif o == "-m": - mix = a - elif o == "-B": - paramBlaster = a - elif o == "-M": - paramMatcher = a - elif o == "-Z": - collectFormat = a - elif o == "-c": - clean = True - elif o == "-v": - verbose = int(a) - - if qryFileName == "" or configFileName == "" or collectFormat == "": - print "*** Error: missing compulsory options" - help() - sys.exit(1) - - if verbose > 0: - print "\nbeginning of %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - if not os.path.exists( qryFileName ): - print "*** Error: query file '%s' doesn't exist" % ( qryFileName ) - sys.exit(1) - if sbjFileName != "": - if not os.path.exists( sbjFileName ): - print "*** Error: subject file '%s' doesn't exist" % ( sbjFileName ) - sys.exit(1) - else: - sbjFileName = qryFileName - - pL = pyRepet.launcher.programLauncher.programLauncher() - - nbSeqQry = pyRepet.seq.fastaDB.dbSize( qryFileName ) - qryPerJob = nbSeqQry / float(maxNbJobs) - - # split the input query file in single files into a new directory - prg = os.environ["REPET_PATH"] + "/bin/dbSplit.py" - cmd = prg - cmd += " -i %s" % ( qryFileName ) - if qryPerJob <= 1.0: - cmd += " -n %i" % ( minQryPerJob ) - else: - cmd += " -n %i" % ( qryPerJob + 1 ) - cmd += " -d" - pL.launch( prg, cmd ) - - # prepare the subject databank - if sbjFileName != qryFileName: - prg = "blaster" - cmd = prg - cmd += " -q %s" % ( sbjFileName ) - cmd += " -P" - pL.launch( prg, cmd ) - - # launch Blaster+Matcher in parallel - prg = "srptBlasterMatcher.py" - cmd = prg - cmd += " -g %s_vs_%s" % ( qryFileName, sbjFileName ) - cmd += " -q %s/batches" % ( os.getcwd() ) - cmd += " -s %s/%s" % ( os.getcwd(), sbjFileName ) - cmd += " -Q '%s'" % ( queue ) - if tmpDir != "": - cmd += " -d %s" % ( tmpDir ) - cmd += " -m %s" % ( mix ) - if paramBlaster != "": - cmd += " -B \"%s\"" % ( paramBlaster ) - if paramMatcher != "": - cmd += " -M \"%s\"" % ( paramMatcher ) - cmd += " -Z %s" % ( collectFormat ) - cmd += " -C %s" % ( configFileName ) - if clean == True: - cmd += " -c" - cmd += " -v %i" % ( verbose - 1 ) - pL.launch( prg, cmd ) - - suffix = "" - if mix in ["2","3"]: - if "-a" in paramMatcher: - suffix = "match.%s" % ( collectFormat ) - else: - suffix = "clean_match.%s" % ( collectFormat ) - os.system( "mv %s_vs_%s.%s %s_vs_%s.align.%s" % ( qryFileName, sbjFileName, collectFormat, qryFileName, sbjFileName, suffix ) ) - - # clean - if clean == True: - prg = "rm" - cmd = prg - cmd += " -rf batches formatdb.log %s_cut* %s.Nstretch.map" % ( sbjFileName, sbjFileName ) - pL.launch( prg, cmd ) - - if verbose > 0: - print "%s finished successfully\n" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - -#---------------------------------------------------------------------------- - -if __name__ == '__main__': - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/launchMafft.py --- a/commons/launcher/launchMafft.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,104 +0,0 @@ -#!/usr/bin/env python - -# DEPRECATED - -import user, os, sys, getopt, exceptions - -if not os.environ.has_key( "REPET_PATH" ): - print "*** Error: no environment variable REPET_PATH" - sys.exit(1) -sys.path.append( os.environ["REPET_PATH"] ) - -import pyRepet.launcher.programLauncher -import pyRepet.seq.fastaDB -from pyRepet.seq.BioseqDB import * - -#------------------------------------------------------------------------------ - -def help(): - - print "DEPRECATED" - print "usage: ",sys.argv[0],"[ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (format='fasta')" - print " -o: name of the output file (default=inFileName+'.fa_aln')" - print " -v: verbose (default=0/1)" - -#------------------------------------------------------------------------------ - -def main(): - - """ - This program launches MAFFT to build a multiple sequence alignment. - """ - - inFileName = "" - outFileName = "" - verbose = 0 - - try: - opts,args=getopt.getopt(sys.argv[1:],"hi:o:v:") - except getopt.GetoptError: - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-o": - outFileName = a - elif o == "-v": - verbose = int(a) - - if inFileName == "": - print "*** Error: missing compulsory options" - help() - sys.exit(1) - - if verbose > 0: - print "beginning of %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - if verbose > 0: - print "build a multiple alignment from '%s'..." % ( inFileName ) - sys.stdout.flush() - - pyRepet.seq.fastaDB.shortenSeqHeaders( inFileName ) - - bsDB = BioseqDB( inFileName+".shortH" ) - bsDB.upCase() - bsDB.save( inFileName+".shortHtmp" ) - del bsDB - os.rename( inFileName+".shortHtmp", inFileName+".shortH" ) - - pL = pyRepet.launcher.programLauncher.programLauncher( inFileName+".shortH" ) - pL.launchMafft( outFileName=inFileName+".shortH.fa_aln", verbose=verbose ) - - pyRepet.seq.fastaDB.retrieveInitSeqHeaders( inFileName+".shortH.fa_aln", - inFileName+".shortHlink", - inFileName+".shortH.fa_aln.initH", - verbose-1 ) - - if outFileName == "": - outFileName = "%s.fa_aln" % ( inFileName ) - os.system( "mv %s.shortH.fa_aln.initH %s" % ( inFileName, outFileName ) ) - - for f in [inFileName+".shortH",inFileName+".shortH.fa_aln",inFileName+".shortHlink"]: - os.remove( f ) - - if verbose > 0: - print "%s finished successfully" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - -#------------------------------------------------------------------------------ - -if __name__ == '__main__': - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/launchMreps.py --- a/commons/launcher/launchMreps.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,140 +0,0 @@ -#!/usr/bin/env python - -from commons.core.seq.BioseqDB import BioseqDB -from commons.core.parsing.MrepsToSet import MrepsToSet -import subprocess -import os -import sys -import getopt - -def help(): - """ - Give the list of the command-line options. - """ - print "usage: ",sys.argv[0],"[ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (format='fasta')" - print " -o: name of the output file (default=inFileName+'.Mreps.set')" - print " -f: error filter (default=1.0)" - print " -c: clean" - print " -v: verbosity level (default=0/1)" - -def main(): - """ - Launch Mreps. - """ - inFileName = "" - outFileName = "" - errorFilter = 1.0 - clean = False - verbose = 0 - - try: - opts=getopt.getopt(sys.argv[1:],"hi:o:f:cv:")[0] - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-o": - outFileName = a - elif o == "-f": - errorFilter = float(a) - elif o == "-c": - clean = True - elif o == "-v": - verbose = int(a) - - if inFileName == "": - print "ERROR: missing compulsory options" - help() - sys.exit(1) - - if verbose > 0: - print "beginning of %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - # Mreps 2.5 doesn't fully support IUPAC nomenclature - if verbose > 0: - print "* check IUPAC symbols"; sys.stdout.flush() - tmpInFileName = "%s.tmp%i" % ( inFileName, os.getpid() ) - if os.path.exists( tmpInFileName ): - os.system( "rm -f %s" % ( tmpInFileName ) ) - bsDB = BioseqDB( inFileName ) - for bs in bsDB.db: - if verbose > 0: - print bs.header; sys.stdout.flush() - bs.partialIUPAC() - onlyN = True - for nt in ["A","T","G","C"]: - if nt in bs.sequence: - onlyN = False - if onlyN == True: - if verbose > 0: - print "** Warning: only Ns"; sys.stdout.flush() - else: - bsDB.save( tmpInFileName ) - - if not os.path.exists( tmpInFileName ): - sys.exit(0) - - if verbose > 0: - print "* remove N stretches"; sys.stdout.flush() - prg = os.environ["REPET_PATH"] + "/bin/cutterDB" - cmd = prg - cmd += " -l 200000" - cmd += " -o 0" - cmd += " -w 11" - cmd += " %s" % ( tmpInFileName ) - if verbose > 0: - print cmd; sys.stdout.flush() - log = os.system( cmd ) - if log != 0: - print "ERROR: %s returned %i" % ( prg, log ) - sys.exit(1) - - # launch Mreps on the input file - MrepsOutFileName = "%s.Mreps.xml" % ( tmpInFileName ) - prg = "mreps" - cmd = prg - cmd += " -res 3" - cmd += " -exp 3.0" - cmd += " -maxsize 50" - cmd += " -xmloutput %s" % MrepsOutFileName - cmd += " -fasta %s_cut" % tmpInFileName - process = subprocess.Popen(cmd, shell = True) - process.communicate() - if process.returncode != 0: - raise Exception("ERROR when launching '%s'" % cmd) - - if outFileName == "": - outFileName = inFileName + ".Mreps.set" - - # parse Mreps results in xml format - iMrepsToSet = MrepsToSet(inFileName, MrepsOutFileName, outFileName, errorFilter) - iMrepsToSet.run() - if clean: - iMrepsToSet.clean() - - # remove temporary input filename - os.remove(tmpInFileName) - os.remove("%s_cut" % tmpInFileName) - os.remove("%s.Nstretch.map" % tmpInFileName) - - if verbose > 0: - print "%s finished successfully\n" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - - -if __name__ == '__main__': - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/launchPhyML.py --- a/commons/launcher/launchPhyML.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,87 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import getopt - -from pyRepet.launcher.programLauncher import programLauncher -from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders - - -def help(): - print "usage: ",sys.argv[0],"[ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (aligned fasta)" - print " -c: clean" - print " -v: verbose (default=0)" - - -def main(): - - inFileName = "" - clean = False - verbose = 0 - try: - opts,args=getopt.getopt(sys.argv[1:],"hi:cv:") - except getopt.GetoptError, err: - print str(err) - help(); sys.exit(1) - for o,a in opts: - if o == "-h": - help(); sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-c": - clean = True - elif o == "-v": - verbose = int(a) - if inFileName == "": - print "ERROR: missing compulsory options" - help(); sys.exit(1) - - if verbose > 0: - print "START %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - csh = ChangeSequenceHeaders() - csh.setInputFile( inFileName ) - csh.setFormat( "fasta" ) - csh.setStep( 1 ) - csh.setPrefix( "seq" ) - csh.setLinkFile( inFileName+".shortHlink" ) - csh.setOutputFile( inFileName+".shortH" ) - csh.run() - - pL = programLauncher( inFileName+".shortH" ) - - pL.launchSreformat( outFormat="phylip", outFileName=inFileName+".shortH.phylip", verbose=verbose ) - - pL.reset( inFileName+".shortH.phylip" ) - - pL.launchPhyML( verbose=verbose ) - - csh.setInputFile( inFileName+".shortH.phylip_phyml_tree.txt" ) - csh.setFormat( "newick" ) - csh.setStep( 2 ) - csh.setLinkFile( inFileName+".shortHlink" ) - csh.setOutputFile( inFileName+"_phyml.newick" ) - csh.run() - - if clean: - for f in [ inFileName+".shortH", inFileName+".shortHlink", inFileName+".shortH.phylip", - inFileName+".shortH.phylip_phyml_lk.txt", inFileName+".shortH.phylip_phyml_tree.txt" ]: - os.remove( f ) - os.system( "mv %s.shortH.phylip_phyml_stat.txt %s_phyml.txt" % ( inFileName, inFileName ) ) - - if verbose > 0: - print "END %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/launchPrank.py --- a/commons/launcher/launchPrank.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,85 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import getopt - -from pyRepet.launcher.programLauncher import programLauncher - - -def help(): - print "usage: launchPrank.py [ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (format=fasta)" - print " -o: name of the output file (format=aligned fasta, default='inFileName'+fa_aln)" - print " -P: Prank's parameters" - print " -c: clean" - print " -v: verbose (default=0/1)" - - -def main(): - """ - Launch PRANK. - """ - inFileName = "" - outFileName = "" - parameters = "" - clean = False - verbose = 0 - - try: - opts, args = getopt.getopt( sys.argv[1:], "hi:o:P:cv:" ) - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-o": - outFileName = a - elif o == "-P": - parameters = a - elif o == "-c": - clean = True - elif o == "-v": - verbose = int(a) - - if inFileName == "": - print "ERROR: missing input file (-i)" - help() - sys.exit(1) - - if not os.path.exists( inFileName ): - print "ERROR: can't find file '%s'" % ( inFileName ) - help() - sys.exit(1) - - if verbose > 0: - print "START %s" % ( sys.argv[0].split("/")[-1] ) - sys.stdout.flush() - - if outFileName == "": - outFileName = "%s.fa_aln" % ( inFileName ) - - pL = programLauncher( inFileName ) - returnStatus = pL.launchPrank( outFileName, parameters, "yes", verbose ) - if returnStatus != 0: - print "ERROR: launchPrank() returned '%i'" % ( returnStatus ) - sys.exit(1) - - if verbose > 0: - print "END %s" % ( sys.argv[0].split("/")[-1] ) - sys.stdout.flush() - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/launchTCoffee.py --- a/commons/launcher/launchTCoffee.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,78 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import getopt -import exceptions - -if not os.environ.has_key( "REPET_PATH" ): - print "ERROR: no environment variable REPET_PATH" - sys.exit(1) -sys.path.append( os.environ["REPET_PATH"] ) - -from pyRepet.launcher.programLauncher import programLauncher - - -def help(): - print "usage: ",sys.argv[0],"[ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (format='fasta')" - print " -P: parameters" - print " -o: name of the output file (format='aligned fasta', default='inFileName'+fa_aln)" - print " -c: clean" - print " -v: verbosity level (default=0/1)" - - -def main(): - - inFileName = "" - parameters = "" - outFileName = "" - clean = False - verbose = 0 - - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:P:o:cv:") - except getopt.GetoptError, err: - print str(err); help(); sys.exit(1) - for o,a in opts: - if o == "-h": - help(); sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-P": - parameters = a - elif o == "-o": - outFileName = a - elif o == "-c": - clean = True - elif o == "-v": - verbose = "yes" - - if inFileName == "" and parameters == "": - print "ERROR: missing compulsory options" - help() - sys.exit(1) - - if outFileName == "": - outFileName = "%s.fa_aln" % ( inFileName ) - - if verbose > 0: - print "START %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - pL = programLauncher( inFileName ) - pL.launchTcoffee( outFileName, parameters ) - - if verbose > 0: - print "END %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/launchTEclass.py --- a/commons/launcher/launchTEclass.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,138 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import getopt -import glob -import shutil - - -def help(): - print "usage: %s [ options ]" % ( sys.argv[0].split("/")[-1] ) - print "options:" - print " -h: this help" - print " -i: name of the input file (format='fasta')" - print " -o: name of the output file (format='map', default=inFileName+'.map')" - print " -c: clean" - print " -v: verbosity level (default=0/1)" - -def parseFastaFileFromTEclass( inFile, outFile, verbose=0 ): - tmpHandler = open( inFile, "r" ) - outHandler = open( outFile, "w" ) - dClassif2Count = {} - header = "" - classif = "" - while True: - line = tmpHandler.readline() - if line == "": - break - if line[0] == ">": - header = line[1:].split("|")[0] - classif = line[1:-1].split(": ")[1].split("|")[0] - if not dClassif2Count.has_key( classif ): - dClassif2Count[ classif ] = 0 - dClassif2Count[ classif ] += 1 - else: - seqLength = len(line[:-1]) - outHandler.write( "%s\t%s\t%i\t%i\n" % ( classif, header, 1, seqLength ) ) - tmpHandler.close() - outHandler.close() - if verbose > 0: - for classif in dClassif2Count.keys(): - print "%s: %i sequences" % ( classif, dClassif2Count[ classif ] ) - sys.stdout.flush() - - -def main(): - """ - Launch TEclass to classify TE sequences. - """ - inFileName = "" - outFileName = "" - clean = False - verbose = 0 - - try: - opts, args = getopt.getopt( sys.argv[1:], "hi:o:cv:" ) - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-o": - outFileName = a - elif o == "-c": - clean = True - elif o == "-v": - verbose = int(a) - - if inFileName == "": - print "ERROR: missing input file (-i)" - help() - sys.exit(1) - if not os.path.exists( inFileName ): - print "ERROR: can't find input file '%s'" % ( inFileName ) - help() - sys.exit(1) - if outFileName == "": - outFileName = "%s.TEclass.map" % ( inFileName ) - - if verbose > 0: - print "START %s" % ( sys.argv[0].split("/")[-1] ) - sys.stdout.flush() - - if verbose > 0: - print "launch TEclass..." - sys.stdout.flush() - prg = "test_consensi_2.1.pl" - cmd = prg - cmd += " %s" % ( inFileName ) - returnValue = os.system( cmd ) - if returnValue != 0: - print "ERROR: '%s' returned %i" % ( prg, returnValue ) - sys.exit(1) - - lOut1 = glob.glob( "%s_*" % ( inFileName ) ) - outDir = "" - for i in lOut1: - if os.path.isdir( i ): - lOut2 = glob.glob( "%s/*" % ( i ) ) - if len(lOut2) == 4 and "%s/%s.lib" % ( i, inFileName ) in lOut2: - outDir = i - break - if outDir == "": - print "ERROR: can't find output directory" - sys.exit(1) - os.chdir( outDir ) - - if verbose > 0: - print "parse the results..." - sys.stdout.flush() - parseFastaFileFromTEclass( "%s.lib" % ( inFileName ), - outFileName, - verbose ) - os.system( "mv %s .." % ( outFileName ) ) - os.chdir( ".." ) - - if clean: - if verbose > 0: - print "clean the temporary files..." - sys.stdout.flush() - shutil.rmtree( outDir ) - - if verbose > 0: - print "END %s" % ( sys.argv[0].split("/")[-1] ) - sys.stdout.flush() - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/MockDataBankForBlat.py --- a/commons/launcher/tests/MockDataBankForBlat.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b"@@ -1,299 +0,0 @@\n-class MockDataBankForBlat(object):\n-\t\n-\tdef write(self, inFileName):\n-\t\tf = open(inFileName, 'w')\n-\t\tf.write('>Vein_ctg_2286\\n')\n-\t\tf.write('AGCAAAAaCGTATTTTCTAAGCTAAAATTTAGCGTAGAAGCTTGGACTCGCTtATTTTTT\\n')\n-\t\tf.write('ATCCTAGGAATTAGTAGAATCTCTCTATAAATATTTATTTTTTATCCGCGCAAAGCTAGG\\n')\n-\t\tf.write('AAACTATAGAATCTTATATATTAGTATATTCTAGCGATTATCTAGAGATTGTaGGGGGGG\\n')\n-\t\tf.write('ggAAAGGTAGTAATAGGCGTGTAAGAGAGATAAAGAGTTtATCTTAGAATCTCCCTACGC\\n')\n-\t\tf.write('CAAGCGAGATTCCTAAGGTAAGAATCCTAAGGTAAAGAATCTAAGCGAGAATTTAGAATC\\n')\n-\t\tf.write('ACGTGCTCGCTTCCTACTACCGTAATTTTACGGTTATAGAGTACGACAGTTCCTATATAT\\n')\n-\t\tf.write('AACCTATACTTATAACAACGAATATAaTATAAGACGTTAATTTGATTTTTTACCGTGTTA\\n')\n-\t\tf.write('CTTATAATAAGGTGTCCCAAAGTTGTTCGAATTTTTTTTGTCCAAGATTGAATACGGTGT\\n')\n-\t\tf.write('TGGTCATGTGATAGTATTTTCACGGTATTTAAACGGAAATTTTACCTACGGCCCCCcGCC\\n')\n-\t\tf.write('TATGTACATCATGAGGATGCACGATGGAGATGAAATGCTTCGTTTCATACTGAGTGGCCG\\n')\n-\t\tf.write('ATTGATGGACGCGTGAACGTCAAAGTAACTTCCATTTGTTTCCTGTCGTTGTCCGGTAGC\\n')\n-\t\tf.write('CTGGCAAATAGTGACATGTTTGATGTCTTTGGAACAGGGTGGAAACTTTTTTTGGGTtGC\\n')\n-\t\tf.write('AAATCGTCAAGAGTCACGTGTCCACACAGTGGCGCAAGTGGGGGCTTAAAATGGTGGACT\\n')\n-\t\tf.write('TGCGCGAGGGCGATTTCTTTTCTTCCCCAACCACAATCTATCGTGATCAAAGAAGCACCC\\n')\n-\t\tf.write('ATCCGGTTGTTGAGGTATGCCAGCCAGCATCCAATGATGCGCTCAAACAACAACTAACTC\\n')\n-\t\tf.write('TCATACAGATCGCCATGCAGATTTTCGTGAAGACCCTCACGGGCAAGACTATCACCCTcG\\n')\n-\t\tf.write('AGGTGGAGTCCTCCGACACCATTGACAATGTCAAGACCAAGATTCAGGGTACGTGGCCTC\\n')\n-\t\tf.write('GCGCAAGCATTTGTAACCATCTTCTAACCCTCTGCCGTAGACAAGGAAGgAATCCCCCCA\\n')\n-\t\tf.write('GACCAGCAGCGCTTGATCTTCGCCGGCAAGCAGCTCGAAGATGGACGCACCCTATCGGAC\\n')\n-\t\tf.write('TACAACATCCAGAAGGAGTCGACCCTCCACCTCGTCCTCCGACTCCGTGGTGGTATGGCC\\n')\n-\t\tf.write('AAGAaGCGCAAGAAGAAGGTCTACACCACCCcAAAGAaGATCAAGCACAAGCGCAAGAaG\\n')\n-\t\tf.write('ACCAAGTTGGCTGTCcTCAAGTACTACAAGGTGGATGGCGATGGAAAgaTCGAGcGCcTC\\n')\n-\t\tf.write('CGACGAGAGTGCCcAGCTGACGAGTGTGGTgCCGGTgTCTTCATGGCTGCCATGCACAAC\\n')\n-\t\tf.write('CGtcAATACTGCGGAAAGTGCCACCTCACCtACGTTTTCGACGAGAGCAAGTAGACGGTT\\n')\n-\t\tf.write('CTGGAAAGCATACAATGACAACCATGATTATGCTGTGGGATGATGGATGCTGAACAAAGG\\n')\n-\t\tf.write('GAGGGAATAGCGACGGACACCGCGTTCTGTAGCTACACAATCAAGCAAAACCTTCACCTC\\n')\n-\t\tf.write('GATAGCGGGCCTCGATCCATGTACTATCTTATGATATGTGACATTGAATGTGCGAGTGTT\\n')\n-\t\tf.write('CATTATTCTTTCGCCGTAGCTTCGTTCTCTCTGTGTTCACCCAACCTCCAAGAATCCCGA\\n')\n-\t\tf.write('CAGTTTCTGGCGATGTTCAAGAATGATATTGCCAGAAATTTATCGGTACCGAACCCTAGA\\n')\n-\t\tf.write('TAAAAGGATGGGTTCGGAGTTAACGTAATTTCGAAGGGCAGATGCCATGTGCTTGGGTGC\\n')\n-\t\tf.write('CGCGTTACGAGAATTACTATGATGGTGCTGTGTATCTTCACAATGGCAACATGGCAGAAC\\n')\n-\t\tf.write('AACGCCAAGAAGTTTCTCCAATGTCAACCCAAGGTCTCCGGACGAATCTAGATGCACCCT\\n')\n-\t\tf.write('GACTGCATCGTTATCGGTCATGCAAAAGCACGCCTAATGTGCAGCGTGATGACAAGGTGG\\n')\n-\t\tf.write('AAAaGGAGGCAAATGCTGGTCTAGTGTCTTGTGGCAGAAGTCAGAGTCACGATGAGCAAG\\n')\n-\t\tf.write('CATGGCGCATGAGGGTTGCCTCCGCAAGCATCCGACAGAGTAGAGACAGAGAAAACACCA\\n')\n-\t\tf.write('CAGCAAAAGATGTCACGGCACTCTCGATTCGCTTGTGACGGCCAAGTCTAGGTCCAGGTC\\n')\n-\t\tf.write('CAGGTCCAGGATACGGATACAAGGCGAATGTGGACACCCCAGCCTCCCGATTAGGGAACT\\n')\n-\t\tf.write('ATACAGCGGGCTGGGTTTATGAATAATGAATCCAATTGCAGCATGAGATCATAGCGTTTG\\n')\n-\t\tf.write('TCTAAGAGGCTTTTTGCTACTGTACATGGCGATTGGCGAGTGTTGGGGGTTAGGTGAGAC\\n')\n-\t\tf.write('GGTCTTGGCTGGCAACCCTGTGAGCGCAAAGATGGAGAAGGGAATGGCAGGCGATCAGGA\\n')\n-\t\tf.write('CGATTGTTTCATGGATGAGCAATGGGCATCTCAAaGAAACACGGATCGTTTCTGATGGAC\\n')\n-\t\tf.write('AGACGGGCCAAGACTGACCAAGCATTTGTGAAATTGGGACAGGAGAAGGGATGGTGGCTT\\n')\n-\t\tf.write('CGACGTGCTGCAGCTGCATACTGTGTAGCTGCGTGTTGATAGCTGCACAACTGCATTGGC\\n')\n-\t\tf.write('TCGACCAGACACATTCCCGGAGCGTTATGCATCCAGCGCCTGATTCGCTTGGGACTTGGG\\n')\n-\t\tf.write('TCGCGACTCGCGAGAGAATTGGTACTCGTAGTCGGTACCTAAGCTGCACCTTGTCCCCGA\\n')\n-\t\tf.write('AGTAGACTGTCGAGACTGTATAGtAGAGGTCGAGGTATATTCTATGCTATACTGTACATT\\n')\n-\t\tf.write('ATTGAAGTGCTCCCATCATATCACCAACCCTCCCGCCTCGTCTTCCATGTCcGTTTCCGC\\n')\n-\t\tf.write('CTTCACATTTCAAAAAGTCGTTGAGTGGTCCTAGTGCTCAATTAAATTGCTTACCAGAGC\\n')\n-\t\tf.write('GTCAGAGCTCTCCTGGAGTCCTGGCAAAAGCCAaaGCTCAACGACCAATTGCCCCATCCT\\n')\n-\t\tf.write('CTCTCCTACCGAGTACTCCGTACCGCTCATCTCGTCAACCACCACCGCAGACAACAATCG\\n')\n-"..b"CCA\\n')\n-\t\tf.write('AAAATTGGGCGCTTTGAAAAAACGGAACTTCCCTATCTCTTAGGATCGACTAACCCTGGA\\n')\n-\t\tf.write('CCAACTGATGTTCTCCAGGAACCTTTCTCCACTTCAGTCTTCAAAGTTCTCATTTGAATA\\n')\n-\t\tf.write('TTTGCTACTACCACCAAGATCTGCACTAGAGGCTGTTTCACTCCGGTTCACACCAAGAGC\\n')\n-\t\tf.write('TTCTTAACAGTTTATAAAAACCTCCACGCCTGCCTACTCGTTATTGCTTCGCTTTTACAA\\n')\n-\t\tf.write('TAACGGCAGAGTATGGGTAACACGCTTAAGCGCCATCCATTTTCAGGGctAGTTCATTCG\\n')\n-\t\tf.write('GCAGGTGAGTTGTTACACACTCCTTAGCGGATTCCGACTTCCATGGCCACCGTCCTGCTG\\n')\n-\t\tf.write('TCTAGATGAACTAACACCTTTTGTGGTGTCTGATGAGCGTGTATTCCGGCACCTTAACTC\\n')\n-\t\tf.write('TGCGTTCGGTTCATCCCGCATCGCCAGTTCTGCTTACCAAAAaTGGCCCACTAGAAACTC\\n')\n-\t\tf.write('TGCATTCAATGACCTGCTTCAATTAAGCAAACAGGTCGTCTTACATATTTAAAGTTTGAG\\n')\n-\t\tf.write('AGTGGTTGAAGGGCGTTTAGCCCCCCGAGACCCCAATCATTCGCTTTACCACATAAAACT\\n')\n-\t\tf.write('GCGTATAAGTTTCTGCTATCCTGAGGGAAACTTCGGCAGGAACCAGCTACTAGATGGTTC\\n')\n-\t\tf.write('GATTAGtCTTTcGCCCCTATaCCCAAATTTGACGATCGATTTGCACGTCAGAATCGCTAC\\n')\n-\t\tf.write('GAGCCTCCACCAGAGTTTCCTCTGGCTTCACCCTATTCAGGCATAGTTCACCATCTTTCG\\n')\n-\t\tf.write('GGTCCCATCATTAGTGCTTTGTCTCGGTCAATTCAGTATAAAACGTCAGCGCCGGACGAT\\n')\n-\t\tf.write('ACTGCCTCCTTAATGGATTCGTATCAATCAGTTTCCTTACGCATATGGGTTTGGCACCCA\\n')\n-\t\tf.write('AATACTCGCACTAATGGTGGACTCCTTGGTCCGTGTTTCAAGACGGGTCATTTAGAGTCA\\n')\n-\t\tf.write('TTAAGCCAACAACCTAAGCGAATAGAAGTATAACCAAAAAGATCAACCTTGATACCGTAG\\n')\n-\t\tf.write('TACCTCAGAAAACCTTCCTGGAAAACTCGCCAATAAGCATTCGCTGCGTTCCTCAATCCA\\n')\n-\t\tf.write('ACCCAAGGTATTTTCTAAGGGACTATAACACCCACAAGTGGGCCACATTTCCCCTAGTTT\\n')\n-\t\tf.write('TTTCCCTCAAGTCAAATTGTCGTTGGCAGGCATAGCCTGCAAGTGCATCCAGGCCGAAGC\\n')\n-\t\tf.write('CTAGATTGATTACAGACAAGCCAGTCTGGCTCCAAACGGTTCCCTTTTAACAATTTCACA\\n')\n-\t\tf.write('TACTGTTTAACTCTCTTTTCAAAGTTCTTTTCATCTTTCCCTCACGGTACTTGTTCGCTA\\n')\n-\t\tf.write('TCGGTTTCTCGCCAATATTTAGCTTTAGGTGAGATTTACCACCCAATTTAGGCTGCATTC\\n')\n-\t\tf.write('CCAAACAACCTGACTCTTTGAAAGCGTATCACAAAAGGCAAATGCTCAAGCCAAAGACGG\\n')\n-\t\tf.write('GATTCTCACCCTCTATGATGCCCTGTTCCAAAGGACTTATTTACTCGGCTTGCCTGGAAA\\n')\n-\t\tf.write('ACACTTCTACAGTCTACAATCCGGTTTAGCTAGGCCAAACAGGTTCCAACTTTGAGCTCT\\n')\n-\t\tf.write('TTCCTCTTCACTCGCCGTTACTAGGGAAATCATTGTTATTTTCTTTTCCTCCGCTTATTG\\n')\n-\t\tf.write('ATATGCTTAAGTTCAGCGGGTAATCCCACCTGACTTCAGATCATAGTTTGAAAGTTACTG\\n')\n-\t\tf.write('GATTATACTCTTGTACTTTACTTCCTGGGCGAACCAAAAAAAAaGATCCTGAGACCAGCG\\n')\n-\t\tf.write('TAATATTCCTGCCTAGCAAGCCAGACAGAAAATCACACACATTTTAGGTGCTCACTGTAA\\n')\n-\t\tf.write('TAAAACAGCGATGCGACCCATCACCACATAAACAAATGTTATGTGTGGGTTTGTGATGAT\\n')\n-\t\tf.write('ACTGAAGCAGGCGTACTCTATAGAAAAACCAT\\n')\n-\t\tf.write('>Vein_ctg_10639\\n')\n-\t\tf.write('ACAAACAGACAAACAGACAAACAGACAAACAGACAAACAGACAAACAGAGAGGCAGACAA\\n')\n-\t\tf.write('ACAGAGAGGCAGACAAGCAGACAAACTTAACATAATGCTTGCATACAAGTATCCTTGAAG\\n')\n-\t\tf.write('ATCAGAAGCCAAGTGTCAAACTGCTAAAACTGAATTACATAAGTGAATCTAGATAAAGAA\\n')\n-\t\tf.write('TCACATGTGGGGGAAGAACATTAAACTAATACTGTTTACATAAAAAAAAaGCAAAAAAAA\\n')\n-\t\tf.write('ATAATATTTAATTTGTATAGCTGAAAGTGTTCCCGTAAGGAACAAATTCAATGACAAGGG\\n')\n-\t\tf.write('CTTAATCTCAGTACATCGTAGCAACAAAGGCTACTCTAGTACTTACAATACCCCGTCCAT\\n')\n-\t\tf.write('TTCATGTCGTCTGCATGCGATTTATCACTTTGATCATTTGCATTATCATCACAGGGTAGT\\n')\n-\t\tf.write('GAATCACAGCATTTCCGCTGCAAAGCCTATCCCGCAAGTAAGGTTTTCAAGCCGAAGCTT\\n')\n-\t\tf.write('TATTTGTACACAACTAGTACAATCAAAGCACAGTAGTATCGCTTCCAGCATGGATTCTGA\\n')\n-\t\tf.write('CTTAGAGGCGTTCAGCCATTATCCAGCAGATGGTAGCTTCGCGGCATTGGCCTTTCAACC\\n')\n-\t\tf.write('AGCCGCAAATACCAATTATCTGAATGAAGGGTTCCTCTCGTACTAACTTCAATTACTGTT\\n')\n-\t\tf.write('GCGATACCAATACCATCAGTAGGGTAAAACTAACCTGTCTCACGACGGTCTAAACCCAGC\\n')\n-\t\tf.write('TCACGTTCCCTATTAGTGGGTGAACAATCCAACACTTAATGAATTCTGCTTCATTATGAT\\n')\n-\t\tf.write('AGGAAGAGCCGACATCGAAGAATCAAAAAGCAACGTCGCTATGAACGCTTGGCTGCCACA\\n')\n-\t\tf.write('AGCCAGTTATCCCTGTGGTAACTTTTCTGGCACCTCTAGCCTCAAATCTTGAGATTCTAA\\n')\n-\t\tf.write('AGGATCGATAGGCCACACTTTCATGGTTTGTATTCACACTGAAAATCAAAATCAAGGGGA\\n')\n-\t\tf.write('CTTTTACCCTTTTATTCTACAGGAGATTTCTGTTCTCCTTGAGTCCCCCTTAGGACACCT\\n')\n-\t\tf.write('GCGTTATCTTTTAACAGATGTGCCGCCCCAGCCAAACTCCCCACTTGACAATGTCAATAA\\n')\n-\t\tf.write('CATGGGTCGCACCCTAATGGATGCTTAAAGCTAGAAGGTGAGTCTTGCGACTCAATCCCA\\n')\n-\t\tf.write('CTTAATTATTTAAGTAAAAAAaCAATAGA\\n')\n-\t\tf.close() \n" |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/MockESTBankForBlat.py --- a/commons/launcher/tests/MockESTBankForBlat.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,5996 +0,0 @@\n-class MockESTBankForBlat(object):\n-\t\n-\tdef write(self, inFileName):\n-\t\tf = open(inFileName, \'w\')\n-\t\tf.write(">gi|226792376|gb|GO546081.1|GO546081 Mdas9010M17_e784.b1 Apple_EST_Mdas Malus x domestica cDNA 3\' similar to ref|NP_850886.1| expressed protein [Arabidopsis thaliana], mRNA sequence\\n")\n-\t\tf.write("GTTTCACGCTCTTCCTCAGCTTCATCAACCTCCGAACCCTAAATTCCCAAATGGCCTCCTCGCCGGACCA\\n")\n-\t\tf.write("CCACATCAACGGCGACACCAAAACCCACATCTCCAAAAAACCTAAACTTTCCCCAAATTTCATCACTGCC\\n")\n-\t\tf.write("GCCGAAATCGCCGCCGAATTCTCCCACCACGACCCGAACGTCGCCCGGATCAACAACGGCAGCTTCGGCT\\n")\n-\t\tf.write("CCTGCCCCGCCTCCTTGATCGAAGCCCAGCGGCGGTGGCAGCTCAAAAACCTCGCCCAGCCCGACCATTT\\n")\n-\t\tf.write("CTACGTCAACGAGCTCAAGAAGGGAATCCACCGTTCCAGAACCATTATCAAGGAGCTCATCAATGCGGAC\\n")\n-\t\tf.write("CATGTCAACGAGGTCTCACTCGTCGACAACGCCACCACCGCCGCCGCCATCGTGCTTCAGCAGACGGC\\n")\n-\t\tf.write("\\n")\n-\t\tf.write(">gi|226792375|gb|GO546080.1|GO546080 Mdas9010J22_e767.b1 Apple_EST_Mdas Malus x domestica cDNA 3\', mRNA sequence\\n")\n-\t\tf.write("TTTTTTTCCCATTAAAGAATTATAAAAGATCAATACATAGAGAAATAAGAGAGGGACATATATATTGTCA\\n")\n-\t\tf.write("CATATACTGGCTAGATATATATATATCTAGCTAGCTACTTGACAGTTATTTGTACGTAATTACTTGACAA\\n")\n-\t\tf.write("TTAAAAGAAGAAGAAGCAAAGAAAAGTGAACAAGACAAAGATGGAAGTAAGACCATGAGGGTGGAAGTGC\\n")\n-\t\tf.write("ATTCTCAAATGAACCGATTTAGAAAAATAAGGTGGCGGGGGACTGTAAGGATTTACAGGATAAAGGCTTG\\n")\n-\t\tf.write("GTGGTACTATAGAGGGCGCAAATGGA\\n")\n-\t\tf.write("\\n")\n-\t\tf.write(">gi|226792374|gb|GO546079.1|GO546079 Mdas9010L17_e779.b1 Apple_EST_Mdas Malus x domestica cDNA 3\' similar to gb|AAG35782.1|AF280060_1 tonneau 1 [Oryza sativa], mRNA sequence\\n")\n-\t\tf.write("TTTTTTTTTTTTTTCAGTTACTAATTTATATTTCAAGAAATCAATCAAAAAGCACTCCAACAAAGCACTA\\n")\n-\t\tf.write("AATCAAATCAAAATAGGGTATAATCTTACATAACATGCCTATCATTTGCGGGTGAAATACACAAAATCAA\\n")\n-\t\tf.write("ATACCGTGCAGTTATACAAAGGTTGTCATCGTGCAGCTACATCTGGTCAGCCCTGCCGTCATCCTCACTA\\n")\n-\t\tf.write("ATTCCATCTCCTGCGTGCCGCCAAAATGTTGTTAAATTGCGAGCTTTTCTATCCAACTGGAGGTTTTCCA\\n")\n-\t\tf.write("TCGCACTTGAAGCTCGAATGACATCCTCTGGACTTTCATCACTGTCGTATCTATAGCTGTAGTCATCTTT\\n")\n-\t\tf.write("CCTGTAGCCAGACATGGAGGACCCACCTCTTCGATCAAATGACTGGGAAGATGCACCAGGCCTTCCTAGT\\n")\n-\t\tf.write("GGAGGTAGCCCACCAGCAACAGATGATGAAGAAGGTCTTCTCATATTGCGAGAATCTAAATTGGACAGGG\\n")\n-\t\tf.write("ATTCTGTTTCTGAAGTCGTTAGCCTCCTTCCGGTACCCCTTGATTGAGATAGATTCTCAAATTTCAAAAA\\n")\n-\t\tf.write("TCCTTCAAGCACATCCAAAAGCAAAGGACCACTATCTCCATTTCGGTTAAGATCATATCCATTCTTGCTA\\n")\n-\t\tf.write("CTAAAGTCCTTCAACTCAGCTTTCCAAGAATCCTTTT\\n")\n-\t\tf.write("\\n")\n-\t\tf.write(">gi|226792373|gb|GO546078.1|GO546078 Mdas9010H22_e754.b1 Apple_EST_Mdas Malus x domestica cDNA 3\' similar to gb|AAC34983.1| light harvesting chlorophyll A/B binding protein [Prunus persica], mRNA sequence\\n")\n-\t\tf.write("AAAAAAAGCAGCAAGCAATGGCAACCTCTGCAATCCAACAATCAGCATTTGCTGGCCAGACTGCTTTGAA\\n")\n-\t\tf.write("GCAGTCCAATGAGCTCGTCCGAAAGATCGGCGGCCTTGGCGGCGGCCGCTTCTCCATGCGGCGCACCGTC\\n")\n-\t\tf.write("AAAAGTGCCCCCCAGAGCATATGGTACGGCCCAGACCGCCCCAAGTACTTGGGACCATTCTCCGAGCAAA\\n")\n-\t\tf.write("CTCCGTCATACTTGACCGGTGAATTCCCCGGAGACTACGGATGGGACACTGCTGGACTATCTGCAGACCC\\n")\n-\t\tf.write("CGAGACATTTGCCAAGAACCGTGAGCTTGAGGTGATCCACTCCAGATGGGCCATGCTTGGTGCACTGGGA\\n")\n-\t\tf.write("TGCGTCTTCACAGAAATCTTGTCAAGGAATGGCGTCAAGTTCGGCGAGGCTGTCTGGTTCAAGGCTGGAT\\n")\n-\t\tf.write("CGCAAATCTTCTCTGAGGGCGGCCTTGACTACCTTGGGCACCCAAACCTTATCCATGCTCAGAGCATCTT\\n")\n-\t\tf.write("GGCAATCTGGGCTGTCCAGGTCGTGCTCATGGGATTCATTGAGGGATACAGAGTTGGAGGAGGAACCACT\\n")\n-\t\tf.write("CGGTGAAGGACTAGACCCACTTTACCCAGGAGGGGCCTTTGACCCCCTTGGACTTGCTGATGATCCCGAA\\n")\n-\t\tf.write("GCTTTTGCTGAACTGAAGGT\\n")\n-\t\tf.write("\\n")\n-\t\tf.write(">gi|226792372|gb|GO546077.1|GO546077 Mdas9010K23_e774.b1 Apple_EST_Mdas Malus x domestica cDNA 3\' similar to ref|NP_187130.1| ribose 5-phosphate isomerase -related [Arabidopsis thaliana] gb|AAF04905.1|AC011437_20 putative ribose 5-phosphate isomerase [Arabidopsis thaliana] gb|AAG51427.1|AC009465_27 putative ribose 5-phosphate isomerase; 91580-90750 [Arabi, mRNA sequence\\n")\n-\t\tf.write("TTTTTTTGAAGCACGAAGGTAATTCATTTCACATTATTTCACAATTCACAATTCCATCATTCTTTAGTAT\\n")\n-\t\tf.write("CATTAGTATACCACTGAGTC'..b'AACCTCTTCTCCAAGATGGACG\\n")\n-\t\tf.write("TCTACGCCGCCGTTTCGGTCGCCGGCGACCCGCGCAACAAGAAGCAGAAGAACAAAACCCCCGTCGTCAA\\n")\n-\t\tf.write("GGACGGAGGCACCAACCCCAAGTGGACCAGCTACCCCATCAGGTTCACCGTCGACGAAGCCGCCCTCCTC\\n")\n-\t\tf.write("AACAACCGCCTCACCCTCAACATCAAGCTCGTCTCCGAACGCACTTTGGGAGACACCAAGATCGGCAAGG\\n")\n-\t\tf.write("TCAAGATCCCGCTCAAGGACCTACTAGACACCATGAGCGGCGGCGATGATCACA\\n")\n-\t\tf.write("\\n")\n-\t\tf.write(">gi|226789543|gb|GO546082.1|GO546082 Mdas9010H14_e752.b1 Apple_EST_Mdas Malus x domestica cDNA 3\' similar to pir|G86463 hypothetical protein F12G12.18 - Arabidopsis thaliana gb|AAG12539.1|AC015446_20 Unknown protein [Arabidopsis thaliana] gb|AAG12849.1|AC079286_6 photosystem II 22 kDa protein, putative; 13290-12539 [Arabidopsis thaliana] gb|AAK55677.1|A, mRNA sequence\\n")\n-\t\tf.write("TTTTTTTATCAACGAGCTCTGGGGAACTTCTTCAATCGTTGAAATCCTGNTAAACATTGTAAGTAAAATA\\n")\n-\t\tf.write("CAGCAGCGTATGATAGCCGAGTATTTCTTGCAAATGAAATTTAAACAAATTACTCAACAAAGTTACAAGT\\n")\n-\t\tf.write("GAAACAGTGAATGTATCTGCAGTAGCTCCAGAGACAAGAAGGTATTAAGGCTTTCAACATCCCACCGGGC\\n")\n-\t\tf.write("CGGTGTATCATTCCAGATCCAGTATTCCGAAATTTGAAAGAAGTATCTTTACTTGATCAACAAAGTCCGA\\n")\n-\t\tf.write("GCCAGTTGCATACTCCGTTAGCATTCCAACAGCAAAACCGAACATTGCCCATCTGCCATTGCTAATCTCG\\n")\n-\t\tf.write("TTCTTGCCAACAAAGCCAAAGAAAGGACCCTGGTTAGCAGCCTCAAGCTTCTTCTGCTTGAAGTACTCCT\\n")\n-\t\tf.write("GAATCTCCTTAGCCTTCTGCCTCTGAAACTCCAAGGTCACCACATTCTTGTCCTCCACCATCGTCAGCCC\\n")\n-\t\tf.write("GGAAACCTGGGCCGGATTCGAGGGCTGCTGAGGCGGTGGAGAAGGAGACGGAGGAGAAGGAGGCGTTGGT\\n")\n-\t\tf.write("TTGAGAGGGGAAGACGGCTGGGAGGGTTCTCGGAGGGAAGGAGCAGCAGGTCTTCTGATAGGCCCTTCCG\\n")\n-\t\tf.write("TCTTGGGAGCTCTTTATGCTAATTTTTA\\n")\n-\t\tf.write("\\n")\n-\t\tf.write(">gi|226789542|gb|GO545826.1|GO545826 Mdas9003M24_e233.b1 Apple_EST_Mdas Malus x domestica cDNA 3\' similar to sp|Q9M4S8|TPIC_FRAAN Triosephosphate isomerase, chloroplast precursor (TIM) gb|AAF66071.1|AF257322_1 triosephosphate isomerase [Fragaria x ananassa], mRNA sequence\\n")\n-\t\tf.write("TCGAGTTTTTTTTTTTTTTTTTTAAGTGACCCATGGAAAATGGATAGAAGATATATTTTACTATCTTTAT\\n")\n-\t\tf.write("GGAGGGGGAAACACTTCAAAAACGACCCAGGAAAAAAAATTCCTTATGATAAACTGGCTCATACATTTGT\\n")\n-\t\tf.write("TACAATATGCTTCAATCTCAAGGTACCTTCGCATCGGCCCTTTATTTGATCTCGGAACCACCATAATCAA\\n")\n-\t\tf.write("GCAGCAACTTTCTTGGCTGTCACAGCGTTGACGATAGTAGCAAATTCAGGGCCCTTTAGGGAAGCACCGC\\n")\n-\t\tf.write("CAACAAGAAAACCATCAATATCTTCCTTCTTTGCGAGCTCAACAGAATTGCCTCCATTTACAGATCCTCC\\n")\n-\t\tf.write("ATAAATAATTCTTGTTTTAGATGCAACTTCTGCTGACACATTCTGTTTCAGCCAATCACGAACAGCTACA\\n")\n-\t\tf.write("TGTACTTCCTGAGCTTGTTCTGGACTGGCTACCTTACCAGTCCCAATGGCCCATACAGGCTCATAAGCAA\\n")\n-\t\tf.write("CAACTATCTTATCCCAGCTGGGTACTGCGTCTGCAAAAGCCTTCAGCTGCTGAAAGCAGACGTCAAAAGT\\n")\n-\t\tf.write("TTTCCCTGCTTCCCTTTCTTCTAGCTTCTCGCCCAATGCAAGCAATTACTCCGAGACCCTCATTCAACGC\\n")\n-\t\tf.write("ATAGG\\n")\n-\t\tf.write("\\n")\n-\t\tf.write(">gi|226789541|gb|GO545825.1|GO545825 Mdas9003P18_e247.b1 Apple_EST_Mdas Malus x domestica cDNA 3\' similar to ref|NP_189513.1| expressed protein [Arabidopsis thaliana] sp|Q9LHA4|V0D2_ARATH Probable vacuolar ATP synthase subunit d 2 (V-ATPase d subunit 2) (Vacuolar proton pump d subunit 2) gb|AAL16278.1|AF428348_1 AT3g28715/MZN14_21 [Arabidopsis thaliana], mRNA sequence\\n")\n-\t\tf.write("TTTTTTATAAACTCACTACGAGACTGCTACTATAGTAGCTCTCAAATTGCAATATATATATTCAATTTAT\\n")\n-\t\tf.write("CCTCACAACTGTAACATGCTCGATTTCAGAACATGACATATTCCCTCTATGTAAAAACGACCGGAATAAT\\n")\n-\t\tf.write("ATATGCAAAAGTGCTTATTAGGAAGGAACACCGGATAGTGCAAACAACGCAACCGCACCCATCTCTACAA\\n")\n-\t\tf.write("TTCGTTCGGGGATATGATGGGGAGGAGATTTACAGAAGATTATGCGAAAGAACGAAGGATCATCTGTAAT\\n")\n-\t\tf.write("GGTGTGTTCTGAGTCCCAATCCGACTAAAATATGAAGACCACGCTGTCGTGAACTCTGGACTTCTGGTTC\\n")\n-\t\tf.write("TGAGCCACACACTCAGATATCCACATCAAATTTCTGATCTCCTGCTCCCTCAACCTCATGTATGCAAAGA\\n")\n-\t\tf.write("AAACAGCGTAATGGAACTGTTGCTCAAATGCTAAGCAAAGCCTTTTCACCTCCTCTTCATAAAATGCCTT\\n")\n-\t\tf.write("GTCAAGCATCTGGGTTTCGCCATAGGATAGTTTTGAAAAAATAGACTGATAAGGAGGATATTTTTCCATG\\n")\n-\t\tf.write("CAACCACGTACCTGATCAATGTCCTCACATACAGCAAGTTCCTCATGGCCATAGGGAATAGAGTAAACCA\\n")\n-\t\tf.write("AAGCTAGAGTACAACTTCCTGCGATCATCTCGAGTAAGCTCAGTTCAATACTATTTATGGGT\\n")\n-\t\tf.write("\\n")\n-\t\tf.close() \n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/MockOutputForBlat.py --- a/commons/launcher/tests/MockOutputForBlat.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,33 +0,0 @@ -class MockOutputForBlat(object): - - def write(self, inFileName): - f = open(inFileName, 'w') - f.write('gi|226792305|gb|GO545799.1|GO545799 290 551 Vein_ctg_10639 674 935 1.0e-130 463.0 93.51\n') - f.write('gi|226792305|gb|GO545799.1|GO545799 138 283 Vein_ctg_10639 519 664 1.0e-50 198.0 82.88\n') - f.write('gi|226792305|gb|GO545799.1|GO545799 577 686 Vein_ctg_10639 961 1070 1.4e-46 184.0 90.91\n') - f.write('gi|226792305|gb|GO545799.1|GO545799 566 572 Vein_ctg_10639 944 950 3.1e+05 13.0 100.00\n') - f.write('gi|226792293|gb|GO546055.1|GO546055 107 193 Vein_ctg_10638 87 1 2.2e-42 170.0 100.00\n') - f.write('gi|226792293|gb|GO546055.1|GO546055 34 91 Vein_ctg_10638 161 104 2.5e-22 103.0 94.83\n') - f.write('gi|226792293|gb|GO546055.1|GO546055 521 611 Vein_ctg_10639 1075 985 2.9e-38 156.0 92.31\n') - f.write('gi|226790810|gb|GO546215.1|GO546215 57 520 Vein_ctg_5197 1862 1399 8.7e-128 454.0 72.84\n') - f.write('gi|226790791|gb|GO546209.1|GO546209 135 199 Vein_ctg_5197 1994 1930 7.4e-25 112.0 93.85\n') - f.write('gi|226790791|gb|GO546209.1|GO546209 36 82 Vein_ctg_5197 2126 2080 1.9e-06 50.0 76.60\n') - f.write('gi|226790483|gb|GO545656.1|GO545656 280 541 Vein_ctg_10639 674 935 1.0e-130 463.0 93.51\n') - f.write('gi|226790483|gb|GO545656.1|GO545656 128 273 Vein_ctg_10639 519 664 1.0e-50 198.0 82.88\n') - f.write('gi|226790483|gb|GO545656.1|GO545656 567 640 Vein_ctg_10639 961 1034 1.1e-25 114.0 87.84\n') - f.write('gi|226790483|gb|GO545656.1|GO545656 556 562 Vein_ctg_10639 944 950 3.1e+05 13.0 100.00\n') - f.write('gi|226790458|gb|GO545644.1|GO545644 1 95 Vein_ctg_10638 1369 1275 3.5e-40 163.0 92.63\n') - f.write('gi|226790458|gb|GO545644.1|GO545644 146 185 Vein_ctg_10638 1225 1186 3.7e-07 53.0 82.50\n') - f.write('gi|226790049|gb|GO546186.1|GO546186 177 263 Vein_ctg_10638 87 1 5.6e-39 159.0 96.55\n') - f.write('gi|226790049|gb|GO546186.1|GO546186 106 161 Vein_ctg_10638 159 104 3.8e-21 99.0 94.64\n') - f.write('gi|226790011|gb|GO546174.1|GO546174 138 283 Vein_ctg_10639 519 664 1.0e-50 198.0 82.88\n') - f.write('gi|226789634|gb|GO545875.1|GO545875 135 306 Vein_ctg_10638 1446 1275 7.3e-80 294.0 91.86\n') - f.write('gi|226789634|gb|GO545875.1|GO545875 451 496 Vein_ctg_10638 1132 1087 1.8e-18 90.0 100.00\n') - f.write('gi|226789634|gb|GO545875.1|GO545875 357 393 Vein_ctg_10638 1225 1189 1.8e-05 47.0 81.08\n') - f.write('gi|226789597|gb|GO546106.1|GO546106 432 537 Vein_ctg_2286 1166 1061 5.0e-40 162.0 86.79\n') - f.write('gi|226789597|gb|GO546106.1|GO546106 538 632 Vein_ctg_2286 1008 914 6.0e-33 139.0 85.26\n') - f.write('gi|226789571|gb|GO546096.1|GO546096 353 474 Vein_ctg_5197 2426 2305 4.1e-46 182.0 84.43\n') - f.write('gi|226789566|gb|GO545840.1|GO545840 73 232 Vein_ctg_10639 776 935 2.5e-75 279.0 92.50\n') - f.write('gi|226789566|gb|GO545840.1|GO545840 258 372 Vein_ctg_10639 961 1075 4.2e-50 196.0 92.17\n') - f.write('gi|226789566|gb|GO545840.1|GO545840 247 253 Vein_ctg_10639 944 950 3.1e+05 13.0 100.00\n') - f.close() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_BlatClusterLauncher.py --- a/commons/launcher/tests/Test_BlatClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,34 +0,0 @@ -import unittest -from commons.launcher.BlatClusterLauncher import BlatClusterLauncher - - -class Test_BlatClusterLauncher( unittest.TestCase ): - - def setUp( self ): - self._i = BlatClusterLauncher() - - - def tearDown( self ): - self._i = None - - - def test_getSpecificHelpAsString( self ): - exp = "" - exp += "\nspecific options:" - exp += "\n -s: name of the subject file (format='fasta')" - exp += "\n -p: parameters for 'blat'" - exp += "\n -Z: concatenate output files" - exp += "\n -A: same sequences (all-by-all)" - obs = self._i.getSpecificHelpAsString() - self.assertEqual( exp, obs ) - - - def test_setASpecificAttributeFromCmdLine( self ): - self._i.setASpecificAttributeFromCmdLine( "-s", "dummySubjectFile.fa" ) - self.assertEqual( "dummySubjectFile.fa", self._i.getSubjectFile() ) - - -test_suite = unittest.TestSuite() -test_suite.addTest( unittest.makeSuite( Test_BlatClusterLauncher ) ) -if __name__ == "__main__": - unittest.TextTestRunner(verbosity=2).run( test_suite ) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_BlatProgramLauncher.py --- a/commons/launcher/tests/Test_BlatProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,98 +0,0 @@ -import unittest -from commons.launcher.BlatProgramLauncher import BlatProgramLauncher - - -class Test_BlatProgramLauncher( unittest.TestCase ): - - def setUp( self ): - self._i = BlatProgramLauncher() - - - def tearDown( self ): - self._i = None - - - def test_getHelpAsString( self ): - exp = "" - exp += "usage: BlatProgramLauncher.py [options]" - exp += "\ngeneric options:" - exp += "\n -h: this help" - exp += "\n -i: name of the input file (format='fasta')" - exp += "\n -c: clean" - exp += "\n -v: verbosity level (default=0/1)" - exp += "\nspecific options:" - exp += "\n -s: name of the subject file (database, format='fasta')" - exp += "\n -p: parameters for 'blat'" - exp += "\n -A: same sequences (all-by-all)" - exp += "\n -o: name of the output file (format='align', default=inFile+'.align')" - obs = self._i.getHelpAsString() - self.assertEqual( exp, obs ) - - - def test_setAttributesFromCmdLine( self ): - self._i.setAttributesFromCmdLine( "-s", "dummySubjectFile.fa" ) - self.assertEqual( "dummySubjectFile.fa", self._i.getSubjectFile() ) - - self._i.setAttributesFromCmdLine( "-o", "dummyOutFile.align" ) - self.assertEqual( "dummyOutFile.align", self._i.getOutputFile() ) - - - def test_setWrapperCommandLine( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - exp = "BlatProgramLauncher.py" - exp += " -i %s" % ( "dummyInFile.fa" ) - exp += " -s %s" % ( "dummySubjectFile.fa" ) - exp += " -o %s.align" % ( "dummyInFile.fa" ) - exp += " -v 0" - self._i.setWrapperCommandLine() - obs = self._i.getWrapperCommandLine() - self.assertEqual( exp, obs ) - - - def test_setProgramCommandLine( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - self._i.setProgramParameters( "-minIdentity=90" ) - exp = "blat dummySubjectFile.fa dummyInFile.fa -minIdentity=90 -out=blast8 dummyInFile.fa.blast" - self._i.setProgramCommandLine() - obs = self._i.getProgramCommandLine() - self.assertEqual( exp, obs ) - - - def test_setListFilesToKeep( self ): - self._i.setInputFile( "dummyInFile.fa" ) - lExp = [ "dummyInFile.fa.align" ] - self._i.setListFilesToKeep() - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setListFilesToRemove( self ): - self._i.setInputFile( "dummyInFile.fa" ) - lExp = [ "dummyInFile.fa.blast" ] - self._i.setListFilesToRemove() - lObs = self._i.getListFilesToRemove() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setSummary( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - exp = "input file: %s" % ( self._i.getInputFile() ) - exp += "\nsubject file: %s" % ( self._i.getSubjectFile() ) - exp += "\nparameters: %s" % ( self._i.getProgramParameters() ) - exp += "\noutput file: %s" % ( "dummyInFile.fa.align" ) - self._i.setSummary() - obs = self._i.getSummary() - self.assertEqual( exp, obs ) - - -test_suite = unittest.TestSuite() -test_suite.addTest( unittest.makeSuite( Test_BlatProgramLauncher ) ) -if __name__ == "__main__": - unittest.TextTestRunner(verbosity=2).run( test_suite ) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_BlatProgramLauncher.py --- a/commons/launcher/tests/Test_F_BlatProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,139 +0,0 @@ -import os -import unittest -from commons.core.utils.FileUtils import FileUtils -from devTools.tests.MockFastaSupctg30 import MockFastaSupctg30 -from devTools.tests.MockMiniProtBankSupctg30 import MockMiniProtBankSupctg30 -from commons.launcher.tests.MockDataBankForBlat import MockDataBankForBlat -from commons.launcher.tests.MockESTBankForBlat import MockESTBankForBlat -from commons.launcher.tests.MockOutputForBlat import MockOutputForBlat -from commons.launcher.BlatProgramLauncher import BlatProgramLauncher - -class Test_F_BlatProgramLauncher(unittest.TestCase): - - def test_run_empty_result(self): - queryFileName = "smallProtBank_supctg30.fa" - mock = MockMiniProtBankSupctg30() - mock.write(queryFileName) - subjectFileName = "subjectBank.fa" - mock = MockFastaSupctg30() - mock.write(subjectFileName) - - expOutputFileName = "expBlatOutput.blast.align" - self.writeEmptyExpOutputFile(expOutputFileName) - - obsOutputFileName = "obsBlatOutput.blast.align" - - bpl = BlatProgramLauncher() - bpl.setInputFile(queryFileName) - bpl.setSubjectFile(subjectFileName) - bpl.setOutputFile(obsOutputFileName) - bpl.setProgramParameters("") - bpl.run() - - blastFileName = queryFileName + ".blast" - - self.assertTrue(os.path.exists(obsOutputFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(expOutputFileName, obsOutputFileName)) - - os.remove(queryFileName) - os.remove(subjectFileName) - os.remove(blastFileName) - os.remove(expOutputFileName) - os.remove(obsOutputFileName) - - def test_as_script_empty_result(self): - queryFileName = "smallProtBank_supctg30.fa" - mock = MockMiniProtBankSupctg30() - mock.write(queryFileName) - subjectFileName = "subjectBank.fa" - mock = MockFastaSupctg30() - mock.write(subjectFileName) - - expOutputFileName = "expBlatOutput.blast.align" - self.writeEmptyExpOutputFile(expOutputFileName) - - obsOutputFileName = "obsBlatOutput.blast.align" - - cmd2Launch = "python ../BlatProgramLauncher.py -s " + subjectFileName + " -i " + queryFileName + " -p '' -o " + obsOutputFileName - - os.system(cmd2Launch) - - blastFileName = queryFileName + ".blast" - - self.assertTrue(os.path.exists(obsOutputFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(expOutputFileName, obsOutputFileName)) - - os.remove(queryFileName) - os.remove(subjectFileName) - os.remove(blastFileName) - os.remove(expOutputFileName) - os.remove(obsOutputFileName) - - def test_run(self): - queryFileName = "smallESTBank.fa" - mock = MockESTBankForBlat() - mock.write(queryFileName) - subjectFileName = "subjectBank.fa" - mock = MockDataBankForBlat() - mock.write(subjectFileName) - - expOutputFileName = "expBlatOutput.blast.align" - mock = MockOutputForBlat() - mock.write(expOutputFileName) - - obsOutputFileName = "obsBlatOutput.blast.align" - - bpl = BlatProgramLauncher() - bpl.setInputFile(queryFileName) - bpl.setSubjectFile(subjectFileName) - bpl.setOutputFile(obsOutputFileName) - bpl.setProgramParameters("") - bpl.run() - - blastFileName = queryFileName + ".blast" - - self.assertTrue(os.path.exists(obsOutputFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(expOutputFileName, obsOutputFileName)) - - os.remove(queryFileName) - os.remove(subjectFileName) - os.remove(blastFileName) - os.remove(expOutputFileName) - os.remove(obsOutputFileName) - - def test_as_script(self): - queryFileName = "smallESTBank.fa" - mock = MockESTBankForBlat() - mock.write(queryFileName) - subjectFileName = "subjectBank.fa" - mock = MockDataBankForBlat() - mock.write(subjectFileName) - - expOutputFileName = "expBlatOutput.blast.align" - mock = MockOutputForBlat() - mock.write(expOutputFileName) - - obsOutputFileName = "obsBlatOutput.blast.align" - - cmd2Launch = "python ../BlatProgramLauncher.py -s " + subjectFileName + " -i " + queryFileName + " -p '' -o " + obsOutputFileName - - os.system(cmd2Launch) - - blastFileName = queryFileName + ".blast" - - self.assertTrue(os.path.exists(obsOutputFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(expOutputFileName, obsOutputFileName)) - - os.remove(queryFileName) - os.remove(subjectFileName) - os.remove(blastFileName) - os.remove(expOutputFileName) - os.remove(obsOutputFileName) - - def writeEmptyExpOutputFile(self, outputFileName): - f = open(outputFileName, "w") - f.write("") - f.close() - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchBlastclust.py --- a/commons/launcher/tests/Test_F_LaunchBlastclust.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,103 +0,0 @@ -import unittest -import os -from commons.launcher.LaunchBlastclust import LaunchBlastclust -from commons.core.utils.FileUtils import FileUtils - -class Test_F_LaunchBlastclust(unittest.TestCase): - - def setUp(self): - self._inputFileName = "DmelChr4_LTRharvest_expected_with_default_params.fa" - os.symlink("%s/Tools/%s" % (os.environ["REPET_DATA"], self._inputFileName), self._inputFileName) - self._outputFileName = "%s_Blastclust.fa" % self._inputFileName - self._outBlastclustFileName = "%s_blastclust.txt" % self._inputFileName - - def tearDown(self): - if os.path.exists(self._outputFileName): - os.remove(self._outputFileName) - if os.path.exists(self._outBlastclustFileName): - os.remove(self._outBlastclustFileName) - os.remove(self._inputFileName) - - def test_run(self): - iLaunchBlastclust = LaunchBlastclust(self._inputFileName, clean = True) - iLaunchBlastclust.run() - expFileName = "%s/Tools/DmelChr4_LTRharvest_Blastclust_expected.fa" % os.environ["REPET_DATA"] - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, self._outputFileName)) - - def test_run_with_tweaked_params(self): - iLaunchBlastclust = LaunchBlastclust(self._inputFileName, clean = True) - iLaunchBlastclust.setBothSequences("F") - iLaunchBlastclust.setIdentityThreshold(0) - iLaunchBlastclust.setIsBlastToMap() - iLaunchBlastclust.run() - - faExpFileName = "%s/Tools/DmelChr4_LTRharvest_Blastclust_expected_with_tweaked_params.fa" % os.environ["REPET_DATA"] - mapExpFileName = "%s/Tools/DmelChr4_LTRharvest_Blastclust_expected_with_tweaked_params.map" % os.environ["REPET_DATA"] - - self.assertTrue(FileUtils.are2FilesIdentical(faExpFileName, self._outputFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(mapExpFileName, "%s.map" % os.path.splitext(self._outputFileName)[0])) - - os.remove("%s.map" % os.path.splitext(self._outputFileName)[0]) - - def test_run_with_header_options(self): - inFileName = "dummyHeaderForTEdenovo.fa" - expFileName = "expDummyHeaderForTEdenovo.fa" - self._writeInputFile_header_options(inFileName) - self._writeExpFile_header_options(expFileName) - obsFileName = "%s_Blastclust.fa" % inFileName - - iLaunchBlastclust = LaunchBlastclust(inFileName, clean = True) - iLaunchBlastclust.setIsHeaderForTEdenovo(True) - iLaunchBlastclust.run() - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - - os.remove(inFileName) - os.remove(expFileName) - os.remove(obsFileName) - os.remove("%s_blastclust.txt" % inFileName) - - def test_run_as_script(self): - cmd = "LaunchBlastclust.py -i %s" % self._inputFileName - os.system(cmd) - expFileName = "%s/Tools/DmelChr4_LTRharvest_Blastclust_expected.fa" % os.environ["REPET_DATA"] - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, self._outputFileName)) - - def _writeInputFile_header_options(self, inFileName): - f = open(inFileName,"w") - f.write(">DTX-incomp_DmelChr4-B-R9-Map3_reversed\n") - f.write("CATTAGATTCAAGGCATCATGGATCAGCACATTTACACAGATATCCTGGAAAATGTGATG\n") - f.write("CTGCCATATGCCGGGGATGAAATGCCGTTGGTTTGGACATTTCAACAGGATAACGATTCA\n") - f.write("AAACACACGAGCAAGAAAGCTTGAAAGTGGTTTGAGCAGAAATCGATCCGAGTAATGAAA\n") - f.write("TGGCCTGCTCTGTCATCCGACTTGAATCCAATCGAAAACCTTTGGGCGGACGTGGAAAAA\n") - f.write(">DTX-incomp_DmelChr4-B-R10-Map3_reversed\n") - f.write("CATTAGATTCAAGGCATCATGGATCAGCACATTTACACAGATATCCTGGAAAATGTGATG\n") - f.write("CTGCCATATGCCGGGGATGAAATGCCGTTGGTTTGGACATTTCAACAGGATAACGATTCA\n") - f.write("AAACACACGAGCAAGAAAGCTTGAAAGTGGTTTGAGCAGAAATCGATCCGAGTAATGAAA\n") - f.write("TGGCCTGCTCTGTCATCCGACTTGAATCCAATCGAAAACCTTTGGGCGGACGTGGAAAAA\n") - f.write(">PotentialHostGene-chim_DmelChr4-B-R4-Map5_reversed\n") - f.write("TACCAAAGACACTAGAATAACAAGATGCGTAACGCCATACGATTTTTTGGCACACGATTT\n") - f.write("TTTCGCCGTGGCTCTAGAGGTGGCTCCAGGCTCTCTCGAATTTTTGTTAGAGAGCGAGAG\n") - f.write("AGCGGAGAGCGCTACAGCGAACAGCTCTTTTCAACGCATAAAGTGATAGCAGACAACTGT\n") - f.close() - - def _writeExpFile_header_options(self, expFileName): - f = open(expFileName,"w") - f.write(">DTX-incomp_Blc1_DmelChr4-B-R9-Map3_reversed\n") - f.write("CATTAGATTCAAGGCATCATGGATCAGCACATTTACACAGATATCCTGGAAAATGTGATG\n") - f.write("CTGCCATATGCCGGGGATGAAATGCCGTTGGTTTGGACATTTCAACAGGATAACGATTCA\n") - f.write("AAACACACGAGCAAGAAAGCTTGAAAGTGGTTTGAGCAGAAATCGATCCGAGTAATGAAA\n") - f.write("TGGCCTGCTCTGTCATCCGACTTGAATCCAATCGAAAACCTTTGGGCGGACGTGGAAAAA\n") - f.write(">DTX-incomp_Blc1_DmelChr4-B-R10-Map3_reversed\n") - f.write("CATTAGATTCAAGGCATCATGGATCAGCACATTTACACAGATATCCTGGAAAATGTGATG\n") - f.write("CTGCCATATGCCGGGGATGAAATGCCGTTGGTTTGGACATTTCAACAGGATAACGATTCA\n") - f.write("AAACACACGAGCAAGAAAGCTTGAAAGTGGTTTGAGCAGAAATCGATCCGAGTAATGAAA\n") - f.write("TGGCCTGCTCTGTCATCCGACTTGAATCCAATCGAAAACCTTTGGGCGGACGTGGAAAAA\n") - f.write(">PotentialHostGene-chim_Blc2_DmelChr4-B-R4-Map5_reversed\n") - f.write("TACCAAAGACACTAGAATAACAAGATGCGTAACGCCATACGATTTTTTGGCACACGATTT\n") - f.write("TTTCGCCGTGGCTCTAGAGGTGGCTCCAGGCTCTCTCGAATTTTTGTTAGAGAGCGAGAG\n") - f.write("AGCGGAGAGCGCTACAGCGAACAGCTCTTTTCAACGCATAAAGTGATAGCAGACAACTGT\n") - f.close() - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchLastZ.py --- a/commons/launcher/tests/Test_F_LaunchLastZ.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,31 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -from commons.launcher.LaunchLastZ import LaunchLastZ - -class Test_F_LaunchLastZ(unittest.TestCase): - - def setUp(self): - self._inFastaFileName = "%s/Tools/input_TestFLastZ.fa" % os.environ["REPET_DATA"] - self._expAxtFileName = "%s/Tools/exp_TestFLastZ.axt" % os.environ["REPET_DATA"] - self._obsAxtFileName = "obsLastZ.axt" - - def tearDown(self): - try: - os.remove(self._obsAxtFileName) - except:pass - - def test_run(self): - ilauncher = LaunchLastZ(self._inFastaFileName, self._inFastaFileName, self._obsAxtFileName,verbosity=1) - ilauncher.run() - self.assertTrue(FileUtils.are2FilesIdentical(self._expAxtFileName, self._obsAxtFileName)) - - def test_run_as_script(self): - #FIXME : change path - cmd = 'python %s/commons/launcher/LaunchLastZ.py -q %s -r %s -o %s' % (os.environ["REPET_PATH"], self._inFastaFileName, self._inFastaFileName, self._obsAxtFileName) - os.system(cmd) - self.assertTrue(FileUtils.are2FilesIdentical(self._expAxtFileName, self._obsAxtFileName)) - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchMCL.py --- a/commons/launcher/tests/Test_F_LaunchMCL.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,87 +0,0 @@ -from commons.core.utils.FileUtils import FileUtils -import unittest -import os -import shutil -from commons.launcher.LaunchMCL import LaunchMCL - -class Test_F_LaunchMCL(unittest.TestCase): -# TODO: test query coverage filter - - def setUp(self): - self._inputFileName = "DmelChr4_LTRharvest_expected_with_default_params.fa" - try: - shutil.rmtree("MCLtmpDirectory") - os.remove(self._inputFileName) - except: - pass - try: - os.symlink("%s/Tools/%s" % (os.environ["REPET_DATA"], self._inputFileName), self._inputFileName) - except: - pass - self._outputFileName = "%s_MCL.fa" % os.path.splitext(self._inputFileName)[0] - - def tearDown(self): - try: - os.remove(self._inputFileName) - os.remove(self._outputFileName) - shutil.rmtree("MCLtmpDirectory") - except: - pass - try: - os.remove("DmelChr4_LTRharvest_expected_with_default_params_MCL.map") - except: - pass - - def test_run(self): - iLaunchMCL = LaunchMCL(self._inputFileName, doClean = True, verbosity = 1) - iLaunchMCL.run() - expFileName = "%s/Tools/DmelChr4_LTRharvest_MCL_expected.fa" % os.environ["REPET_DATA"] - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, self._outputFileName)) - - def test_run_with_map_file(self): - iLaunchMCL = LaunchMCL(self._inputFileName, isCluster2Map = True, doClean = False, verbosity = 1) -# iLaunchMCL.setCoverageThreshold(0.60) - iLaunchMCL.run() - expFastaFileName = "%s/Tools/DmelChr4_LTRharvest_MCL_expected.fa" % os.environ["REPET_DATA"] - expMapFileName = "%s/Tools/DmelChr4_LTRharvest_MCL_expected.map" % os.environ["REPET_DATA"] - obsMapFileName = "%s.map" % os.path.splitext(self._outputFileName)[0] - - self.assertTrue(FileUtils.are2FilesIdentical(expFastaFileName, self._outputFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(expMapFileName, obsMapFileName)) - - os.remove(obsMapFileName) - - def test_run_clusterConsensus_headers(self): - os.remove(self._inputFileName) - self._inputFileName = "DmelChr4_LTRharvest_MCL_ClusterConsHeaders_input.fa" - os.symlink("%s/Tools/%s" % (os.environ["REPET_DATA"], self._inputFileName), self._inputFileName) - iLaunchMCL = LaunchMCL(self._inputFileName, isClusterConsensusHeaders = True, doClean = True, verbosity = 1) - iLaunchMCL.run() - expFastaFileName = "%s/Tools/DmelChr4_LTRharvest_MCL_ClusterConsHeaders_expected.fa" % os.environ["REPET_DATA"] - self._outputFileName = "%s_MCL.fa" % os.path.splitext(self._inputFileName)[0] - - self.assertTrue(FileUtils.are2FilesIdentical(expFastaFileName, self._outputFileName)) - - def test_run_as_script(self): - cmd = "LaunchMCL.py -i %s -j -v 6" % self._inputFileName - os.system(cmd) - expFileName = "%s/Tools/DmelChr4_LTRharvest_MCL_expected.fa" % os.environ["REPET_DATA"] - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, self._outputFileName)) - self.assertTrue(FileUtils.isRessourceExists("MCLtmpDirectory")) - - def test_run_as_script_allParams(self): - cmd = "LaunchMCL.py -i %s -j -I 1.5 -T 0.0 -m -v 6" % self._inputFileName - os.system(cmd) - expFileName = "%s/Tools/DmelChr4_LTRharvest_MCL_expected.fa" % os.environ["REPET_DATA"] - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, self._outputFileName)) - self.assertTrue(FileUtils.isRessourceExists("MCLtmpDirectory")) - - def test_run_as_script_without_join(self): - cmd = "LaunchMCL.py -i %s -v 2" % self._inputFileName - os.system(cmd) - expFileName = "%s/Tools/DmelChr4_LTRharvest_MCL_expected.fa" % os.environ["REPET_DATA"] - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, self._outputFileName)) - self.assertTrue(FileUtils.isRessourceExists("MCLtmpDirectory")) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchMap.py --- a/commons/launcher/tests/Test_F_LaunchMap.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,41 +0,0 @@ -import unittest -import os -import subprocess -from commons.core.utils.FileUtils import FileUtils -from commons.launcher.LaunchMap import LaunchMap - -class Test_F_LaunchMap(unittest.TestCase): - - def setUp(self): - self._fastaFileName = "LaunchMap_seqCluster1.fa" - fastaFilePath = "%s/Tools/%s" % (os.environ["REPET_DATA"], self._fastaFileName) - os.symlink(fastaFilePath, self._fastaFileName) - self._obsFileName = "%s.fa_aln" % self._fastaFileName - - def tearDown(self): - os.remove(self._fastaFileName) - try: - os.remove(self._obsFileName) - except: pass - - def test_run_as_script(self): - expFileName = "%s/Tools/expLaunchMap_seqCluster1.fa.fa_aln" % os.environ["REPET_DATA"] - obsFileName = "obs.fa_aln" - cmd = "LaunchMap.py " - cmd += "-i %s " % self._fastaFileName - cmd += "-o %s " % obsFileName - cmd += "-c " - process = subprocess.Popen(cmd, shell = True) - process.communicate() - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(obsFileName) - - def test_run(self): - expFileName = "%s/Tools/expLaunchMap_seqCluster1.fa.fa_aln" % os.environ["REPET_DATA"] - iLaunchMap = LaunchMap(self._fastaFileName) - iLaunchMap.setDoClean(True) - iLaunchMap.run() - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, self._obsFileName)) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchMatcher.py --- a/commons/launcher/tests/Test_F_LaunchMatcher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,63 +0,0 @@ -from commons.core.utils.FileUtils import FileUtils -import unittest -import os -import subprocess -from commons.launcher.LaunchMatcher import LaunchMatcher - -class Test_F_LaunchMatcher(unittest.TestCase): - - def setUp(self): - self._inFileName = "DmelChr4.align" - self._fastaFileName = "DmelChr4.fa" - inFilePath = "%s/Tools/%s" % (os.environ["REPET_DATA"], self._inFileName) - inFastaPath = "%s/Tools/%s" % (os.environ["REPET_DATA"], self._fastaFileName) - try: - os.remove(self._inFileName) - except: - pass - os.symlink(inFilePath, self._inFileName) - os.symlink(inFastaPath, self._fastaFileName) - self._iLaunchMatcher = LaunchMatcher(align=self._inFileName, queryFileName=self._fastaFileName, subjectFileName=self._fastaFileName, doJoin=True, evalue="1e-20", keepConflict=True) - self._iLaunchMatcher.setVerbosity(2) - - def tearDown(self): - try: - FileUtils.removeFilesByPattern("%s*" % self._inFileName) - os.remove(self._fastaFileName) - except: - pass - - def test_run_as_class_1_file(self): - expPathFileName = "%s/Tools/DmelChr4.align.match.path" % os.environ["REPET_DATA"] - expTabFileName = "%s/Tools/DmelChr4.align.match.tab" % os.environ["REPET_DATA"] - - obsPathFileName = "%s.match.path" % self._inFileName - obsTabFileName = "%s.match.tab" % self._inFileName - - self._iLaunchMatcher.run() - - self.assertTrue(FileUtils.are2FilesIdentical(expPathFileName, obsPathFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(expTabFileName, obsTabFileName)) - - def test_run_as_script(self): - expPathFileName = "%s/Tools/DmelChr4.align.match.path" % os.environ["REPET_DATA"] - expTabFileName = "%s/Tools/DmelChr4.align.match.tab" % os.environ["REPET_DATA"] - - cmd = "LaunchMatcher.py " - cmd += "-a %s " % self._inFileName - cmd += "-q %s " % self._fastaFileName - cmd += "-s %s " % self._fastaFileName - cmd += "-o DmelChr4.align " - cmd += "-j " - cmd += "-k " - cmd += "-e 1e-20 " - process = subprocess.Popen(cmd, shell = True) - process.communicate() - obsPathFileName = "%s.match.path" % self._inFileName - obsTabFileName = "%s.match.tab" % self._inFileName - - self.assertTrue(FileUtils.are2FilesIdentical(expPathFileName, obsPathFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(expTabFileName, obsTabFileName)) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchMummerPlot.py --- a/commons/launcher/tests/Test_F_LaunchMummerPlot.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,166 +0,0 @@\n-import unittest\n-import os\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.launcher.LaunchMummerPlot import LaunchMummerPlot\n-\n-class Test_F_LaunchMummerPlot(unittest.TestCase):\n- \n- def setUp(self):\n- self._queryFastaFileName = "query.fa"\n- self._refFastaFileName = "ref.fa"\n- self._writeInputFastaFiles()\n- \n- self._inputDeltaFileName = "inputNucmer.delta"\n- self._writeInputDeltaFileName()\n- \n- self._expGpFileName = "expMummerPlot.gp"\n- self._obsGpFileName = "obsMummerPlot.gp"\n- self._obsPngFileName = "obsMummerPlot.png"\n- \n- def tearDown(self):\n- try:\n- os.remove(self._queryFastaFileName)\n- except:pass\n- try:\n- os.remove(self._refFastaFileName)\n- except:pass\n- try:\n- os.remove(self._inputDeltaFileName)\n- except:pass\n- try:\n- os.remove(self._expGpFileName)\n- except:pass\n- try:\n- os.remove(self._obsGpFileName)\n- except:pass\n- try:\n- os.remove(self._obsPngFileName)\n- except:pass\n- \n- \n- def test_run(self):\n- self._writeExpGpFile()\n- ilaunchMummerPlot = LaunchMummerPlot(self._inputDeltaFileName, self._refFastaFileName, self._queryFastaFileName,"obsMummerPlot",fat=True, filter=True, clean=True, verbosity=1)\n- ilaunchMummerPlot.run()\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expGpFileName, self._obsGpFileName))\n- \n- def test_run_as_script(self):\n- self._writeExpGpFile()\n- cmd = \'LaunchMummerPlot.py --input %s --Qfile %s --Rfile %s --prefix %s --fat --filter --clean\' % (self._inputDeltaFileName, self._refFastaFileName, self._queryFastaFileName, "obsMummerPlot")\n- os.system(cmd)\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expGpFileName, self._obsGpFileName))\n- \n- def _writeInputFastaFiles(self):\n- InputFile = open(self._queryFastaFileName, \'w\')\n- InputFile.write(\'>Bovc-tA2:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGCTTCCCTGGTAGCTCAGCTGGTAAAGAATCCGCCTGCAATGCAGGAGACCCCGGTTC\\n\')\n- InputFile.write(\'GATTCCTGGGTCGGGAAGATCCCCTGGAGAAGGGATAGGCTACCCACTCCAGTATTCTTG\\n\')\n- InputFile.write(\'GGCTTCCCTGGTGGCTCAGACGGTAAAGAATCCGCCTGCAATGCGGGAGACCTGGGTTCG\\n\')\n- InputFile.write(\'ATCCCTGGGTTGGGAAGATCCCCTGGAGGAGGGCATGGCAACCCACTCCAGTATTCTTGC\\n\')\n- InputFile.write(\'CTGGAGAATCCCCATGGACAGAGGAGCCTGGCGGGCTACAGTCCATGGGGTCGCAAAGAG\\n\')\n- InputFile.write(\'TCGGACACGACTGAGCGACTAAGCACAGCACAG\\n\')\n- InputFile.write(\'>SUSINE2:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGAGTTCTCTGATGGCCTAGCGGGTTGAGGCTCCTGCGTTCTCACCGCTGTGGCTCTGG\\n\')\n- InputFile.write(\'TTGCTGCTGTGCGGCGTAGGTTCAATCCCTGGCCCAGGAATTCCCACATACTGCCTGTGT\\n\')\n- InputFile.write(\'GGCAAAAAAGAAAAAAAAAAAAAATACAAAAAAAAAAAAAACAAGAGAGAACCTGAAATA\\n\')\n- InputFile.write(\'AACGTTGCAACTCTCATTNAAAAAAAAAAA\\n\')\n- InputFile.write(\'>SINE1A_SS:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGAGTTCTCTTGTGGCACAGCAGGTTAAGGATCCAGCGTTGTCACTGCAGTGGCTTGGG\\n\')\n- InputFile.write(\'TCGCTGCTGTGGCACGGGTTCAATCCCTGGCCCAGGAACTTCCACATGCCACGGGCATGG\\n\')\n- InputFile.write(\'CCAAAAAAAAA\\n\')\n- InputFile.write(\'>SINE2-1_Pca:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGCAGTGGTGGTTCAGTGGTAGAATTCTTGCCTTCCATGCGGGAGACCCGGGTTCGATT\\n\')\n- InputFile.write(\'CCCGGCCAGTGCACCTCATGCGCAGCCACCACCCGTCTGTCAGTGGAGGCTTGCGTGTTG\\n\')\n- InputFile.write(\'CTGTGATGCTGAACAGGTTTCAGCGGAGCTTCCAGACTAAGACGGACTAGGAAGAAAGGC\\n\')\n- InputFile.write(\'CTGGCGATCTACTTCTGAAAATCAGCCAATGAAAACCCTGTGGATCACAGTGGTCTGATC\\n\')\n- InputFile.write(\'TGCAACTGATCATGGGGATGGCGCAGGACCGGGCAGCGTTTTGTTCTATTGTGCATGGGG\\n\')\n- InputFile.write(\'TCGCCATGAGTCGGGCCGACTCGATGGCAGCTAACAACAA\\n\')\n- InputFile.write(\'>SINE_FR2:classI:SINE:?\\n\')\n- InputFile.write(\'GGGCGG'..b'ACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG\\n\')\n- InputFile.write(\'TGTCTCTGCCTCTCTCTCTCTCTGTGTCTCTCATGAATAAATAA\\n\')\n- InputFile.write(\'>ALPINE1:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGGAGGGTATAGCTCAGTGGTAGAGCGCATGCTTAGCATGCACGAGGTCCTGGGTTCAA\\n\')\n- InputFile.write(\'TCCCCAGTACCTCCATTAAAAATAAATAAATAAATAAACCTAATTACCTCCCCCACCAAA\\n\')\n- InputFile.write(\'AAAAAAA\\n\')\n- InputFile.close()\n- \n- InputFile = open(self._refFastaFileName, \'w\')\n- InputFile.write(\'>SINE_FR2:classI:SINE:?\\n\')\n- InputFile.write(\'GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC\\n\')\n- InputFile.write(\'GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT\\n\')\n- InputFile.write(\'GCCTGCGTGGGTTCTCTCCGGGTACTCCGGCTTCCTCCCACAGTCCAAAGACATGCATGA\\n\')\n- InputFile.write(\'TTGGGGATTAGGCTAATTGGAAACTCTAAAATTGCCCGTAGGTGTGAGTGTGAGAGAGAA\\n\')\n- InputFile.write(\'TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCCAGGGTGTACC\\n\')\n- InputFile.write(\'CTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCCCG\\n\')\n- InputFile.write(\'CAAGCGGTAGAAAGTGAGTGAGTGAGTGA\\n\')\n- InputFile.write(\'>SINEC1B2_CF:classI:SINE:?\\n\')\n- InputFile.write(\'GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCGTGATCCTGGA\\n\')\n- InputFile.write(\'GACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG\\n\')\n- InputFile.write(\'TGTCTCTGCCTCTCTCTCTCTCTGTGTCTCTCATGAATAAA\\n\')\n- InputFile.close()\n- \n- def _writeExpGpFile(self):\n- f = open(self._expGpFileName, \'w\')\n- f.write(\'set terminal png tiny size 800,800\\n\')\n- f.write(\'set output "obsMummerPlot.png"\\n\')\n- f.write(\'set xtics rotate ( \\\\\\n\')\n- f.write(\' "SINE_FR2:classI:SINE:?" 1, \\\\\\n\')\n- f.write(\' "SINEC1B2_CF:classI:SINE:?" 389, \\\\\\n\')\n- f.write(\' "SINE1A_SS:classI:SINE:SINE2/tRNA" 552, \\\\\\n\')\n- f.write(\' "SUSINE2:classI:SINE:SINE2/tRNA" 682, \\\\\\n\')\n- f.write(\' "Bovc-tA2:classI:SINE:SINE2/tRNA" 891, \\\\\\n\')\n- f.write(\' "ALPINE1:classI:SINE:SINE2/tRNA" 1223, \\\\\\n\')\n- f.write(\' "SINE2-1_Pca:classI:SINE:SINE2/tRNA" 1349, \\\\\\n\')\n- f.write(\' "" 1694 \\\\\\n\')\n- f.write(\')\\n\')\n- f.write(\'set ytics ( \\\\\\n\')\n- f.write(\' "SINE_FR2:classI:SINE:?" 1, \\\\\\n\')\n- f.write(\' "SINEC1B2_CF:classI:SINE:?" 371, \\\\\\n\')\n- f.write(\' "" 532 \\\\\\n\')\n- f.write(\')\\n\')\n- f.write(\'set size 1,1\\n\')\n- f.write(\'set grid\\n\')\n- f.write(\'unset key\\n\')\n- f.write(\'set border 0\\n\')\n- f.write(\'set tics scale 0\\n\')\n- f.write(\'set xlabel "REF"\\n\')\n- f.write(\'set ylabel "QRY"\\n\')\n- f.write(\'set format "%.0f"\\n\')\n- f.write(\'set mouse format "%.0f"\\n\')\n- f.write(\'set mouse mouseformat "[%.0f, %.0f]"\\n\')\n- f.write(\'set mouse clipboardformat "[%.0f, %.0f]"\\n\')\n- f.write(\'set xrange [1:1694]\\n\')\n- f.write(\'set yrange [1:532]\\n\')\n- f.write(\'set style line 1 lt 1 lw 3 pt 6 ps 1\\n\')\n- f.write(\'set style line 2 lt 3 lw 3 pt 6 ps 1\\n\')\n- f.write(\'set style line 3 lt 2 lw 3 pt 6 ps 1\\n\')\n- f.write(\'plot \\\\\\n\')\n- f.write(\' "obsMummerPlot.fplot" title "FWD" w lp ls 1, \\\\\\n\')\n- f.write(\' "obsMummerPlot.rplot" title "REV" w lp ls 2\\n\')\n- f.write(\'\')\n- f.close()\n- \n- def _writeInputDeltaFileName(self):\n- f = open(self._inputDeltaFileName, \'w\')\n- f.write("%s %s\\n" %(os.path.abspath(self._queryFastaFileName), os.path.abspath(self._refFastaFileName)))\n- f.write(\'NUCMER\\n\')\n- f.write(\'>SINE_FR2:classI:SINE:? SINE_FR2:classI:SINE:? 389 371\\n\')\n- f.write(\'1 343 1 343 0 0 0\\n\')\n- f.write(\'0\\n\')\n- f.write(\'>SINEC1B2_CF:classI:SINE:? SINEC1B2_CF:classI:SINE:? 164 161\\n\')\n- f.write(\'1 161 1 161 0 0 0\\n\')\n- f.write(\'0\\n\')\n- f.close()\n- \n-if __name__ == "__main__":\n- unittest.main()\n- \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchNucmer.py --- a/commons/launcher/tests/Test_F_LaunchNucmer.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,153 +0,0 @@\n-import unittest\n-import os\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.launcher.LaunchNucmer import LaunchNucmer\n-\n-class Test_F_LaunchNucmer(unittest.TestCase):\n- \n- def setUp(self):\n- self._queryFastaFileName = "query.fa"\n- self._refFastaFileName = "ref.fa"\n- self._writeInputFastaFiles()\n- self._expDeltaFileName = "expNucmer.delta"\n- self._writeExpDeltaFile()\n- self._obsDeltaFileName = "obsNucmer.delta"\n- self._obsCoordFileName= "obsNucmer.coords"\n- self._expCoordFileName= "expNucmer.coords"\n- \n- def tearDown(self):\n- try:\n- os.remove(self._queryFastaFileName)\n- except:pass\n- try:\n- os.remove(self._refFastaFileName)\n- except:pass\n- try:\n- os.remove(self._expDeltaFileName)\n- except:pass\n- try:\n- os.remove(self._obsDeltaFileName)\n- except:pass\n- \n- def test_run(self):\n- ilauncher = LaunchNucmer(self._refFastaFileName, self._queryFastaFileName,"obsNucmer",verbosity=1)\n- ilauncher.run()\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expDeltaFileName, self._obsDeltaFileName))\n- \n- def test_run_as_script(self):\n- cmd = \'LaunchNucmer.py --query %s --ref %s --prefix %s\' % (self._refFastaFileName, self._queryFastaFileName, "obsNucmer")\n- os.system(cmd)\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expDeltaFileName, self._obsDeltaFileName))\n- \n- def test_run_as_script_gencoords_output(self):\n- self._writeExpGenCoordsFile()\n- cmd = \'LaunchNucmer.py --query %s --ref %s --prefix %s --gencoords\' % (self._refFastaFileName, self._queryFastaFileName, "obsNucmer")\n- os.system(cmd)\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expCoordFileName, self._obsCoordFileName))\n- os.remove(self._obsCoordFileName)\n- os.remove(self._expCoordFileName)\n- \n- def test_run_as_script_with_mincluster(self):\n- cmd = \'LaunchNucmer.py --query %s --ref %s --prefix %s --mincluster 30\' % (self._refFastaFileName, self._queryFastaFileName, "obsNucmer")\n- os.system(cmd)\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expDeltaFileName, self._obsDeltaFileName)) \n- \n- def test_run_as_script_showcoords_output(self):\n- self._writeExpShowCoordsFile()\n- cmd = \'LaunchNucmer.py --query %s --ref %s --prefix %s --showcoords\' % (self._refFastaFileName, self._queryFastaFileName, "obsNucmer")\n- os.system(cmd)\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expCoordFileName, self._obsCoordFileName))\n- os.remove(self._obsCoordFileName)\n- os.remove(self._expCoordFileName) \n- \n- def _writeInputFastaFiles(self):\n- InputFile = open(self._queryFastaFileName, \'w\')\n- InputFile.write(\'>Bovc-tA2:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGCTTCCCTGGTAGCTCAGCTGGTAAAGAATCCGCCTGCAATGCAGGAGACCCCGGTTC\\n\')\n- InputFile.write(\'GATTCCTGGGTCGGGAAGATCCCCTGGAGAAGGGATAGGCTACCCACTCCAGTATTCTTG\\n\')\n- InputFile.write(\'GGCTTCCCTGGTGGCTCAGACGGTAAAGAATCCGCCTGCAATGCGGGAGACCTGGGTTCG\\n\')\n- InputFile.write(\'ATCCCTGGGTTGGGAAGATCCCCTGGAGGAGGGCATGGCAACCCACTCCAGTATTCTTGC\\n\')\n- InputFile.write(\'CTGGAGAATCCCCATGGACAGAGGAGCCTGGCGGGCTACAGTCCATGGGGTCGCAAAGAG\\n\')\n- InputFile.write(\'TCGGACACGACTGAGCGACTAAGCACAGCACAG\\n\')\n- InputFile.write(\'>SUSINE2:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGAGTTCTCTGATGGCCTAGCGGGTTGAGGCTCCTGCGTTCTCACCGCTGTGGCTCTGG\\n\')\n- InputFile.write(\'TTGCTGCTGTGCGGCGTAGGTTCAATCCCTGGCCCAGGAATTCCCACATACTGCCTGTGT\\n\')\n- InputFile.write(\'GGCAAAAAAGAAAAAAAAAAAAAATACAAAAAAAAAAAAAACAAGAGAGAACCTGAAATA\\n\')\n- InputFile.write(\'AACGTTGCAACTCTCATTNAAAAAAAAAAA\\n\')\n- InputFile.write(\'>SINE1A_SS:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGAGTTCTCTTGTGGCACAGCAGGTTAAG'..b'GTGAGTGTGAGAGAGAA\\n\')\n- InputFile.write(\'TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCCAGGGTGTACC\\n\')\n- InputFile.write(\'CTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCCCGCGACCCTCAGTGGAGGAA\\n\')\n- InputFile.write(\'CAAGCGGTAGAAAGTGAGTGAGTGAGTGA\\n\')\n- InputFile.write(\'>SINEC1B2_CF:classI:SINE:?\\n\')\n- InputFile.write(\'GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCGTGATCCTGGA\\n\')\n- InputFile.write(\'GACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG\\n\')\n- InputFile.write(\'TGTCTCTGCCTCTCTCTCTCTCTGTGTCTCTCATGAATAAATAA\\n\')\n- InputFile.write(\'>ALPINE1:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGGAGGGTATAGCTCAGTGGTAGAGCGCATGCTTAGCATGCACGAGGTCCTGGGTTCAA\\n\')\n- InputFile.write(\'TCCCCAGTACCTCCATTAAAAATAAATAAATAAATAAACCTAATTACCTCCCCCACCAAA\\n\')\n- InputFile.write(\'AAAAAAA\\n\')\n- InputFile.close()\n- \n- InputFile = open(self._refFastaFileName, \'w\')\n- InputFile.write(\'>SINE_FR2:classI:SINE:?\\n\')\n- InputFile.write(\'GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC\\n\')\n- InputFile.write(\'GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT\\n\')\n- InputFile.write(\'GCCTGCGTGGGTTCTCTCCGGGTACTCCGGCTTCCTCCCACAGTCCAAAGACATGCATGA\\n\')\n- InputFile.write(\'TTGGGGATTAGGCTAATTGGAAACTCTAAAATTGCCCGTAGGTGTGAGTGTGAGAGAGAA\\n\')\n- InputFile.write(\'TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCCAGGGTGTACC\\n\')\n- InputFile.write(\'CTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCCCG\\n\')\n- InputFile.write(\'CAAGCGGTAGAAAGTGAGTGAGTGAGTGA\\n\')\n- InputFile.write(\'>SINEC1B2_CF:classI:SINE:?\\n\')\n- InputFile.write(\'GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCGTGATCCTGGA\\n\')\n- InputFile.write(\'GACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG\\n\')\n- InputFile.write(\'TGTCTCTGCCTCTCTCTCTCTCTGTGTCTCTCATGAATAAA\\n\')\n- InputFile.close()\n- \n- def _writeExpDeltaFile(self):\n- f = open(self._expDeltaFileName, \'w\')\n- f.write("%s %s\\n" %(os.path.abspath(self._queryFastaFileName), os.path.abspath(self._refFastaFileName)))\n- f.write(\'NUCMER\\n\')\n- f.write(\'>SINE_FR2:classI:SINE:? SINE_FR2:classI:SINE:? 389 371\\n\')\n- f.write(\'1 343 1 343 0 0 0\\n\')\n- f.write(\'0\\n\')\n- f.write(\'>SINEC1B2_CF:classI:SINE:? SINEC1B2_CF:classI:SINE:? 164 161\\n\')\n- f.write(\'1 161 1 161 0 0 0\\n\')\n- f.write(\'0\\n\')\n- f.close()\n- \n- def _writeExpGenCoordsFile(self):\n- f = open(self._expCoordFileName, \'w\')\n- f.write("%s %s\\n" %(os.path.abspath(self._queryFastaFileName), os.path.abspath(self._refFastaFileName)))\n- f.write(\'NUCMER\\n\\n\')\n- f.write(\' [S1] [E1] | [S2] [E2] | [LEN 1] [LEN 2] | [% IDY] | [TAGS]\\n\')\n- f.write(\'=====================================================================================\\n\')\n- f.write(\' 1 161 | 1 161 | 161 161 | 100.00 | SINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\' 1 343 | 1 343 | 343 343 | 100.00 | SINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.close()\n- \n- def _writeExpShowCoordsFile(self):\n- f = open(self._expCoordFileName, \'w\')\n- f.write("%s %s\\n" %(os.path.abspath(self._queryFastaFileName), os.path.abspath(self._refFastaFileName)))\n- f.write(\'NUCMER\\n\\n\')\n- f.write(\'[S1]\\t[E1]\\t[S2]\\t[E2]\\t[LEN 1]\\t[LEN 2]\\t[% IDY]\\t[LEN R]\\t[LEN Q]\\t[COV R]\\t[COV Q]\\t[FRM]\\t[TAGS]\\n\')\n- f.write(\'1\\t161\\t1\\t161\\t161\\t161\\t100.00\\t164\\t161\\t98.17\\t100.00\\t1\\t1\\tSINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\'1\\t343\\t1\\t343\\t343\\t343\\t100.00\\t389\\t371\\t88.17\\t92.45\\t1\\t1\\tSINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.close()\n- \n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchPhyML.py --- a/commons/launcher/tests/Test_F_LaunchPhyML.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,83 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -from shutil import rmtree -from commons.launcher.LaunchPhyML import LaunchPhyML - - -class Test_F_LaunchPhyML(unittest.TestCase): - - def setUp(self): - self._curTestDir = os.getcwd() - self._testPrefix = 'test_LRA' - try: - os.makedirs(self._testPrefix) - except:pass - os.chdir(self._testPrefix) - - - self._inputFastaFileName = "%s_input.fa" % self._testPrefix - self._obsOutputFileName = self._inputFastaFileName +'_obs.phylip' - self._expOutputFileName = "%s_exp.phylip" % self._testPrefix - self._writeInputFile() - -# def tearDown(self): -# os.chdir(self._curTestDir) -# try: -# rmtree(self._testPrefix) -# except:pass - - def test_run(self): - #phylip use only same length sequences - self._writeExpFile() - ilauncher = LaunchPhyML(self._inputFastaFileName,verbosity=7) - ilauncher.run() - self.assertTrue(FileUtils.are2FilesIdentical(self._expOutputFileName, self._obsOutputFileName)) - - -# def test_run_as_script(self): -# self._writeExpOutputFile_wo_refseq() -# cmd = 'LaunchPhyML.py -i %s -o %s -v 5' % (self._inputFastaFileName, self._obsOutputFileName) -# os.system(cmd) -# self.assertTrue(FileUtils.are2FilesIdentical(self._expOutputFileName, self._obsOutputFileName)) - - - def _writeInputFile(self): - InputFile = open(self._inputFastaFileName, 'w') - InputFile.write(""">sequence1 -GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC -GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT -GCCTGCGTGGGTTCTCTCCGGGTACTCCGGCTTCCTCCCACAGTCCAAAG ->sequence2 -GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCGTGATCCTGGA -GACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG -GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGG ->sequence3 -ATCTTAGTTTTGCTGAGCGCCTTCATGGCTGCTTGACTATCAGACAGTATAGCAATGTCC -TTGCCATGATAGTTCCTTTTCAGATTAAACTCTGCACAGCGTCCAATAGCACAGACTTCA -GCTTGAATGCTGGTGTATCTGCCCATTGATTCGTGGTATTTCAACCTGGG -""") - InputFile.close() - - def _writeExpFile(self): - InputFile = open(self._expOutputFileName, 'w') - InputFile.write(""" 3 170 -sequence1 GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGG -sequence2 GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCG -sequence3 ATCTTAGTTTTGCTGAGCGCCTTCATGGCTGCTTGACTATCAGACAGTAT - -CCCCGGGTTCGATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGG -TGATCCTGGAGACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAG -AGCAATGTCCTTGCCATGATAGTTCCTTTTCAGATTAAACTCTGCACAGC - -AGTTTGCATGTTCTCCCTGTGCCTGCGTGGGTTCTCTCCGGGTACTCCGG -CCTGCTTCTCCCTCTGCCTGGGGCGGCACGGTGGTGTGGTGGTTAGCACT -GTCCAATAGCACAGACTTCAGCTTGAATGCTGGTGTATCTGCCCATTGAT - -CTTCCTCCCACAGTCCAAAG -GTTGCCTCACAGCAAGAAGG -TCGTGGTATTTCAACCTGGG""") - InputFile.close() - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchPromer.py --- a/commons/launcher/tests/Test_F_LaunchPromer.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,231 +0,0 @@\n-import unittest\n-import os\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.launcher.LaunchPromer import LaunchPromer\n-\n-\n-class Test_F_LaunchPromer(unittest.TestCase):\n- \n- def setUp(self):\n- self._queryFastaFileName = "query.fa"\n- self._refFastaFileName = "ref.fa"\n- self._writeInputFastaFiles()\n- self._expDeltaFileName = "expPromer.delta"\n- self._writeExpDeltaFile()\n- self._obsDeltaFileName = "obsPromer.delta"\n- self._obsCoordFileName= "obsPromer.coords"\n- self._expCoordFileName= "expPromer.coords"\n- \n- def tearDown(self):\n- try:\n- os.remove(self._queryFastaFileName)\n- except:pass\n- try:\n- os.remove(self._refFastaFileName)\n- except:pass\n- try:\n- os.remove(self._expDeltaFileName)\n- except:pass\n- try:\n- os.remove(self._obsDeltaFileName)\n- except:pass\n- \n- def test_run(self):\n- ilauncher = LaunchPromer(self._refFastaFileName, self._queryFastaFileName,"obsPromer",verbosity=1)\n- ilauncher.run()\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expDeltaFileName, self._obsDeltaFileName))\n- \n- def test_run_as_script(self):\n- cmd = \'LaunchPromer.py --query %s --ref %s --prefix %s\' % (self._refFastaFileName, self._queryFastaFileName, "obsPromer")\n- os.system(cmd)\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expDeltaFileName, self._obsDeltaFileName))\n- \n- def test_run_as_script_gencoords_output(self):\n- self._writeExpGenCoordsFile()\n- cmd = \'LaunchPromer.py --query %s --ref %s --prefix %s --gencoords\' % (self._refFastaFileName, self._queryFastaFileName, "obsPromer")\n- os.system(cmd)\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expCoordFileName, self._obsCoordFileName))\n- os.remove(self._obsCoordFileName)\n- os.remove(self._expCoordFileName)\n- \n- def test_run_as_script_with_mincluster(self):\n- cmd = \'LaunchPromer.py --query %s --ref %s --prefix %s --mincluster 30\' % (self._refFastaFileName, self._queryFastaFileName, "obsPromer")\n- os.system(cmd)\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expDeltaFileName, self._obsDeltaFileName)) \n- \n- def test_run_as_script_showcoords_output(self):\n- self._writeExpShowCoordsFile()\n- cmd = \'LaunchPromer.py --query %s --ref %s --prefix %s --showcoords\' % (self._refFastaFileName, self._queryFastaFileName, "obsPromer")\n- os.system(cmd)\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expCoordFileName, self._obsCoordFileName))\n- os.remove(self._obsCoordFileName)\n- os.remove(self._expCoordFileName) \n- \n- def _writeInputFastaFiles(self):\n- InputFile = open(self._queryFastaFileName, \'w\')\n- InputFile.write(\'>Bovc-tA2:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGCTTCCCTGGTAGCTCAGCTGGTAAAGAATCCGCCTGCAATGCAGGAGACCCCGGTTC\\n\')\n- InputFile.write(\'GATTCCTGGGTCGGGAAGATCCCCTGGAGAAGGGATAGGCTACCCACTCCAGTATTCTTG\\n\')\n- InputFile.write(\'GGCTTCCCTGGTGGCTCAGACGGTAAAGAATCCGCCTGCAATGCGGGAGACCTGGGTTCG\\n\')\n- InputFile.write(\'ATCCCTGGGTTGGGAAGATCCCCTGGAGGAGGGCATGGCAACCCACTCCAGTATTCTTGC\\n\')\n- InputFile.write(\'CTGGAGAATCCCCATGGACAGAGGAGCCTGGCGGGCTACAGTCCATGGGGTCGCAAAGAG\\n\')\n- InputFile.write(\'TCGGACACGACTGAGCGACTAAGCACAGCACAG\\n\')\n- InputFile.write(\'>SUSINE2:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGAGTTCTCTGATGGCCTAGCGGGTTGAGGCTCCTGCGTTCTCACCGCTGTGGCTCTGG\\n\')\n- InputFile.write(\'TTGCTGCTGTGCGGCGTAGGTTCAATCCCTGGCCCAGGAATTCCCACATACTGCCTGTGT\\n\')\n- InputFile.write(\'GGCAAAAAAGAAAAAAAAAAAAAATACAAAAAAAAAAAAAACAAGAGAGAACCTGAAATA\\n\')\n- InputFile.write(\'AACGTTGCAACTCTCATTNAAAAAAAAAAA\\n\')\n- InputFile.write(\'>SINE1A_SS:classI:SINE:SINE2/tRNA\\n\')\n- InputFile.write(\'GGGAGTTCTCTTGTGGCACAGCAGGTTA'..b'.00 100.00 1.89 | 3 3 SINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\' 159 1 | 159 1 | 159 159 | 100.00 100.00 3.77 | -3 -3 SINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\' 160 2 | 160 2 | 159 159 | 100.00 100.00 1.89 | -2 -2 SINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\' 161 3 | 161 3 | 159 159 | 100.00 100.00 0.00 | -1 -1 SINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\' 1 387 | 1 369 | 387 369 | 95.35 95.35 3.88 | 1 1 SINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.write(\' 2 388 | 2 370 | 387 369 | 95.35 95.35 3.10 | 2 2 SINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.write(\' 3 389 | 3 371 | 387 369 | 95.35 95.35 6.20 | 3 3 SINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.write(\' 387 1 | 369 1 | 387 369 | 95.35 95.35 1.94 | -3 -3 SINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.write(\' 388 2 | 370 2 | 387 369 | 95.35 95.35 2.33 | -2 -2 SINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.write(\' 389 3 | 371 3 | 387 369 | 95.35 95.35 1.55 | -1 -1 SINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- \n- \n- def _writeExpShowCoordsFile(self):\n- with open(self._expCoordFileName, \'w\') as f:\n- f.write("%s %s\\n" %(os.path.abspath(self._queryFastaFileName), os.path.abspath(self._refFastaFileName)))\n- f.write(\'PROMER\\n\\n\')\n- f.write(\'[S1]\\t[E1]\\t[S2]\\t[E2]\\t[LEN 1]\\t[LEN 2]\\t[% IDY]\\t[% SIM]\\t[% STP]\\t[LEN R]\\t[LEN Q]\\t[COV R]\\t[COV Q]\\t[FRM]\\t[TAGS]\\n\')\n- f.write(\'1\\t159\\t1\\t159\\t159\\t159\\t100.00\\t100.00\\t1.89\\t164\\t161\\t96.95\\t98.76\\t1\\t1\\tSINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\'2\\t160\\t2\\t160\\t159\\t159\\t100.00\\t100.00\\t3.77\\t164\\t161\\t96.95\\t98.76\\t2\\t2\\tSINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\'3\\t161\\t3\\t161\\t159\\t159\\t100.00\\t100.00\\t1.89\\t164\\t161\\t96.95\\t98.76\\t3\\t3\\tSINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\'159\\t1\\t159\\t1\\t159\\t159\\t100.00\\t100.00\\t3.77\\t164\\t161\\t96.95\\t98.76\\t-3\\t-3\\tSINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\'160\\t2\\t160\\t2\\t159\\t159\\t100.00\\t100.00\\t1.89\\t164\\t161\\t96.95\\t98.76\\t-2\\t-2\\tSINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\'161\\t3\\t161\\t3\\t159\\t159\\t100.00\\t100.00\\t0.00\\t164\\t161\\t96.95\\t98.76\\t-1\\t-1\\tSINEC1B2_CF:classI:SINE:?\\tSINEC1B2_CF:classI:SINE:?\\n\')\n- f.write(\'1\\t387\\t1\\t369\\t387\\t369\\t95.35\\t95.35\\t3.88\\t389\\t371\\t99.49\\t99.46\\t1\\t1\\tSINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.write(\'2\\t388\\t2\\t370\\t387\\t369\\t95.35\\t95.35\\t3.10\\t389\\t371\\t99.49\\t99.46\\t2\\t2\\tSINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.write(\'3\\t389\\t3\\t371\\t387\\t369\\t95.35\\t95.35\\t6.20\\t389\\t371\\t99.49\\t99.46\\t3\\t3\\tSINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.write(\'387\\t1\\t369\\t1\\t387\\t369\\t95.35\\t95.35\\t1.94\\t389\\t371\\t99.49\\t99.46\\t-3\\t-3\\tSINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.write(\'388\\t2\\t370\\t2\\t387\\t369\\t95.35\\t95.35\\t2.33\\t389\\t371\\t99.49\\t99.46\\t-2\\t-2\\tSINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n- f.write(\'389\\t3\\t371\\t3\\t387\\t369\\t95.35\\t95.35\\t1.55\\t389\\t371\\t99.49\\t99.46\\t-1\\t-1\\tSINE_FR2:classI:SINE:?\\tSINE_FR2:classI:SINE:?\\n\')\n-\n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchRefAlign.py --- a/commons/launcher/tests/Test_F_LaunchRefAlign.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,72 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -from commons.launcher.LaunchRefAlign import LaunchRefAlign - - -class Test_F_LaunchRefAlign(unittest.TestCase): - - def setUp(self): - self._inputFastaFileName = "input.fa" - self._obsOutputFileName = "obs" - self._expOutputFileName = "exp" - self._writeInputFile() - self._writeExpOutputFile() - -# def tearDown(self): -# try: -# os.remove(self._inputFastaFileName) -# except:pass -# -# try: -# os.remove(self._expOutputFileName) -# except:pass -# try: -# os.remove(self._obsOutputFileName) -# except:pass -# try: -# os.remove("input.fa.2.3.5.80.10.20.15.dat") -# except:pass - - def test_run(self): - ilauncher = LaunchRefAlign(self._inputFastaFileName,verbosity=5) - ilauncher.run() - self.assertTrue(FileUtils.are2FilesIdentical(self._expOutputFileName, self._obsOutputFileName)) - -# def test_run_as_script(self): -# cmd = 'LaunchTRF.py -i %s -o %s -v 3' % (self._inputFastaFileName, self._obsTRFOutputFileName) -# os.system(cmd) -# self.assertTrue(FileUtils.are2FilesIdentical(self._expTRFOutputFileName, self._obsTRFOutputFileName)) - - - def _writeInputFile(self): - InputFile = open(self._inputFastaFileName, 'w') - InputFile.write('>sequence\n') - InputFile.write('GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC\n') - InputFile.write('GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT\n') - InputFile.write('GCCTGCGTGGGTTCTCTCCGGGTACTCCGGCTTCCTCCCACAGTCCAAAGACATGCATGA\n') - InputFile.write('TTGGGGATTAGGCTAATTGGAAACTCTAAAATTGCCCGTAGGTGTGAGTGTGAGAGAGAA\n') - InputFile.write('TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCCAGGGTGTACC\n') - InputFile.write('CTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCCCG\n') - InputFile.write('CAAGCGGTAGAAAGTGAGTGAGTGAGTGA\n') - InputFile.write('>sequence2\n') - InputFile.write('GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCGTGATCCTGGA\n') - InputFile.write('GACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG\n') - InputFile.write('TGTCTCTGCCTCTCTCTCTCTCTGTGTCTCTCATGAATAAA\n') - InputFile.close() - - def _writeExpOutputFile(self): - with open(self._expOutputFileName,'w') as expOutputFile: - expOutputFile.write("""1\t(GTGGT)2\tsequence\t11\t21 -2\t(GGT)5\tsequence\t10\t23 -3\t(GTGTGA)4\tsequence\t222\t242 -4\t(GTCCA)2\tsequence\t282\t292 -5\t(AGTG)4\tsequence\t355\t371 -6\t(GCCTGTCTCTCCTCT)4\tsequence2\t100\t152 -7\t(CTCTGCCTGTGT)3\tsequence2\t112\t151 -8\t(TC)23\tsequence2\t107\t152 -""") - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchRefalign.py --- a/commons/launcher/tests/Test_F_LaunchRefalign.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,104 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -from commons.launcher.LaunchRefAlign import LaunchRefAlign -from shutil import rmtree - - -class Test_F_LaunchRefAlign(unittest.TestCase): - - def setUp(self): - self._curTestDir = os.getcwd() - self._testPrefix = 'test_LRA' - try: - os.makedirs(self._testPrefix) - except:pass - os.chdir(self._testPrefix) - - - self._inputFastaFileName = "%s_input.fa" % self._testPrefix - self._obsOutputFileName = self._inputFastaFileName +'.fa_aln' - self._expOutputFileName = "%s_exp.fa_aln" % self._testPrefix - self._writeInputFile() - - def tearDown(self): - os.chdir(self._curTestDir) - try: - rmtree(self._testPrefix) - except:pass - - def test_run(self): - self._writeExpOutputFile_wo_refseq() - ilauncher = LaunchRefAlign(self._inputFastaFileName,verbosity=5) - ilauncher.run() - self.assertTrue(FileUtils.are2FilesIdentical(self._expOutputFileName, self._obsOutputFileName)) - - def test_run_KeepRefSeq(self): - self._writeExpOutputFile_with_refseq() - ilauncher = LaunchRefAlign(self._inputFastaFileName,verbosity=5, keepRefseq=True) - ilauncher.run() - - self.assertTrue(FileUtils.are2FilesIdentical(self._expOutputFileName, self._obsOutputFileName)) - - def test_run_as_script(self): - self._writeExpOutputFile_wo_refseq() - cmd = 'LaunchRefAlign.py -i %s -o %s -v 5' % (self._inputFastaFileName, self._obsOutputFileName) - os.system(cmd) - self.assertTrue(FileUtils.are2FilesIdentical(self._expOutputFileName, self._obsOutputFileName)) - - def test_run_as_script_KeepRefSeq(self): - self._writeExpOutputFile_with_refseq() - cmd = 'LaunchRefAlign.py -i %s -r -o %s -v 5' % (self._inputFastaFileName, self._obsOutputFileName) - os.system(cmd) - self.assertTrue(FileUtils.are2FilesIdentical(self._expOutputFileName, self._obsOutputFileName)) - - def _writeInputFile(self): - InputFile = open(self._inputFastaFileName, 'w') - InputFile.write('>sequence\n') - InputFile.write('GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC\n') - InputFile.write('GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT\n') - InputFile.write('GCCTGCGTGGGTTCTCTCCGGGTACTCCGGCTTCCTCCCACAGTCCAAAGACATGCATGA\n') - InputFile.write('TTGGGGATTAGGCTAATTGGAAACTCTAAAATTGCCCGTAGGTGTGAGTGTGAGAGAGAA\n') - InputFile.write('TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCCAGGGTGTACC\n') - InputFile.write('CTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCCCG\n') - InputFile.write('CAAGCGGTAGAAAGTGAGTGAGTGAGTGA\n') - InputFile.write('>sequence2\n') - InputFile.write('GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCGTGATCCTGGA\n') - InputFile.write('GACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG\n') - InputFile.write('TGTCTCTGCCTCTCTCTCTCTCTGTGTCTCTCATGAATAAA\n') - InputFile.close() - - def _writeExpOutputFile_wo_refseq(self): - with open(self._expOutputFileName,'w') as expOutputFile: - expOutputFile.write(""">sequence2 -GGGCAGC-CGGTGGTGCGGT--TTAGCGCTGTTGGCCCAGGGCGTGATGGACCCGGGATC -GATCCCACATCGGG--------------CTCCCTGCATGGAGCCTGC---TTCTCCCTCT -GCCTGTGTCTCTTCTCTC------------------------------------------ ------------------------------------------------------------- -----------TCTCTCTGTGTCTCTCATGA-ATAAA------------------------ ------------------------------------------------------------- ------------ -""") - - def _writeExpOutputFile_with_refseq(self): - with open(self._expOutputFileName,'w') as expOutputFile: - expOutputFile.write(""">sequence -GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC -GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT -GCCTGCGTGGGTTCTCTCCGGGTACTCCGGCTTCCTCCCACAGTCCAAAGACATGCATGA -TTGGGGATTAGGCTAATTGGAAACTCTAAAATTGCCCGTAGGTGTGAGTGTGAGAGAGAA -TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCCAGGGTGTACC -CTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCCCGCAAGCGGTAGAAAGTGAG -TGAGTGAGTGA ->sequence2 -GGGCAGC-CGGTGGTGCGGT--TTAGCGCTGTTGGCCCAGGGCGTGATGGACCCGGGATC -GATCCCACATCGGG--------------CTCCCTGCATGGAGCCTGC---TTCTCCCTCT -GCCTGTGTCTCTTCTCTC------------------------------------------ ------------------------------------------------------------- -----------TCTCTCTGTGTCTCTCATGA-ATAAA------------------------ ------------------------------------------------------------- ------------ -""") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchRepeatMasker.py --- a/commons/launcher/tests/Test_F_LaunchRepeatMasker.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,110 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -from commons.launcher.LaunchRepeatMasker import LaunchRepeatMasker - - -class Test_F_RepeatMasker(unittest.TestCase): - - def setUp(self): - self._queryFastaFileName = "query.fa" - self._libFastaFileName = "lib.fa" - self._expMaskedQueryFileName = "expMaskedQuery.fa" - self._obsMaskedQueryFileName = "%s.masked" % self._queryFastaFileName - - self._expCatFileName = "expCat.fa" - self._obsCatFileName = "%s.cat" % self._queryFastaFileName - - self._writeInputFastaFiles() - self._writeExpMaskedQueryFile() - self._writeExpCatFile() - - def tearDown(self): - os.remove(self._queryFastaFileName) - os.remove(self._libFastaFileName) - os.remove(self._expMaskedQueryFileName) - os.remove(self._obsMaskedQueryFileName) - os.remove(self._expCatFileName) - os.remove(self._obsCatFileName) - os.remove("%s.tbl" % self._queryFastaFileName) - os.remove("%s.out" % self._queryFastaFileName) - os.remove("%s.ori.out" % self._queryFastaFileName) - - def test_run(self): - ilauncher = LaunchRepeatMasker(self._queryFastaFileName, self._libFastaFileName,verbosity=1 ) - ilauncher.run() - self.assertTrue(FileUtils.are2FilesIdentical(self._obsMaskedQueryFileName, self._expMaskedQueryFileName)) - - def test_run_as_script(self): - #FIXME : change path to launcher - cmd = 'python %s/commons/launcher/LaunchRepeatMasker.py -q %s -l %s' % (os.environ["REPET_PATH"],self._queryFastaFileName, self._libFastaFileName) - os.system(cmd) - self.assertTrue(FileUtils.are2FilesIdentical(self._obsMaskedQueryFileName, self._expMaskedQueryFileName)) - - def _writeInputFastaFiles(self): - InputFile = open(self._queryFastaFileName, 'w') - InputFile.write('>Bovc-tA2:classI:SINE:SINE2/tRNA\n') - InputFile.write('GGGCTTCCCTGGTAGCTCAGCTGGTAAAGAATCCGCCTGCAATGCAGGAGACCCCGGTTC\n') - InputFile.write('GATTCCTGGGTCGGGAAGATCCCCTGGAGAAGGGATAGGCTACCCACTCCAGTATTCTTG\n') - InputFile.write('GGCTTCCCTGGTGGCTCAGACGGTAAAGAATCCGCCTGCAATGCGGGAGACCTGGGTTCG\n') - InputFile.write('ATCCCTGGGTTGGGAAGATCCCCTGGAGGAGGGCATGGCAACCCACTCCAGTATTCTTGC\n') - InputFile.write('CTGGAGAATCCCCATGGACAGAGGAGCCTGGCGGGCTACAGTCCATGGGGTCGCAAAGAG\n') - InputFile.write('TCGGACACGACTGAGCGACTAAGCACAGCACAGGTCTTTCCTGCCACTTACCTCCTTCCA\n') - InputFile.write('GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC\n') - InputFile.write('GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT\n') - InputFile.write('GCCTGCGTGGGTTCTCTCCGGGTACTCCGGCTTCCTCCCACAGTCCAAAGACATGCATGA\n') - InputFile.write('TTGGGGATTAGGCTAATTGGAAACTCTAAAATTGCCCGTAGGTGTGAGTGTGAGAGAGAA\n') - InputFile.write('TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCCAGGGTGTACC\n') - InputFile.write('CTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCCCGCGACCCTCAGTGGAGGAA\n') - InputFile.write('GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCGTGATCCTGGA\n') - InputFile.write('GACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG\n') - InputFile.write('GGGGAGGGTATAGCTCAGTGGTAGAGCGCATGCTTAGCATGCACGAGGTCCTGGGTTCAA\n') - InputFile.write('TCCCCAGTACCTCCATTAAAAATAAATAAATAAATAAACCTAATTACCTCCCCCACCAAA\n') - InputFile.write('AAAAAAA\n') - InputFile.close() - - InputFile = open(self._libFastaFileName, 'w') - InputFile.write('>RefLib\n') - InputFile.write('GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC\n') - InputFile.write('GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT\n') - InputFile.close() - - def _writeExpMaskedQueryFile(self): - f = open(self._expMaskedQueryFileName, 'w') - f.write('>Bovc-tA2:classI:SINE:SINE2/tRNA\n') - f.write('GGGCTTCCCTGGTAGCTCAGCTGGTAAAGAATCCGCCTGCAATGCAGGAG\n') - f.write('ACCCCGGTTCGATTCCTGGGTCGGGAAGATCCCCTGGAGAAGGGATAGGC\n') - f.write('TACCCACTCCAGTATTCTTGGGCTTCCCTGGTGGCTCAGACGGTAAAGAA\n') - f.write('TCCGCCTGCAATGCGGGAGACCTGGGTTCGATCCCTGGGTTGGGAAGATC\n') - f.write('CCCTGGAGGAGGGCATGGCAACCCACTCCAGTATTCTTGCCTGGAGAATC\n') - f.write('CCCATGGACAGAGGAGCCTGGCGGGCTACAGTCCATGGGGTCGCAAAGAG\n') - f.write('TCGGACACGACTGAGCGACTAAGCACAGCACAGGTCTTTCCTGCCACTTA\n') - f.write('CCTCCTTCCANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN\n') - f.write('NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN\n') - f.write('NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGCCTGCGTGGGTTCTCTCCG\n') - f.write('GGTACTCCGGCTTCCTCCCACAGTCCAAAGACATGCATGATTGGGGATTA\n') - f.write('GGCTAATTGGAAACTCTAAAATTGCCCGTAGGTGTGAGTGTGAGAGAGAA\n') - f.write('TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCC\n') - f.write('AGGGTGTACCCTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCC\n') - f.write('CGCGACCCTCAGTGGAGGAAGGGCAGCCTGGGTGGCTCAGCGGTTTAGCG\n') - f.write('CCTGCCTTTGGCCCAGGGCGTGATCCTGGAGACCCGGGATCGAGTCCCAC\n') - f.write('ATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTGGGGGAGGGTA\n') - f.write('TAGCTCAGTGGTAGAGCGCATGCTTAGCATGCACGAGGTCCTGGGTTCAA\n') - f.write('TCCCCAGTACCTCCATTAAAAATAAATAAATAAATAAACCTAATTACCTC\n') - f.write('CCCCACCAAAAAAAAAA\n') - f.close() - - def _writeExpCatFile(self): - f = open(self._expCatFileName, 'w') - f.write('958 0.00 0.00 0.00 Bovc-tA2:classI:SINE:SINE2/tRNA 361 480 (487) RefLib 1 120 (0) 5\n') - f.write('## Total Sequences: 1\n') - f.write('## Total Length: 967\n') - f.write('## Total NonMask ( excluding >20bp runs of N/X bases ): 967\n') - f.write('## Total NonSub ( excluding all non ACGT bases ):967\n') - f.write('RepeatMasker version open-3.2.6 , default mode\n') - f.write('run with blastp version 2.0MP-WashU\n') - f.write('RepBase Update 20080801, RM database version 20080801\n') - f.close() - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchTRF.py --- a/commons/launcher/tests/Test_F_LaunchTRF.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,84 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -from commons.launcher.LaunchTRF import LaunchTRF - - -class Test_F_LaunchTRF(unittest.TestCase): - - def setUp(self): - self._inputFastaFileName = "input.fa" - self._obsTRFOutputFileName = "obsTRF.TRF.set" - self._expTRFOutputFileName = "expTRF.TRF.set" - self._writeInputFile() - self._writeExpTRFOutputFile() - - def tearDown(self): - try: - os.remove(self._inputFastaFileName) - except:pass - - try: - os.remove(self._expTRFOutputFileName) - except:pass - try: - os.remove(self._obsTRFOutputFileName) - except:pass - try: - os.remove("input.fa.2.3.5.80.10.20.15.dat") - except:pass - - def test_run(self): - ilauncher = LaunchTRF(self._inputFastaFileName,self._obsTRFOutputFileName,verbosity=5) - ilauncher.run() - self.assertTrue(FileUtils.are2FilesIdentical(self._expTRFOutputFileName, self._obsTRFOutputFileName)) - - def test_run_as_script(self): - cmd = 'LaunchTRF.py -i %s -o %s -v 3' % (self._inputFastaFileName, self._obsTRFOutputFileName) - os.system(cmd) - self.assertTrue(FileUtils.are2FilesIdentical(self._expTRFOutputFileName, self._obsTRFOutputFileName)) - - def test_run_as_scriptNoOutputGiven(self): - cmd = 'LaunchTRF.py -i %s -v 3' % (self._inputFastaFileName) - os.system(cmd) - self._obsTRFOutputFileName = "input.fa.TRF.set" - self.assertTrue(FileUtils.are2FilesIdentical(self._expTRFOutputFileName, self._obsTRFOutputFileName)) - - def test_run_as_scriptNoOutputGivenDoClean(self): - cmd = 'LaunchTRF.py -i %s -c -v 3' % (self._inputFastaFileName) - os.system(cmd) - self._obsTRFOutputFileName = "input.fa.TRF.set" - datFilePath = os.path.join(os.getcwd(),"%s.2.3.5.80.10.20.15.dat" % self._inputFastaFileName) - self.assertFalse(os.path.exists(datFilePath)) - - def _writeInputFile(self): - InputFile = open(self._inputFastaFileName, 'w') - InputFile.write('>sequence\n') - InputFile.write('GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC\n') - InputFile.write('GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT\n') - InputFile.write('GCCTGCGTGGGTTCTCTCCGGGTACTCCGGCTTCCTCCCACAGTCCAAAGACATGCATGA\n') - InputFile.write('TTGGGGATTAGGCTAATTGGAAACTCTAAAATTGCCCGTAGGTGTGAGTGTGAGAGAGAA\n') - InputFile.write('TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCCAGGGTGTACC\n') - InputFile.write('CTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCCCG\n') - InputFile.write('CAAGCGGTAGAAAGTGAGTGAGTGAGTGA\n') - InputFile.write('>sequence2\n') - InputFile.write('GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCGTGATCCTGGA\n') - InputFile.write('GACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG\n') - InputFile.write('TGTCTCTGCCTCTCTCTCTCTCTGTGTCTCTCATGAATAAA\n') - InputFile.close() - - def _writeExpTRFOutputFile(self): - with open(self._expTRFOutputFileName,'w') as expTRFOutputFile: - expTRFOutputFile.write("""1\t(GTGGT)2\tsequence\t11\t21 -2\t(GGT)5\tsequence\t10\t23 -3\t(GTGTGA)4\tsequence\t222\t242 -4\t(GTCCA)2\tsequence\t282\t292 -5\t(AGTG)4\tsequence\t355\t371 -6\t(GCCTGTCTCTCCTCT)4\tsequence2\t100\t152 -7\t(CTCTGCCTGTGT)3\tsequence2\t112\t151 -8\t(TC)23\tsequence2\t107\t152 -""") - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_F_LaunchTallymer.py --- a/commons/launcher/tests/Test_F_LaunchTallymer.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,151 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -import shutil -from commons.launcher.LaunchTallymer import LaunchTallymer - -class Test_F_LaunchTallymer(unittest.TestCase): - - def setUp(self): - self._inFastaFileName = "%s/Tools/DmelChr4.fa" % os.environ["REPET_DATA"] - - def test_run_output_as_gff_cleaned(self): - iLaunchTallymer = LaunchTallymer(self._inFastaFileName, clean = True, verbosity=2) - iLaunchTallymer.run() - - expFileName = "%s/Tools/DmelChr4.fa.tallymer_k20.gff" % os.environ["REPET_DATA"] - obsFileName = "DmelChr4.tallymer.gff" - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(obsFileName) - os.remove("DmelChr4.tallymer.stat") - - def test_run_with_remote_dir(self): - os.makedirs("sourceDir") - changedInFastaFileName = os.path.basename(self._inFastaFileName) - changedInFastaFilepath = os.path.join("sourceDir",changedInFastaFileName) - shutil.copy2(self._inFastaFileName, changedInFastaFilepath) - - iLaunchTallymer = LaunchTallymer(changedInFastaFilepath, clean = True, verbosity=2) - iLaunchTallymer.run() - - expFileName = "%s/Tools/DmelChr4.fa.tallymer_k20.gff" % os.environ["REPET_DATA"] - obsFileName = "DmelChr4.tallymer.gff" - - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - obsSourceDirFiles = os.listdir("sourceDir") - expSourceDirFiles = [changedInFastaFileName,] - self.assertEquals(expSourceDirFiles, obsSourceDirFiles) - - os.remove(obsFileName) - os.remove("DmelChr4.tallymer.stat") - shutil.rmtree("sourceDir") - - - def test_run_output_as_gff_cleaned_changed_minOccs2(self): - iLaunchTallymer = LaunchTallymer(self._inFastaFileName, minOccs=2, clean = True, verbosity=2) - iLaunchTallymer.run() - - expFileName = "%s/Tools/DmelChr4.fa.tallymer_k20_minOcc2.gff" % os.environ["REPET_DATA"] - obsFileName = "DmelChr4.tallymer.gff" - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(obsFileName) - os.remove("DmelChr4.tallymer.stat") - - def test_run_output_as_gff_cleaned_relative_input(self): - srcFastaFileName = self._inFastaFileName - dstFastaFileName = os.path.basename(self._inFastaFileName) - shutil.copy2(srcFastaFileName, dstFastaFileName) - iLaunchTallymer = LaunchTallymer(dstFastaFileName, clean = True, verbosity=2) - iLaunchTallymer.run() - - expFileName = "%s/Tools/DmelChr4.fa.tallymer_k20.gff" % os.environ["REPET_DATA"] - obsFileName = "DmelChr4.tallymer.gff" - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - - os.remove(obsFileName) - os.remove("DmelChr4.tallymer.stat") - os.remove(dstFastaFileName) - - def test_run_as_script_output_as_gff_cleaned_relative_input_(self): - srcFastaFileName = self._inFastaFileName - dstFastaFileName = os.path.basename(self._inFastaFileName) - shutil.copy2(srcFastaFileName, dstFastaFileName) - - cmd = 'LaunchTallymer.py -i %s -s 20 -c -v 3' % (self._inFastaFileName) - os.system(cmd) - expFileName = "%s/Tools/DmelChr4.fa.tallymer_k20.gff" % os.environ["REPET_DATA"] - obsFileName = "DmelChr4.tallymer.gff" - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - - os.remove(obsFileName) - os.remove("DmelChr4.tallymer.stat") - os.remove(dstFastaFileName) - - def test_run_output_as_wig_cleaned(self): - iLaunchTallymer = LaunchTallymer(self._inFastaFileName, outputFormats="wig", clean=True) - iLaunchTallymer.run() - - expFileName = "%s/Tools/DmelChr4.fa.tallymer_k20.wig" % os.environ["REPET_DATA"] - obsFileName = "DmelChr4.tallymer.wig" - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - - os.remove(obsFileName) - os.remove("DmelChr4.tallymer.stat") - - def test_run_output_as_gff_and_wig_k15_cleaned(self): - iLaunchTallymer = LaunchTallymer(self._inFastaFileName, merSize=15, outputFormats="wig,gff3", clean=True) - iLaunchTallymer.run() - - expFileName = "%s/Tools/DmelChr4.fa.tallymer_k15.wig" % os.environ["REPET_DATA"] - obsFileName = "DmelChr4.tallymer.wig" - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(obsFileName) - - expFileName = "%s/Tools/DmelChr4.fa.tallymer_k15.gff3" % os.environ["REPET_DATA"] - obsFileName = "DmelChr4.tallymer.gff3" - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(obsFileName) - - os.remove("DmelChr4.tallymer.stat") - - def test_run_as_script_run_output_as_gff_and_wig_k15_cleaned(self): - logFileName = "test.log" - cmd = 'LaunchTallymer.py -i %s -s 15 -f gff,wig,vero -c -v 3 > %s' % (self._inFastaFileName, logFileName) - os.system(cmd) - - expFileName = "%s/Tools/DmelChr4.fa.tallymer_k15.wig" % os.environ["REPET_DATA"] - obsFileName = "DmelChr4.tallymer.wig" - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(obsFileName) - - expFileName = "%s/Tools/DmelChr4.fa.tallymer_k15.gff3" % os.environ["REPET_DATA"] - obsFileName = "DmelChr4.tallymer.gff" - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(obsFileName) - - expLogFileName = "exp.log" - with open(expLogFileName, "w") as f: - f.write(" LaunchTallymer - WARNING - Warning: ignoring invalid formats: <vero>\n") - f.write(" LaunchTallymer - INFO - Starting to run tallymer search of sequence DmelChr4.fa \n") - f.write(" LaunchTallymer - INFO - Finished running tallymer scan of sequence DmelChr4.fa \n") - f.write(" LaunchTallymer - INFO - Starting to run tallymer search to map conversion\n") - f.write(" LaunchTallymer - INFO - Finished tallymer search to map conversion\n") - f.write(" LaunchTallymer - INFO - Generating wig file\n") - f.write(" LaunchTallymer - INFO - Generating gff file\n") - obsLogFileName = "obs.log" - os.system("cut -d'-' -f4,5,6 %s > %s" % (logFileName, obsLogFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(expLogFileName, obsLogFileName)) - - os.remove(logFileName) - os.remove(expLogFileName) - os.remove(obsLogFileName) - os.remove("DmelChr4.tallymer.stat") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_LaunchBlastclust.py --- a/commons/launcher/tests/Test_LaunchBlastclust.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,237 +0,0 @@\n-import unittest\n-import time\n-import os\n-from commons.launcher.LaunchBlastclust import LaunchBlastclust\n-from commons.core.utils.FileUtils import FileUtils\n-\n-class Test_LaunchBlastclust( unittest.TestCase ):\n-\n- def setUp(self):\n- self._iLaunchBlastclust = LaunchBlastclust()\n- self._iLaunchBlastclust.setClean()\n- self._uniqId = "%s_%s" % (time.strftime("%Y%m%d%H%M%S"), os.getpid())\n-\n- def tearDown(self):\n- self._iLaunchBlastclust = None\n- self._uniqId = None\n-\n- def test_getClustersFromTxtFile(self):\n- inFileName = "dummyInFile_%s" % self._uniqId\n- inF = open(inFileName, "w")\n- inF.write("seq1 seq3 seq4 \\n")\n- inF.write("seq2 seq5 \\n")\n- inF.close()\n- dExp = {1:["seq1","seq3","seq4"], 2:["seq2","seq5"]}\n- self._iLaunchBlastclust.setTmpFileName(inFileName)\n- dObs = self._iLaunchBlastclust.getClustersFromTxtFile()\n- self.assertEqual(dObs, dExp)\n- os.remove(inFileName)\n- \n- def test_getClusteringResultsInFasta_without_filtering(self):\n- inFileName = "dummyInFile_%s" % self._uniqId\n- inF = open(inFileName, "w")\n- inF.write(">seq1\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">seq2\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">seq3\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">seq4\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">seq5\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.close()\n- \n- tmpFileName = "%s_blastclust.txt" % self._uniqId\n- inF = open(tmpFileName, "w")\n- inF.write("seq1 seq3 seq4 \\n")\n- inF.write("seq2 seq5 \\n")\n- inF.close()\n- self._iLaunchBlastclust.setTmpFileName(tmpFileName)\n- \n- fileExp = "getClusteringResultsInFastaExpected.fa"\n- outF = open(fileExp, "w")\n- outF.write(">BlastclustCluster1Mb1_seq1\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.write(">BlastclustCluster1Mb2_seq3\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.write(">BlastclustCluster1Mb3_seq4\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.write(">BlastclustCluster2Mb1_seq2\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.write(">BlastclustCluster2Mb2_seq5\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.close()\n- \n- self._iLaunchBlastclust.getClusteringResultsInFasta(inFileName)\n- fileObs = "%s_Blastclust.fa" % os.path.splitext(inFileName)[0]\n- \n- if not FileUtils.are2FilesIdentical(fileObs, fileExp):\n- print "Files are different"\n- return\n- else:\n- print "Files are identical\\n"\n-\n- os.remove(inFileName)\n- os.remove(tmpFileName)\n- os.remove(fileExp)\n- os.remove(fileObs)\n-\n- def test_getClusteringResultsInFasta_with_filtering(self):\n- inFileName = "dummyInFile_%s" % self._uniqId\n- inF = open(inFileName, "w")\n- inF.write(">seq1\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">seq2\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">seq3\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">seq4\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">seq5\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.close()\n- \n- tmpFileName = "%s_blastclust.txt" % self._uniqId\n- inF = open(tmpFileName, "w")\n- inF.write("seq1 seq3 seq4 \\n")\n- inF.write("seq2\\n")\n- inF.write("seq5\\n")\n- inF.close()\n- self._iLaunchBlastclust.setTmpFileName(tmpFileName)\n- \n- fileExp = "getClusteringResultsInFastaExpected.fa"\n- outF = open(fileExp, "w")\n- outF.write(">BlastclustCluster1Mb1_seq1\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.write(">BlastclustCluster1Mb2_seq3\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.write(">Bl'..b'Headers()\n- dExp = {"seq1":"Header1", "seq2":"Header2", "seq3":"Header3", "seq4":"Header4"}\n- \n- self.assertEqual(dObs, dExp)\n- os.remove(inFileName)\n- \n- def test_retrieveInitHeaders(self):\n- dIn = {"seq1":"Header1", "seq2":"Header2", "seq3":"Header3", "seq4":"Header4"}\n- \n- inFileName = "dummyInFile_%s" % self._uniqId\n- outFilePrefix = self._uniqId\n- \n- tmpFileName = "%s_blastclust.txt" % outFilePrefix\n- inF = open(tmpFileName, "w")\n- inF.write("seq1 seq3 seq4\\n")\n- inF.write("seq2\\n")\n- inF.close()\n- \n- shortHFile = "%s.shortH_Blastclust.fa" % inFileName\n- shF = open(shortHFile, "w")\n- shF.write(">BlastclustCluster1Mb1_seq1\\n")\n- shF.write("gaattgtttactta\\n")\n- shF.write(">BlastclustCluster1Mb2_seq3\\n")\n- shF.write("gaattgtttactta\\n")\n- shF.write(">BlastclustCluster1Mb3_seq4\\n")\n- shF.write("gaattgtttactta\\n")\n- shF.write(">BlastclustCluster2Mb1_seq2\\n")\n- shF.write("gaattgtttactta\\n")\n- shF.close()\n- \n- fileExp = "retrieveInitHeadersExpected.fa"\n- outF = open(fileExp, "w")\n- outF.write(">BlastclustCluster1Mb1_Header1\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.write(">BlastclustCluster1Mb2_Header3\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.write(">BlastclustCluster1Mb3_Header4\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.write(">BlastclustCluster2Mb1_Header2\\n")\n- outF.write("gaattgtttactta\\n")\n- outF.close()\n-\n- self._iLaunchBlastclust.setInputFileName(inFileName)\n- self._iLaunchBlastclust.setTmpFileName(tmpFileName)\n- self._iLaunchBlastclust.setOutputFilePrefix(outFilePrefix)\n- self._iLaunchBlastclust.retrieveInitHeaders(dIn)\n- fileObs = "%s_Blastclust.fa" % outFilePrefix\n- \n- if not FileUtils.are2FilesIdentical(fileObs, fileExp):\n- print "Files are different"\n- return\n- else:\n- print "Files are identical\\n"\n- \n- os.remove(fileObs)\n- os.remove(fileExp)\n- os.remove(tmpFileName)\n-\n- def test_filterUnclusteredSequences(self):\n- dClusterId2SeqHeaders = {1: ["seq1","seq2"], 2: ["seq3"]}\n- dExp = {1: ["seq1","seq2"]}\n- dObs = self._iLaunchBlastclust.filterUnclusteredSequences(dClusterId2SeqHeaders)\n- self.assertEqual(dObs, dExp)\n- \n- def test_blastclustToMap(self):\n- inFileName = "dummyBlastclustOut_%s.fa" % self._uniqId\n- inF = open(inFileName, "w")\n- inF.write(">BlastclustCluster1Mb1_chunk1 (dbseq-nr 1) [1,14]\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">BlastclustCluster1Mb2_chunk1 (dbseq-nr 1) [30,44]\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">BlastclustCluster2Mb1_chunk2 (dbseq-nr 1) [100,114]\\n")\n- inF.write("gaattgtttactta\\n")\n- inF.write(">BlastclustCluster3Mb1_chunk5 (dbseq-nr 8) [1000,1014]\\n")\n- inF.write("gaattgtttactta")\n- inF.close()\n- \n- fileExp = "blastclustToMapExpected.map"\n- outF = open(fileExp, "w")\n- outF.write("BlastclustCluster1Mb1\\tchunk1\\t1\\t14\\n")\n- outF.write("BlastclustCluster1Mb2\\tchunk1\\t30\\t44\\n")\n- outF.write("BlastclustCluster2Mb1\\tchunk2\\t100\\t114\\n")\n- outF.write("BlastclustCluster3Mb1\\tchunk5\\t1000\\t1014\\n")\n- outF.close()\n- \n- self._iLaunchBlastclust.blastclustToMap(inFileName)\n- fileObs = "%s.map" % os.path.splitext(inFileName)[0]\n- \n- if not FileUtils.are2FilesIdentical(fileObs, fileExp):\n- print "Files are different"\n- return\n- else:\n- print "Files are identical\\n"\n- \n- os.remove(inFileName)\n- os.remove(fileObs)\n- os.remove(fileExp)\n-\n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_LaunchTallymer.py --- a/commons/launcher/tests/Test_LaunchTallymer.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,121 +0,0 @@ -from commons.core.utils.FileUtils import FileUtils -import os -import unittest -from commons.launcher.LaunchTallymer import ConvertUtils - -class Test_ConvertUtils(unittest.TestCase): - - def test_convertTallymerFormatIntoMapFormatAndGenerateData(self): - inputFastaFileName = "input.fa" - inputTallymerSearchFileName = "input.tallymer" - expMapFileName = "exp.map" - obsMapFileName = "obs.map" - self._writeInputFasta(inputFastaFileName) - self._writeInputTallymerSearch(inputTallymerSearchFileName) - self._writeExpMap(expMapFileName) - - expOccNb = 4 - expDKmer2Occ = {"caagatgcgtaacggccata":1, - "aagatgcgtaacggccatac":1, - "agatgcgtaacggccataca":1, - "gatgcgtaacggccatacat":1} - expPlotData = {4379: 17, - 4380: 17, - 4381: 16, - 4382: 16} - - obsOccNb, obsDKmer2Occ, obsPlotData, obsPlotData2 = ConvertUtils.convertTallymerFormatIntoMapFormatAndGenerateData(inputFastaFileName, inputTallymerSearchFileName, obsMapFileName) - - self.assertEquals(expOccNb, obsOccNb) - self.assertEquals(expDKmer2Occ, obsDKmer2Occ) - self.assertEquals(expPlotData, obsPlotData) - self.assertTrue(FileUtils.are2FilesIdentical(expMapFileName, obsMapFileName)) - - os.remove(inputFastaFileName) - os.remove(inputTallymerSearchFileName) - os.remove(expMapFileName) - os.remove(obsMapFileName) - - def test_convertTallymerFormatIntoMapFormatAndGenerateDataMultiFasta(self): - inputFastaFileName = "input.fa" - inputTallymerSearchFileName = "input.tallymer" - expMapFileName = "exp.map" - obsMapFileName = "obs.map" - self._writeInputMultiFasta(inputFastaFileName) - self._writeInputTallymerSearchMultiFasta(inputTallymerSearchFileName) - self._writeExpMapMultiFasta(expMapFileName) - - expOccNb = 6 - expDKmer2Occ = {"caagatgcgtaacggccata":1, - "aagatgcgtaacggccatac":1, - "agatgcgtaacggccataca":1, - "gatgcgtaacggccatacat":1, - "agatgcgtaacggccataca":2, - "gatgcgtaacggccatacat":2} - expPlotData = {4379: 17, 4380: 17, 4381: 16, 4382: 35} - - obsOccNb, obsDKmer2Occ, obsPlotData, obsPlotData2 = ConvertUtils.convertTallymerFormatIntoMapFormatAndGenerateData(inputFastaFileName, inputTallymerSearchFileName, obsMapFileName) - - self.assertEquals(expOccNb, obsOccNb) - self.assertEquals(expDKmer2Occ, obsDKmer2Occ) - self.assertEquals(expPlotData, obsPlotData) - self.assertTrue(FileUtils.are2FilesIdentical(expMapFileName, obsMapFileName)) - - os.remove(inputFastaFileName) - os.remove(inputTallymerSearchFileName) - os.remove(expMapFileName) - os.remove(obsMapFileName) - - def _writeInputTallymerSearch(self, tallymerFormatFileName): - with open(tallymerFormatFileName, 'w') as f: - f.write("0\t+4378\t17\tcaagatgcgtaacggccata\n") - f.write("0\t+4379\t17\taagatgcgtaacggccatac\n") - f.write("0\t+4380\t16\tagatgcgtaacggccataca\n") - f.write("0\t+4381\t16\tgatgcgtaacggccatacat\n") - - def _writeInputFasta(self, fastaFileName): - with open(fastaFileName, 'w') as f: - f.write(">Seq1\n") - f.write("caagatgcgtaacggccata\n") - f.write("aagatgcgtaacggccatac\n") - f.write("agatgcgtaacggccataca\n") - f.write("gatgcgtaacggccatacat\n") - - def _writeExpMap(self, mapFileName): - with open(mapFileName, 'w') as f: - f.write("caagatgcgtaacggccata_17\tSeq1\t4379\t4399\t17\n") - f.write("aagatgcgtaacggccatac_17\tSeq1\t4380\t4400\t17\n") - f.write("agatgcgtaacggccataca_16\tSeq1\t4381\t4401\t16\n") - f.write("gatgcgtaacggccatacat_16\tSeq1\t4382\t4402\t16\n") - - def _writeInputTallymerSearchMultiFasta(self, tallymerFormatFileName): - with open(tallymerFormatFileName, 'w') as f: - f.write("0\t+4378\t17\tcaagatgcgtaacggccata\n") - f.write("0\t+4379\t17\taagatgcgtaacggccatac\n") - f.write("0\t+4380\t16\tagatgcgtaacggccataca\n") - f.write("0\t+4381\t16\tgatgcgtaacggccatacat\n") - f.write("1\t+4380\t16\tagatgcgtaacggccataca\n") - f.write("1\t+4381\t35\tgatgcgtaacggccatacat\n") - - def _writeInputMultiFasta(self, fastaFileName): - with open(fastaFileName, 'w') as f: - f.write(">Seq1\n") - f.write("caagatgcgtaacggccata\n") - f.write("aagatgcgtaacggccatac\n") - f.write("agatgcgtaacggccataca\n") - f.write("gatgcgtaacggccatacat\n") - f.write(">Seq2\n") - f.write("agatgcgtaacggccataca\n") - f.write("gatgcgtaacggccatacat\n") - - def _writeExpMapMultiFasta(self, mapFileName): - with open(mapFileName, 'w') as f: - f.write("caagatgcgtaacggccata_17\tSeq1\t4379\t4399\t17\n") - f.write("aagatgcgtaacggccatac_17\tSeq1\t4380\t4400\t17\n") - f.write("agatgcgtaacggccataca_16\tSeq1\t4381\t4401\t16\n") - f.write("gatgcgtaacggccatacat_16\tSeq1\t4382\t4402\t16\n") - f.write("agatgcgtaacggccataca_16\tSeq2\t4381\t4401\t16\n") - f.write("gatgcgtaacggccatacat_35\tSeq2\t4382\t4402\t35\n") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_MafftClusterLauncher.py --- a/commons/launcher/tests/Test_MafftClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,28 +0,0 @@ -import unittest -from commons.launcher.MafftClusterLauncher import MafftClusterLauncher - - -class Test_MafftClusterLauncher( unittest.TestCase ): - - def setUp( self ): - self._i = MafftClusterLauncher() - - - def tearDown( self ): - self._i = None - - - def test_getSpecificHelpAsString( self ): - exp = "" - exp += "\nspecific options:" - exp += "\n -p: parameters for 'mafft' (default='--auto')" - obs = self._i.getSpecificHelpAsString() - self.assertEqual( exp, obs ) - - - def test_setASpecificAttributeFromCmdLine( self ): - self._i.setASpecificAttributeFromCmdLine( "-p", "dummyPrgParam" ) - self.assertEqual( "dummyPrgParam", self._i.getProgramParameters() ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_MafftProgramLauncher.py --- a/commons/launcher/tests/Test_MafftProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,105 +0,0 @@ -import unittest -from commons.launcher.MafftProgramLauncher import MafftProgramLauncher - -class Test_MafftProgramLauncher( unittest.TestCase ): - - - def setUp( self ): - self._i = MafftProgramLauncher() - - - def tearDown( self ): - self._i = None - - - def test_getSpecificHelpAsString( self ): - exp = "" - exp += "\nspecific options:" - exp += "\n -p: parameters for '%s' (default='--auto')" % ( "mafft" ) - exp += "\n -o: name of the output file (format='aligned fasta', default=inFile+'.fa_aln')" - obs = self._i.getSpecificHelpAsString() - self.assertEqual( exp, obs ) - - - def test_setASpecificAttributeFromCmdLine( self ): - self._i.setASpecificAttributeFromCmdLine( "-p", "'--auto --maxiterate 500'" ) - self.assertEqual( "'--auto --maxiterate 500'", self._i.getProgramParameters() ) - - self._i.setASpecificAttributeFromCmdLine( "-o", "dummyOutFile.fa_aln" ) - self.assertEqual( "dummyOutFile.fa_aln", self._i.getOutputFile() ) - - - def test_setWrapperCommandLine( self ): - inFile = "dummyInFile.fa" - self._i.setInputFile( inFile ) - exp = "MafftProgramLauncher.py" - exp += " -i %s" % ( inFile ) - exp += " -p '%s'" % ( "--auto" ) - exp += " -o %s.fa_aln" % ( inFile ) - exp += " -v 0" - self._i.setWrapperCommandLine() - obs = self._i.getWrapperCommandLine() - self.assertEqual( exp, obs ) - - - def test_setProgramCommandLine( self ): - inFile = "dummyInFile.fa" - self._i.setInputFile( inFile ) - exp = self._i.getProgramName() - exp += " %s" % ( "--auto" ) - exp += " --quiet" - exp += " %s.shortH" % ( inFile ) - exp += " > %s.shortH.fa_aln" % ( inFile ) - exp += " 2> /dev/null" - self._i.setProgramCommandLine() - obs = self._i.getProgramCommandLine() - self.assertEqual( exp, obs ) - - - def test_setListFilesToKeep( self ): - inFile = "dummyInFile.fa" - self._i.setInputFile( inFile ) - self._i.setListFilesToKeep() - lExp = [ "dummyInFile.fa.fa_aln" ] - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - self._i._lFilesToKeep = [] - - outFile = "dummyOutFile.fa_aln" - self._i.setOutputFile( outFile ) - self._i.setListFilesToKeep() - lExp = [ outFile ] - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setListFilesToRemove( self ): - inFile = "dummyInFile.fa" - self._i.setInputFile( inFile ) - self._i.setListFilesToRemove() - lExp = [ "dummyInFile.fa.shortH", \ - "dummyInFile.fa.shortH.fa_aln", \ - "dummyInFile.fa.shortHlink" ] - lObs = self._i.getListFilesToRemove() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setSummary( self ): - self._i.setInputFile( "dummyInFile.fa" ) - exp = "input file: %s" % ( "dummyInFile.fa" ) - exp += "\nparameters: %s" % ( "--auto" ) - exp += "\noutput file: %s" % ( "dummyInFile.fa.fa_aln" ) - self._i.setSummary() - obs = self._i.getSummary() - self.assertEqual( exp, obs ) - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_MapClusterLauncher.py --- a/commons/launcher/tests/Test_MapClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,41 +0,0 @@ -import unittest -from commons.launcher.MapClusterLauncher import MapClusterLauncher - - -class Test_MapClusterLauncher( unittest.TestCase ): - - - def setUp( self ): - self._i = MapClusterLauncher() - - - def tearDown( self ): - self._i = None - - - def test_getSpecificHelpAsString( self ): - exp = "" - exp += "\nspecific options:" - exp += "\n -s: size above which a gap is not penalized anymore (default='%i')" % ( self._i.getGapSize() ) - exp += "\n -m: penalty for a mismatch (default='%i')" % ( self._i.getMismatchPenalty() ) - exp += "\n -O: penalty for a gap openning (default='%i')" % ( self._i.getGapOpenPenalty() ) - exp += "\n -e: penalty for a gap extension (default='%i')" % ( self._i.getGapExtendPenalty() ) - obs = self._i.getSpecificHelpAsString() - self.assertEqual( exp, obs ) - - - def test_setASpecificAttributeFromCmdLine( self ): - self._i.setASpecificAttributeFromCmdLine( "-s", "42" ) - self.assertEqual( 42, self._i.getGapSize() ) - - self._i.setASpecificAttributeFromCmdLine( "-m", "-7" ) - self.assertEqual( -7, self._i.getMismatchPenalty() ) - - self._i.setASpecificAttributeFromCmdLine( "-O", "15" ) - self.assertEqual( 15, self._i.getGapOpenPenalty() ) - - self._i.setASpecificAttributeFromCmdLine( "-e", "5" ) - self.assertEqual( 5, self._i.getGapExtendPenalty() ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_MapProgramLauncher.py --- a/commons/launcher/tests/Test_MapProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,115 +0,0 @@ -import unittest -from commons.launcher.MapProgramLauncher import MapProgramLauncher - -class Test_MapProgramLauncher( unittest.TestCase ): - - def setUp( self ): - self._i = MapProgramLauncher() - - def tearDown( self ): - self._i = None - - def test_getSpecificHelpAsString( self ): - exp = "" - exp += "\nspecific options:" - exp += "\n -s: size above which a gap is not penalized anymore (default='%i')" % ( self._i.getGapSize() ) - exp += "\n -m: penalty for a mismatch (default='%i', match=10)" % ( self._i.getMismatchPenalty() ) - exp += "\n -O: penalty for a gap opening (default='%i')" % ( self._i.getGapOpenPenalty()) - exp += "\n -e: penalty for a gap extension (default='%i')" % ( self._i.getGapExtendPenalty() ) - exp += "\n -o: name of the output file (format='aligned fasta', default=inFile+'.fa_aln')" - obs = self._i.getSpecificHelpAsString() - self.assertEqual( exp, obs ) - - def test_setASpecificAttributeFromCmdLine( self ): - self._i.setASpecificAttributeFromCmdLine( "-s", "40" ) - self.assertEqual( 40, self._i.getGapSize() ) - - self._i.setASpecificAttributeFromCmdLine( "-m", "-7" ) - self.assertEqual( -7, self._i.getMismatchPenalty() ) - - self._i.setASpecificAttributeFromCmdLine( "-O", "15" ) - self.assertEqual( 15, self._i.getGapOpenPenalty() ) - - self._i.setASpecificAttributeFromCmdLine( "-e", "5" ) - self.assertEqual( 5, self._i.getGapExtendPenalty() ) - - self._i.setASpecificAttributeFromCmdLine( "-o", "dummyOutFile.fa_aln" ) - self.assertEqual( "dummyOutFile.fa_aln", self._i.getOutputFile() ) - - def test_setWrapperCommandLine( self ): - inFile = "dummyInFile.fa" - self._i.setInputFile( inFile ) - exp = "MapProgramLauncher.py" - exp += " -i %s" % ( inFile ) - exp += " -s 50" - exp += " -m -8" - exp += " -O 16" - exp += " -e 4" - exp += " -o %s.fa_aln" % ( inFile ) - exp += " -v 0" - self._i.setWrapperCommandLine() - obs = self._i.getWrapperCommandLine() - self.assertEqual( exp, obs ) - - def test_setProgramCommandLine( self ): - inFile = "dummyInFile.fa" - self._i.setInputFile( inFile ) - exp = self._i.getProgramName() - exp += " %s.shortH" % ( inFile ) - exp += " 50" - exp += " -8" - exp += " 16" - exp += " 4" - exp += " > %s.shortH.fa_aln" % ( inFile ) - self._i.setProgramCommandLine() - obs = self._i.getProgramCommandLine() - self.assertEqual( exp, obs ) - - def test_setListFilesToKeep( self ): - inFile = "dummyInFile.fa" - self._i.setInputFile( inFile ) - self._i.setListFilesToKeep() - lExp = [ "dummyInFile.fa.fa_aln" ] - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - self._i._lFilesToKeep = [] - - outFile = "dummyOutFile.fa_aln" - self._i.setOutputFile( outFile ) - self._i.setListFilesToKeep() - lExp = [ outFile ] - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - def test_getListFilesToRemove( self ): - inFile = "dummyInFile.fa" - self._i.setInputFile( inFile ) - self._i.setListFilesToRemove() - lExp = [ "dummyInFile.fa.shortH", \ - "dummyInFile.fa.shortH.fa_aln", \ - "dummyInFile.fa.shortHlink" ] - lObs = self._i.getListFilesToRemove() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - def test_setSummary( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setGapSize( 104 ) - exp = "input file: %s" % ( "dummyInFile.fa" ) - exp += "\ngap size: %i" % ( self._i.getGapSize() ) - exp += "\nmismatch penalty: %i" % ( self._i.getMismatchPenalty() ) - exp += "\ngap openning penalty: %i" % ( self._i.getGapOpenPenalty() ) - exp += "\ngap extension penalty: %i" % ( self._i.getGapExtendPenalty() ) - exp += "\noutput file: %s" % ( "dummyInFile.fa.fa_aln" ) - self._i.setSummary() - obs = self._i.getSummary() - self.assertEqual( exp, obs ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_NWalignProgramLauncher.py --- a/commons/launcher/tests/Test_NWalignProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,78 +0,0 @@ -import unittest -from commons.launcher.NWalignProgramLauncher import NWalignProgramLauncher - - -class Test_NWalignProgramLauncher( unittest.TestCase ): - - def setUp( self ): - self._i = NWalignProgramLauncher() - - - def tearDown( self ): - self._i = None - - - def test_getSpecificHelpAsString( self ): - exp = "" - exp += "\nspecific options:" - exp += "\n -s: name of the subject file (format='fasta')" - exp += "\n -p: parameters for 'NWalign'" - exp += "\n -o: name of the output file (format='align', default=inFile+'.align')" - obs = self._i.getSpecificHelpAsString() - self.assertEqual( exp, obs ) - - - def test_setASpecificAttributeFromCmdLine( self ): - self._i.setASpecificAttributeFromCmdLine( "-s", "dummySubjectFile.fa" ) - self.assertEqual( "dummySubjectFile.fa", self._i.getSubjectFile() ) - - self._i.setASpecificAttributeFromCmdLine( "-o", "dummyOutFile.align" ) - self.assertEqual( "dummyOutFile.align", self._i.getOutputFile() ) - - - def test_setWrapperCommandLine( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - exp = "NWalignProgramLauncher.py" - exp += " -i %s" % ( "dummyInFile.fa" ) - exp += " -s %s" % ( "dummySubjectFile.fa" ) - exp += " -o %s.align" % ( "dummyInFile.fa" ) - exp += " -v 0" - self._i.setWrapperCommandLine() - obs = self._i.getWrapperCommandLine() - self.assertEqual( exp, obs ) - - - def test_setProgramCommandLine( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - self._i.setProgramParameters( "-m 2" ) - exp = "NWalign -m 2 -o dummyInFile.fa.afa -v 0 dummySubjectFile.fa dummyInFile.fa" - self._i.setProgramCommandLine() - obs = self._i.getProgramCommandLine() - self.assertEqual( exp, obs ) - - - def test_setListFilesToKeep( self ): - self._i.setInputFile( "dummyInFile.fa" ) - lExp = [ "dummyInFile.fa.afa" ] - self._i.setListFilesToKeep() - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setSummary( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - exp = "input file: %s" % ( self._i.getInputFile() ) - exp += "\nsubject file: %s" % ( self._i.getSubjectFile() ) - exp += "\nparameters: %s" % ( self._i.getProgramParameters() ) - exp += "\noutput file: %s" % ( "dummyInFile.fa.align" ) - self._i.setSummary() - obs = self._i.getSummary() - self.assertEqual( exp, obs ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_RepeatMaskerClusterLauncher.py --- a/commons/launcher/tests/Test_RepeatMaskerClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,45 +0,0 @@ -import unittest -from commons.launcher.RepeatMaskerClusterLauncher import RepeatMaskerClusterLauncher - - -class Test_RepeatmaskerClusterLauncher( unittest.TestCase ): - - - def setUp( self ): - self._i = RepeatMaskerClusterLauncher() - - - def tearDown( self ): - self._i = None - - - def test_getSpecificHelpAsString( self ): - exp = "" - exp += "\nspecific options:" - exp += "\n -s: name of the subject file (repeats, format='fasta')" - exp += "\n -n: nb of processors to use in parallel (default=1)" - exp += "\n -g: calculate the GC content" - exp += "\n -b: skip bacterial insertion element check" - exp += "\n -l: mask low-complexity DNA or simple repeats" - obs = self._i.getSpecificHelpAsString() - self.assertEqual( exp, obs ) - - - def test_setASpecificAttributeFromCmdLine( self ): - self._i.setASpecificAttributeFromCmdLine( "-s", "dummySubjectFile.fa" ) - self.assertEqual( "dummySubjectFile.fa", self._i.getSubjectFile() ) - - self._i.setASpecificAttributeFromCmdLine( "-n", "2" ) - self.assertEqual( 2, self._i.getNbProcessors() ) - - self._i.setASpecificAttributeFromCmdLine( "-g" ) - self.assertTrue( self._i.getCalculateGCcontent() ) - - self._i.setASpecificAttributeFromCmdLine( "-b" ) - self.assertTrue( self._i.getSkipBacterialIsCheck() ) - - self._i.setASpecificAttributeFromCmdLine( "-l" ) - self.assertFalse( self._i.getMaskSsr() ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_RepeatMaskerProgramLauncher.py --- a/commons/launcher/tests/Test_RepeatMaskerProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,171 +0,0 @@ -import unittest -from commons.launcher.RepeatMaskerProgramLauncher import RepeatMaskerProgramLauncher - - -class Test_RepeatMaskerProgramLauncher( unittest.TestCase ): - - def setUp( self ): - self._i = RepeatMaskerProgramLauncher() - - - def tearDown( self ): - self._i = None - - - def test_getSpecificHelpAsString( self ): - exp = "" - exp += "\nspecific options:" - exp += "\n -s: name of the subject file (repeats, format='fasta')" - exp += "\n -n: nb of processors to use in parallel (default='%i')" % ( self._i.getNbProcessors() ) - exp += "\n -g: calculate the GC content" - exp += "\n -b: skip bacterial insertion element check" - exp += "\n -l: does not mask low-complexity DNA or simple repeats" - exp += "\n -m: only masks low complex/simple repeats (no interspersed repeats)" - exp += "\n -o: name of the output file" - exp += "\n with -s: format='align', default=inFile+'.cat.align')" - exp += "\n with -m: format='path', default=inFile+'.cat.path')" - obs = self._i.getSpecificHelpAsString() - self.assertEqual( exp, obs ) - - - def test_setASpecificAttributeFromCmdLine( self ): - self._i.setASpecificAttributeFromCmdLine( "-s", "dummySubjectFile.fa" ) - self.assertEqual( "dummySubjectFile.fa", self._i.getSubjectFile() ) - - self._i.setASpecificAttributeFromCmdLine( "-n", "2" ) - self.assertEqual( 2, self._i.getNbProcessors() ) - - self._i.setASpecificAttributeFromCmdLine( "-g" ) - self.assertEqual( True, self._i.getCalculateGCcontent() ) - - self._i.setASpecificAttributeFromCmdLine( "-b" ) - self.assertEqual( True, self._i.getSkipBacterialIsCheck() ) - - self._i.setASpecificAttributeFromCmdLine( "-l" ) - self.assertEqual( False, self._i.getMaskSsr() ) - - self._i.setASpecificAttributeFromCmdLine( "-o", "dummyOutFile.align" ) - self.assertEqual( "dummyOutFile.align", self._i.getOutputFile() ) - - - def test_setWrapperCommandLine( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - exp = "RepeatMaskerProgramLauncher.py" - exp += " -i %s" % ( "dummyInFile.fa" ) - exp += " -s %s" % ( "dummySubjectFile.fa" ) - exp += " -n 1" - self._i.setWrapperCommandLine() - obs = self._i.getWrapperCommandLine() - self.assertEqual( exp, obs ) - - - def test_setProgramCommandLine( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - self._i.setCalculateGCcontent() - self._i.setSkipBacterialIsCheck() - exp = "RepeatMasker -dir . -pa 1 -gccalc -no_is -nolow -lib dummySubjectFile.fa dummyInFile.fa" - self._i.setProgramCommandLine() - obs = self._i.getProgramCommandLine() - self.assertEqual( exp, obs ) - - - def test_setProgramCommandLine_withoutSubjects_withMaskSsr( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setCalculateGCcontent() - self._i.setSkipBacterialIsCheck() - exp = "RepeatMasker -dir . -pa 1 -gccalc -no_is -nolow dummyInFile.fa" - self._i.setProgramCommandLine() - obs = self._i.getProgramCommandLine() - self.assertEqual( exp, obs ) - - - def test_setListFilesToKeep_onlyInFile( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setOnlySsr() - lExp = [ "dummyInFile.fa.cat", "dummyInFile.fa.cat.path" ] - self._i.setListFilesToKeep() - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setListFilesToKeep_withSubjectFile( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySbjFile.fa" ) - lExp = [ "dummyInFile.fa.cat", "dummyInFile.fa.cat.align" ] - self._i.setListFilesToKeep() - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setListFilesToKeep_inFileAndOutFile( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setOutputFile( "dummyOutFile.align" ) - lExp = [ "dummyInFile.fa.cat", "dummyOutFile.align" ] - self._i.setListFilesToKeep() - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setListFilesToKeep_inFileAndOutFileAndSsr( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.unsetMaskSsr() - self._i.setOutputFile( "dummyOutFile.path" ) - lExp = [ "dummyInFile.fa.cat", "dummyOutFile.path" ] - self._i.setListFilesToKeep() - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setListFilesToRemove( self ): - self._i.setInputFile( "dummyInFile.fa" ) - lExp = [ "dummyInFile.fa.out", \ - "dummyInFile.fa.log", \ - "dummyInFile.fa.stderr", \ - "dummyInFile.fa.ori.out", \ - "dummyInFile.fa.masked", \ - "dummyInFile.fa.tbl", \ - "dummyInFile.fa.ref" ] - self._i.setListFilesToRemove() - lObs = self._i.getListFilesToRemove() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setSummary( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - exp = "input file: %s" % ( self._i.getInputFile() ) - exp += "\nsubject file: %s" % ( self._i.getSubjectFile() ) - exp += "\nnb processors: %i" % ( self._i.getNbProcessors() ) - exp += "\nmask low-complexity DNA or simple repeats" - exp += "\noutput file: %s" % ( "dummyInFile.fa.cat.path" ) - self._i.setSummary() - obs = self._i.getSummary() - self.assertEqual( exp, obs ) - - - def test_setSummary_noMaskSsr( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - self._i.unsetMaskSsr() - exp = "input file: %s" % ( self._i.getInputFile() ) - exp += "\nsubject file: %s" % ( self._i.getSubjectFile() ) - exp += "\nnb processors: %i" % ( self._i.getNbProcessors() ) - exp += "\noutput file: %s" % ( "dummyInFile.fa.cat.align" ) - self._i.setSummary() - obs = self._i.getSummary() - self.assertEqual( exp, obs ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_YassClusterLauncher.py --- a/commons/launcher/tests/Test_YassClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,30 +0,0 @@ -import unittest -from commons.launcher.YassClusterLauncher import YassClusterLauncher - -class Test_YassClusterLauncher( unittest.TestCase ): - - def setUp( self ): - self._i = YassClusterLauncher() - - - def tearDown( self ): - self._i = None - - - def test_getSpecificHelpAsString( self ): - exp = "" - exp += "\nspecific options:" - exp += "\n -s: name of the subject file (format='fasta')" - exp += "\n -p: parameters for 'yass'" - exp += "\n -Z: concatenate output files" - exp += "\n -A: same sequences (all-by-all)" - obs = self._i.getSpecificHelpAsString() - self.assertEqual( exp, obs ) - - - def test_setASpecificAttributeFromCmdLine( self ): - self._i.setASpecificAttributeFromCmdLine( "-s", "dummySubjectFile.fa" ) - self.assertEqual( "dummySubjectFile.fa", self._i.getSubjectFile() ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_YassProgramLauncher.py --- a/commons/launcher/tests/Test_YassProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,79 +0,0 @@ -import unittest -from commons.launcher.YassProgramLauncher import YassProgramLauncher - - - -class Test_YassProgramLauncher( unittest.TestCase ): - - def setUp( self ): - self._i = YassProgramLauncher() - - - def tearDown( self ): - self._i = None - - - def test_getSpecificHelpAsString( self ): - exp = "" - exp += "\nspecific options:" - exp += "\n -s: name of the subject file (format='fasta')" - exp += "\n -p: parameters for 'yass'" - exp += "\n -A: same sequences (all-by-all)" - exp += "\n -o: name of the output file (format='align', default=inFile+'.align')" - obs = self._i.getSpecificHelpAsString() - self.assertEqual( exp, obs ) - - - def test_setASpecificAttributeFromCmdLine( self ): - self._i.setASpecificAttributeFromCmdLine( "-s", "dummySubjectFile.fa" ) - self.assertEqual( "dummySubjectFile.fa", self._i.getSubjectFile() ) - - self._i.setASpecificAttributeFromCmdLine( "-o", "dummyOutFile.align" ) - self.assertEqual( "dummyOutFile.align", self._i.getOutputFile() ) - - - def test_setWrapperCommandLine( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - exp = "YassProgramLauncher.py" - exp += " -i %s" % ( "dummyInFile.fa" ) - exp += " -s %s" % ( "dummySubjectFile.fa" ) - exp += " -o %s.align" % ( "dummyInFile.fa" ) - exp += " -v 0" - self._i.setWrapperCommandLine() - obs = self._i.getWrapperCommandLine() - self.assertEqual( exp, obs ) - - - def test_setProgramCommandLine( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - exp = "yass -d 2 -o dummyInFile.fa.blast dummyInFile.fa dummySubjectFile.fa" - self._i.setProgramCommandLine() - obs = self._i.getProgramCommandLine() - self.assertEqual( exp, obs ) - - - def test_setListFilesToKeep( self ): - self._i.setInputFile( "dummyInFile.fa" ) - lExp = [ "dummyInFile.fa.align" ] - self._i.setListFilesToKeep() - lObs = self._i.getListFilesToKeep() - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_setSummary( self ): - self._i.setInputFile( "dummyInFile.fa" ) - self._i.setSubjectFile( "dummySubjectFile.fa" ) - exp = "input file: %s" % ( self._i.getInputFile() ) - exp += "\nsubject file: %s" % ( self._i.getSubjectFile() ) - exp += "\nparameters: %s" % ( self._i.getProgramParameters() ) - exp += "\noutput file: %s" % ( "dummyInFile.fa.align" ) - self._i.setSummary() - obs = self._i.getSummary() - self.assertEqual( exp, obs ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/launcher/tests/Test_launchTEclass.py --- a/commons/launcher/tests/Test_launchTEclass.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,34 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -from commons.launcher import launchTEclass - - -class Test_launchTEclass( unittest.TestCase ): - - def test_parseFastaFileFromTEclass( self ): - inFile = "dummyLibFile.fa" - inHandler = open( inFile, "w" ) - inHandler.write( ">1360|TEclass result: DNA|ORFs: 1360..2226:+1\n" ) - inHandler.write( "AGCATGACGCA\n" ) - inHandler.write( ">FB|TEclass result: unclear\n" ) - inHandler.write( "GCATGCAGCGACGCGAC\n" ) - inHandler.close() - - expFile = "dummyExpFile.map" - expHandler = open( expFile, "w" ) - expHandler.write( "DNA\t1360\t1\t11\n" ) - expHandler.write( "unclear\tFB\t1\t17\n" ) - expHandler.close() - - obsFile = "dummyObsFile.map" - - launchTEclass.parseFastaFileFromTEclass( inFile, obsFile ) - - self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) ) - - for f in [ inFile, expFile, obsFile ]: - os.remove( f ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/AlignList.py --- a/commons/pyRepetUnit/align/AlignList.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,51 +0,0 @@ -## class of list of align object -# -class AlignList: - - list; - - def __init__( self ): - self.list = [] - - ## append align instance in the align instance list - # - # @param AlignInstance instance of align object - # - def append(self, AlignInstance): - self.list.append(AlignInstance) - - ## get length of list of align instance - # - #@return length integer length of list - # - def len(self): - return len(self.list) - - ## get list of align instance - # - #@return list of align instance - # - def getList(self): - return self.list - - ## get item in list of align instance according to index - # - #@param index integer index of list - #@return align instance item of list of align instance - # - def get(self, index): - return self.list[index] - - ## extend align instance in the align instance list - # - # @param AlignInstance instance of align object - # - def extend(self, AlignInstance): - self.list.extend(AlignInstance) - - ## take off an align instance from the align instance list - # - # @param AlignInstance instance of align object - # - def remove(self, AlignInstance): - self.list.remove(AlignInstance) \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/AlignListUtils.py --- a/commons/pyRepetUnit/align/AlignListUtils.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,53 +0,0 @@ -import os -import commons.core.coord.Align -import commons.pyRepetUnit.align.AlignList -from commons.core.utils.FileUtils import FileUtils - -class AlignListUtils: - - ##read a file in align format and return a AlignList - # - # @param inFileName string name of file - # @return listAlignInstance list list of align instance - # - def read( inFileName ): - alignInstance = commons.core.coord.Align.Align() - listAlignInstance = commons.pyRepetUnit.align.AlignList.AlignList() - f = open( inFileName , "r") - while alignInstance.read( f ): - listAlignInstance.append(alignInstance) - alignInstance = commons.core.coord.Align.Align() - f.close - return (listAlignInstance) - - read = staticmethod( read ) - - ## write a file in align format from an AlignList - # - # @param alignListInstance list list of align instance object - # @param inFileName string name of file - def write( alignListInstance, inFileName ): - f = open( inFileName , "w") - for alignInstance in alignListInstance.getList(): - alignInstance.write( f ) - f.close - - write = staticmethod( write ) - - ## Filter an AlignList by removing all is <= minScore - # - # @param listAlignInstance list list of align instance object - # @param minScore integer minimum score to keep in result - # - def filterOnAMinimalScore( listAlignInstance, minScore ): - listAlignInstanceOld = commons.pyRepetUnit.align.AlignList.AlignList() - for alignInstance in listAlignInstance.getList(): - listAlignInstanceOld.append(alignInstance) - for alignInstance in listAlignInstanceOld.getList(): - if alignInstance.score <= minScore: - listAlignInstance.remove(alignInstance) - - filterOnAMinimalScore = staticmethod( filterOnAMinimalScore ) - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/HmmpfamOutput2align.py --- a/commons/pyRepetUnit/align/hmmOutputParsing/HmmpfamOutput2align.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,32 +0,0 @@ -from commons.pyRepetUnit.hmmer.hmmOutput.HmmpfamOutputProcessing import HmmpfamOutputProcessing - -##data processor : read an output from hmmpfam and transform it into .align file -# -class HmmpfamOutput2align( object ): - - ## constructor - # - def __init__(self): - self.hmmpfamOutputProcess = HmmpfamOutputProcessing() - self._inputFile = "" - self._outputFile = "" - - ## set input file - # - # @param input file input file - # - def setInputFile(self, input): - self._inputFile = input - - ## set output file - # - # @param output file output file - # - def setOutputFile(self, output): - self._outputFile = output - - - ##read a hmmpfam output file, parse it and, write the corresponding .align file - # - def run( self ): - self.hmmpfamOutputProcess.readHmmOutputsAndWriteAlignFile( self._inputFile, self._outputFile ) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/HmmscanOutput2align.py --- a/commons/pyRepetUnit/align/hmmOutputParsing/HmmscanOutput2align.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,28 +0,0 @@ -from commons.pyRepetUnit.hmmer.hmmOutput.HmmscanOutputProcessing import HmmscanOutputProcessing -##data processor : read an output from hmmscan and transform it into .align file -# -class HmmscanOutput2align( object ): - - ## constructor - # - def __init__(self): - self.hmmscanOutputProcess = HmmscanOutputProcessing() - self._inputFile = "" - self._outputFile = "" - - ## set input file - # - # @param input file input file - # - def setInputFile(self, input): - self._inputFile = input - ## set output file - # @param output file output file - # - def setOutputFile(self, output): - self._outputFile = output - - ##read a hmmscan output file, parse it and, write the corresponding .align file - # - def run( self ): - self.hmmscanOutputProcess.readHmmOutputsAndWriteAlignFile( self._inputFile, self._outputFile ) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/HmmpfamOutput2AlignTestSuite.py --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/HmmpfamOutput2AlignTestSuite.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,21 +0,0 @@ -import unittest -import sys -from Test_F_HmmpfamOutput2align import Test_F_HmmpfamOutput2align -from Test_F_HmmscanOutput2align import Test_F_HmmscanOutput2align -from Test_F_Hmmerpfam2align import Test_F_Hmmerpfam2align -from commons.tools.tests.Test_F_HmmOutput2alignAndTransformCoordInNtAndFilterScores_script import Test_F_HmmOutput2alignAndTransformCoordInNtAndFilterScores_script - -def main(): - - hmmerTestSuite = unittest.TestSuite() - hmmerTestSuite.addTest(unittest.makeSuite(Test_F_HmmpfamOutput2align,'test')) - hmmerTestSuite.addTest(unittest.makeSuite(Test_F_HmmscanOutput2align,'test')) - hmmerTestSuite.addTest(unittest.makeSuite(Test_F_HmmOutput2alignAndTransformCoordInNtAndFilterScores_script,'test')) - hmmerTestSuite.addTest(unittest.makeSuite(Test_F_Hmmerpfam2align,'test')) - - runner = unittest.TextTestRunner(sys.stderr, 2, 2) - runner.run(hmmerTestSuite) - - -if __name__ == '__main__': - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/Test_F_Hmmerpfam2align.py --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/Test_F_Hmmerpfam2align.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,20 +0,0 @@ -import os -import unittest -import commons.pyRepetUnit.hmmer.hmmOutput.HmmpfamOutputProcessing -from commons.core.utils.FileUtils import FileUtils - -class Test_F_Hmmerpfam2align(unittest.TestCase): - - def setUp(self): - self.hmmpfamOutputProcess = commons.pyRepetUnit.hmmer.hmmOutput.HmmpfamOutputProcessing.HmmpfamOutputProcessing() - self._inputFile = "./datas/test_hmmpfam_output" - self._outputFile = "./datas/PostProcessResult.align" - - def testAcceptanceHmmpfam2align(self): - self.hmmpfamOutputProcess.readHmmOutputsAndWriteAlignFile( self._inputFile, self._outputFile ) - self.assertTrue(FileUtils.isRessourceExists(self._outputFile)) - self.assertTrue(FileUtils.are2FilesIdentical(self._inputFile + ".align", self._outputFile)) - os.remove(self._outputFile) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/Test_F_HmmpfamOutput2align.py --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/Test_F_HmmpfamOutput2align.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,22 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.align.hmmOutputParsing.HmmpfamOutput2align import HmmpfamOutput2align -from commons.core.utils.FileUtils import FileUtils - -class Test_F_HmmpfamOutput2align(unittest.TestCase): - - def setUp(self): - self.hmmpfamOutput2align = HmmpfamOutput2align() - self._inputFile = "./datas/test_hmmpfam_output" - self._outputFile = "./datas/hmmpfam_output.align" - - def testParseHmmpfamOutput2align(self): - self.hmmpfamOutput2align.setInputFile(self._inputFile) - self.hmmpfamOutput2align.setOutputFile(self._outputFile) - self.hmmpfamOutput2align.run() - self.assertTrue(FileUtils.isRessourceExists(self._outputFile)) - self.assertTrue(FileUtils.are2FilesIdentical(self._inputFile + ".align", self._outputFile)) - os.remove( self._outputFile ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/Test_F_HmmscanOutput2align.py --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/Test_F_HmmscanOutput2align.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,27 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.align.hmmOutputParsing.HmmscanOutput2align import HmmscanOutput2align -from commons.core.utils.FileUtils import FileUtils - -CURRENT_DIR = os.getcwd() - -class Test_F_HmmscanOutput2align(unittest.TestCase): - - def setUp(self): - self.hmmscanOutput2align = HmmscanOutput2align() - self._inputFile = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput" - self._outputFile = "./datas/test_hmmscanOutput.align" - os.chdir(CURRENT_DIR) - - def testParseHmmscanOutput2align(self): - self.hmmscanOutput2align.setInputFile(self._inputFile) - self.hmmscanOutput2align.setOutputFile(self._outputFile) - self.hmmscanOutput2align.run() - expectedFile = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput.align" - self.assertTrue(FileUtils.isRessourceExists(self._outputFile)) - self.assertTrue(FileUtils.are2FilesIdentical(expectedFile, self._outputFile)) - os.remove( self._outputFile ) - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/ConsensusTestFile_nt.fsa --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/ConsensusTestFile_nt.fsa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,18 +0,0 @@ ->blumeria_Grouper_590_20:NoCat -TTTCGATCNTATTGAAATGTATAACCCACTACTTAGTTCGTGGACTTGTTGGTAGAGGGA -AGCTTATGCAATAATGAAGGATAAAAGGATGTCAATTCGACTACTCTTCTAAACACAGAT -ACCAGACTCCTTTTAATCCCAATAGATAGCCCGTGCGGGATCTCCTATTAACAGCAGTAA -ACAACGCTAACACAGGGTATACGCAATCTCCGTTCGCCAAACACCAGTCTGTCGGGACTA -CTAATTATCGAGCCTAGTAGGATCGACAATGTGTATCCCAACATAGAAATAATAGAAAGC -TCAACACCCAAACCCCTCATCAATAACTGCCATTAATCATCACCTGACTTATCTCTGTAC -TCCATAATTTCAACACTNAAGAATATTTGTA ->blumeria_Grouper_4152_12:NoCat -GGACCGGCCGCCACGAATTGCGCGATTGCTGCTCGCAAGTAGACTTTGATGGAGTCTACA -AAATTTTTGTCTTCACCGGTGGAGAGCGGTTGAAGAGCTGCCTCGACACTGCTAATAGCC -GTCGAGCATATTGTGAATTGCGCGGCTTTTTGTCTTGCCCTGCGCTCCTCCGCTTCGATC -GCTGCAAGCAATTCTGGAGGGTGTGTATTTTTTCTGCCTGCTGCTTCTAGTGCTGGAGGC -TGCGGGGCCAGTGGAGGGTTTTCGGCTCCTGCTGCCTTAGTGGATGGTGTTTCAGCCCTT -TTCGCGGGCCTCACTTCTGCAGGTCGCGGTAGTGCTGGAACCGTGATGCGCTTCTCGGGT -GCGACGACGGTTTTTCTGGGGGATCCGGTGGGATCCAAGACTTGCTCTGCGTCTTCTGGG -CTGGAGGATGCCCAAACTGAATCGGCGAGGGTTTTTAGCTTCTCGACTTCTGCGTCCACC -ATATCTACCTCGGGGACATTG |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/OutputHmmpfamTest --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/OutputHmmpfamTest Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,406 +0,0 @@\n-hmmpfam - search one or more sequences against HMM database\n-HMMER 2.3.2 (Oct 2003)\n-Copyright (C) 1992-2003 HHMI/Washington University School of Medicine\n-Freely distributed under the GNU General Public License (GPL)\n-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n-HMM file: /home/choede/hmmer3/Pfam_fs\n-Sequence file: ConsensusTestFile_aaWithoutStop.fsa\n-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n-\n-Query sequence: blumeria_Grouper_590_20:NoCat_1\n-Accession: [none]\n-Description: [none]\n-\n-Scores for sequence family classification (score includes all domains):\n-Model Description Score E-value N \n--------- ----------- ----- ------- ---\n-DUF234 Archaea bacterial proteins of unknown 3.2 1.5 1\n-DUF1414 Protein of unknown function (DUF1414) 2.9 6.3 1\n-\n-Parsed for domains:\n-Model Domain seq-f seq-t hmm-f hmm-t score E-value\n--------- ------- ----- ----- ----- ----- ----- -------\n-DUF234 1/1 91 108 .. 5 22 .. 3.2 1.5\n-DUF1414 1/1 111 119 .. 1 9 [. 2.9 6.3\n-\n-Alignments of top-scoring domains:\n-DUF234: domain 1 of 1, from 91 to 108: score 3.2, E = 1.5\n- *->VyPNrseIEsGnikevle<-*\n- VyPN++ IEs ++k++++ \n- blumeria_G 91 VYPNIEIIESSTPKPLIN 108 \n-\n-DUF1414: domain 1 of 1, from 111 to 119: score 2.9, E = 6.3\n- *->HkAPvDLSL<-*\n- H ++DLSL \n- blumeria_G 111 HXSSPDLSL 119 \n-\n-//\n-\n-Query sequence: blumeria_Grouper_590_20:NoCat_2\n-Accession: [none]\n-Description: [none]\n-\n-Scores for sequence family classification (score includes all domains):\n-Model Description Score E-value N \n--------- ----------- ----- ------- ---\n-\t[no hits above thresholds]\n-\n-Parsed for domains:\n-Model Domain seq-f seq-t hmm-f hmm-t score E-value\n--------- ------- ----- ----- ----- ----- ----- -------\n-\t[no hits above thresholds]\n-\n-Alignments of top-scoring domains:\n-\t[no hits above thresholds]\n-//\n-\n-Query sequence: blumeria_Grouper_590_20:NoCat_3\n-Accession: [none]\n-Description: [none]\n-\n-Scores for sequence family classification (score includes all domains):\n-Model Description Score E-value N \n--------- ----------- ----- ------- ---\n-CPW_WPC Plasmodium falciparum domain of unknown func 1.5 7.7 1\n-HECT HECT-domain (ubiquitin-transferase) 0.0 9.2 1\n-\n-Parsed for domains:\n-Model Domain seq-f seq-t hmm-f hmm-t score E-value\n--------- ------- ----- ----- ----- ----- ----- -------\n-CPW_WPC 1/1 30 37 .. 1 9 [. 1.5 7.7\n-HECT 1/1 55 69 .. 341 355 .] 0.0 9.2\n-\n-Alignments of top-scoring domains:\n-CPW_WPC: domain 1 of 1, from 30 to 37: score 1.5, E = 7.7\n- *->CerdYsisk<-*\n- C++dYs sk \n- blumeria_G 30 CQFDYS-SK 37 \n-\n-HECT: domain 1 of 1, from 55 to 69: score 0.0, E = 9.2\n- *->LllAIneeteGFgle<-*\n- Ll+A+n+ + G+ ++ \n- blumeria_G 55 LLTAVNNANTGYTQS 69 \n-\n-//\n-\n-Query sequence: blumeria_Grouper_590_20:NoCat_4\n-Accession: [none]\n-Description: [none]\n-\n-Scores for sequence family classification (score includes all domains):\n-Model Description Score E-value N \n--------- ----------- ----- ------- ---\n-DUF46 Putative integral membrane protein DUF46 6.4 0.11 1\n-\n-Parsed for domains:\n-Model Domain seq-f seq-t hmm-f hmm-t score E-value\n----'..b'inal do 1.8 3.8 1\n-Jun Jun-like transcription factor -0.7 6.5 1\n-\n-Parsed for domains:\n-Model Domain seq-f seq-t hmm-f hmm-t score E-value\n--------- ------- ----- ----- ----- ----- ----- -------\n-DUF1798 1/1 2 19 .. 35 52 .. 3.0 3.3\n-DUF881 1/1 46 69 .. 214 237 .] 4.0 1.6\n-Jun 1/1 77 93 .. 264 284 .. -0.7 6.5\n-SLT 1/1 89 108 .. 1 20 [. 4.5 1.2\n-DUF2346 1/1 93 115 .. 63 85 .] 3.2 2.8\n-LBP_BPI_CETP 1/1 124 139 .. 191 209 .] 1.8 3.8\n-\n-Alignments of top-scoring domains:\n-DUF1798: domain 1 of 1, from 2 to 19: score 3.0, E = 3.3\n- *->KPfvdevdqllaeWkelA<-*\n- +P+vd+vd++++++k+lA \n- blumeria_G 2 VPEVDMVDAEVEKLKTLA 19 \n-\n-DUF881: domain 1 of 1, from 46 to 69: score 4.0, E = 1.6\n- *->VeksdditiPAydgplklrYAkPv<-*\n- V + +it+PA++ p +r Ak++ \n- blumeria_G 46 VAPEKRITVPALPRPAEVRPAKRA 69 \n-\n-Jun: domain 1 of 1, from 77 to 93: score -0.7, E = 6.5\n- *->qHheNPpgfqhsavgpPRlaa<-*\n- +++eNPp+ a++pP+l a \n- blumeria_G 77 AGAENPPL----APQPPALEA 93 \n-\n-SLT: domain 1 of 1, from 89 to 108: score 4.5, E = 1.2\n- CS HHHHHHHHHHTS-HHHHHHH \n- *->dliikaaekygidpsllaAi<-*\n- ++ ++a+ k+ ++p llaAi \n- blumeria_G 89 PALEAAGRKNTHPPELLAAI 108 \n-\n-DUF2346: domain 1 of 1, from 93 to 115: score 3.2, E = 2.8\n- *->AtKRrEkhdneLlealeeeEaKk<-*\n- A R+ h eLl+a+e eE+ \n- blumeria_G 93 AAGRKNTHPPELLAAIEAEERRA 115 \n-\n-LBP_BPI_CETP: domain 1 of 1, from 124 to 139: score 1.8, E = 3.8\n- CS HHHHHHHCHHHH...HTTS \n- *->lCPviessVnslNvhLstl<-*\n- +C +++ssV++ L++l \n- blumeria_G 124 ICSTAISSVEAA---LQPL 139 \n-\n-//\n-\n-Query sequence: blumeria_Grouper_4152_12:NoCat_6\n-Accession: [none]\n-Description: [none]\n-\n-Scores for sequence family classification (score includes all domains):\n-Model Description Score E-value N \n--------- ----------- ----- ------- ---\n-DUF258 Protein of unknown function, DUF258 1.5 3.8 1\n-TRAP_alpha Translocon-associated protein (TRAP), alph 0.1 4.1 1\n-DUF1289 Protein of unknown function (DUF1289) 2.8 5.3 1\n-SOCS_box SOCS box 2.4 9.7 1\n-\n-Parsed for domains:\n-Model Domain seq-f seq-t hmm-f hmm-t score E-value\n--------- ------- ----- ----- ----- ----- ----- -------\n-DUF258 1/1 50 62 .. 293 305 .] 1.5 3.8\n-SOCS_box 1/1 85 90 .. 1 6 [. 2.4 9.7\n-DUF1289 1/1 95 115 .. 36 56 .] 2.8 5.3\n-TRAP_alpha 1/1 106 116 .. 317 327 .] 0.1 4.1\n-\n-Alignments of top-scoring domains:\n-DUF258: domain 1 of 1, from 50 to 62: score 1.5, E = 3.8\n- CS -HHHHHHHHHHHH \n- *->seeRYesYlklle<-*\n- s++R+++Y+ l++ \n- blumeria_G 50 SASRFQHYRDLQK 62 \n-\n-SOCS_box: domain 1 of 1, from 85 to 90: score 2.4, E = 9.7\n- *->prSLqh<-*\n- prSLqh \n- blumeria_G 85 PRSLQH 90 \n-\n-DUF1289: domain 1 of 1, from 95 to 115: score 2.8, E = 5.3\n- *->dERravlqllpqRlaalglkp<-*\n- +E+ + lq+++qR +++++ + \n- blumeria_G 95 AEKIHTLQNCLQRSKRRSAGQ 115 \n-\n-TRAP_alpha: domain 1 of 1, from 106 to 116: score 0.1, E = 4.1\n- *->kRkvKRsvGdD<-*\n- +R +Rs+G+D \n- blumeria_G 106 QRSKRRSAGQD 116 \n-\n-//\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/PostPostProcessTestFiltered.align --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/PostPostProcessTestFiltered.align Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,25 +0,0 @@ -blumeria_Grouper_590_20:NoCat 271 324 DUF234 5 22 1.5 3 0.000000 -blumeria_Grouper_590_20:NoCat 331 357 DUF1414 1 9 6.3 2 0.000000 -blumeria_Grouper_590_20:NoCat 90 113 CPW_WPC 1 9 7.7 1 0.000000 -blumeria_Grouper_590_20:NoCat 119 148 DUF46 182 173 0.11 6 0.000000 -blumeria_Grouper_4152_12:NoCat 97 201 TrbL 231 285 8 0 0.000000 -blumeria_Grouper_4152_12:NoCat 172 240 TNV_CP 167 189 7.9 0 0.000000 -blumeria_Grouper_4152_12:NoCat 280 327 DGOK 283 298 1.3 0 0.000000 -blumeria_Grouper_4152_12:NoCat 337 381 Peptidase_S29 1 15 1.1 4 0.000000 -blumeria_Grouper_4152_12:NoCat 442 471 DUF1301 1 10 9.9 0 0.000000 -blumeria_Grouper_4152_12:NoCat 62 79 Toxin_18 50 55 4.4 4 0.000000 -blumeria_Grouper_4152_12:NoCat 377 412 ABC_transp_aux 276 287 5.2 1 0.000000 -blumeria_Grouper_4152_12:NoCat 428 478 DUF1602 23 39 0.39 5 0.000000 -blumeria_Grouper_4152_12:NoCat 306 368 zf-P11 1 20 1.8 3 0.000000 -blumeria_Grouper_4152_12:NoCat 378 407 V-ATPase_G 1 10 5.3 2 0.000000 -blumeria_Grouper_4152_12:NoCat 136 228 XhoI 202 172 0.014 9 0.000000 -blumeria_Grouper_4152_12:NoCat 145 165 Endomucin 267 261 6 0 0.000000 -blumeria_Grouper_4152_12:NoCat 444 497 DUF1798 52 35 3.3 3 0.000000 -blumeria_Grouper_4152_12:NoCat 294 365 DUF881 237 214 1.6 4 0.000000 -blumeria_Grouper_4152_12:NoCat 177 236 SLT 20 1 1.2 4 0.000000 -blumeria_Grouper_4152_12:NoCat 156 224 DUF2346 85 63 2.8 3 0.000000 -blumeria_Grouper_4152_12:NoCat 84 131 LBP_BPI_CETP 209 191 3.8 1 0.000000 -blumeria_Grouper_4152_12:NoCat 314 352 DUF258 305 293 3.8 1 0.000000 -blumeria_Grouper_4152_12:NoCat 230 247 SOCS_box 6 1 9.7 2 0.000000 -blumeria_Grouper_4152_12:NoCat 155 217 DUF1289 56 36 5.3 2 0.000000 -blumeria_Grouper_4152_12:NoCat 152 184 TRAP_alpha 327 317 4.1 0 0.000000 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/hmmscanTransformedExpected.align --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/hmmscanTransformedExpected.align Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,7 +0,0 @@ -Polinton-1_DY:classII:Polinton 2974 3642 DNA_pol_B_2 13 252 3.7e-06 24 0.000000 -Polinton-1_DY:classII:Polinton 7897 7944 ASFV_p27 59 74 6 4 0.000000 -Polinton-1_DY:classII:Polinton 9022 9123 Ribosomal_S4 39 72 18 4 0.000000 -Polinton-1_DY:classII:Polinton 11896 11955 Homo_sperm_syn 49 68 8.8 2 0.000000 -Polinton-1_DY:classII:Polinton 5480 5932 rve 168 4 6.7e-30 103 0.000000 -Polinton-1_DY:classII:Polinton 5099 5191 Chromo 51 4 8.5e-06 24 0.000000 -Polinton-1_DY:classII:Polinton 8408 8434 GARS_A 204 196 11 2 0.000000 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/repetHmmscan.fa --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/repetHmmscan.fa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,314 +0,0 @@\n->SAR:satellite:satellite\n-acagtatataatatatattttgggtactttgatattttatgtacagtatataatatatat\n-tttgggtactttgatattttatgt\n->BARI_DM:classII:TIR\n-acagtcatggtcaaaattattttcacaaagtgcatttttgtgcatgggtcacaaacagtt\n-gcttgtgcagcaagtggggggaggtgaaatgcaaaaaaacttttgcttttgcaaattcaa\n-acctatgcagagtcagatgaaagaagaattgaaaaaataactgttcctatgcgcaaggaa\n-gaggcaaatgaagagatctttatcagttgtcagaagtatttgcacacggtttcgtcgcat\n-cacaattattttcacaacgcaatttcttcttcagtgattggtttagagtgacaagtgccg\n-gtttgtttgcttaaatacatttaaattattgaataaaaattagatttaatcattttccta\n-ttacagttattaaataaaatgcccaaaacaaaagagttaacagttgaggcccgggctggt\n-attgttgctaggtttaaagccggtacacctgcggccaaaatagctgaaatatatcaaatt\n-tcgcgtagaactgtctactacttaataaaaaagtttgatacagttggcacattaaaaaat\n-aaaaaaagatcaggccgaaaacctgtgctggaccaaaggcaatgcaggcaaatacttgga\n-gttgtggcgaagaatcctagtgccagtccggtaaaaattgccttagaatcaaaaaataca\n-attggcaaacaagttagtagttctacaattcgtcgcaggctaaaagaagctgattttaag\n-acatacgttgttcgcaaaacgattgagatcacaccaaccaacaaaacaaaacgtcttcga\n-tttgcgttggaatatgttaagaagcctcttgacttttggtttaatattttatggactgat\n-gagtctgcatttcagtaccaggggtcatacagcaagcattttatgcatttgaaaaataat\n-caaaagcatttggcagcccagccaaccaatagatttggtgggggcacagtcatgttttgg\n-ggatgtctttcctattatggattcggagacttggtaccgatagaaggaactttaaatcag\n-aacggataccttcttatcttaaacaaccatgcttttacgtctggaaatagactttttcca\n-actactgaatggattcttcagcaggacaatgctccatgccataagggtaggataccaaca\n-aaatttttaaacgaccttaatctggcggttcttccgtggcccccccaaagcccagacctt\n-aatatcattgaaaacgtttgggcttttattaaaaaccaacgaactattgataaaaataga\n-aaacgagagggagccatcattgaaatagcggagatttggtccaaattgacattagaattt\n-gcacaaactttggtaaggtcaataccaaaaagacttcaagcagttattgatgccaaaggt\n-ggtgttacaaaatattagtattgtatttatataaaataaagaaattcttatgttgaaatt\n-agatgttaagctgaaatttactaaattaagttgagtgaaaatacttttgaagcgcaataa\n-acatgtgaaaatactattgacaacttgcatgcatattttcttttgctttaagctttgtac\n-tatgaaccgttatctttcgtatttcttttcgactaccttctgcatagatcaagctaagcg\n-ataagaactatttcaggcaaatcggacaacaacaagaagaaatataacaaaaagaagttg\n-aagtttgcaaatattgtgcgttgtgaaaatacttttgaccacctctgt\n->MOLLY_SN:classII:TIR\n-acgtacctcacgggttggccggacacacggtttggccggacacttttgccaagcccccac\n-caaattctacctctcaacgtgatgcctcaacaacaacaccagatagacccttctagcgaa\n-cgtcatatacagactgcccttcaagctcttaaacaagacgcgacactgtccttgcgacgc\n-gctgcagctatctataacgtctctcgagcaacactaagcgatcgacgcgctggacggcct\n-tcacaagcagattgctggcctaaaacaaagaatctaactaagactgaggaggacgtagtt\n-gttaagcatatacttgagctggttacgcgtggatttcctcctaggctcgcagctgtggct\n-gatatggctaattccctgcgcgctgagcgcggtctgggccaagttggctcaaactggccc\n-agtacgttcgtcaaacgccgccctgagctccaaacgaagtttaatcgcaaatacgactac\n-aagagagccctctgcgaggatcctgaggttatacgagactggttccggcttgtagagaac\n-atgaaggcgaagcacggtatccttgatggcgacatgtacaactttgacgagtctggcttt\n-atgatgggccagatctcaactggagcagtcgttacagcttcagagcgacgaggacggccg\n-aagacagtgcaacagggcaatcgagagtggacgacggtcatccagggcgtcaacgcaaca\n-gggtgggccattccacccttcatcatcttcaagggccgccaccacctctcagcttggtat\n-aaggaggaggatctacctcataattgggttattgcagtctctaagaacggctggacaaca\n-aatgagctcggtctgcagtggttaaagcactttgatgagcatacaaagaggagggttaca\n-ggcgcttatcggctgcttattatcgacggccatgagagccacgactcgcttgaattccag\n-caatactgcaaggataacaagattatcactctctgcatgcctcctcactcgtcgcacctc\n-ctgcagcctcttgatgtgggttgttttgcctctttaaagaaggcgtacagacgccaagcc\n-gaagagctcatgcgcaaccggatcacgcacatcacgaaacttgagttcctaccgtgcttt\n-aagcgcgcctttgacgcagcaattactcctagtaatatccaaggagggtttcgaggcgct\n-ggattggtcccatttgacccagagcgggtcatattagcccttgacgtccgcatccgtacc\n-ccaccgttgcccaccgtcgaagactgtccctggcagtcgcaaactccaagtaataccctt\n-gaattaggatcgcaatcgacgcttgtaaaggcaaggattcagaggcatatagatagctca\n-ccaacgtctatggtggaggcctttgagaaggtctcaaaaggggcagcgattattgcgcac\n-aagctagtgttggcgcagaaggagattgctgagcttcgagcagctaataaggccgccacg\n-cgacgtaaatcgcacaaaagaaagcgtgtacaggaagaagggaccttgacggtcgaggac\n-ggtcttcgacggacgactctaaaggagtttggtgcgcgtagtgatgggaagaaggcgaag\n-aagcaggttcgcgctggtgcaggcgagccctcccaaaggcggtgtggacggtgcaatgag\n-actgggcataatgcgcgtacgtgtaagaaaacagtagaagtagactctgaatgatattgc\n-atcttgctttgtactatacagggccaaagtgggttgttttgcgccagaatagggtggttt\n-tggtgggggcttggcaaaagtgtccggccaaaccgtgtgtccggccaacccgtgaggtac\n-gt\n->Polinton-1_DY:classII:Polinton\n-aaaaaaaaaacaagttgggtgtcattggaaaggatttttcaagccctttccaatggtatg\n-cttttcacgattct'..b'tgtcaa\n-taatgttgacttaagaattaattttaatattgaaaaaactgcattttatttaatggaaaa\n-ggatagcgaatcaaatttaaagatattagaagcacaacttttcatgaatcatgtaactgt\n-gaacccaagcattttattggctcatcatcatgttttacaaacaaaaaatgctctttaccc\n-attcagtaaagtagaagtaaaatcgtttacaatttacccaggaaacaatacgctatcaat\n-agacaatgctgtaattggacaattaccaaattttctagctttttgtatgattaaaaaccg\n-ttcatactcaggcaacagaggactagatccatttaattttgaacattttaaaatgcaacg\n-ctttaatctaatggtgaatggagttcaagttccttcgcaagctctggaatttgactactc\n-gaactctgaaaacgttcaaagctcaagaggctataatatgctattcagatcaagcggaat\n-aaaacattatgatcggggtcttcaaattaccaaggaaatgtttgatacgaacagttttat\n-attagcctttgatttaactgctgatcagtcaaataccaccatatgttcaaatttgatgtc\n-gcaaggcacaataagaatcgaaggaagattttcagaacctcttagtgaagccgttacttg\n-tctggtatattgtgaatacgattccatgattgatattgataagcatagaaatattcgaac\n-ccttttttaaaatgaatactttacaaattcacaatttgcttacaaaacatatatacacaa\n-aatcaatttttaaaggagttttcccttcagaccagcttccaaaaactatttcaaagtatc\n-cggctttaattattgcaaacaccgacacttcagatcaaccaggaactcattggattgcat\n-tctatttcgaaagtcgcaaatcagcagaattttttgattcctatggacaatttccccaaa\n-acaaggaattcgtgacatttttaaaatctaacgcaaataaatattgctataacaagcaac\n-aactacaaggatatttttctaatacgtgtggtcattattgcataatgtatggtcttttta\n-aatgtaaaaagaaaacgctaaaatatttattaacaaattttaagagaaatgacttttcat\n-ataacgataaattaatacttaaaatgtttaagtctaattttaaaaaataaaatgcaagat\n-atttaagaaaatcaatgtagtttatttattaagtcgtttgtttagcttataatattttaa\n-cataatattgaaggcctcgtctcttaaaattggaagcctatgacactggcacgtatcggg\n-tccttccgaagcgtcatcatcactccagggacaaagcttgtagtggaatccatatttaga\n-atggatcagttctttatcctctaagtcctccagagtgctcttcaaatatataagctgcgt\n-tacgtgctcctcaaatatcatgtcttcgaactgcatcaagaagagctcaatttgtttgga\n-gtccattttcgttatggttcttttaaggttttttaaagactgatgttggatttagaaaac\n-tcaaacctttatattggaaaatttcatttacttatttatttactgataaaaattcaattc\n-gtgcagaactatatctatttacatccttccccttatataccatatgggtaataccattct\n-catttaatttcctaaaaggtgtcttagtacagaatttgtttacataactcttaggtagaa\n-aaatccaaacatctttttcgtccttgtctgctaaataaagagctaccttagttccataag\n-gtgtctttttcagcttacaaccagtgatcttatactcaaatccaatacatagatcttcag\n-tttttgtataaccaatcacaggcttcgattcattcagagtctctaggaaatcctagaaat\n-tcaataaaatttgaacaggatttatttattaatgtcctatatgcataccatttctgacca\n-acgtgagatttgattcgttatgctcttgtaactattcgtattatactaatgcatttactt\n-acaattacgagacttttatactgttcagcactacatatatatatatatatatatatatta\n-caagaacaaaatactacgtgaaagagataccaatatatctgttatgctctttatatacat\n-aaactcagttaagcctatgtagaatatttttatatacttgagtatatctatctcattttg\n-tataaatatataacttcatatgaaataaaaggttactacaaacctaatataagacagcac\n-ttttctcgaaaactcagattcaatttttactctcagaatgacaaagttgtattgtgagtt\n-gtgttcggaaacaaaatcgtttgcttcacgcagcggtttaaaaaaacataccttaaaagt\n-gcataacttcagctatcaaaaatcaaaatcttcttattattgttgctttttctgtcccaa\n-tgaacgaaaattctggttgcgatataattacaatgttcatctcttgctgatgcacgatgc\n-agaattaaagagtatgcgtaaatcaatggaaagttatcaaataaagataaaacaagtttg\n-agaatttaattttgtaaaatagttttatttaataaatttctgtataatatagacaaatta\n-aaaacctagatcaaataaaacgtctagtaatgaatggtcatcttcatccttcattattcg\n-taaataaatgttgggttgacttggctcgatgaactgatcaaaaatatgatcatcatcagg\n-aaactcatagattataggatctgtgtgcagtatatccatatcgaaatgctgtgcacattg\n-catttcttgatcgtctccattgcctcgtataagatcatttaaaacgtcctgcgttgccgc\n-tccaaaaggaaaatcgctccactcaagagacgcaaattcacttccaatttttgtagtggg\n-ggtagatgacatagaagggtcaaatactcctcttaagaagcgatctatcgaatcctctgt\n-gtcgatagcctccacataaccttccttcgagccttcaattatttcgacatcagagtcttg\n-agttaatggaacatttattccatttactgagtcaacaaactctacagtaagatccattgg\n-tatgcagtgctgaggtattataagaactgatcctgagcaatttaaggggatccattttta\n-tacacgaggattagagagtttgacatctacagggggtgtctactcttagaatccacctga\n-ttggttctcgatttaaggagccttcacagactgcagactgcacagactgcaatggggaag\n-tcagaaaaggagggcgagctatgggtttggatgcaggtaaatagccgcttgactttctcg\n-ataataggttcaaagagtcataaatatttgattttatggggtctcctagcataatgaaaa\n-tggagacagatcacagataatctgaaatacatatctctgtagggaattatttcggatgac\n-cgcagtcagggatcatgaaattattggtgactactagtcattgttactttataagtaaca\n-ttttgcaaggcatacatttaaaacgtgggtagccttaagctgaaagtcgctatgacttca\n-gattgtttagattttcttctcaacggctccatagcttttagctgaaagtagctggaatat\n-acgggaacgacggttttttaacggttttatgattatatgattttttatatatacgtatac\n-acgaccctataaccagtttgtttgatatttctaaatatttctcaactaataatccaacca\n-ccagttaccttcccagaaaattgaggacacagtaaggtgcatagccttgaacagaaatct\n-cacccccacccttgcgatcatc\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/test_hmmpfam_output --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/test_hmmpfam_output Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,321 +0,0 @@\n-hmmpfam - search one or more sequences against HMM database\n-HMMER 2.3.2 (Oct 2003)\n-Copyright (C) 1992-2003 HHMI/Washington University School of Medicine\n-Freely distributed under the GNU General Public License (GPL)\n-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n-HMM file: myhmms\n-Sequence file: test.fa\n-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n-\n-Query sequence: pkinase_full\n-Accession: [none]\n-Description: Dario rerio\n-\n-Scores for sequence family classification (score includes all domains):\n-Model Description Score E-value N \n--------- ----------- ----- ------- ---\n-pkinase Protein kinase domain 266.6 3.3e-80 1\n-pkinase Protein kinase domain 265.4 7.6e-80 1\n-rrm -42.5 2.5 1\n-rrm -8.7 3.7 1\n-fn3 Fibronectin type III domain -45.8 3.7 1\n-fn3 Fibronectin type III domain -9.0 3.8 1\n-\n-Parsed for domains:\n-Model Domain seq-f seq-t hmm-f hmm-t score E-value\n--------- ------- ----- ----- ----- ----- ----- -------\n-rrm 1/1 169 180 .. 66 77 .] -8.7 3.7\n-fn3 1/1 197 200 .. 81 84 .] -9.0 3.8\n-rrm 1/1 256 319 .. 1 77 [] -42.5 2.5\n-pkinase 1/1 258 540 .. 1 294 [] 266.6 3.3e-80\n-pkinase 1/1 258 537 .. 1 289 [. 265.4 7.6e-80\n-fn3 1/1 434 506 .. 1 84 [] -45.8 3.7\n-\n-Alignments of top-scoring domains:\n-rrm: domain 1 of 1, from 169 to 180: score -8.7, E = 3.7\n- *->nGkelggrklrv<-*\n- n++ ++l v \n- pkinase_fu 169 NKQDPHQHRLSV 180 \n-\n-fn3: domain 1 of 1, from 197 to 200: score -9.0, E = 3.8\n- CS CCCC \n- *->GpeS<-*\n- G eS \n- pkinase_fu 197 GGES 200 \n-\n-rrm: domain 1 of 1, from 256 to 319: score -42.5, E = 2.5\n- *->lfVgNL..ppdvteedLkdlFsk.fGpivsikivkDhkektketgks\n- +N++ +d+ e + F+ + +++ +\n- pkinase_fu 256 ---NNIeyVRDIGEGAFGRVFQArAPGL----LPTE----------P 285 \n-\n- kGfaFVeFeseedAekAlealnG.kelggrklrv<-*\n- + V++ +ee+ ++ ++++ + l++ + \n- pkinase_fu 286 FTMVAVKMLKEEASTDMQNDFQReAALMSEFDHP 319 \n-\n-pkinase: domain 1 of 1, from 258 to 540: score 266.6, E = 3.3e-80\n- *->yelleklGeGsfGkVykakhkd....ktgkiVAvKilkkekesikek\n- +e ++ +GeG+fG+V++a+ +++ VAvK+lk e+ s++ \n- pkinase_fu 258 IEYVRDIGEGAFGRVFQARAPGllptEPFTMVAVKMLK-EEASTDMQ 303 \n-\n- .rflrEiqilkrLsHpNIvrligvfedtddhlylvmEymegGdLfdylrr\n- ++f+rE++++ +++HpNIvrl+gv+ +++++l +Eym GdL+++lrr\n- pkinase_fu 304 nDFQREAALMSEFDHPNIVRLLGVCA-VGKPMCLMFEYMAYGDLNEFLRR 352 \n-\n- ng........................gplsekeakkialQilrGleYLHs\n- + +++++ ++++ ++++ +++++ pls +e ++i +Q++ G++YL +\n- pkinase_fu 353 RCatqqpslsrdtltssslvseperyPPLSCQEQLSISKQVAAGMAYLSE 402 \n-\n- ngivHRDLKpeNILldendgtvKiaDFGLArlle..sssklttfvGTpwY\n- +++vHRDL+++N+L+ en +vKiaDFGL+r ++ +++k++ + p +\n- pkinase_fu 403 RKFVHRDLATRNCLVAEN-LVVKIADFGLSRNIYaaDYYKASENDAIPIR 451 \n-\n- mmAPEvilegrgysskvDvWSlGviLyElltggplfpgadlpaftggdev\n- +m+PE ++++ y+s++DvW++Gv+L+E++++g \n- pkinase_fu 452 WMPPES-IFYNRYTSESDVWAYGVVLWEIFSYG----------------- 483 \n-\n- dqliifvlklPfsdelpktridpleelfriikrpglrlplpsncSeelkd\n- ++P+++ + ee+ + +++ g l +p+nc+ el+ \n- pkinase_fu 484 --------MQPYYG-------'..b'III domain -39.7 1.2 1\n-pkinase Protein kinase domain -9.2 1.8 1\n-fn3 Fibronectin type III domain -7.5 1.9 1\n-\n-Parsed for domains:\n-Model Domain seq-f seq-t hmm-f hmm-t score E-value\n--------- ------- ----- ----- ----- ----- ----- -------\n-fn3 1/1 143 224 .. 1 84 [] -39.7 1.2\n-pkinase 1/1 233 241 .. 1 9 [. -9.2 1.8\n-rrm 1/1 440 456 .. 1 17 [. -6.1 0.92\n-rrm 1/1 669 731 .. 1 77 [] -32.5 0.26\n-pkinase 1/1 906 1127 .. 1 294 [] -171.6 0.19\n-fn3 1/1 923 934 .. 1 12 [. -7.5 1.9\n-\n-Alignments of top-scoring domains:\n-fn3: domain 1 of 1, from 143 to 224: score -39.7, E = 1.2\n- CS C CCCCEEEEEECCTTCCEEEEECCCCCCCCCCEEEEE.ECCCCCCC\n- *->P.saPtnltvtdvtstsltlsWspptgngpitgYevtyRqpknggew\n- + ++t+l++ dv ++ sWs+ +g+ + tg v R + ng +\n- S13421 143 IdLEVTGLSCVDVAN--IQESWSKVSGDLKTTGSVVFQR-MINGH-P 185 \n-\n- CS CCCEEECCCCCECECCEEEEECCCCEEEEEECCC CCCC \n- neltvpgtttsytltgLkPgteYevrVqAvnggG.GpeS<-*\n- +++ ++ + + l L + + V v ++ +G \n- S13421 186 EYQQLFRQFRDVDLDKLGESNSFVAHVFRVVAAFdGIIH 224 \n-\n-pkinase: domain 1 of 1, from 233 to 241: score -9.2, E = 1.8\n- *->yelleklGe<-*\n- +l+klGe \n- S13421 233 VSTLKKLGE 241 \n-\n-rrm: domain 1 of 1, from 440 to 456: score -6.1, E = 0.92\n- *->lfVgNLppdvteedLkd<-*\n- + ++ L++ + d+ d \n- S13421 440 VIISFLNEGLRQADIVD 456 \n-\n-rrm: domain 1 of 1, from 669 to 731: score -32.5, E = 0.26\n- *->lfVgNL.ppdvteedLkdlFskfGpivsikivkDhkektketgkskG\n- V L+++d+ + + f i k++ D +\n- S13421 669 --VEELpSTDAFHYHISLVMNRFSSI--GKVIDD------------N 699 \n-\n- faFVeFeseedAekAlealnGkelggr.klrv<-*\n- + FV ++ + e+ ++ l k+++ +l++ \n- S13421 700 VSFVYLLKKLGREHIKRGLSRKQFDQFvELYI 731 \n-\n-pkinase: domain 1 of 1, from 906 to 1127: score -171.6, E = 0.19\n- *->yelleklGeGsfGkVykakhkd........ktgkiVAvKilkkekes\n- ++l G++ ++ + ++ ++ ++ + ++VAv + ++\n- S13421 906 FKLMH-------GVIEEGLLQLerinpitgLSAREVAVVKQ---TWN 942 \n-\n- ikekrflrEiqilkrLsHpNIvrligvfedtddhlylvmEymegGdLfdy\n- + + L+ ++ fe + + v++ +d \n- S13421 943 LVK----------PDLMGVGMRIFKSLFE-AFPAYQAVFPKFSD-VPLDK 980 \n-\n- lrrng....gplsekeakkialQilrGleYLHsngivHRDLKpeNILlde\n- l + +++ +s ++ Q+ lde\n- S13421 981 LEDTPavgkHSISVTTKLDELIQT-----------------------LDE 1007 \n-\n- ndgtvKiaDFGLArlle........sssklttfvGTpwYmmAPEvi...l\n- + ++ + LAr+l +++ + + +++++f+ +++ ++++l\n- S13421 1008 P-ANLAL----LARQLGedhivlrvNKPMFKSFGKVLVRL-----LendL 1047 \n-\n- egrgysskvDvW..SlGviLyElltggplfpgadlpaftggdevdqliif\n- +r s ++ W++++ vi+ ++ g \n- S13421 1048 GQRFSSFASRSWhkAYDVIVEYIEEG------------------------ 1073 \n-\n- vlklPfsdelpktridpleelfriikrpglrlplpsncSeelkdLlkkcL\n- l++ +++ dp + + k l + ++++ ++l+ L +k++\n- S13421 1074 -LQQSYKQ-------DPVTGITDAEKA--LVQESWDLLKPDLLGLGRKIF 1113 \n-\n- nkDPskRpGsatakeilnhpwf<-*\n- +k +k p +i f \n- S13421 1114 TKVFTKHP----DYQI----LF 1127 \n-\n-fn3: domain 1 of 1, from 923 to 934: score -7.5, E = 1.9\n- CS CCCCCEEEEEEC \n- *->PsaPtnltvtdv<-*\n- + t+l++++v \n- S13421 923 INPITGLSAREV 934 \n-\n-//\n-\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/test_hmmpfam_output.align --- a/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/test_hmmpfam_output.align Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,18 +0,0 @@ -pkinase_full 169 180 rrm 66 77 3.7 -8.7 0 -pkinase_full 197 200 fn3 81 84 3.8 -9.0 0 -pkinase_full 256 319 rrm 1 77 2.5 -42.5 0 -pkinase_full 258 540 pkinase 1 294 3.3e-80 266.6 0 -pkinase_full 258 537 pkinase 1 289 7.6e-80 265.4 0 -pkinase_full 434 506 fn3 1 84 3.7 -45.8 0 -pkinase_part 169 180 rrm 66 77 3.7 -8.7 0 -pkinase_part 197 200 fn3 81 84 3.8 -9.0 0 -pkinase_part 233 299 fn3 1 84 5.9 -52.2 0 -pkinase_part 256 319 rrm 1 77 2.5 -42.5 0 -pkinase_part 258 400 pkinase 1 116 1.7e-30 101.5 0 -pkinase_part 258 400 pkinase 1 294 1.5e-05 -94.7 0 -S13421 143 224 fn3 1 84 1.2 -39.7 0 -S13421 233 241 pkinase 1 9 1.8 -9.2 0 -S13421 440 456 rrm 1 17 0.92 -6.1 0 -S13421 669 731 rrm 1 77 0.26 -32.5 0 -S13421 906 1127 pkinase 1 294 0.19 -171.6 0 -S13421 923 934 fn3 1 12 1.9 -7.5 0 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/tests/Test_AlignListUtils.py --- a/commons/pyRepetUnit/align/tests/Test_AlignListUtils.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,100 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.align.AlignList import AlignList -from commons.pyRepetUnit.align.AlignListUtils import AlignListUtils -from commons.core.utils.FileUtils import FileUtils -from commons.core.coord.Range import Range -from commons.core.coord.Align import Align - -class Test_AlignListUtils (unittest.TestCase): - - def setUp(self): - self.inputFileName = "dummyAlignFile.align" - self.outputFileName = "dummyAlignFile.out" - - def testRead(self): - f = open(self.inputFileName, "w") - f.write("blumeria_Grouper_590_20:NoCat_1\t91\t108\tDUF234\t5\t22\t2.6e-60\t0\t3.2\n") - f.write("blumeria_Grouper_590_20:NoCat_1\t111\t119\tDUF1414\t1\t9\t6.3\t0\t2.9\n") - f.close() - alignRead = AlignListUtils() - tableauAlignInstance = alignRead.read(self.inputFileName) - self.assertEquals(tableauAlignInstance.get(0).range_query.seqname, "blumeria_Grouper_590_20:NoCat_1") - self.assertEquals(tableauAlignInstance.get(0).range_query.start, 91) - self.assertEquals(tableauAlignInstance.get(0).range_query.end, 108) - self.assertEquals(tableauAlignInstance.get(0).range_subject.seqname, "DUF234") - self.assertEquals(tableauAlignInstance.get(0).range_subject.start, 5) - self.assertEquals(tableauAlignInstance.get(0).range_subject.end, 22) - self.assertEquals(tableauAlignInstance.get(0).e_value, 2.6e-60) - self.assertEquals(tableauAlignInstance.get(0).score, 0) - self.assertEquals(tableauAlignInstance.get(0).identity, 3.2) - self.assertEquals(tableauAlignInstance.get(1).range_query.seqname, "blumeria_Grouper_590_20:NoCat_1") - self.assertEquals(tableauAlignInstance.get(1).range_query.start, 111) - self.assertEquals(tableauAlignInstance.get(1).range_query.end, 119) - self.assertEquals(tableauAlignInstance.get(1).range_subject.seqname, "DUF1414") - self.assertEquals(tableauAlignInstance.get(1).range_subject.start, 1) - self.assertEquals(tableauAlignInstance.get(1).range_subject.end, 9) - self.assertEquals(tableauAlignInstance.get(1).e_value, 6.3) - self.assertEquals(tableauAlignInstance.get(1).score, 0) - self.assertEquals(tableauAlignInstance.get(1).identity, 2.9) - os.system("rm " + self.inputFileName) - - def testWrite(self): - f = open("expectedAlignFile.align", "w") - f.write("biduleChouetteQuery\t20\t55\tbiduleChouetteSubject\t2\t15\t0.005\t20\t0.000000\n") - f.write("trucBiduleQuery\t110\t155\ttrucBiduleSubject\t1\t35\t2\t1\t0.000000\n") - f.write("dummyQuery\t1\t65\tdummySubject\t1\t25\t2.6e-60\t50\t0.000000\n") - f.close() - listAlignInstance = AlignList() - align1 = Align() - align1.range_query = Range("biduleChouetteQuery", 20, 55) - align1.range_subject = Range("biduleChouetteSubject", 2, 15) - align1.e_value = 0.005 - align1.score = 20 - listAlignInstance.append(align1) - align2 = Align() - align2.range_query = Range("trucBiduleQuery", 110, 155) - align2.range_subject = Range("trucBiduleSubject", 1, 35) - align2.e_value = 2 - align2.score = 1.5 - listAlignInstance.append(align2) - align3 = Align() - align3.range_query = Range("dummyQuery", 1, 65) - align3.range_subject = Range("dummySubject", 1, 25) - align3.e_value = 2.6e-60 - align3.score = 50 - listAlignInstance.append(align3) - f = open(self.outputFileName, "w") - alignUtils = AlignListUtils() - alignUtils.write(listAlignInstance, self.outputFileName) - self.assertTrue(FileUtils.are2FilesIdentical(self.outputFileName, "expectedAlignFile.align")) - os.system("rm " + self.outputFileName) - os.system("rm expectedAlignFile.align") - - def testFilterOnAMinimalScore(self): - listAlignInstance = AlignList() - align1 = Align() - align1.range_query = Range("biduleChouetteQuery", 20, 55) - align1.range_subject = Range("biduleChouetteSubject", 2, 15) - align1.e_value = 5 - align1.score = -0.5 - listAlignInstance.append(align1) - align2 = Align() - align2.range_query = Range("trucBiduleQuery", 110, 155) - align2.range_subject = Range("trucBiduleSubject", 1, 35) - align2.e_value = 2 - align2.score = -2.0 - listAlignInstance.append(align2) - align3 = Align() - align3.range_query = Range("dummyQuery", 1, 65) - align3.range_subject = Range("dummySubject", 1, 25) - align3.e_value = 2.6e-60 - align3.score = 50 - listAlignInstance.append(align3) - expectedAlignInstance = align3 - alignUtils = AlignListUtils() - alignUtils.filterOnAMinimalScore(listAlignInstance, 0) - self.assertEquals(listAlignInstance.get(0), expectedAlignInstance) - -if __name__ == "__main__" : - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/tests/hmmpfamOutputParsingTestSuite.py --- a/commons/pyRepetUnit/align/tests/hmmpfamOutputParsingTestSuite.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,21 +0,0 @@ -''' -Created on 29 mai 2009 - -@author: oinizan -''' -import unittest -import sys -from commons.pyRepetUnit.align.tests.Test_AlignListUtils import Test_AlignListUtils - - -def main(): - - hmmpfamOutputParsingTestSuite = unittest.TestSuite() - hmmpfamOutputParsingTestSuite.addTest(unittest.makeSuite(Test_AlignListUtils,'test')) - - runner = unittest.TextTestRunner(sys.stderr, 2, 2) - runner.run(hmmpfamOutputParsingTestSuite) - - -if __name__ == '__main__': - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/transformAACoordIntoNtCoord/TransformAACoordIntoNtCoordInAlignFormat.py --- a/commons/pyRepetUnit/align/transformAACoordIntoNtCoord/TransformAACoordIntoNtCoordInAlignFormat.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,133 +0,0 @@ -import os -import sys -from commons.pyRepetUnit.align.AlignListUtils import AlignListUtils -from commons.core.seq.BioseqUtils import BioseqUtils -from commons.core.checker.RepetException import RepetException - -### Transform amino acid query coord in an align format to nucleotide coord -### according to the frame specified at the end of seqName -# -class TransformAACoordIntoNtCoordInAlignFormat( object ): - - def __init__(self): - self._inFileName = None - self._clean = False - self._outFileName = None - self._consensusFileName = None - self._IsFiltered = True - - ## read input file, transform it and write the output file - # - def run(self): - alignUtils = AlignListUtils() - listAlignInstance = alignUtils.read(self._inFileName) - self.transformQueryCoord(listAlignInstance) - #self.getOriginalQueryNameForAlignList(listAlignInstance) - if self._IsFiltered: - alignUtils.filterOnAMinimalScore(listAlignInstance, 0) - alignUtils.write(listAlignInstance, self._outFileName) - if self._clean: - self.clean() - - ## Transform the amino acid query coord into nucleotides and switch subject coord if the strand is reversed - # @param listAlignInstance list of align object instance - # - def transformQueryCoord(self, listAlignInstance): - bioseqList = BioseqUtils.extractBioseqListFromFastaFile( self._consensusFileName ) - for alignInstance in listAlignInstance.getList(): - try: - frame = self.extractFrameFromSeqName(alignInstance) - except RepetException, e: - raise e - previousEnd = alignInstance.range_query.end - previousStart = alignInstance.range_query.start - alignInstance.range_query.seqname = self._getOriginalQueryNameForAlignInstance(alignInstance) - if frame < 4: - self._changeStartInAAIntoNtInPositiveFrame(alignInstance, frame, previousStart) - self._changeEndInAAIntoNtInPositiveFrame(alignInstance, frame, previousEnd) - else: - self._checkIfSeqNameIsInDNASeqFile(bioseqList, alignInstance.range_query.seqname) - consensusLength = BioseqUtils.getSeqLengthWithSeqName(bioseqList, alignInstance.range_query.seqname) - self._changeStartInAAIntoNtInNegativeFrame(alignInstance, frame, consensusLength, previousEnd) - self._changeEndInAAIntoNtInNegativeFrame(alignInstance, frame, consensusLength, previousStart) - self._invertedSubjectCoord(alignInstance) - - ## remove the input file - # - def clean(self): - os.remove(self._inFileName) - - ## set input file name - # - # @param fileName string name of file - # - def setInFileName(self, fileName): - self._inFileName = fileName - - ## set output file name - # - # @param fileName string name of file - # - def setOutFileName(self, fileName): - self._outFileName = fileName - - ## set consensus file name - # - # @param fileName string name of file - # - def setConsensusFileName(self, fileName): - self._consensusFileName = fileName - - ## set is clean will be done - # - # @param clean boolean clean - # - def setIsClean(self, clean): - self._clean = clean - - ## get input file name - # - def getInFileName(self): - return self._inFileName - - ## set is negativ score filter will be done - # - # @param isFiltered boolean isFiltered - # - def setIsFiltered(self, isFiltered): - self._IsFiltered = isFiltered - - def _getOriginalQueryNameForAlignInstance(self, alignInstance): - return alignInstance.range_query.seqname[0:len(alignInstance.range_query.seqname) - 2] - - def _invertedSubjectCoord(self, alignInstance): - return alignInstance.range_subject.reverse() - - def _changeEndInAAIntoNtInPositiveFrame(self, alignInstance, frame, previousEnd): - alignInstance.range_query.end = 3 * previousEnd + frame - 1 - - def _changeStartInAAIntoNtInPositiveFrame(self, alignInstance, frame, previousStart): - alignInstance.range_query.start = 3 * (previousStart - 1) + frame - - def _changeEndInAAIntoNtInNegativeFrame(self, alignInstance, frame, consensusLength, previousStart): - alignInstance.range_query.end = consensusLength - 3 * (previousStart - 1) - frame + 4 - - def _changeStartInAAIntoNtInNegativeFrame(self, alignInstance, frame, consensusLength, previousEnd): - alignInstance.range_query.start = consensusLength - 3 * (previousEnd - 1) - frame + 2 - - def extractFrameFromSeqName(self, alignInstance): - try: - frame = int(alignInstance.range_query.seqname[len(alignInstance.range_query.seqname) - 1]) - except ValueError: - raise RepetException("Unable to extract frame from sequence name") - return frame - - def _checkIfSeqNameIsInDNASeqFile(self, bioseqList, seqName): - isSeqNameInBioseqList = False - for bioseq in bioseqList: - if seqName == bioseq.header: - isSeqNameInBioseqList = True - if not isSeqNameInBioseqList: - sys.stderr.write("seqName : " + seqName + " is not in the consensus file " + self._consensusFileName + "\n") - sys.exit(1) - \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/Test_F_TransformAACoordIntoNtCoordAndScoreFiltering.py --- a/commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/Test_F_TransformAACoordIntoNtCoordAndScoreFiltering.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,38 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.align.transformAACoordIntoNtCoord.TransformAACoordIntoNtCoordInAlignFormat import TransformAACoordIntoNtCoordInAlignFormat -from commons.core.utils.FileUtils import FileUtils - -class Test_F_TransformAACoordIntoNtCoordAndScoreFiltering (unittest.TestCase): - - def setUp(self): - self._inputFile = "./datas/OutputHmmpfamTest.align" - self._consensusFile = "./datas/ConsensusTestFile_nt.fsa" - self._outputFile = "./datas/alignTransformedToTest.align" - self._expectedFile = "./datas/PostPostProcessTest.align" - self._expectedFileFiltered = "./datas/PostPostProcessTestFiltered.align" - self._alignTransformation = TransformAACoordIntoNtCoordInAlignFormat() - - def testRun_with_no_filter(self): - self._alignTransformation.setInFileName(self._inputFile) - self._alignTransformation.setOutFileName(self._outputFile) - self._alignTransformation.setConsensusFileName(self._consensusFile) - self._alignTransformation.setIsFiltered(False) - self._alignTransformation.run() - self.assertTrue(FileUtils.isRessourceExists(self._outputFile)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expectedFile, self._outputFile)) - os.remove(self._outputFile) - - def testRun_with_filter(self): - self._alignTransformation.setInFileName(self._inputFile) - self._alignTransformation.setOutFileName(self._outputFile) - self._alignTransformation.setConsensusFileName(self._consensusFile) - self._alignTransformation.setIsFiltered(True) - self._alignTransformation.run() - self.assertTrue(FileUtils.isRessourceExists(self._outputFile)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expectedFileFiltered, self._outputFile)) - os.remove(self._outputFile) - - -if __name__ == "__main__" : - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/Test_TransformAACoordIntoNtCoordInAlignFormat.py --- a/commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/Test_TransformAACoordIntoNtCoordInAlignFormat.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,237 +0,0 @@\n-import os\n-import unittest\n-from commons.pyRepetUnit.align.AlignListUtils import AlignListUtils\n-from commons.pyRepetUnit.align.transformAACoordIntoNtCoord.TransformAACoordIntoNtCoordInAlignFormat import TransformAACoordIntoNtCoordInAlignFormat\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.coord.Align import Align\n-from commons.core.coord.Range import Range\n-from commons.core.checker.RepetException import RepetException\n-\n-class Test_TransformAACoordIntoNtCoordInAlignFormat(unittest.TestCase):\n- \n- def setUp(self):\n- self.inputFileName = "alignFile.align"\n- self.consensusFile = "consensus.fa"\n- self.outputFileName = "outputFile.align"\n- self._expFileName = "expFile.align"\n- \n- def tearDown(self):\n- if FileUtils.isRessourceExists(self.inputFileName):\n- os.remove(self.inputFileName)\n- if FileUtils.isRessourceExists(self.consensusFile):\n- os.remove(self.consensusFile)\n- if FileUtils.isRessourceExists(self.outputFileName):\n- os.remove(self.outputFileName)\n- if FileUtils.isRessourceExists(self._expFileName):\n- os.remove(self._expFileName)\n- \n- def test_transformQueryCoord(self):\n- f = open(self.inputFileName, "w")\n- f.write("blumeria_Grouper_590_20:NoCat_1\\t91\\t108\\tDUF234\\t5\\t22\\t1.5\\t3.2\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_1\\t111\\t119\\tDUF1414\\t1\\t9\\t6.3\\t2.9\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_3\\t30\\t37\\tCPW_WPC\\t1\\t9\\t7.7\\t1.5\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_3\\t55\\t69\\tHECT\\t341\\t355\\t9.2\\t0.0\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_4\\t82\\t91\\tDUF46\\t173\\t182\\t0.11\\t6.4\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_5\\t121\\t125\\tPOC4\\t276\\t280\\t6.3\\t-1.7\\t0\\n")\n- f.close()\n- f = open(self.consensusFile, "w")\n- f.write(">blumeria_Grouper_590_20:NoCat\\n")\n- f.write("TTTCGATCNTATTGAAATGTATAACCCACTACTTAGTTCGTGGACTTGTTGGTAGAGGGA\\n")\n- f.write("AGCTTATGCAATAATGAAGGATAAAAGGATGTCAATTCGACTACTCTTCTAAACACAGAT\\n")\n- f.write("ACCAGACTCCTTTTAATCCCAATAGATAGCCCGTGCGGGATCTCCTATTAACAGCAGTAA\\n")\n- f.write("ACAACGCTAACACAGGGTATACGCAATCTCCGTTCGCCAAACACCAGTCTGTCGGGACTA\\n")\n- f.write("CTAATTATCGAGCCTAGTAGGATCGACAATGTGTATCCCAACATAGAAATAATAGAAAGC\\n")\n- f.write("TCAACACCCAAACCCCTCATCAATAACTGCCATTAATCATCACCTGACTTATCTCTGTAC\\n")\n- f.write("TCCATAATTTCAACACTNAAGAATATTTGTA")\n- f.close() \n- alignRead = AlignListUtils() \n- tableauAlignInstance = alignRead.read(self.inputFileName)\n- alignTransformation = TransformAACoordIntoNtCoordInAlignFormat()\n- alignTransformation.setConsensusFileName(self.consensusFile)\n- alignTransformation.transformQueryCoord(tableauAlignInstance)\n- #check query coord\n- self.assertEquals(tableauAlignInstance.get(0).range_query.start, 271)\n- self.assertEquals(tableauAlignInstance.get(0).range_query.end, 324) \n- self.assertEquals(tableauAlignInstance.get(1).range_query.start, 331)\n- self.assertEquals(tableauAlignInstance.get(1).range_query.end, 357) \n- self.assertEquals(tableauAlignInstance.get(2).range_query.start, 90)\n- self.assertEquals(tableauAlignInstance.get(2).range_query.end, 113) \n- self.assertEquals(tableauAlignInstance.get(3).range_query.start, 165)\n- self.assertEquals(tableauAlignInstance.get(3).range_query.end, 209) \n- self.assertEquals(tableauAlignInstance.get(4).range_query.start, 119)\n- self.assertEquals(tableauAlignInstance.get(4).range_query.end, 148) \n- self.assertEquals(tableauAlignInstance.get(5).range_query.start, 16)\n- self.assertEquals(tableauAlignInstance.get(5).range_query.end, 30) \n- #check subject (profiles) coord\n- #positive frame : they don\'t change\n- self.assertEquals(tableauAlignInstance.get(0).range_subject.start, 5)\n- '..b'nTransformation = TransformAACoordIntoNtCoordInAlignFormat()\n- self.assertRaises(RepetException, alignTransformation.extractFrameFromSeqName, alignInstance)\n- \n- def test_run_no_filter(self):\n- f = open(self.inputFileName, "w")\n- f.write("blumeria_Grouper_590_20:NoCat_1\\t91\\t108\\tDUF234\\t5\\t22\\t1.5\\t3.2\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_1\\t111\\t119\\tDUF1414\\t1\\t9\\t6.3\\t2.9\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_3\\t30\\t37\\tCPW_WPC\\t1\\t9\\t7.7\\t1.5\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_3\\t55\\t69\\tHECT\\t341\\t355\\t9.2\\t0.0\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_4\\t82\\t91\\tDUF46\\t173\\t182\\t0.11\\t6.4\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_5\\t121\\t125\\tPOC4\\t276\\t280\\t6.3\\t-1.7\\t0\\n")\n- f.close()\n- f = open(self.consensusFile, "w")\n- f.write(">blumeria_Grouper_590_20:NoCat\\n")\n- f.write("TTTCGATCNTATTGAAATGTATAACCCACTACTTAGTTCGTGGACTTGTTGGTAGAGGGA\\n")\n- f.write("AGCTTATGCAATAATGAAGGATAAAAGGATGTCAATTCGACTACTCTTCTAAACACAGAT\\n")\n- f.write("ACCAGACTCCTTTTAATCCCAATAGATAGCCCGTGCGGGATCTCCTATTAACAGCAGTAA\\n")\n- f.write("ACAACGCTAACACAGGGTATACGCAATCTCCGTTCGCCAAACACCAGTCTGTCGGGACTA\\n")\n- f.write("CTAATTATCGAGCCTAGTAGGATCGACAATGTGTATCCCAACATAGAAATAATAGAAAGC\\n")\n- f.write("TCAACACCCAAACCCCTCATCAATAACTGCCATTAATCATCACCTGACTTATCTCTGTAC\\n")\n- f.write("TCCATAATTTCAACACTNAAGAATATTTGTA")\n- f.close() \n- alignTransformation = TransformAACoordIntoNtCoordInAlignFormat()\n- alignTransformation.setInFileName(self.inputFileName)\n- alignTransformation.setOutFileName(self.outputFileName)\n- alignTransformation.setConsensusFileName(self.consensusFile)\n- alignTransformation.setIsFiltered(False)\n- alignTransformation.run()\n- self.assertTrue(FileUtils.getNbLinesInSingleFile(self.outputFileName), 6) \n- self.assertTrue(FileUtils.isRessourceExists(self.inputFileName)) \n- \n- def test_run_no_filter_clean_option(self):\n- f = open(self.inputFileName, "w")\n- f.write("blumeria_Grouper_590_20:NoCat_1\\t91\\t108\\tDUF234\\t5\\t22\\t1.5\\t3.2\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_1\\t111\\t119\\tDUF1414\\t1\\t9\\t6.3\\t2.9\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_3\\t30\\t37\\tCPW_WPC\\t1\\t9\\t7.7\\t1.5\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_3\\t55\\t69\\tHECT\\t341\\t355\\t9.2\\t0.0\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_4\\t82\\t91\\tDUF46\\t173\\t182\\t0.11\\t6.4\\t0\\n")\n- f.write("blumeria_Grouper_590_20:NoCat_5\\t121\\t125\\tPOC4\\t276\\t280\\t6.3\\t-1.7\\t0\\n")\n- f.close()\n- f = open(self.consensusFile, "w")\n- f.write(">blumeria_Grouper_590_20:NoCat\\n")\n- f.write("TTTCGATCNTATTGAAATGTATAACCCACTACTTAGTTCGTGGACTTGTTGGTAGAGGGA\\n")\n- f.write("AGCTTATGCAATAATGAAGGATAAAAGGATGTCAATTCGACTACTCTTCTAAACACAGAT\\n")\n- f.write("ACCAGACTCCTTTTAATCCCAATAGATAGCCCGTGCGGGATCTCCTATTAACAGCAGTAA\\n")\n- f.write("ACAACGCTAACACAGGGTATACGCAATCTCCGTTCGCCAAACACCAGTCTGTCGGGACTA\\n")\n- f.write("CTAATTATCGAGCCTAGTAGGATCGACAATGTGTATCCCAACATAGAAATAATAGAAAGC\\n")\n- f.write("TCAACACCCAAACCCCTCATCAATAACTGCCATTAATCATCACCTGACTTATCTCTGTAC\\n")\n- f.write("TCCATAATTTCAACACTNAAGAATATTTGTA")\n- f.close() \n- alignTransformation = TransformAACoordIntoNtCoordInAlignFormat()\n- alignTransformation.setInFileName(self.inputFileName)\n- alignTransformation.setOutFileName(self.outputFileName)\n- alignTransformation.setConsensusFileName(self.consensusFile)\n- alignTransformation.setIsFiltered(True)\n- alignTransformation.setIsClean(True)\n- alignTransformation.run()\n- self.assertTrue(FileUtils.getNbLinesInSingleFile(self.outputFileName), 6) \n- self.assertFalse(FileUtils.isRessourceExists(self.inputFileName)) \n- \n-if __name__ == "__main__" :\n- unittest.main() \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/TransformAACoordIntoNtCoordTestSuite.py --- a/commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/TransformAACoordIntoNtCoordTestSuite.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,17 +0,0 @@ -import unittest -import sys -import TestTransformAACoordIntoNtCoordInAlignFormat -import TestAcceptanceTransformAACoordIntoNtCoordAndScoreFiltering - -def main(): - - TransformAlignTestSuite = unittest.TestSuite() - TransformAlignTestSuite.addTest(unittest.makeSuite(TestTransformAACoordIntoNtCoordInAlignFormat.TestTransformAACoordIntoNtCoordInAlignFormat,'test')) - TransformAlignTestSuite.addTest(unittest.makeSuite(TestAcceptanceTransformAACoordIntoNtCoordAndScoreFiltering.TestAcceptanceTransformAACoordIntoNtCoordAndScoreFiltering,'test')) - - runner = unittest.TextTestRunner(sys.stderr, 2, 2) - runner.run(TransformAlignTestSuite) - - -if __name__ == '__main__': - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/ConsensusTestFile_nt.fsa --- a/commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/ConsensusTestFile_nt.fsa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,18 +0,0 @@ ->blumeria_Grouper_590_20:NoCat -TTTCGATCNTATTGAAATGTATAACCCACTACTTAGTTCGTGGACTTGTTGGTAGAGGGA -AGCTTATGCAATAATGAAGGATAAAAGGATGTCAATTCGACTACTCTTCTAAACACAGAT -ACCAGACTCCTTTTAATCCCAATAGATAGCCCGTGCGGGATCTCCTATTAACAGCAGTAA -ACAACGCTAACACAGGGTATACGCAATCTCCGTTCGCCAAACACCAGTCTGTCGGGACTA -CTAATTATCGAGCCTAGTAGGATCGACAATGTGTATCCCAACATAGAAATAATAGAAAGC -TCAACACCCAAACCCCTCATCAATAACTGCCATTAATCATCACCTGACTTATCTCTGTAC -TCCATAATTTCAACACTNAAGAATATTTGTA ->blumeria_Grouper_4152_12:NoCat -GGACCGGCCGCCACGAATTGCGCGATTGCTGCTCGCAAGTAGACTTTGATGGAGTCTACA -AAATTTTTGTCTTCACCGGTGGAGAGCGGTTGAAGAGCTGCCTCGACACTGCTAATAGCC -GTCGAGCATATTGTGAATTGCGCGGCTTTTTGTCTTGCCCTGCGCTCCTCCGCTTCGATC -GCTGCAAGCAATTCTGGAGGGTGTGTATTTTTTCTGCCTGCTGCTTCTAGTGCTGGAGGC -TGCGGGGCCAGTGGAGGGTTTTCGGCTCCTGCTGCCTTAGTGGATGGTGTTTCAGCCCTT -TTCGCGGGCCTCACTTCTGCAGGTCGCGGTAGTGCTGGAACCGTGATGCGCTTCTCGGGT -GCGACGACGGTTTTTCTGGGGGATCCGGTGGGATCCAAGACTTGCTCTGCGTCTTCTGGG -CTGGAGGATGCCCAAACTGAATCGGCGAGGGTTTTTAGCTTCTCGACTTCTGCGTCCACC -ATATCTACCTCGGGGACATTG |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/OutputHmmpfamTest.align --- a/commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/OutputHmmpfamTest.align Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,29 +0,0 @@ -blumeria_Grouper_590_20:NoCat_1 91 108 DUF234 5 22 1.5 3.2 0 -blumeria_Grouper_590_20:NoCat_1 111 119 DUF1414 1 9 6.3 2.9 0 -blumeria_Grouper_590_20:NoCat_3 30 37 CPW_WPC 1 9 7.7 1.5 0 -blumeria_Grouper_590_20:NoCat_3 55 69 HECT 341 355 9.2 0.0 0 -blumeria_Grouper_590_20:NoCat_4 82 91 DUF46 173 182 0.11 6.4 0 -blumeria_Grouper_590_20:NoCat_5 121 125 POC4 276 280 6.3 -1.7 0 -blumeria_Grouper_4152_12:NoCat_1 27 38 Amino_oxidase 471 482 9.1 -0.6 0 -blumeria_Grouper_4152_12:NoCat_1 33 67 TrbL 231 285 8 0.8 0 -blumeria_Grouper_4152_12:NoCat_1 58 80 TNV_CP 167 189 7.9 0.1 0 -blumeria_Grouper_4152_12:NoCat_1 94 109 DGOK 283 298 1.3 0.5 0 -blumeria_Grouper_4152_12:NoCat_1 113 127 Peptidase_S29 1 15 1.1 4.7 0 -blumeria_Grouper_4152_12:NoCat_1 148 157 DUF1301 1 10 9.9 0.4 0 -blumeria_Grouper_4152_12:NoCat_2 21 26 Toxin_18 50 55 4.4 4.2 0 -blumeria_Grouper_4152_12:NoCat_2 126 137 ABC_transp_aux 276 287 5.2 1.1 0 -blumeria_Grouper_4152_12:NoCat_2 143 159 DUF1602 23 39 0.39 5.0 0 -blumeria_Grouper_4152_12:NoCat_3 102 122 zf-P11 1 20 1.8 3.6 0 -blumeria_Grouper_4152_12:NoCat_3 126 135 V-ATPase_G 1 10 5.3 2.4 0 -blumeria_Grouper_4152_12:NoCat_4 92 122 XhoI 172 202 0.014 9.9 0 -blumeria_Grouper_4152_12:NoCat_4 113 119 Endomucin 261 267 6 0.1 0 -blumeria_Grouper_4152_12:NoCat_5 2 19 DUF1798 35 52 3.3 3.0 0 -blumeria_Grouper_4152_12:NoCat_5 46 69 DUF881 214 237 1.6 4.0 0 -blumeria_Grouper_4152_12:NoCat_5 77 93 Jun 264 284 6.5 -0.7 0 -blumeria_Grouper_4152_12:NoCat_5 89 108 SLT 1 20 1.2 4.5 0 -blumeria_Grouper_4152_12:NoCat_5 93 115 DUF2346 63 85 2.8 3.2 0 -blumeria_Grouper_4152_12:NoCat_5 124 139 LBP_BPI_CETP 191 209 3.8 1.8 0 -blumeria_Grouper_4152_12:NoCat_6 50 62 DUF258 293 305 3.8 1.5 0 -blumeria_Grouper_4152_12:NoCat_6 85 90 SOCS_box 1 6 9.7 2.4 0 -blumeria_Grouper_4152_12:NoCat_6 95 115 DUF1289 36 56 5.3 2.8 0 -blumeria_Grouper_4152_12:NoCat_6 106 116 TRAP_alpha 317 327 4.1 0.1 0 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/PostPostProcessTest.align --- a/commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/PostPostProcessTest.align Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,29 +0,0 @@ -blumeria_Grouper_590_20:NoCat 271 324 DUF234 5 22 1.5 3 0.000000 -blumeria_Grouper_590_20:NoCat 331 357 DUF1414 1 9 6.3 2 0.000000 -blumeria_Grouper_590_20:NoCat 90 113 CPW_WPC 1 9 7.7 1 0.000000 -blumeria_Grouper_590_20:NoCat 165 209 HECT 341 355 9.2 0 0.000000 -blumeria_Grouper_590_20:NoCat 119 148 DUF46 182 173 0.11 6 0.000000 -blumeria_Grouper_590_20:NoCat 16 30 POC4 280 276 6.3 -1 0.000000 -blumeria_Grouper_4152_12:NoCat 79 114 Amino_oxidase 471 482 9.1 0 0.000000 -blumeria_Grouper_4152_12:NoCat 97 201 TrbL 231 285 8 0 0.000000 -blumeria_Grouper_4152_12:NoCat 172 240 TNV_CP 167 189 7.9 0 0.000000 -blumeria_Grouper_4152_12:NoCat 280 327 DGOK 283 298 1.3 0 0.000000 -blumeria_Grouper_4152_12:NoCat 337 381 Peptidase_S29 1 15 1.1 4 0.000000 -blumeria_Grouper_4152_12:NoCat 442 471 DUF1301 1 10 9.9 0 0.000000 -blumeria_Grouper_4152_12:NoCat 62 79 Toxin_18 50 55 4.4 4 0.000000 -blumeria_Grouper_4152_12:NoCat 377 412 ABC_transp_aux 276 287 5.2 1 0.000000 -blumeria_Grouper_4152_12:NoCat 428 478 DUF1602 23 39 0.39 5 0.000000 -blumeria_Grouper_4152_12:NoCat 306 368 zf-P11 1 20 1.8 3 0.000000 -blumeria_Grouper_4152_12:NoCat 378 407 V-ATPase_G 1 10 5.3 2 0.000000 -blumeria_Grouper_4152_12:NoCat 136 228 XhoI 202 172 0.014 9 0.000000 -blumeria_Grouper_4152_12:NoCat 145 165 Endomucin 267 261 6 0 0.000000 -blumeria_Grouper_4152_12:NoCat 444 497 DUF1798 52 35 3.3 3 0.000000 -blumeria_Grouper_4152_12:NoCat 294 365 DUF881 237 214 1.6 4 0.000000 -blumeria_Grouper_4152_12:NoCat 222 272 Jun 284 264 6.5 0 0.000000 -blumeria_Grouper_4152_12:NoCat 177 236 SLT 20 1 1.2 4 0.000000 -blumeria_Grouper_4152_12:NoCat 156 224 DUF2346 85 63 2.8 3 0.000000 -blumeria_Grouper_4152_12:NoCat 84 131 LBP_BPI_CETP 209 191 3.8 1 0.000000 -blumeria_Grouper_4152_12:NoCat 314 352 DUF258 305 293 3.8 1 0.000000 -blumeria_Grouper_4152_12:NoCat 230 247 SOCS_box 6 1 9.7 2 0.000000 -blumeria_Grouper_4152_12:NoCat 155 217 DUF1289 56 36 5.3 2 0.000000 -blumeria_Grouper_4152_12:NoCat 152 184 TRAP_alpha 327 317 4.1 0 0.000000 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/PostPostProcessTestFiltered.align --- a/commons/pyRepetUnit/align/transformAACoordIntoNtCoord/tests/datas/PostPostProcessTestFiltered.align Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,25 +0,0 @@ -blumeria_Grouper_590_20:NoCat 271 324 DUF234 5 22 1.5 3 0.000000 -blumeria_Grouper_590_20:NoCat 331 357 DUF1414 1 9 6.3 2 0.000000 -blumeria_Grouper_590_20:NoCat 90 113 CPW_WPC 1 9 7.7 1 0.000000 -blumeria_Grouper_590_20:NoCat 119 148 DUF46 182 173 0.11 6 0.000000 -blumeria_Grouper_4152_12:NoCat 97 201 TrbL 231 285 8 0 0.000000 -blumeria_Grouper_4152_12:NoCat 172 240 TNV_CP 167 189 7.9 0 0.000000 -blumeria_Grouper_4152_12:NoCat 280 327 DGOK 283 298 1.3 0 0.000000 -blumeria_Grouper_4152_12:NoCat 337 381 Peptidase_S29 1 15 1.1 4 0.000000 -blumeria_Grouper_4152_12:NoCat 442 471 DUF1301 1 10 9.9 0 0.000000 -blumeria_Grouper_4152_12:NoCat 62 79 Toxin_18 50 55 4.4 4 0.000000 -blumeria_Grouper_4152_12:NoCat 377 412 ABC_transp_aux 276 287 5.2 1 0.000000 -blumeria_Grouper_4152_12:NoCat 428 478 DUF1602 23 39 0.39 5 0.000000 -blumeria_Grouper_4152_12:NoCat 306 368 zf-P11 1 20 1.8 3 0.000000 -blumeria_Grouper_4152_12:NoCat 378 407 V-ATPase_G 1 10 5.3 2 0.000000 -blumeria_Grouper_4152_12:NoCat 136 228 XhoI 202 172 0.014 9 0.000000 -blumeria_Grouper_4152_12:NoCat 145 165 Endomucin 267 261 6 0 0.000000 -blumeria_Grouper_4152_12:NoCat 444 497 DUF1798 52 35 3.3 3 0.000000 -blumeria_Grouper_4152_12:NoCat 294 365 DUF881 237 214 1.6 4 0.000000 -blumeria_Grouper_4152_12:NoCat 177 236 SLT 20 1 1.2 4 0.000000 -blumeria_Grouper_4152_12:NoCat 156 224 DUF2346 85 63 2.8 3 0.000000 -blumeria_Grouper_4152_12:NoCat 84 131 LBP_BPI_CETP 209 191 3.8 1 0.000000 -blumeria_Grouper_4152_12:NoCat 314 352 DUF258 305 293 3.8 1 0.000000 -blumeria_Grouper_4152_12:NoCat 230 247 SOCS_box 6 1 9.7 2 0.000000 -blumeria_Grouper_4152_12:NoCat 155 217 DUF1289 56 36 5.3 2 0.000000 -blumeria_Grouper_4152_12:NoCat 152 184 TRAP_alpha 327 317 4.1 0 0.000000 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/blastnForClassifierStep1/RepbaseBLRnForClassifierStep1.py --- a/commons/pyRepetUnit/blastnForClassifierStep1/RepbaseBLRnForClassifierStep1.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,186 +0,0 @@\n-"""\n-Launch Blaster and then Matcher to compare the input sequences with known TEs via blastn and record the results into a MySQL table.\n-"""\n-\n-import os\n-import ConfigParser\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.LoggerFactory import LoggerFactory\n-\n-LOG_DEPTH = "repet.tools"\n-\n-class RepbaseBLRnForClassifierStep1( object ):\n- \n- """\n- Launch Blaster and then Matcher to compare the input sequences with known TEs via blastn and record the results into a MySQL table.\n- \n- @param inFileName: name of the input fasta file\n- @type inFileName: string\n- \n- @param launch_1: generic command at the beginning of a specific command\n- @type launch_1: string\n- \n- @param launch_2: generic command at the end of a specific command\n- @type launch_2: string\n-\n- @return: all the commands to run the job\n- @rtype: string\n- \n- @param cDir: current directory (where to retrieve the result files)\n- @ype cDir: string\n-\n- @param tmpDir: temporary directory (where the job will run)\n- @type tmpDir: string\n- \n- @param configFileName: configuration file name\n- @type configFileName: string\n- \n- @param logger: a logger Instance\n- @type logger: logger\n- \n- @param verbose: verbose(0/1/2)\n- @type verbose: int\n- \n- @param pL: program launcher\n- @type pL: programLauncher Instance\n- \n- @param project: project name\n- @type project: string\n- \n- """\n-\n- def __init__(self, inFileName, launch_1, launch_2, cDir, tmpDir, configFileName, verbose, pL, project):\n- """\n- Constructor\n- """\n- self._inFileName = inFileName\n- self._launch_1 = launch_1\n- self._launch_2 = launch_2\n- self._cDir = cDir\n- self._tmpDir = tmpDir\n- self._verbose = verbose\n- self._pL = pL\n- self._project = project\n- self._fileUtils = FileUtils()\n- self._config = ConfigParser.ConfigParser()\n- self._configFileName = configFileName\n- self._config.readfp( open(self._configFileName) )\n- self._bank = self._config.get("detect_features","TE_nucl_bank")\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbose)\n-\n- def formatRepbase_ntIfNecessary( self ):\n- """\n- Format Repbase (make \'cut\' files).\n- """\n- if not os.path.exists( "%s_cut" % ( self._bank ) ):\n- self._log.debug("prepare bank \'%s\'..." % ( self._bank ))\n- prg = os.environ["REPET_PATH"] + "/bin/blaster"\n- cmd = prg\n- cmd += " -s %s" % ( self._bank )\n- cmd += " -n blastn"\n- if self._config.get("detect_features","wublast") == "yes":\n- cmd += " -W"\n- cmd += " -r"\n- cmd += " -P"\n- self._pL.launch( prg, cmd )\n- os.system( "rm -f %s-blastn-*.param" % ( self._bank ) )\n- \n- def createCmdToLaunch( self ):\n- cmd = self._launch_1 + os.environ["REPET_PATH"] + "/bin/blaster"\n- cmd += " -q %s" % ( self._inFileName )\n- cmd += " -s %s/%s" % ( self._cDir, self._bank )\n- cmd += " -B %s_BLRn_%s" % ( self._inFileName, self._bank )\n- cmd += " -n blastn"\n- if self._config.get("detect_features","wublast") == "yes":\n- cmd += " -W"\n- cmd += " -r"\n- cmd += " -v 1"\n- cmd += self._launch_2\n- \n- cmd += "if not os.path.exists( \\"%s/%s_BLRn_%s.param\\" ):\\n" % ( self._cDir, self._inFileName, self._bank )\n- cmd += "\\tos.system( \\"mv %s_BLRn_%s.param %s\\" )\\n" % ( self._inFileName, self._bank, self._cDir )\n- cmd += "if os.path.exists( \\"%s_cut\\" ):\\n" % ( self._inFileName )\n- cmd += "\\tos.system( \\"rm -f %s_cut*\\" )\\n" % ( self._inFileName )\n- cmd += "if os.path.exists( \\"%s.Nstretch.map\\" ):\\n" % ( self._inFileName )\n- cmd += "\\tos.remove( \\"%s.Nstretch.map\\" )\\n" % ( self._inFileName )'..b'%s.align" % ( self._inFileName, self._bank )\n- cmd += " -q %s" % ( self._inFileName )\n- cmd += " -s %s/%s" % ( self._cDir, self._bank )\n- cmd += " -j"\n- cmd += " -v 1"\n- cmd += self._launch_2\n- \n- cmd += "if not os.path.exists( \\"%s/%s_BLRn_%s.align.clean_match.path\\" ):\\n" % ( self._cDir, self._inFileName, self._bank )\n- cmd += "\\tos.system( \\"mv %s_BLRn_%s.align.clean_match.path %s\\" )\\n" % ( self._inFileName, self._bank, self._cDir )\n- cmd += "if not os.path.exists( \\"%s/%s_BLRn_%s.align.clean_match.param\\" ):\\n" % ( self._cDir, self._inFileName, self._bank )\n- cmd += "\\tos.system( \\"mv %s_BLRn_%s.align.clean_match.param %s\\" )\\n" % ( self._inFileName, self._bank, self._cDir )\n- cmd += "if os.path.exists( \\"%s_BLRn_%s.align\\" ):\\n" % ( self._inFileName, self._bank )\n- cmd += "\\tos.remove( \\"%s_BLRn_%s.align\\" )\\n" % ( self._inFileName, self._bank )\n- cmd += "if os.path.exists( \\"%s_BLRn_%s.align.clean_match.fa\\" ):\\n" % ( self._inFileName, self._bank )\n- cmd += "\\tos.remove( \\"%s_BLRn_%s.align.clean_match.fa\\" )\\n" % ( self._inFileName, self._bank )\n- cmd += "if os.path.exists( \\"%s_BLRn_%s.align.clean_match.map\\" ):\\n" % ( self._inFileName, self._bank )\n- cmd += "\\tos.remove( \\"%s_BLRn_%s.align.clean_match.map\\" )\\n" % ( self._inFileName, self._bank )\n- cmd += "if os.path.exists( \\"%s_BLRn_%s.align.clean_match.tab\\" ):\\n" % ( self._inFileName, self._bank )\n- cmd += "\\tos.remove( \\"%s_BLRn_%s.align.clean_match.tab\\" )\\n" % ( self._inFileName, self._bank )\n- \n- if self._tmpDir != self._cDir:\n- cmd += "if os.path.exists( \\"%s\\" ):\\n" % ( self._bank )\n- cmd += "\\tos.remove( \\"%s\\" )\\n" % ( self._bank )\n- \n- return cmd\n- \n- def collectRepbaseBLRn( self ):\n- """\n- Concatenate the outputs of blastn, adapt the ID and load the results into a table.\n- """\n- bankFull = self._bank\n- bankPath, bank = os.path.split( bankFull )\n- self._concatPathFile(bank)\n- self._adaptIDInPathFile(bank)\n- self._loadPathFileInTable(bank) \n- self._findAndRemoveUselessFiles(bank)\n- \n- def _concatPathFile(self, bank):\n- FileUtils.catFilesByPattern("../batch_*.fa_BLRn_%s.align.clean_match.path" % bank,\n- "%s_BLRn_%s.align.clean_match.path.tmp" % (self._project, bank))\n-\n- def _adaptIDInPathFile(self, bank):\n- if os.path.exists(os.environ["REPET_PATH"] + "/bin/pathnum2id"):\n- prg = os.environ["REPET_PATH"] + "/bin/pathnum2id"\n- cmd = prg\n- cmd += " -i %s_BLRn_%s.align.clean_match.path.tmp" % (self._project, bank)\n- cmd += " -o %s_BLRn_%s.align.clean_match.path" % (self._project, bank)\n- cmd += " -v %i" % (self._verbose - 1)\n- self._pL.launch(prg, cmd)\n- else:\n- prg = os.environ["REPET_PATH"] + "/bin/pathnum2id.py"\n- cmd = prg\n- cmd += " -i %s_BLRn_%s.align.clean_match.path.tmp" % (self._project, bank)\n- cmd += " -o %s_BLRn_%s.align.clean_match.path" % (self._project, bank)\n- self._pL.launch(prg, cmd)\n-\n- def _loadPathFileInTable(self, bank):\n- prg = os.environ["REPET_PATH"] + "/bin/srptCreateTable.py"\n- cmd = prg\n- cmd += " -f %s_BLRn_%s.align.clean_match.path" % (self._project, bank)\n- cmd += " -n %s_TE_BLRn_path" % (self._project)\n- cmd += " -t path"\n- cmd += " -c ../%s" % (self._configFileName)\n- self._pL.launch(prg, cmd)\n-\n- def _findAndRemoveUselessFiles(self, bank):\n- prg = "find"\n- cmd = prg\n- cmd += " .. -name \\"batch_*.fa_BLRn_%s.*\\" -exec rm {} \\;" % (bank)\n- self._pL.launch(prg, cmd)\n- prg = "rm"\n- cmd = prg\n- cmd += " %s_BLRn_%s.align.clean_match.path.tmp" % (self._project, bank)\n- self._pL.launch(prg, cmd)\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/blastnForClassifierStep1/tests/Test_RepbaseBLRnForClassifierStep1.py --- a/commons/pyRepetUnit/blastnForClassifierStep1/tests/Test_RepbaseBLRnForClassifierStep1.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,343 +0,0 @@\n-import unittest\n-import os\n-import shutil\n-import ConfigParser\n-import sys\n-from commons.pyRepetUnit.blastnForClassifierStep1.RepbaseBLRnForClassifierStep1 import RepbaseBLRnForClassifierStep1\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.core.sql.TablePathAdaptator import TablePathAdaptator\n-from commons.core.coord.Path import Path\n-import pyRepet.launcher.programLauncher\n-\n-if not os.environ.has_key( "REPET_PATH" ):\n- print "*** Error: no environment variable REPET_PATH"\n- sys.exit(1)\n-sys.path.append( os.environ["REPET_PATH"] )\n-\n-NB_EXPECTED_LINES_IN_PATH_FILE = 10\n-CURRENT_DIR = os.getcwd()\n-\n-\n-class Test_RepbaseBLRnForClassifierStep1( unittest.TestCase ):\n- \n- \n- def setUp( self ):\n- os.chdir(CURRENT_DIR)\n- self._inFileName = "dummyFileName"\n- self._launch_1 = "log = os.system( \\""\n- self._launch_2 = "\\" )\\n"\n- self._launch_2 += "if log != 0:\\n"\n- self._launch_2 += "\\tsys.exit(1)\\n"\n- self._cDir = "/home/user/dummy_cdir"\n- self._tmpDir = "/home/user/dummy_tmpDir"\n- self._configFileName = "configFile"\n- self._repbaseName = "dummyRepbase_nt.fa"\n- f = open(self._configFileName, "w")\n- f.write("[repet_env]\\n")\n- f.write("repet_host: %s\\n" % os.environ["REPET_HOST"])\n- f.write("repet_user: %s\\n" % os.environ["REPET_USER"])\n- f.write("repet_pw: %s\\n" % os.environ["REPET_PW"])\n- f.write("repet_db: %s\\n" % os.environ["REPET_DB"])\n- f.write("repet_port: %s\\n" % os.environ["REPET_PORT"])\n- f.write("[detect_features]\\n")\n- f.write("TE_BLRn: yes\\n")\n- f.write("TE_nucl_bank: %s\\n" % self._repbaseName)\n- f.write("wublast: yes\\n")\n- f.close()\n- self._verbose = 0\n- self._config = ConfigParser.ConfigParser()\n- self._config.readfp( open(self._configFileName) )\n- self._pL = pyRepet.launcher.programLauncher.programLauncher()\n- self._project = "dummyProject"\n- self._repbaseBLRn = RepbaseBLRnForClassifierStep1(self._inFileName, self._launch_1, self._launch_2, self._cDir, self._tmpDir, self._configFileName, self._verbose, self._pL, self._project)\n- self._expFileName = "expFile"\n- self._bank = self._config.get("detect_features","TE_nucl_bank")\n- self._db = DbFactory.createInstance()\n- \n- \n- def tearDown( self ):\n- self._db.dropTable("%s_TE_BLRn_path" % (self._project))\n- os.chdir(CURRENT_DIR)\n- self._repbaseBLRn = None\n- os.remove(self._configFileName)\n- if os.path.isfile("%s_BLRn_%s.align.clean_match.path" % (self._project, self._bank)):\n- os.remove("%s_BLRn_%s.align.clean_match.path" % (self._project, self._bank))\n- if os.path.isfile("%s_BLRn_%s.align.clean_match.path.tmp" % (self._project, self._bank)):\n- os.remove("%s_BLRn_%s.align.clean_match.path.tmp" % (self._project, self._bank))\n- if os.path.isfile("batch_1.fa_BLRn_%s.*" % (self._bank)):\n- os.remove("batch_1.fa_BLRn_%s.*" % (self._bank))\n- if os.path.isfile("batch_2.fa_BLRn_%s.*" % (self._bank)):\n- os.remove("batch_2.fa_BLRn_%s.*" % (self._bank))\n- if os.path.isfile("batch_1.fa_BLRn_%s.align.clean_match.path" % (self._bank)):\n- os.remove("batch_1.fa_BLRn_%s.align.clean_match.path" % (self._bank))\n- if os.path.isfile("batch_2.fa_BLRn_%s.align.clean_match.path" % (self._bank)):\n- os.remove("batch_2.fa_BLRn_%s.align.clean_match.path" % (self._bank))\n- if os.path.isfile(self._repbaseName):\n- os.remove(self._repbaseName)\n- os.remove(self._repbaseName + "_cut")\n- os.remove(self._repbaseName + "_cut.xnd")\n- os.remove(self._repbaseName + "_cut.xns")\n- os.remove(self._repbaseName + "_cut.xnt")\n- os.remove(self._repbaseName + ".Nstretch.map")\n- o'..b'FromFilePathList = self._readPathResultsFromFileAndFillList()\n- resultFromTablePathList = self._readPathResultsFromTableAndFillList() \n- self.assertEquals(resultFromFilePathList, resultFromTablePathList)\n- \n- \n- def test_findAndRemoveUselessFiles( self ):\n- self._createFile("%s_BLRn_%s.align.clean_match.path.tmp" % (self._project, self._bank))\n- self._createFile("batch_1.fa_BLRn_%s.*" % (self._bank))\n- self._createFile("batch_2.fa_BLRn_%s.*" % (self._bank))\n- self._repbaseBLRn._findAndRemoveUselessFiles(self._bank)\n- self.assertFalse(FileUtils.isRessourceExists("%s_BLRn_%s.align.clean_match.path.tmp" % (self._project, self._bank)))\n- self.assertFalse(FileUtils.isRessourceExists("batch_1.fa_BLRn_%s.*" % (self._bank)))\n- self.assertFalse(FileUtils.isRessourceExists("batch_2.fa_BLRn_%s.*" % (self._bank)))\n- \n- \n- def test_collectRepbaseBLRn( self ):\n- os.chdir(CURRENT_DIR)\n- if not FileUtils.isRessourceExists("TE_BLRn"):\n- os.mkdir( "TE_BLRn" )\n- self._createPathFiles(self._bank)\n- os.chdir( "TE_BLRn" )\n- self._repbaseBLRn.collectRepbaseBLRn() \n- self.assertTrue(FileUtils.isRessourceExists("%s_BLRn_%s.align.clean_match.path" % ( self._project, self._bank )))\n- self.assertEquals(NB_EXPECTED_LINES_IN_PATH_FILE, FileUtils.getNbLinesInSingleFile("%s_BLRn_%s.align.clean_match.path" % ( self._project, self._bank )))\n- self.assertTrue(self._db.doesTableExist("%s_TE_BLRn_path" % (self._project)))\n- self._db.execute(\'select * from %s_TE_BLRn_path\' % (self._project))\n- self.assertEquals(NB_EXPECTED_LINES_IN_PATH_FILE, len(self._db.fetchall()))\n- self._db.dropTable("%s_TE_BLRn_path" % (self._project))\n- \n- \n- def _createPathFiles( self, bankFull ):\n- bank = os.path.split(bankFull)[1]\n- fileName = "batch_1.fa_BLRn_" + bank + ".align.clean_match.path"\n- f = open(fileName, "w")\n- f.write("1\\tQueryName1\\t2\\t250\\tsubjectName1\\t5\\t255\\t4.1e-39\\t132\\t88.2\\n")\n- f.write("2\\tQueryName1\\t255\\t550\\tsubjectName2\\t5\\t255\\t0.0002\\t32\\t78.2\\n")\n- f.write("3\\tQueryName2\\t1\\t150\\tsubjectName1\\t250\\t400\\t5.1e-59\\t132\\t98\\n")\n- f.write("4\\tQueryName3\\t2\\t250\\tsubjectName3\\t5\\t255\\t4.1e-39\\t132\\t88.2\\n")\n- f.write("5\\tQueryName1\\t300\\t450\\tsubjectName1\\t300\\t450\\t4.1e-39\\t132\\t80.2\\n")\n- f.close()\n- fileName = "batch_2.fa_BLRn_" + bank + ".align.clean_match.path"\n- f = open(fileName, "w")\n- f.write("1\\tQueryName4\\t2\\t250\\tsubjectName1\\t5\\t255\\t4.1e-39\\t132\\t88.2\\n")\n- f.write("2\\tQueryName4\\t255\\t550\\tsubjectName2\\t5\\t255\\t0.0002\\t32\\t78.2\\n")\n- f.write("3\\tQueryName5\\t1\\t150\\tsubjectName1\\t250\\t400\\t5.1e-59\\t132\\t98\\n")\n- f.write("4\\tQueryName6\\t2\\t250\\tsubjectName3\\t5\\t255\\t4.1e-39\\t132\\t88.2\\n")\n- f.write("5\\tQueryName7\\t300\\t450\\tsubjectName1\\t300\\t450\\t4.1e-39\\t132\\t80.2\\n")\n- f.close()\n- \n- \n- def _readPathResultsFromTableAndFillList( self ):\n- tablePathAdaptatorInstance = TablePathAdaptator (self._db, "%s_TE_BLRn_path" % (self._project))\n- pathList = tablePathAdaptatorInstance.getListOfAllPaths()\n- return pathList\n- \n- \n- def _readPathResultsFromFileAndFillList( self ):\n- pathInstance = Path()\n- pathList = []\n- f = open( "%s_BLRn_%s.align.clean_match.path" % (self._project, self._bank) , "r")\n- while pathInstance.read( f ):\n- pathList.append(pathInstance)\n- pathInstance = Path()\n- f.close()\n- return pathList\n- \n- \n- def _createFile( self, nameFile ):\n- f = open(nameFile, "w")\n- f.close()\n- \n- \n-test_suite = unittest.TestSuite()\n-test_suite.addTest( unittest.makeSuite( Test_RepbaseBLRnForClassifierStep1 ) )\n-if __name__ == "__main__":\n- unittest.TextTestRunner(verbosity=2).run( test_suite )\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/AbstractClusterLauncher.py --- a/commons/pyRepetUnit/components/AbstractClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,606 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-import getopt\n-import time\n-import glob\n-import sys\n-import os\n-\n-from commons.core.checker.CheckerException import CheckerException\n-from commons.core.sql.RepetJob import RepetJob\n-from commons.core.sql.Job import Job\n-from commons.core.stat.Stat import Stat\n-from pyRepet.launcher.AbstractProgramLauncher import AbstractProgramLauncher\n-\n-GENERIC_IN_FILE = "zDUMMYz"\n-\n-\n-## Abstract class to launch a program in parallel on a cluster.\n-#\n-class AbstractClusterLauncher( object ): #( IClusterLauncher )\n- \n- def __init__( self ):\n- """\n- Constructor.\n- """\n- self._inputDir = "" # path to the directory with input files\n- self._queueName = "" # name of the queue on the cluster\n- self._groupId = "" # identifier of the group of jobs (groupid)\n- self._inputFileSuffix = "fa" # suffix of the input files (default=\'fa\')\n- self._prgAcronym = "" # acronym of the program to launch\n- self._configFile = "" # name of the configuration file (connect to MySQL)\n- self._currentDir = os.getcwd() # path to the current directory\n- self._tmpDir = "" # path to the temporary directory\n- self._jobTable = "jobs" # name of the table recording the jobs\n- self._catOutFiles = False # concatenate output files of all jobs\n- self._clean = False # clean job file, job stdout, job table...\n- self._verbose = 1 # verbosity level\n- self.jobdb = None # RepetJob instance\n- self.job = Job() # Job instance\n- \n- self._nbJobs = 0\n- self._cmdLineGenericOptions = "hi:Q:g:S:a:C:d:j:Zcv:"\n- self._cmdLineSpecificOptions = ""\n- \n- self._exeWrapper = "AbstractProgramLauncher.py"\n- self._prgLauncher = None\n- # list of instances derived from AbstractProgramLauncher()\n- # If several program are launched successively in the same job,\n- # \'lPrgLaunchers\' has to be filled before run().\n- self.lPrgLaunchers = []\n- \n- def setProgramLauncherAttributeFromCmdLine(self, o, a=""):\n- self.getProgramLauncherInstance().setASpecificAttributeFromCmdLine(o, a)\n- \n- def setClusterLauncherAttributeFromCmdLine(self, o, a=""):\n- i'..b'lf.getTemporaryDirectory() == "":\n- self.setTemporaryDirectory(self._currentDir)\n- \n- def checkGenericAttributes( self ):\n- self.checkClusterLauncherAttributes()\n- \n- def checkProgramLauncherAttributes( self ):\n- self.getProgramLauncherInstance().checkSpecificAttributes()\n- \n- def checkSpecificAttributes( self ):\n- self.checkProgramLauncherAttributes()\n- \n- def start( self ):\n- \n- if self.lPrgLaunchers == []:\n- self.setSingleProgramLauncher()\n- for pL in self.lPrgLaunchers:\n- if pL.getWrapperCommandLine() == "":\n- string = "ERROR: wrapper command is empty !"\n- print string\n- sys.exit(1)\n- if pL.getProgramCommandLine() == "":\n- string = "ERROR: program command is empty !"\n- print string\n- sys.exit(1)\n- self.checkProgramAvailability()\n- \n- try:\n- self.checkProgramLauncherAttributes()\n- except CheckerException, msg:\n- print msg\n- print self.getHelpAsString()\n- sys.exit(1)\n- \n- if self.getVerbosityLevel() > 0:\n- string = "START %s" % ( type(self).__name__ )\n- print string\n- self.job.tablename = self.getJobTableName()\n- self.job.groupid = self.getGroupIdentifier()\n- tokens = self.getQueueName().replace("\'","").split(" ")\n- self.job.setQueue( tokens[0] )\n- if len(tokens) > 1:\n- lResources = tokens[1:]\n- self.job.lResources = lResources\n- if self.getVerbosityLevel() > 0:\n- print "groupid: %s" % ( self.getGroupIdentifier() )\n- self.jobdb = RepetJob( cfgFileName=self.getConfigFile() )\n- if self.jobdb.hasUnfinishedJob( self.job.tablename, \\\n- self.job.groupid ):\n- self.jobdb.waitJobGroup( self.job.tablename, self.job.groupid )\n- return\n- self.jobdb.cleanJobGroup( self.job.tablename, self.job.groupid )\n- sys.stdout.flush()\n- \n- def end( self ):\n- if self.getClean():\n- self.removeAllJobFiles()\n- self.removeAllJobStdouts()\n- self.removeAllJobStderrs()\n- \n- if self.getCatOutputFiles():\n- self.catOutputFiles()\n- \n- self.jobdb.close()\n- \n- if self.getVerbosityLevel() > 0:\n- string = "END %s" % ( type(self).__name__ )\n- print string\n- sys.stdout.flush()\n- \n- def run( self ):\n- try:\n- self.checkClusterLauncherAttributes()\n- except CheckerException, msg:\n- print msg\n- print self.getHelpAsString()\n- sys.exit(1)\n- \n- self.start()\n- \n- lInFiles = self.getInputFilesList()\n- self._nbJobs = len(lInFiles)\n- \n- if self._verbose > 0:\n- string = "submitting " + str(self._nbJobs) + " jobs... " + self.formatGroupidAndTime() \n- print string; sys.stdout.flush()\n- \n- self.submitJob(lInFiles)\n- \n- if self._verbose > 0: \n- string = "waiting for jobs... " + self.formatGroupidAndTime() \n- print string; sys.stdout.flush()\n- \n- self.jobdb.waitJobGroup( self.job.tablename, self.job.groupid )\n- \n- if self._verbose > 0:\n- string = "all jobs completed ! " + self.formatGroupidAndTime() \n- print string; sys.stdout.flush()\n- statsExecutionTime = self.getStatsOfExecutionTime()\n- print "execution time of all jobs (seconds): %f" % statsExecutionTime.getSum()\n- print "execution time per job: %s" % statsExecutionTime.string()\n- sys.stdout.flush()\n- \n- self.jobdb.cleanJobGroup( self.job.tablename, self.job.groupid )\n- \n- self.end()\n- \n- \n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/AbstractProgramLauncher.py --- a/commons/pyRepetUnit/components/AbstractProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,73 +0,0 @@ -#!/usr/bin/env python -##@file -# Abstract class to launch a program. - -import getopt -import sys -import os -import pyRepet.launcher.AbstractProgramLauncher - -class AbstractProgramLauncher( pyRepet.launcher.AbstractProgramLauncher.AbstractProgramLauncher ): #( IProgramLauncher ) - - def getHelpAsString( self ): - """ - Return the generic help as a string. - """ - string = "" - string += "usage: %s.py [options]" % ( type(self).__name__ ) - string += "\ngeneric options:" - string += "\n -h: this help" - string += "\n -i: name of the input file (format='%s')" % ( self.getFormatInputFile() ) - string += "\n -c: clean" - string += "\n -v: verbosity level (default=0/1)" - return string - - def setAttributesFromCmdLine( self, o, a="" ): - """ - Set a generic attribute from the command-line arguments. - """ - if o == "-h": - print self.getHelpAsString() - sys.exit(0) - elif o == "-i": - self.setInputFile( a ) - elif o == "-c": - self.setClean() - elif o == "-v": - self.setVerbosityLevel( a ) - - def checkAttributesFromCmdLine( self ): - """ - Set the attributes from the command-line arguments. - """ - try: - opts, args = getopt.getopt( sys.argv[1:], "%s" % (self.getCmdLineOptions()) ) - except getopt.GetoptError, err: - print str(err); - print self.getHelpAsString() - sys.exit(1) - for o, a in opts: - self.setAttributesFromCmdLine( o, a ) - - def getCmdLineOptions(self): - return self._cmdLineGenericOptions - - def check( self ): - """ - Check the generic attributes before running the program. - """ - self._checkProgramName() - self.checkInput() - - def checkInput(self): - if self.getInputFile() == "": - string = "ERROR: missing input file" - print string - print self.getHelpAsString() - sys.exit(1) - - if not os.path.exists(self.getInputFile()): - string = "ERROR: input file '%s' doesn't exist" % (self.getInputFile()) - print string - print self.getHelpAsString() - sys.exit(1) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/IClusterLauncher.py --- a/commons/pyRepetUnit/components/IClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,290 +0,0 @@ - -## Interface for AbstractClusterLauncher -# -class IClusterLauncher(object): - - ## Constructor. - # - def __init__( self ): - pass - - ## Useful commands before running the program (check, open database connector...). - # - def start(self): - pass - - ## Useful commands after the program was run (clean, close database connector...). - # - def end(self): - pass - - ## Launch jobs in parallel on each file in the query directory. - # - def run(self): - pass - - ## Initialize the job (jobname, command, launcher). - # - def initializeJob(self, fileName, count): - pass - - ## Return all the job commands as a string. - # - def getJobCommandsAsString(self, fileName, jobName, minFreeGigaInTmpDir=1): - pass - - ## Return the generic help as a string. - # - def getGenericHelpAsString(self): - pass - - ## Check the generic attributes before running the program. - # - def checkGenericAttributes(self): - pass - - ## Check the specific attributes of each program launcher. - # - def checkSpecificAttributes(self): - pass - - ## Check that all required programs are in the user's PATH. - # - def checkProgramAvailability(self): - pass - - ## Return the command-line to launch in each job. Specified in each wrapper. - # - def getProgramCommandLineAsString(self): - pass - - ## Return the list of files to keep at the end of each job. Specified in each wrapper. - # - def getListFilesToKeep(self): - pass - - ## Return the list of files to remove at the end of each job. Specified in each wrapper. - # - def getListFilesToRemove(self): - pass - - ## Return the name of the job file as a string. - # - def getJobFileNameAsString(self, count): - pass - - ## Return the command to update the job status in the table. - # - def getCmdUpdateJobStatusAsString(self, newStatus): - pass - - ## Return the launching command as a string. Launch the wrapper, retrieve its exit status, update status if error. - # - def getCmdToLaunchWrapper(self, fileName, genericCmd, exeWrapper): - pass - - ## Return the commands to keep the output files. - # - def getCmdToKeepFiles( self, fileName, lFilesToKeep ): - pass - - ## Return the commands to remove the temporary files. - # - def getCmdToRemoveFiles( self, fileName, lFilesToRemove ): - pass - - ## Remove all job files. - # - def removeAllJobFiles( self ): - pass - - ## Remove all job stdout. - # - def removeAllJobStdouts( self ): - pass - - ## Remove all job stderr. - # - def removeAllJobStderrs( self ): - pass - - ## Process the output file if necessary. - # - def processOutputFile( self, tmpFile, outFile ): - pass - - ## Concatenate output files from all jobs. - # - def catOutputFiles( self ): - pass - - ## Return the specific help as a string. - # - def getSpecificHelpAsString( self ): - pass - - ## Return the help as a string. - # - def getHelpAsString( self ): - pass - - ##Set a generic attribute from the command-line arguments. - # - def setAGenericAttributeFromCmdLine( self, o, a="" ): - pass - - ## Set the specific attributes from the command-line arguments. - # - def setASpecificAttributeFromCmdLine( self, o, a="" ): - pass - - ## Set the attributes from the command-line arguments. - # - def setAttributesFromCmdLine( self ): - pass - - ## - # - def setInputDirectory( self, arg ): - pass - - ## - # - def setQueueName( self, arg ): - pass - - ## - # - def setGroupIdentifier( self, arg ): - pass - - ## - # - def setInputFileSuffix( self, arg ): - pass - - ## - # - def setAcronym( self, arg ): - pass - - ## - # - def setConfigFile( self, arg ): - pass - - ## - # - def setCurrentDirectory( self ): - pass - - ## - # - def setTemporaryDirectory( self, arg ): - pass - - ## - # - def setJobTableName( self, arg ): - pass - - ## - # - def setCatOutputFiles( self ): - pass - - ## - # - def setClean( self ): - pass - - ## - # - def setVerbosityLevel( self, arg ): - pass - - ## - # - def setExecutableWrapper( self, arg ): - pass - - ## Set the wrapper and program command-lines of the program launcher. Append the program launcher to 'self.lPrgLaunchers'. - # - def setSingleProgramLauncher( self ): - pass - - ## - # - def getInputDirectory( self ): - pass - - ## - # - def getQueueName( self ): - pass - - ## - # - def getGroupIdentifier( self ): - pass - - ## - # - def getInputFileSuffix( self ): - pass - - ## - # - def getAcronym( self ): - pass - - ## - # - def getConfigFile( self ): - pass - - ## - # - def getCurrentDirectory( self ): - pass - - ## - # - def getTemporaryDirectory( self ): - pass - - ## - # - def getJobTableName( self ): - pass - - ## - # - def getCatOutputFiles( self ): - pass - - ## - # - def getClean( self ): - pass - - ## - # - def getVerbosityLevel( self ): - pass - - ## - # - def getWrapperName( self ): - pass - - ## - # - def getProgramName( self ): - pass - - ## - # - def getPatternToConcatenate( self ): - pass - \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/blastx2GFF/tests/blastx2GFFTestSuite.py --- a/commons/pyRepetUnit/components/blastx2GFF/tests/blastx2GFFTestSuite.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,26 +0,0 @@ -import unittest -import sys -import Test_BlasterClusterLauncher -import Test_BlasterProgramLauncher -import Test_F_BlasterClusterLauncher -import Test_F_BlasterComponent -import Test_F_BlasterMatcher2GFF3 -import Test_F_BlasterMatcherComponent -import Test_F_BlasterProgramLauncher - -def main(): - - commonsTestSuite = unittest.TestSuite() - commonsTestSuite.addTest( unittest.makeSuite( Test_BlasterClusterLauncher.Test_BlasterClusterLauncher, "test" ) ) - commonsTestSuite.addTest( unittest.makeSuite( Test_BlasterProgramLauncher.Test_BlasterProgramLauncher, "test" ) ) - commonsTestSuite.addTest( unittest.makeSuite( Test_F_BlasterClusterLauncher.Test_F_BlasterClusterLauncher, "test" ) ) - commonsTestSuite.addTest( unittest.makeSuite( Test_F_BlasterComponent.Test_F_BlasterComponent, "test" ) ) - commonsTestSuite.addTest( unittest.makeSuite( Test_F_BlasterMatcher2GFF3.Test_F_BlasterMatcher2GFF3, "test" ) ) - commonsTestSuite.addTest( unittest.makeSuite( Test_F_BlasterMatcherComponent.Test_F_BlasterMatcherComponent, "test" ) ) - commonsTestSuite.addTest( unittest.makeSuite( Test_F_BlasterProgramLauncher.Test_F_BlasterProgramLauncher, "test" ) ) - runner = unittest.TextTestRunner( sys.stderr, 2, 2 ) - runner.run( commonsTestSuite ) - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/blastx2GFF/tests/datas/dummy.align.match.path --- a/commons/pyRepetUnit/components/blastx2GFF/tests/datas/dummy.align.match.path Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,5 +0,0 @@ -1 lm_SuperContig_30_v2 35498 35914 mito_010 NADH dehydrogenase (ubiquinone) chain 5 307 445 1e-62 244 82.73 -1 lm_SuperContig_30_v2 37314 37823 mito_010 NADH dehydrogenase (ubiquinone) chain 5 494 663 8e-67 258 67.65 -161 lm_SuperContig_29_v2 193781 194212 1nc550_030 related to putative multidrug transporter Mfs1.1 (major facilitator family protein) 228 85 1e-40 84 30.56 -161 lm_SuperContig_29_v2 192832 193704 1nc550_030 related to putative multidrug transporter Mfs1.1 (major facilitator family protein) 522 229 1e-40 106 23.99 -174 lm_SuperContig_29_v2 78031 78588 xnc164_090 related to multidrug resistance protein 19 209 3e-21 101 30.89 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/blastx2GFF/tests/datas/dummy.align.match.tab --- a/commons/pyRepetUnit/components/blastx2GFF/tests/datas/dummy.align.match.tab Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,3 +0,0 @@ -lm_SuperContig_30_v2 35498 37823 927 0.00598594 1.29469 mito_010 307 663 309 0.431564 8e-67 424 74.4336 1 -lm_SuperContig_29_v2 192832 194212 1305 0.00649448 2.13934 1nc550_030 522 85 438 0.718033 1e-40 99 26.1649 161 -lm_SuperContig_29_v2 78031 78588 558 0.00277695 0.980668 xnc164_090 19 209 191 0.335677 3e-21 101 30.89 174 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/blastx2GFF/tests/datas/exp_dummy.gff --- a/commons/pyRepetUnit/components/blastx2GFF/tests/datas/exp_dummy.gff Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,9 +0,0 @@ -##gff-version 3 -lm_SuperContig_30_v2 blastx_ProtBank match 35498 37823 8e-67 + . ID=BlastBank_lm_SuperContig_30_v2_mito_010_m0001;Target=mito_010+307+663;Name=lm_SuperContig_30_v2_mito_010;target_pcover=43.15;target_pident=74.43;evalue=8e-67;target_description=NADH dehydrogenase (ubiquinone) chain 5;target_length=716;lib=BlastBank;program=blastx -lm_SuperContig_30_v2 blastx_ProtBank match_part 35498 35914 1e-62 + 0 ID=BlastBank_lm_SuperContig_30_v2_mito_010_m0001mp0001;Target=mito_010+307+445;Parent=BlastBank_lm_SuperContig_30_v2_mito_010_m0001 -lm_SuperContig_30_v2 blastx_ProtBank match_part 37314 37823 8e-67 + 2 ID=BlastBank_lm_SuperContig_30_v2_mito_010_m0001mp0002;Target=mito_010+494+663;Parent=BlastBank_lm_SuperContig_30_v2_mito_010_m0001 -lm_SuperContig_29_v2 blastx_ProtBank match 192832 194212 1e-40 - . ID=BlastBank_lm_SuperContig_30_v2_1nc550_030_m0002;Target=1nc550_030+85+522;Name=lm_SuperContig_30_v2_1nc550_030;target_pcover=71.80;target_pident=26.16;evalue=1e-40;target_description=related to putative multidrug transporter Mfs1.1 (major facilitator family protein);target_length=610;lib=BlastBank;program=blastx -lm_SuperContig_29_v2 blastx_ProtBank match_part 193781 194212 1e-40 - 0 ID=BlastBank_lm_SuperContig_30_v2_1nc550_030_m0002mp0002;Target=1nc550_030+85+228;Parent=BlastBank_lm_SuperContig_30_v2_1nc550_030_m0002 -lm_SuperContig_29_v2 blastx_ProtBank match_part 192832 193704 1e-40 - 2 ID=BlastBank_lm_SuperContig_30_v2_1nc550_030_m0002mp0001;Target=1nc550_030+229+522;Parent=BlastBank_lm_SuperContig_30_v2_1nc550_030_m0002 -lm_SuperContig_29_v2 blastx_ProtBank match 78031 78588 3e-21 + . ID=BlastBank_lm_SuperContig_30_v2_xnc164_090_m0003;Target=xnc164_090+19+209;Name=lm_SuperContig_30_v2_xnc164;target_pcover=33.56;target_pident=30.89;evalue=3e-21;target_description=related to multidrug resistance protein;target_length=569;lib=BlastBank;program=blastx -lm_SuperContig_29_v2 blastx_ProtBank match_part 78031 78588 3e-21 + 1 ID=BlastBank_lm_SuperContig_30_v2_xnc164_090_m0003mp0001;Target=xnc164_090+19+209;Parent=BlastBank_lm_SuperContig_30_v2_xnc164_090_m0003 \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align --- a/commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,456 +0,0 @@\n-lm_SuperContig_30_v2\t23817\t24089\tmito_010 NADH dehydrogenase (ubiquinone) chain 5\t1\t91\t7e-25\t119\t63.74\n-lm_SuperContig_30_v2\t27615\t28001\tmito_010 NADH dehydrogenase (ubiquinone) chain 5\t109\t237\t1e-53\t214\t77.52\n-lm_SuperContig_30_v2\t29503\t29673\tmito_010 NADH dehydrogenase (ubiquinone) chain 5\t254\t310\t3e-21\t107\t92.98\n-lm_SuperContig_30_v2\t35498\t35914\tmito_010 NADH dehydrogenase (ubiquinone) chain 5\t307\t445\t1e-62\t244\t82.73\n-lm_SuperContig_30_v2\t37314\t37823\tmito_010 NADH dehydrogenase (ubiquinone) chain 5\t494\t663\t8e-67\t258\t67.65\n-lm_SuperContig_30_v2\t23817\t24089\tmito_020 predicted ND5 intron 2 protein\t1\t91\t7e-25\t119\t63.74\n-lm_SuperContig_30_v2\t27615\t28001\tmito_020 predicted ND5 intron 2 protein\t109\t237\t1e-53\t214\t77.52\n-lm_SuperContig_30_v2\t28681\t29418\tmito_020 predicted ND5 intron 2 protein\t303\t540\t4e-37\t159\t41.2\n-lm_SuperContig_30_v2\t94306\t95085\tmito_020 predicted ND5 intron 2 protein\t544\t279\t2e-22\t110\t28.46\n-lm_SuperContig_30_v2\t18181\t19317\tmito_030 predicted ND5 intron 1 protein\t167\t528\t3e-57\t226\t37.76\n-lm_SuperContig_30_v2\t22437\t23375\tmito_030 predicted ND5 intron 1 protein\t219\t528\t1e-43\t181\t32.59\n-lm_SuperContig_30_v2\t23817\t24089\tmito_030 predicted ND5 intron 1 protein\t1\t91\t7e-25\t119\t63.74\n-lm_SuperContig_30_v2\t26190\t27509\tmito_030 predicted ND5 intron 1 protein\t84\t525\t0\t666\t76.52\n-lm_SuperContig_30_v2\t32527\t33390\tmito_030 predicted ND5 intron 1 protein\t236\t518\t6e-40\t169\t36.15\n-lm_SuperContig_30_v2\t35963\t37213\tmito_030 predicted ND5 intron 1 protein\t114\t525\t4e-62\t242\t38.08\n-lm_SuperContig_30_v2\t55780\t56187\tmito_030 predicted ND5 intron 1 protein\t492\t357\t1e-34\t96\t36.96\n-lm_SuperContig_30_v2\t56292\t56582\tmito_030 predicted ND5 intron 1 protein\t351\t255\t1e-34\t74\t38.78\n-lm_SuperContig_30_v2\t61805\t62656\tmito_030 predicted ND5 intron 1 protein\t528\t241\t3e-55\t219\t38.89\n-lm_SuperContig_30_v2\t63837\t64676\tmito_030 predicted ND5 intron 1 protein\t511\t232\t1e-35\t155\t35.21\n-lm_SuperContig_30_v2\t80861\t81706\tmito_030 predicted ND5 intron 1 protein\t525\t242\t5e-44\t182\t35.66\n-lm_SuperContig_30_v2\t82749\t83615\tmito_030 predicted ND5 intron 1 protein\t525\t236\t3e-47\t193\t35.27\n-lm_SuperContig_30_v2\t86928\t87770\tmito_030 predicted ND5 intron 1 protein\t525\t242\t3e-47\t193\t36.14\n-lm_SuperContig_30_v2\t90399\t91238\tmito_030 predicted ND5 intron 1 protein\t528\t249\t1e-37\t161\t32.52\n-lm_SuperContig_30_v2\t109092\t109925\tmito_030 predicted ND5 intron 1 protein\t525\t243\t2e-49\t200\t38.16\n-lm_SuperContig_30_v2\t115228\t116103\tmito_030 predicted ND5 intron 1 protein\t236\t528\t6e-48\t195\t35.93\n-lm_SuperContig_30_v2\t116645\t117925\tmito_030 predicted ND5 intron 1 protein\t121\t526\t6e-60\t235\t37.12\n-lm_SuperContig_30_v2\t117965\t119308\tmito_030 predicted ND5 intron 1 protein\t87\t525\t1e-63\t248\t35.79\n-lm_SuperContig_30_v2\t141039\t141308\tmito_030 predicted ND5 intron 1 protein\t250\t342\t8e-47\t58\t34.41\n-lm_SuperContig_30_v2\t141292\t141858\tmito_030 predicted ND5 intron 1 protein\t337\t525\t8e-47\t155\t42.11\n-lm_SuperContig_30_v2\t146223\t147503\tmito_030 predicted ND5 intron 1 protein\t114\t528\t2e-64\t250\t37.61\n-lm_SuperContig_30_v2\t149559\t149744\tmito_030 predicted ND5 intron 1 protein\t233\t296\t6e-40\t41\t35.94\n-lm_SuperContig_30_v2\t149749\t150444\tmito_030 predicted ND5 intron 1 protein\t299\t530\t6e-40\t149\t37.02\n-lm_SuperContig_30_v2\t150994\t152199\tmito_030 predicted ND5 intron 1 protein\t121\t525\t4e-58\t229\t36.3\n-lm_SuperContig_30_v2\t21984\t22220\tmito_040 NADH dehydrogenase (ubiquinone) chain 4L\t1\t79\t3e-30\t136\t84.81\n-lm_SuperContig_30_v2\t18466\t19329\tmito_050 predicted ND4L intron protein\t145\t438\t6e-54\t215\t40.53\n-lm_SuperContig_30_v2\t21984\t22229\tmito_050 predicted ND4L intron protein\t1\t82\t8e-31\t138\t82.93\n-lm_SuperContig_30_v2\t22509\t23387\tmito_050 predicted ND4L intron protein\t145\t438\t7e-81\t305\t49\n-lm_SuperContig_30_v2\t26661\t27530\tmito_050 predicted ND4L intron protein\t145\t438\t1e-43\t181\t35.67\n-lm_SuperContig_30_v2\t32542\t33390\tmito_050 predicted ND4L intron protein\t145\t424\t6e-43\t179\t38.91\n-lm_SuperContig_30_v2\t36323\t37234\tmito_050 predicted ND4L intron protein\t145\t438\t4e-49\t199\t40.39\n-lm_SuperContig_30_v2\t'..b'cuolar Basic Amino acid transporter, Contig um_contig_1.17\t529\t218\t2e-42\t82\t20.7\n-lm_SuperContig_29_v2\t193787\t194374\tum00679 related to VBA1 - Vacuolar Basic Amino acid transporter, Contig um_contig_1.17\t211\t18\t2e-42\t114\t31\n-lm_SuperContig_29_v2\t78115\t78588\tum00842 probable aflatoxin efflux pump AFLT, Contig um_contig_1.27\t53\t210\t2e-53\t183\t55.06\n-lm_SuperContig_29_v2\t78662\t78814\tum00842 probable aflatoxin efflux pump AFLT, Contig um_contig_1.27\t211\t264\t2e-53\t47\t44.44\n-lm_SuperContig_29_v2\t192760\t193692\tum00842 probable aflatoxin efflux pump AFLT, Contig um_contig_1.27\t534\t211\t2e-104\t220\t36.92\n-lm_SuperContig_29_v2\t193766\t194239\tum00842 probable aflatoxin efflux pump AFLT, Contig um_contig_1.27\t210\t53\t2e-104\t183\t55.06\n-lm_SuperContig_29_v2\t78112\t78570\tum01882 related to multidrug resistance proteins, Contig um_contig_1.70\t94\t246\t7e-23\t104\t35.95\n-lm_SuperContig_29_v2\t78659\t78802\tum01882 related to multidrug resistance proteins, Contig um_contig_1.70\t253\t297\t7e-23\t24\t25\n-lm_SuperContig_29_v2\t192760\t193695\tum01882 related to multidrug resistance proteins, Contig um_contig_1.70\t560\t253\t5e-40\t84\t19.43\n-lm_SuperContig_29_v2\t193784\t194242\tum01882 related to multidrug resistance proteins, Contig um_contig_1.70\t246\t94\t5e-40\t104\t35.95\n-lm_SuperContig_29_v2\t78019\t78567\tum01964 related to multidrug resistance protein, Contig um_contig_1.72\t40\t220\t1e-24\t113\t33.7\n-lm_SuperContig_29_v2\t192901\t193695\tum01964 related to multidrug resistance protein, Contig um_contig_1.72\t490\t227\t7e-43\t85\t24.16\n-lm_SuperContig_29_v2\t193787\t194335\tum01964 related to multidrug resistance protein, Contig um_contig_1.72\t220\t40\t7e-43\t113\t33.7\n-lm_SuperContig_29_v2\t77890\t78591\tum02062 related to multidrug resistance proteins, Contig um_contig_1.75\t38\t263\t1e-32\t115\t32.07\n-lm_SuperContig_29_v2\t78659\t78814\tum02062 related to multidrug resistance proteins, Contig um_contig_1.75\t264\t313\t1e-32\t46\t36.54\n-lm_SuperContig_29_v2\t192760\t193695\tum02062 related to multidrug resistance proteins, Contig um_contig_1.75\t575\t264\t1e-65\t158\t30.6\n-lm_SuperContig_29_v2\t193763\t194464\tum02062 related to multidrug resistance proteins, Contig um_contig_1.75\t263\t38\t1e-65\t115\t32.07\n-lm_SuperContig_29_v2\t78136\t78576\tum02598 related to mfs1 - putative multidrug transporter, Contig um_contig_1.86\t133\t280\t1e-21\t91\t30.41\n-lm_SuperContig_29_v2\t78650\t78814\tum02598 related to mfs1 - putative multidrug transporter, Contig um_contig_1.86\t280\t331\t1e-21\t33\t29.09\n-lm_SuperContig_29_v2\t192754\t193704\tum02598 related to mfs1 - putative multidrug transporter, Contig um_contig_1.86\t598\t280\t3e-45\t114\t25.93\n-lm_SuperContig_29_v2\t193778\t194218\tum02598 related to mfs1 - putative multidrug transporter, Contig um_contig_1.86\t280\t133\t3e-45\t91\t30.41\n-lm_SuperContig_29_v2\t77938\t78585\tum03115 related to Sge1 - drug resistance protein, Contig um_contig_1.105\t27\t239\t2e-24\t93\t30.73\n-lm_SuperContig_29_v2\t78650\t78808\tum03115 related to Sge1 - drug resistance protein, Contig um_contig_1.105\t236\t285\t2e-24\t40\t33.96\n-lm_SuperContig_29_v2\t192757\t193704\tum03115 related to Sge1 - drug resistance protein, Contig um_contig_1.105\t554\t236\t1e-48\t124\t25.7\n-lm_SuperContig_29_v2\t193769\t194416\tum03115 related to Sge1 - drug resistance protein, Contig um_contig_1.105\t239\t27\t1e-48\t93\t30.73\n-lm_SuperContig_29_v2\t77938\t78576\tum05414 probable aflatoxin efflux pump AFLT, Contig um_contig_1.192\t13\t215\t4e-45\t167\t39.91\n-lm_SuperContig_29_v2\t78650\t78736\tum05414 probable aflatoxin efflux pump AFLT, Contig um_contig_1.192\t216\t244\t4e-45\t36\t55.17\n-lm_SuperContig_29_v2\t192826\t193704\tum05414 probable aflatoxin efflux pump AFLT, Contig um_contig_1.192\t511\t216\t2e-98\t216\t37.04\n-lm_SuperContig_29_v2\t193778\t194416\tum05414 probable aflatoxin efflux pump AFLT, Contig um_contig_1.192\t215\t13\t2e-98\t167\t39.91\n-lm_SuperContig_29_v2\t193006\t193692\tum05421 related to Multidrug resistance protein , Contig um_contig_1.192\t496\t272\t6e-41\t107\t27.07\n-lm_SuperContig_29_v2\t193778\t194107\tum05421 related to Multidrug resistance protein , Contig um_contig_1.192\t267\t158\t6e-41\t83\t35.45\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align.match.map --- a/commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align.match.map Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,341 +0,0 @@\n-Afu3g02110.115\tlm_SuperContig_29_v2\t77989\t78369\n-Afu3g02110.116\tlm_SuperContig_29_v2\t194365\t193985\n-Afu3g01520.117\tlm_SuperContig_29_v2\t78109\t78817\n-Afu3g01520.118\tlm_SuperContig_29_v2\t194245\t192760\n-Afu3g02520.119\tlm_SuperContig_29_v2\t78010\t78808\n-Afu3g02520.120\tlm_SuperContig_29_v2\t194344\t192766\n-Afu3g02720.121\tlm_SuperContig_29_v2\t78109\t78817\n-Afu3g02720.122\tlm_SuperContig_29_v2\t194245\t192754\n-Afu6g03320.123\tlm_SuperContig_29_v2\t78061\t78814\n-Afu6g03320.124\tlm_SuperContig_29_v2\t194293\t192760\n-Afu6g02220.125\tlm_SuperContig_29_v2\t78007\t78817\n-Afu6g02220.126\tlm_SuperContig_29_v2\t194347\t193288\n-Afu8g00940.127\tlm_SuperContig_29_v2\t78133\t78817\n-Afu8g00940.128\tlm_SuperContig_29_v2\t194221\t192760\n-Afu4g02630.129\tlm_SuperContig_29_v2\t134343\t133669\n-Afu4g02630.130\tlm_SuperContig_29_v2\t168372\t167776\n-Afu4g02630.131\tlm_SuperContig_29_v2\t42080\t41484\n-Afu4g02630.132\tlm_SuperContig_29_v2\t102000\t101404\n-Afu4g02630.133\tlm_SuperContig_29_v2\t32272\t31597\n-Afu4g02630.134\tlm_SuperContig_29_v2\t17082\t16462\n-Afu4g02630.135\tlm_SuperContig_29_v2\t179264\t178590\n-Afu4g02630.136\tlm_SuperContig_29_v2\t11625\t10942\n-Afu4g02630.137\tlm_SuperContig_29_v2\t92562\t91888\n-Afu4g03920.138\tlm_SuperContig_29_v2\t78184\t78814\n-Afu4g03920.139\tlm_SuperContig_29_v2\t194170\t192964\n-Afu6g09110.140\tlm_SuperContig_29_v2\t78049\t78775\n-Afu6g09110.141\tlm_SuperContig_29_v2\t194305\t192904\n-Afu6g14640.142\tlm_SuperContig_29_v2\t78151\t78814\n-Afu6g14640.143\tlm_SuperContig_29_v2\t194203\t192760\n-Afu6g09710.144\tlm_SuperContig_29_v2\t78109\t78814\n-Afu6g09710.145\tlm_SuperContig_29_v2\t194245\t192772\n-Afu5g01540.146\tlm_SuperContig_29_v2\t78115\t78817\n-Afu5g01540.147\tlm_SuperContig_29_v2\t194239\t192754\n-Afu2g15140.148\tlm_SuperContig_29_v2\t194323\t192868\n-fg00095.149\tlm_SuperContig_29_v2\t194221\t193303\n-fg12051.150\tlm_SuperContig_29_v2\t194221\t192877\n-fg12074.151\tlm_SuperContig_29_v2\t77956\t78814\n-fg12074.152\tlm_SuperContig_29_v2\t194398\t192883\n-fg12335.153\tlm_SuperContig_29_v2\t78124\t78718\n-fg12335.154\tlm_SuperContig_29_v2\t194230\t192769\n-fg12717.155\tlm_SuperContig_29_v2\t194383\t193222\n-b13o8_150.156\tlm_SuperContig_29_v2\t194248\t193036\n-b18d24_100.157\tlm_SuperContig_29_v2\t78010\t78814\n-b18d24_100.158\tlm_SuperContig_29_v2\t194344\t192916\n-b5k2_230.159\tlm_SuperContig_29_v2\t78184\t78814\n-b5k2_230.160\tlm_SuperContig_29_v2\t194170\t192760\n-1nc550_030.161\tlm_SuperContig_29_v2\t194212\t192832\n-1nc570_120.162\tlm_SuperContig_29_v2\t77941\t78736\n-1nc570_120.163\tlm_SuperContig_29_v2\t194413\t192760\n-6nc360_090.164\tlm_SuperContig_29_v2\t194086\t192817\n-29e8_240.165\tlm_SuperContig_29_v2\t78112\t78817\n-29e8_240.166\tlm_SuperContig_29_v2\t194242\t192769\n-7nc450_010.167\tlm_SuperContig_29_v2\t194218\t192940\n-4nc446_010.168\tlm_SuperContig_29_v2\t194218\t192865\n-b11e5_230.169\tlm_SuperContig_29_v2\t194239\t192904\n-xnc126_050.170\tlm_SuperContig_29_v2\t77935\t78817\n-xnc126_050.171\tlm_SuperContig_29_v2\t194419\t192757\n-4nc135_070.172\tlm_SuperContig_29_v2\t78109\t78817\n-4nc135_070.173\tlm_SuperContig_29_v2\t194245\t192751\n-xnc164_090.174\tlm_SuperContig_29_v2\t78031\t78588\n-xnc164_090.175\tlm_SuperContig_29_v2\t194323\t192802\n-YBR293w.176\tlm_SuperContig_29_v2\t194107\t192916\n-YCL069w.177\tlm_SuperContig_29_v2\t193954\t192985\n-YDL037c.178\tlm_SuperContig_29_v2\t197422\t197024\n-YDL037c.179\tlm_SuperContig_29_v2\t197413\t197027\n-YDL037c.180\tlm_SuperContig_29_v2\t197437\t197039\n-YDL037c.181\tlm_SuperContig_29_v2\t197416\t197021\n-YGR109w-b.182\tlm_SuperContig_29_v2\t42272\t40143\n-YGR109w-b.183\tlm_SuperContig_29_v2\t17274\t16081\n-YGR109w-b.184\tlm_SuperContig_29_v2\t102192\t100993\n-YGR109w-b.185\tlm_SuperContig_29_v2\t168564\t167371\n-YGR109w-b.186\tlm_SuperContig_29_v2\t134535\t133543\n-YGR109w-b.187\tlm_SuperContig_29_v2\t92754\t91762\n-YGR109w-b.188\tlm_SuperContig_29_v2\t179477\t178464\n-YGR224w.189\tlm_SuperContig_29_v2\t78139\t78724\n-YGR224w.190\tlm_SuperContig_29_v2\t194215\t193630\n-YHL028w.191\tlm_SuperContig_29_v2\t197437\t197024\n-YHL028w.192\tlm_SuperContig_29_v2\t197413\t197024\n-YHL028w.193\tlm_SuperContig_29_v2\t197425\t197024\n-YHL028w.194\tlm_SuperContig_29_v2\t197434\t197024\n-YHL028w.195\tlm_SuperContig_29_v2\t1'..b'perContig_30_v2\t62650\t61793\n-mito_050.30\tlm_SuperContig_30_v2\t18466\t19329\n-mito_050.31\tlm_SuperContig_30_v2\t81703\t80849\n-mito_050.32\tlm_SuperContig_30_v2\t36323\t37234\n-mito_050.33\tlm_SuperContig_30_v2\t83594\t82737\n-mito_050.34\tlm_SuperContig_30_v2\t149583\t150450\n-mito_050.35\tlm_SuperContig_30_v2\t64748\t63768\n-mito_050.36\tlm_SuperContig_30_v2\t118442\t119320\n-mito_050.37\tlm_SuperContig_30_v2\t87767\t86916\n-mito_050.38\tlm_SuperContig_30_v2\t26661\t27530\n-mito_050.39\tlm_SuperContig_30_v2\t109925\t109071\n-mito_050.40\tlm_SuperContig_30_v2\t115249\t116115\n-mito_050.41\tlm_SuperContig_30_v2\t91259\t90387\n-mito_050.42\tlm_SuperContig_30_v2\t32542\t33390\n-mito_050.43\tlm_SuperContig_30_v2\t141021\t141879\n-mito_050.44\tlm_SuperContig_30_v2\t117050\t117943\n-mito_050.45\tlm_SuperContig_30_v2\t146610\t147515\n-mito_050.46\tlm_SuperContig_30_v2\t151234\t152220\n-mito_060.47\tlm_SuperContig_30_v2\t53696\t53343\n-mito_080.48\tlm_SuperContig_30_v2\t5079\t5582\n-mito_080.49\tlm_SuperContig_30_v2\t59799\t53703\n-mito_110.50\tlm_SuperContig_30_v2\t65165\t64707\n-mito_150.51\tlm_SuperContig_30_v2\t110387\t108494\n-mito_150.52\tlm_SuperContig_30_v2\t103711\t103508\n-mito_170.53\tlm_SuperContig_30_v2\t17614\t20481\n-mito_180.54\tlm_SuperContig_30_v2\t17614\t19341\n-mito_180.55\tlm_SuperContig_30_v2\t62653\t61781\n-mito_180.56\tlm_SuperContig_30_v2\t32542\t33390\n-mito_180.57\tlm_SuperContig_30_v2\t83615\t82716\n-mito_180.58\tlm_SuperContig_30_v2\t36329\t37252\n-mito_180.59\tlm_SuperContig_30_v2\t109979\t109059\n-mito_180.60\tlm_SuperContig_30_v2\t141030\t141897\n-mito_180.61\tlm_SuperContig_30_v2\t81706\t80825\n-mito_180.62\tlm_SuperContig_30_v2\t149580\t150465\n-mito_180.63\tlm_SuperContig_30_v2\t64718\t63756\n-mito_180.64\tlm_SuperContig_30_v2\t115189\t116127\n-mito_180.65\tlm_SuperContig_30_v2\t87770\t86895\n-mito_180.66\tlm_SuperContig_30_v2\t22509\t23405\n-mito_180.67\tlm_SuperContig_30_v2\t91256\t90384\n-mito_180.68\tlm_SuperContig_30_v2\t118439\t119344\n-mito_180.69\tlm_SuperContig_30_v2\t56585\t55774\n-mito_180.70\tlm_SuperContig_30_v2\t117050\t117955\n-mito_180.71\tlm_SuperContig_30_v2\t26640\t27542\n-mito_180.72\tlm_SuperContig_30_v2\t151309\t152232\n-mito_180.73\tlm_SuperContig_30_v2\t146610\t147527\n-mito_180.74\tlm_SuperContig_30_v2\t42209\t42879\n-mito_180.75\tlm_SuperContig_30_v2\t125743\t126138\n-mito_190.76\tlm_SuperContig_30_v2\t44197\t47305\n-mito_210.77\tlm_SuperContig_30_v2\t102604\t102101\n-mito_210.78\tlm_SuperContig_30_v2\t94202\t89139\n-mito_220.79\tlm_SuperContig_30_v2\t14626\t15192\n-mito_220.80\tlm_SuperContig_30_v2\t15860\t16315\n-mito_220.81\tlm_SuperContig_30_v2\t9733\t9936\n-mito_220.82\tlm_SuperContig_30_v2\t6405\t6605\n-mito_230.83\tlm_SuperContig_30_v2\t9733\t9936\n-mito_230.84\tlm_SuperContig_30_v2\t6405\t6605\n-mito_240.85\tlm_SuperContig_30_v2\t9733\t9927\n-mito_240.86\tlm_SuperContig_30_v2\t6405\t6605\n-mito_155.87\tlm_SuperContig_30_v2\t18442\t19341\n-mito_155.88\tlm_SuperContig_30_v2\t110081\t109056\n-mito_155.89\tlm_SuperContig_30_v2\t36323\t37249\n-mito_155.90\tlm_SuperContig_30_v2\t62650\t61781\n-mito_155.91\tlm_SuperContig_30_v2\t141021\t141891\n-mito_155.92\tlm_SuperContig_30_v2\t81703\t80828\n-mito_155.93\tlm_SuperContig_30_v2\t149583\t150462\n-mito_155.94\tlm_SuperContig_30_v2\t83594\t82716\n-mito_155.95\tlm_SuperContig_30_v2\t116981\t117955\n-mito_155.96\tlm_SuperContig_30_v2\t87767\t86895\n-mito_155.97\tlm_SuperContig_30_v2\t146610\t147533\n-mito_155.98\tlm_SuperContig_30_v2\t64655\t63756\n-mito_155.99\tlm_SuperContig_30_v2\t151258\t152232\n-mito_155.100\tlm_SuperContig_30_v2\t91256\t90381\n-mito_155.101\tlm_SuperContig_30_v2\t32494\t33504\n-mito_155.102\tlm_SuperContig_30_v2\t115198\t116127\n-mito_155.103\tlm_SuperContig_30_v2\t26607\t27542\n-mito_155.104\tlm_SuperContig_30_v2\t118442\t119341\n-mito_155.105\tlm_SuperContig_30_v2\t22509\t23387\n-mito_155.106\tlm_SuperContig_30_v2\t125740\t126240\n-mito_195.107\tlm_SuperContig_30_v2\t44996\t45911\n-mito_195.108\tlm_SuperContig_30_v2\t46058\t46769\n-SPMIT.05.109\tlm_SuperContig_30_v2\t14662\t15189\n-SPMIT.05.110\tlm_SuperContig_30_v2\t15941\t16303\n-SPMIT.04.111\tlm_SuperContig_30_v2\t65204\t64752\n-SPMIT.03.112\tlm_SuperContig_30_v2\t95262\t94345\n-SPMIT.01.113\tlm_SuperContig_30_v2\t102580\t102098\n-SPMIT.01.114\tlm_SuperContig_30_v2\t94202\t93876\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align.match.path --- a/commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align.match.path Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,456 +0,0 @@\n-1\tlm_SuperContig_30_v2\t35498\t35914\tmito_010 NADH dehydrogenase (ubiquinone) chain 5\t307\t445\t1e-62\t244\t82.73\n-1\tlm_SuperContig_30_v2\t37314\t37823\tmito_010 NADH dehydrogenase (ubiquinone) chain 5\t494\t663\t8e-67\t258\t67.65\n-2\tlm_SuperContig_30_v2\t27615\t28001\tmito_010 NADH dehydrogenase (ubiquinone) chain 5\t109\t237\t1e-53\t214\t77.52\n-2\tlm_SuperContig_30_v2\t29503\t29673\tmito_010 NADH dehydrogenase (ubiquinone) chain 5\t254\t310\t3e-21\t107\t92.98\n-3\tlm_SuperContig_30_v2\t23817\t24089\tmito_010 NADH dehydrogenase (ubiquinone) chain 5\t1\t91\t7e-25\t119\t63.74\n-4\tlm_SuperContig_30_v2\t27615\t28001\tmito_020 predicted ND5 intron 2 protein\t109\t237\t1e-53\t214\t77.52\n-4\tlm_SuperContig_30_v2\t28681\t29418\tmito_020 predicted ND5 intron 2 protein\t303\t540\t4e-37\t159\t41.2\n-5\tlm_SuperContig_30_v2\t94306\t95085\tmito_020 predicted ND5 intron 2 protein\t544\t279\t2e-22\t110\t28.46\n-6\tlm_SuperContig_30_v2\t23817\t24089\tmito_020 predicted ND5 intron 2 protein\t1\t91\t7e-25\t119\t63.74\n-7\tlm_SuperContig_30_v2\t23817\t24089\tmito_030 predicted ND5 intron 1 protein\t1\t91\t7e-25\t119\t63.74\n-7\tlm_SuperContig_30_v2\t26190\t27509\tmito_030 predicted ND5 intron 1 protein\t84\t525\t0\t666\t76.52\n-8\tlm_SuperContig_30_v2\t61805\t62656\tmito_030 predicted ND5 intron 1 protein\t528\t241\t3e-55\t219\t38.89\n-9\tlm_SuperContig_30_v2\t146223\t147503\tmito_030 predicted ND5 intron 1 protein\t114\t528\t2e-64\t250\t37.61\n-10\tlm_SuperContig_30_v2\t109092\t109925\tmito_030 predicted ND5 intron 1 protein\t525\t243\t2e-49\t200\t38.16\n-11\tlm_SuperContig_30_v2\t117965\t119308\tmito_030 predicted ND5 intron 1 protein\t87\t525\t1e-63\t248\t35.79\n-12\tlm_SuperContig_30_v2\t82749\t83615\tmito_030 predicted ND5 intron 1 protein\t525\t236\t3e-47\t193\t35.27\n-13\tlm_SuperContig_30_v2\t35963\t37213\tmito_030 predicted ND5 intron 1 protein\t114\t525\t4e-62\t242\t38.08\n-14\tlm_SuperContig_30_v2\t86928\t87770\tmito_030 predicted ND5 intron 1 protein\t525\t242\t3e-47\t193\t36.14\n-15\tlm_SuperContig_30_v2\t116645\t117925\tmito_030 predicted ND5 intron 1 protein\t121\t526\t6e-60\t235\t37.12\n-16\tlm_SuperContig_30_v2\t80861\t81706\tmito_030 predicted ND5 intron 1 protein\t525\t242\t5e-44\t182\t35.66\n-17\tlm_SuperContig_30_v2\t150994\t152199\tmito_030 predicted ND5 intron 1 protein\t121\t525\t4e-58\t229\t36.3\n-18\tlm_SuperContig_30_v2\t56292\t56582\tmito_030 predicted ND5 intron 1 protein\t351\t255\t1e-34\t74\t38.78\n-18\tlm_SuperContig_30_v2\t55780\t56187\tmito_030 predicted ND5 intron 1 protein\t492\t357\t1e-34\t96\t36.96\n-19\tlm_SuperContig_30_v2\t18181\t19317\tmito_030 predicted ND5 intron 1 protein\t167\t528\t3e-57\t226\t37.76\n-20\tlm_SuperContig_30_v2\t90399\t91238\tmito_030 predicted ND5 intron 1 protein\t528\t249\t1e-37\t161\t32.52\n-21\tlm_SuperContig_30_v2\t141039\t141308\tmito_030 predicted ND5 intron 1 protein\t250\t342\t8e-47\t58\t34.41\n-21\tlm_SuperContig_30_v2\t141292\t141858\tmito_030 predicted ND5 intron 1 protein\t337\t525\t8e-47\t155\t42.11\n-22\tlm_SuperContig_30_v2\t63837\t64676\tmito_030 predicted ND5 intron 1 protein\t511\t232\t1e-35\t155\t35.21\n-23\tlm_SuperContig_30_v2\t115228\t116103\tmito_030 predicted ND5 intron 1 protein\t236\t528\t6e-48\t195\t35.93\n-24\tlm_SuperContig_30_v2\t149559\t149744\tmito_030 predicted ND5 intron 1 protein\t233\t296\t6e-40\t41\t35.94\n-24\tlm_SuperContig_30_v2\t149749\t150444\tmito_030 predicted ND5 intron 1 protein\t299\t530\t6e-40\t149\t37.02\n-25\tlm_SuperContig_30_v2\t22437\t23375\tmito_030 predicted ND5 intron 1 protein\t219\t528\t1e-43\t181\t32.59\n-26\tlm_SuperContig_30_v2\t32527\t33390\tmito_030 predicted ND5 intron 1 protein\t236\t518\t6e-40\t169\t36.15\n-27\tlm_SuperContig_30_v2\t21984\t22220\tmito_040 NADH dehydrogenase (ubiquinone) chain 4L\t1\t79\t3e-30\t136\t84.81\n-28\tlm_SuperContig_30_v2\t21984\t22229\tmito_050 predicted ND4L intron protein\t1\t82\t8e-31\t138\t82.93\n-28\tlm_SuperContig_30_v2\t22509\t23387\tmito_050 predicted ND4L intron protein\t145\t438\t7e-81\t305\t49\n-29\tlm_SuperContig_30_v2\t61793\t62650\tmito_050 predicted ND4L intron protein\t438\t145\t3e-49\t200\t40.33\n-30\tlm_SuperContig_30_v2\t18466\t19329\tmito_050 predicted ND4L intron protein\t145\t438\t6e-54\t215\t40.53\n-31\tlm_SuperContig_30_v2\t80849\t81703\tmito_050 predicted ND4L intron protein\t435\t145\t1e-45\t188\t39.6\n-32\tlm_SuperCont'..b'm00679 related to VBA1 - Vacuolar Basic Amino acid transporter, Contig um_contig_1.17\t529\t218\t2e-42\t82\t20.7\n-327\tlm_SuperContig_29_v2\t78115\t78588\tum00842 probable aflatoxin efflux pump AFLT, Contig um_contig_1.27\t53\t210\t2e-53\t183\t55.06\n-327\tlm_SuperContig_29_v2\t78662\t78814\tum00842 probable aflatoxin efflux pump AFLT, Contig um_contig_1.27\t211\t264\t2e-53\t47\t44.44\n-328\tlm_SuperContig_29_v2\t193766\t194239\tum00842 probable aflatoxin efflux pump AFLT, Contig um_contig_1.27\t210\t53\t2e-104\t183\t55.06\n-328\tlm_SuperContig_29_v2\t192760\t193692\tum00842 probable aflatoxin efflux pump AFLT, Contig um_contig_1.27\t534\t211\t2e-104\t220\t36.92\n-329\tlm_SuperContig_29_v2\t78112\t78570\tum01882 related to multidrug resistance proteins, Contig um_contig_1.70\t94\t246\t7e-23\t104\t35.95\n-329\tlm_SuperContig_29_v2\t78659\t78802\tum01882 related to multidrug resistance proteins, Contig um_contig_1.70\t253\t297\t7e-23\t24\t25\n-330\tlm_SuperContig_29_v2\t193784\t194242\tum01882 related to multidrug resistance proteins, Contig um_contig_1.70\t246\t94\t5e-40\t104\t35.95\n-330\tlm_SuperContig_29_v2\t192760\t193695\tum01882 related to multidrug resistance proteins, Contig um_contig_1.70\t560\t253\t5e-40\t84\t19.43\n-331\tlm_SuperContig_29_v2\t78019\t78567\tum01964 related to multidrug resistance protein, Contig um_contig_1.72\t40\t220\t1e-24\t113\t33.7\n-332\tlm_SuperContig_29_v2\t193787\t194335\tum01964 related to multidrug resistance protein, Contig um_contig_1.72\t220\t40\t7e-43\t113\t33.7\n-332\tlm_SuperContig_29_v2\t192901\t193695\tum01964 related to multidrug resistance protein, Contig um_contig_1.72\t490\t227\t7e-43\t85\t24.16\n-333\tlm_SuperContig_29_v2\t77890\t78591\tum02062 related to multidrug resistance proteins, Contig um_contig_1.75\t38\t263\t1e-32\t115\t32.07\n-333\tlm_SuperContig_29_v2\t78659\t78814\tum02062 related to multidrug resistance proteins, Contig um_contig_1.75\t264\t313\t1e-32\t46\t36.54\n-334\tlm_SuperContig_29_v2\t193763\t194464\tum02062 related to multidrug resistance proteins, Contig um_contig_1.75\t263\t38\t1e-65\t115\t32.07\n-334\tlm_SuperContig_29_v2\t192760\t193695\tum02062 related to multidrug resistance proteins, Contig um_contig_1.75\t575\t264\t1e-65\t158\t30.6\n-335\tlm_SuperContig_29_v2\t78136\t78576\tum02598 related to mfs1 - putative multidrug transporter, Contig um_contig_1.86\t133\t280\t1e-21\t91\t30.41\n-335\tlm_SuperContig_29_v2\t78650\t78814\tum02598 related to mfs1 - putative multidrug transporter, Contig um_contig_1.86\t280\t331\t1e-21\t33\t29.09\n-336\tlm_SuperContig_29_v2\t193778\t194218\tum02598 related to mfs1 - putative multidrug transporter, Contig um_contig_1.86\t280\t133\t3e-45\t91\t30.41\n-336\tlm_SuperContig_29_v2\t192754\t193704\tum02598 related to mfs1 - putative multidrug transporter, Contig um_contig_1.86\t598\t280\t3e-45\t114\t25.93\n-337\tlm_SuperContig_29_v2\t77938\t78585\tum03115 related to Sge1 - drug resistance protein, Contig um_contig_1.105\t27\t239\t2e-24\t93\t30.73\n-337\tlm_SuperContig_29_v2\t78650\t78808\tum03115 related to Sge1 - drug resistance protein, Contig um_contig_1.105\t236\t285\t2e-24\t40\t33.96\n-338\tlm_SuperContig_29_v2\t193769\t194416\tum03115 related to Sge1 - drug resistance protein, Contig um_contig_1.105\t239\t27\t1e-48\t93\t30.73\n-338\tlm_SuperContig_29_v2\t192757\t193704\tum03115 related to Sge1 - drug resistance protein, Contig um_contig_1.105\t554\t236\t1e-48\t124\t25.7\n-339\tlm_SuperContig_29_v2\t77938\t78576\tum05414 probable aflatoxin efflux pump AFLT, Contig um_contig_1.192\t13\t215\t4e-45\t167\t39.91\n-339\tlm_SuperContig_29_v2\t78650\t78736\tum05414 probable aflatoxin efflux pump AFLT, Contig um_contig_1.192\t216\t244\t4e-45\t36\t55.17\n-340\tlm_SuperContig_29_v2\t193778\t194416\tum05414 probable aflatoxin efflux pump AFLT, Contig um_contig_1.192\t215\t13\t2e-98\t167\t39.91\n-340\tlm_SuperContig_29_v2\t192826\t193704\tum05414 probable aflatoxin efflux pump AFLT, Contig um_contig_1.192\t511\t216\t2e-98\t216\t37.04\n-341\tlm_SuperContig_29_v2\t193778\t194107\tum05421 related to Multidrug resistance protein , Contig um_contig_1.192\t267\t158\t6e-41\t83\t35.45\n-341\tlm_SuperContig_29_v2\t193006\t193692\tum05421 related to Multidrug resistance protein , Contig um_contig_1.192\t496\t272\t6e-41\t107\t27.07\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align.match.tab --- a/commons/pyRepetUnit/components/blastx2GFF/tests/datas/lm_supctg_v2_29_30_vs_BlastBank.align.match.tab Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,342 +0,0 @@\n-query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n-lm_SuperContig_30_v2\t35498\t37823\t927\t0.00598594\t1.29469\tmito_010\t307\t663\t309\t0.431564\t8e-67\t424\t74.4336\t1\n-lm_SuperContig_30_v2\t27615\t29673\t558\t0.00360318\t0.77933\tmito_010\t109\t310\t186\t0.259777\t1e-53\t244\t82.2577\t2\n-lm_SuperContig_30_v2\t23817\t24089\t273\t0.00176285\t0.381285\tmito_010\t1\t91\t91\t0.127095\t7e-25\t119\t63.74\t3\n-lm_SuperContig_30_v2\t27615\t29418\t1125\t0.00726449\t2.06044\tmito_020\t109\t540\t367\t0.672161\t1e-53\t329\t53.6941\t4\n-lm_SuperContig_30_v2\t94306\t95085\t780\t0.00503671\t1.42857\tmito_020\t544\t279\t266\t0.487179\t2e-22\t110\t28.46\t5\n-lm_SuperContig_30_v2\t23817\t24089\t273\t0.00176285\t0.5\tmito_020\t1\t91\t91\t0.166667\t7e-25\t119\t63.74\t6\n-lm_SuperContig_30_v2\t23817\t27509\t1593\t0.0102865\t2.98315\tmito_030\t1\t525\t525\t0.983146\t0\t680\t74.3298\t7\n-lm_SuperContig_30_v2\t61805\t62656\t852\t0.00550164\t1.59551\tmito_030\t528\t241\t288\t0.539326\t3e-55\t219\t38.89\t8\n-lm_SuperContig_30_v2\t146223\t147503\t1281\t0.00827183\t2.39888\tmito_030\t114\t528\t415\t0.777154\t2e-64\t250\t37.61\t9\n-lm_SuperContig_30_v2\t109092\t109925\t834\t0.00538541\t1.5618\tmito_030\t525\t243\t283\t0.529963\t2e-49\t200\t38.16\t10\n-lm_SuperContig_30_v2\t117965\t119308\t1344\t0.00867864\t2.51685\tmito_030\t87\t525\t439\t0.822097\t1e-63\t248\t35.79\t11\n-lm_SuperContig_30_v2\t82749\t83615\t867\t0.0055985\t1.6236\tmito_030\t525\t236\t290\t0.543071\t3e-47\t193\t35.27\t12\n-lm_SuperContig_30_v2\t35963\t37213\t1251\t0.00807811\t2.3427\tmito_030\t114\t525\t412\t0.771536\t4e-62\t242\t38.08\t13\n-lm_SuperContig_30_v2\t86928\t87770\t843\t0.00544352\t1.57865\tmito_030\t525\t242\t284\t0.531835\t3e-47\t193\t36.14\t14\n-lm_SuperContig_30_v2\t116645\t117925\t1281\t0.00827183\t2.39888\tmito_030\t121\t526\t406\t0.7603\t6e-60\t235\t37.12\t15\n-lm_SuperContig_30_v2\t80861\t81706\t846\t0.00546289\t1.58427\tmito_030\t525\t242\t284\t0.531835\t5e-44\t182\t35.66\t16\n-lm_SuperContig_30_v2\t150994\t152199\t1206\t0.00778753\t2.25843\tmito_030\t121\t525\t405\t0.758427\t4e-58\t229\t36.3\t17\n-lm_SuperContig_30_v2\t55780\t56582\t699\t0.00451367\t1.30899\tmito_030\t492\t255\t233\t0.43633\t1e-34\t118\t37.7177\t18\n-lm_SuperContig_30_v2\t18181\t19317\t1137\t0.00734197\t2.12921\tmito_030\t167\t528\t362\t0.677903\t3e-57\t226\t37.76\t19\n-lm_SuperContig_30_v2\t90399\t91238\t840\t0.00542415\t1.57303\tmito_030\t528\t249\t280\t0.524345\t1e-37\t161\t32.52\t20\n-lm_SuperContig_30_v2\t141039\t141858\t820\t0.005295\t1.53558\tmito_030\t250\t525\t276\t0.516854\t8e-47\t212\t39.6261\t21\n-lm_SuperContig_30_v2\t63837\t64676\t840\t0.00542415\t1.57303\tmito_030\t511\t232\t280\t0.524345\t1e-35\t155\t35.21\t22\n-lm_SuperContig_30_v2\t115228\t116103\t876\t0.00565661\t1.64045\tmito_030\t236\t528\t293\t0.548689\t6e-48\t195\t35.93\t23\n-lm_SuperContig_30_v2\t149559\t150444\t882\t0.00569536\t1.65169\tmito_030\t233\t530\t296\t0.554307\t6e-40\t189\t36.7922\t24\n-lm_SuperContig_30_v2\t22437\t23375\t939\t0.00606342\t1.75843\tmito_030\t219\t528\t310\t0.580524\t1e-43\t181\t32.59\t25\n-lm_SuperContig_30_v2\t32527\t33390\t864\t0.00557912\t1.61798\tmito_030\t236\t518\t283\t0.529963\t6e-40\t169\t36.15\t26\n-lm_SuperContig_30_v2\t21984\t22220\t237\t0.00153038\t2.63333\tmito_040\t1\t79\t79\t0.877778\t3e-30\t136\t84.81\t27\n-lm_SuperContig_30_v2\t21984\t23387\t1125\t0.00726449\t2.48344\tmito_050\t1\t438\t376\t0.830022\t7e-81\t419\t56.4194\t28\n-lm_SuperContig_30_v2\t61793\t62650\t858\t0.00554038\t1.89404\tmito_050\t438\t145\t294\t0.649007\t3e-49\t200\t40.33\t29\n-lm_SuperContig_30_v2\t18466\t19329\t864\t0.00557912\t1.90728\tmito_050\t145\t438\t294\t0.649007\t6e-54\t215\t40.53\t30\n-lm_SuperContig_30_v2\t80849\t81703\t855\t0.00552101\t1.88742\tmito_050\t435\t145\t291\t0.642384\t1e-45\t188\t39.6\t31\n-lm_SuperContig_30_v2\t36323\t37234\t912\t0.00588908\t2.01325\tmito_050\t145\t438\t294\t0.649007\t4e-49\t199\t40.39\t32\n-lm_SuperContig_30_v2\t82737\t83594\t858\t0.00554038\t1.89404\tmito_050\t435\t145\t291\t0.642384\t1e-45\t188\t37.46\t33\n-lm_SuperContig_30_v2\t149583\t150450\t868\t0.00560495\t1.91611\tmito_050\t145\t438\t294\t0.649007\t3e-39\t188\t37.5948\t34\n-lm_SuperContig_30_v2\t63768\t64748\t981\t0.00633463\t2.16556\tmito_050\t438\t111\t328\t0.724062\t4e-45\t186\t37.09\t35\n-lm_SuperContig_30_v2\t118442\t119320\t879\t0.00567598\t1.9404\tmito_050\t145\t435\t291\t0.642384\t3e-44\t1'..b'AC13D1.01c\t831\t427\t405\t0.303826\t2e-39\t166\t28.15\t305\n-lm_SuperContig_29_v2\t91693\t92700\t1008\t0.00501642\t0.756189\tSPAC13D1.01c\t786\t452\t335\t0.251313\t1e-37\t161\t32.94\t306\n-lm_SuperContig_29_v2\t178395\t179504\t1110\t0.00552404\t0.832708\tSPAC13D1.01c\t786\t418\t369\t0.276819\t1e-37\t160\t30.91\t307\n-lm_SuperContig_29_v2\t10747\t11856\t1110\t0.00552404\t0.832708\tSPAC13D1.01c\t786\t418\t369\t0.276819\t1e-36\t157\t31.18\t308\n-lm_SuperContig_29_v2\t133341\t134754\t1380\t0.00686772\t1.03526\tSPBC9B6.02c\t831\t358\t461\t0.345836\t4e-46\t116\t29.6018\t309\n-lm_SuperContig_29_v2\t100993\t102531\t1539\t0.007659\t1.15454\tSPBC9B6.02c\t831\t312\t520\t0.390098\t7e-44\t182\t27.67\t310\n-lm_SuperContig_29_v2\t41079\t42287\t1209\t0.00601672\t0.906977\tSPBC9B6.02c\t831\t427\t405\t0.303826\t7e-42\t175\t28.64\t311\n-lm_SuperContig_29_v2\t167371\t168579\t1209\t0.00601672\t0.906977\tSPBC9B6.02c\t831\t427\t405\t0.303826\t2e-42\t174\t29.14\t312\n-lm_SuperContig_29_v2\t16081\t17289\t1209\t0.00601672\t0.906977\tSPBC9B6.02c\t831\t427\t405\t0.303826\t4e-39\t165\t27.9\t313\n-lm_SuperContig_29_v2\t91693\t92700\t1008\t0.00501642\t0.756189\tSPBC9B6.02c\t786\t452\t335\t0.251313\t3e-37\t159\t32.64\t314\n-lm_SuperContig_29_v2\t178395\t179504\t1110\t0.00552404\t0.832708\tSPBC9B6.02c\t786\t418\t369\t0.276819\t3e-37\t158\t30.65\t315\n-lm_SuperContig_29_v2\t10747\t11856\t1110\t0.00552404\t0.832708\tSPBC9B6.02c\t786\t418\t369\t0.276819\t3e-36\t155\t30.91\t316\n-lm_SuperContig_29_v2\t133341\t134754\t1380\t0.00686772\t1.03526\tSPAC9.04\t831\t358\t461\t0.345836\t4e-46\t116\t29.6018\t317\n-lm_SuperContig_29_v2\t100993\t102531\t1539\t0.007659\t1.15454\tSPAC9.04\t831\t312\t520\t0.390098\t7e-44\t182\t27.67\t318\n-lm_SuperContig_29_v2\t41079\t42287\t1209\t0.00601672\t0.906977\tSPAC9.04\t831\t427\t405\t0.303826\t7e-42\t175\t28.64\t319\n-lm_SuperContig_29_v2\t167371\t168579\t1209\t0.00601672\t0.906977\tSPAC9.04\t831\t427\t405\t0.303826\t2e-42\t174\t29.14\t320\n-lm_SuperContig_29_v2\t16081\t17289\t1209\t0.00601672\t0.906977\tSPAC9.04\t831\t427\t405\t0.303826\t4e-39\t165\t27.9\t321\n-lm_SuperContig_29_v2\t91693\t92700\t1008\t0.00501642\t0.756189\tSPAC9.04\t786\t452\t335\t0.251313\t3e-37\t159\t32.64\t322\n-lm_SuperContig_29_v2\t178395\t179504\t1110\t0.00552404\t0.832708\tSPAC9.04\t786\t418\t369\t0.276819\t3e-37\t158\t30.65\t323\n-lm_SuperContig_29_v2\t10747\t11856\t1110\t0.00552404\t0.832708\tSPAC9.04\t786\t418\t369\t0.276819\t3e-36\t155\t30.91\t324\n-lm_SuperContig_29_v2\t77980\t78567\t588\t0.00292625\t1.01379\tum00679\t18\t211\t194\t0.334483\t5e-25\t114\t31\t325\n-lm_SuperContig_29_v2\t192772\t194374\t1512\t0.00752463\t2.6069\tum00679\t529\t18\t506\t0.872414\t2e-42\t90\t24.7056\t326\n-lm_SuperContig_29_v2\t78115\t78814\t627\t0.00312033\t1.07179\tum00842\t53\t264\t212\t0.362393\t2e-53\t226\t52.4685\t327\n-lm_SuperContig_29_v2\t192760\t194239\t1407\t0.00700209\t2.40513\tum00842\t534\t53\t482\t0.823932\t2e-104\t305\t43.0311\t328\n-lm_SuperContig_29_v2\t78112\t78802\t603\t0.0030009\t1.005\tum01882\t94\t297\t198\t0.33\t7e-23\t123\t33.3351\t329\n-lm_SuperContig_29_v2\t192760\t194242\t1395\t0.00694237\t2.325\tum01882\t560\t94\t461\t0.768333\t5e-40\t91\t24.8656\t330\n-lm_SuperContig_29_v2\t78019\t78567\t549\t0.00273216\t0.90894\tum01964\t40\t220\t181\t0.299669\t1e-24\t113\t33.7\t331\n-lm_SuperContig_29_v2\t192901\t194335\t1344\t0.00668856\t2.22517\tum01964\t490\t40\t445\t0.736755\t7e-43\t104\t28.0569\t332\n-lm_SuperContig_29_v2\t77890\t78814\t858\t0.00426993\t1.33645\tum02062\t38\t313\t276\t0.429907\t1e-32\t158\t32.8827\t333\n-lm_SuperContig_29_v2\t192760\t194464\t1638\t0.00815169\t2.5514\tum02062\t575\t38\t538\t0.838006\t1e-65\t161\t31.23\t334\n-lm_SuperContig_29_v2\t78136\t78814\t606\t0.00301583\t0.795276\tum02598\t133\t331\t199\t0.261155\t1e-21\t120\t30.0506\t335\n-lm_SuperContig_29_v2\t192754\t194218\t1392\t0.00692744\t1.82677\tum02598\t598\t133\t466\t0.611549\t3e-45\t109\t27.3493\t336\n-lm_SuperContig_29_v2\t77938\t78808\t807\t0.00401612\t1.30161\tum03115\t27\t285\t259\t0.417742\t2e-24\t130\t31.3664\t337\n-lm_SuperContig_29_v2\t192757\t194416\t1596\t0.00794267\t2.57419\tum03115\t554\t27\t528\t0.851613\t1e-48\t108\t27.7423\t338\n-lm_SuperContig_29_v2\t77938\t78736\t726\t0.00361302\t1.24528\tum05414\t13\t244\t232\t0.397942\t4e-45\t199\t41.7387\t339\n-lm_SuperContig_29_v2\t192826\t194416\t1518\t0.00755449\t2.60377\tum05414\t511\t13\t499\t0.855918\t2e-98\t279\t38.2481\t340\n-lm_SuperContig_29_v2\t193006\t194107\t1017\t0.00506121\t1.44255\tum05421\t496\t158\t335\t0.475177\t6e-41\t118\t29.7892\t341\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/convCoord/ConvMapChr2Chunk.py --- a/commons/pyRepetUnit/convCoord/ConvMapChr2Chunk.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,64 +0,0 @@ -from copy import deepcopy -from commons.core.sql.TableMapAdaptator import TableMapAdaptator -from commons.core.coord.Map import Map -import os - -class ConvMapChr2Chunk(object): - - def __init__(self, db, table, chunk_table, outtable): - self._tablename = table - self._chunk_table = chunk_table - self._db = db - self._outtable = outtable - - def convert(self): - """ - Convert a 'set' table format. - """ - temp_file=str(os.getpid()) + ".on_chunk" - fout=open(temp_file,'w') - - str_mask = "SELECT * FROM "+\ - self._chunk_table + " WHERE chr='%s' AND ("+\ - "(%d BETWEEN LEAST(start,end) AND GREATEST(start,end))"+\ - " OR (%d BETWEEN LEAST(start,end) AND GREATEST(start,end))"+\ - " OR (%d <= LEAST(start,end) AND %d >= GREATEST(start,end)));" - - iTMA = TableMapAdaptator(self._db, self._tablename) - chr_list = iTMA.getSeqNameList() - - for chr in chr_list: - mlist = iTMA.getMapListFromChr(chr) - for m in mlist: - sql_cmd = str_mask%(m.seqname,m.getMin(),m.getMax(),m.getMin(),m.getMax()) - self._db.execute(sql_cmd) - res = self._db.fetchall() - for i in res: - chunk = Map(i[0],i[1],int(i[2]),int(i[3])) - - new_m = deepcopy(m) - new_m.seqname = chunk.name - - if (m.start > chunk.start and m.start < chunk.end): - new_m.start = m.start - chunk.start + 1 - if (m.end > chunk.start and m.end < chunk.end): - new_m.end = m.end - chunk.start + 1 - - if m.isOnDirectStrand(): - if m.start <= chunk.start: - new_m.start = 1 - if m.end >= chunk.end: - new_m.end = chunk.end - chunk.start + 1 - else: - if m.end <= chunk.start: - new_m.end = 1 - if m.start >= chunk.end: - new_m.start = chunk.end - chunk.start + 1 - - new_m.write(fout) - - fout.close() - - self._db.createTable(self._outtable, "map", temp_file) - - os.remove(temp_file) \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/convCoord/ConvPathChr2Chunk.py --- a/commons/pyRepetUnit/convCoord/ConvPathChr2Chunk.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,68 +0,0 @@ -from copy import deepcopy -from commons.core.sql.TablePathAdaptator import TablePathAdaptator -from commons.core.coord.PathUtils import PathUtils -from commons.core.coord.Map import Map -from commons.core.coord.Path import Path -import os - -class ConvPathChr2Chunk(object): - - def __init__(self, db, table, chunk_table, outtable): - self._tablename = table - self._chunk_table = chunk_table - self._db = db - self._outtable = outtable - - def convert(self): - """ - Convert a 'path' table format. - """ - temp_file = str(os.getpid()) + ".on_chunk" - fout = open(temp_file,'w') - - str_mask = "SELECT * FROM "+\ - self._chunk_table + " WHERE chr='%s' AND ("+\ - "(%d BETWEEN LEAST(start,end) AND GREATEST(start,end))"+\ - " OR (%d BETWEEN LEAST(start,end) AND GREATEST(start,end))"+\ - " OR (%d <= LEAST(start,end) AND %d >= GREATEST(start,end)));" - - iTPA = TablePathAdaptator(self._db, self._tablename) - path_num_list = iTPA.getIdList() - - for path_num in path_num_list: - slist = iTPA.getPathListFromId(path_num) - for r in slist: - r_min, r_max = PathUtils.getQueryMinMaxFromPathList([r]) - sql_cmd = str_mask%(r.range_query.seqname,r_min,r_max,r_min,r_max) - self._db.execute(sql_cmd) - res = self._db.fetchall() - for i in res: - chunk = Map(i[0],i[1],int(i[2]),int(i[3])) - - new_r = Path() - new_r = deepcopy(r) - new_r.range_query.seqname = chunk.name - - if (r.range_query.start > chunk.start and r.range_query.start < chunk.end): - new_r.range_query.start = r.range_query.start - chunk.start + 1 - if (r.range_query.end > chunk.start and r.range_query.end < chunk.end): - new_r.range_query.end = r.range_query.end - chunk.start + 1 - - if r.range_query.isOnDirectStrand(): - if r.range_query.start <= chunk.start: - new_r.range_query.start = 1 - if r.range_query.end >= chunk.end: - new_r.range_query.end = chunk.end - chunk.start + 1 - else: - if r.range_query.end <= chunk.start: - new_r.range_query.end = 1 - if r.range_query.start >= chunk.end: - new_r.range_query.start = chunk.end - chunk.start + 1 - - new_r.write(fout) - - fout.close() - - self._db.createTable(self._outtable, "path", temp_file) - - os.remove(temp_file) \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/convCoord/ConvSetChr2Chunk.py --- a/commons/pyRepetUnit/convCoord/ConvSetChr2Chunk.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,66 +0,0 @@ -from copy import deepcopy -from commons.core.sql.TableSetAdaptator import TableSetAdaptator -from commons.core.coord.Map import Map -from commons.core.coord.Set import Set -import os - -class ConvSetChr2Chunk(object): - - def __init__(self, db, table, chunk_table, outtable): - self._tablename = table - self._chunk_table = chunk_table - self._db = db - self._outtable = outtable - - def convert(self): - """ - Convert a 'set' table format. - """ - temp_file = str(os.getpid()) + ".on_chunk" - fout = open(temp_file,'w') - - str_mask = "SELECT * FROM "+\ - self._chunk_table + " WHERE chr='%s' AND ("+\ - "(%d BETWEEN LEAST(start,end) AND GREATEST(start,end))"+\ - " OR (%d BETWEEN LEAST(start,end) AND GREATEST(start,end))"+\ - " OR (%d <= LEAST(start,end) AND %d >= GREATEST(start,end)));" - - iTSA = TableSetAdaptator(self._db, self._tablename) - path_num_list = iTSA.getIdList() - - for path_num in path_num_list: - slist = iTSA.getSetListFromId(path_num) - for r in slist: - sql_cmd = str_mask%(r.seqname,r.getMin(),r.getMax(),r.getMin(),r.getMax()) - self._db.execute(sql_cmd) - res = self._db.fetchall() - for i in res: - chunk = Map(i[0],i[1],int(i[2]),int(i[3])) - - new_r = Set() - new_r = deepcopy(r) - new_r.seqname = chunk.name - - if (r.start > chunk.start and r.start < chunk.end): - new_r.start = r.start - chunk.start + 1 - if (r.end > chunk.start and r.end < chunk.end): - new_r.end = r.end - chunk.start + 1 - - if r.isOnDirectStrand(): - if r.start <= chunk.start: - new_r.start = 1 - if r.end >= chunk.end: - new_r.end = chunk.end - chunk.start + 1 - else: - if r.end <= chunk.start: - new_r.end = 1 - if r.start >= chunk.end: - new_r.start = chunk.end - chunk.start + 1 - - new_r.write(fout) - - fout.close() - - self._db.createTable(self._outtable, "set", temp_file) - - os.remove(temp_file) \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/convCoord/PathChunkConnector.py --- a/commons/pyRepetUnit/convCoord/PathChunkConnector.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,134 +0,0 @@ -from pyRepet.coord.Map import Map -import commons.core.sql.TablePathAdaptator - - -## Connect overlapping chunks in a single fragment -# -class PathChunkConnector( object): - - def __init__(self, mapFileName, db, table, verbose): - - self._verbose = verbose - self._chunk = self._getChunkDictFromMapFileForConnectPathChunks( mapFileName ) - self._tablePathAdaptator = commons.core.sql.TablePathAdaptator.TablePathAdaptator( db, table ) - - def run (self): - for num_chunk in xrange(1,len(self._chunk.keys())): - chunkName = "chunk"+str(num_chunk) - if self._verbose > 1: - print chunkName - next_chunkName="chunk"+str(num_chunk+1) - - if next_chunkName not in self._chunk.keys(): - break - - start=self._chunk[chunkName][2] - end=self._chunk[next_chunkName][1] - - if self._chunk[chunkName][0] == self._chunk[next_chunkName][0]: - lpath=self._tablePathAdaptator.getPathListIncludedInQueryCoord(self._chunk[chunkName][0],start,end) - - if self._verbose > 1: - print "----------" - - lpath.sort() - chg_path_id={} - pathnum_to_ins=[] - pathnum_to_del=[] - - self._createDirectAndReversePaths(lpath) - - self._mergeDirectPaths(chg_path_id, pathnum_to_ins, pathnum_to_del) - - if self._verbose > 1: - print "..........." - - self._mergeReversePaths(chg_path_id, pathnum_to_ins, pathnum_to_del) - - if self._verbose > 1: - print "..........." - print pathnum_to_del - - self._tablePathAdaptator.deleteFromIdList(pathnum_to_del) - - if self._verbose > 1: - print pathnum_to_ins - - self._tablePathAdaptator.deleteFromIdList(pathnum_to_ins) - - self._insertDirectPaths(chg_path_id, pathnum_to_ins) - - self._insertReversePaths(chg_path_id, pathnum_to_ins) - - - def _createDirectAndReversePaths(self, lpath): - self._dpath = [] - self._rpath = [] - for i in lpath: - if i.range_query.isOnDirectStrand() and i.range_subject.isOnDirectStrand(): - self._dpath.append(i) - else: - self._rpath.append(i) - - def _insertDirectPaths (self, chg_path_id, pathnum_to_ins): - self._insertPaths(chg_path_id, pathnum_to_ins, self._dpath) - - def _insertReversePaths (self, chg_path_id, pathnum_to_ins): - self._insertPaths(chg_path_id, pathnum_to_ins, self._rpath) - - def _insertPaths(self, chg_path_id, pathnum_to_ins, paths2Insert): - for i in paths2Insert: - if chg_path_id.has_key(i.id): - i.id = chg_path_id[i.id] - - if self._verbose > 1: - i.show() - - if i.id in pathnum_to_ins: - self._tablePathAdaptator.insert(i) - if self._verbose > 1: - print "--> inserted!" - - if self._verbose > 1: - print "==========" - - def _mergeDirectPaths(self, chg_path_id, pathnum_to_ins, pathnum_to_del): - self._mergePaths(chg_path_id, pathnum_to_ins, pathnum_to_del, self._dpath) - - def _mergeReversePaths(self, chg_path_id, pathnum_to_ins, pathnum_to_del): - self._mergePaths(chg_path_id, pathnum_to_ins, pathnum_to_del, self._rpath) - - def _mergePaths(self, chg_path_id, pathnum_to_ins, pathnum_to_del, dpath): - x = 0 - while x < len(dpath) - 1: - x = x + 1 - if self._verbose > 1: - print "++++" - dpath[x - 1].show() - dpath[x].show() - - if dpath[x - 1].canMerge(dpath[x]): - chg_path_id[dpath[x].id] = dpath[x - 1].id - if dpath[x - 1].id not in pathnum_to_ins: - pathnum_to_ins.append(dpath[x - 1].id) - - if dpath[x].id not in pathnum_to_del: - pathnum_to_del.append(dpath[x].id) - - dpath[x - 1].merge(dpath[x]) - del dpath[x] - x = x - 1 - if self._verbose > 1: - print "--> merged" - - def _getChunkDictFromMapFileForConnectPathChunks(self, mapFileName): - mapDict = {} - mapFile = open(mapFileName) - mapInstance = Map() - while True: - if not mapInstance.read(mapFile): - break - mapDict[mapInstance.name] = (mapInstance.seqname, mapInstance.start, mapInstance.end) - - mapFile.close() - return mapDict |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/convCoord/test/TestConvCoordWithOverlapps.py --- a/commons/pyRepetUnit/convCoord/test/TestConvCoordWithOverlapps.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,169 +0,0 @@\n-import unittest\n-import os\n-import time\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.sql.DbMySql import DbMySql\n-\n-\n-class Test_ConvCoordWithOverlaps( unittest.TestCase ):\n- pass\n-\n-# def setUp(self):\n-# self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S") , os.getpid() )\n-# self._mapFile = "map_file.map"\n-# _MockMapFile( self._mapFile )\n-# self._resultFile = "dummyObsFile_%s" % ( self._uniqId )\n-# self._refFileToCompare = "dummyExpFile_%s" % ( self._uniqId )\n-# self._configFileName = "dummyConfigFile_%s" % ( self._uniqId )\n-# configF = open(self._configFileName, "w" )\n-# configF.write( "[repet_env]\\n" )\n-# configF.write( "repet_host: %s\\n" % ( os.environ["REPET_HOST"] ) )\n-# configF.write( "repet_user: %s\\n" % ( os.environ["REPET_USER"] ) )\n-# configF.write( "repet_pw: %s\\n" % ( os.environ["REPET_PW"] ) )\n-# configF.write( "repet_db: %s\\n" % ( os.environ["REPET_DB"] ) )\n-# configF.write( "repet_port: %s\\n" % ( os.environ["REPET_PORT"] ) )\n-# configF.close()\n-# self._db = DbMySql( cfgFileName = self._configFileName )\n-# \n-# def tearDown(self):\n-# os.remove( self._mapFile )\n-# os.remove( self._resultFile )\n-# os.remove( self._refFileToCompare )\n-# self._db.close()\n-# self._uniqId = None\n-# \n-# \n-# def test_run_TwoHitsOverlapOnFirstAndSecondChunks( self ):\n-# file2Process = "two_hits_overlap_on_first_and_second_chunk.align"\n-# linesToProcess = [ "chunk1" + "\\t" + "95535" + "\\t" + "95570" + "\\t" + "sbj2" + "\\t" + "125423" + "\\t" + "125467" + "\\t" + "7e-15" + "\\t" + "82" + "\\t" + "97.78" + "\\n", \n-# "chunk2" + "\\t" + "5544" + "\\t" + "5575" + "\\t" + "sbj2" + "\\t" + "125457" + "\\t" + "133465" + "\\t" + "2e-38" + "\\t" + "83" + "\\t" + "65" + "\\n" ]\n-# _MockAlignFile( file2Process, linesToProcess )\n-# \n-# convCoord = ConvCoord( file2Process, "q", self._mapFile, self._resultFile, "", 0, self._db )\n-# convCoord.run()\n-# \n-# refLine = ["dmel_chr4" + "\\t" + "95535" + "\\t" + "95575" + "\\t" + "sbj2" + "\\t" + "125423" + "\\t" + "133465" + "\\t" + "2e-38" + "\\t" + "83" + "\\t" + "97.78" + "\\n"]\n-# _MockAlignFile( self._refFileToCompare, refLine )\n-# \n-# self.assertTrue( FileUtils.are2FilesIdentical( self._refFileToCompare, self._resultFile ) )\n-# os.remove( file2Process )\n-#\n-# \n-# def test_run_ThreeHitsOverlapOnFirstAndSecondChunks( self ):\n-# file2Process = "three_hits_overlap_on_first_and_second_chunk.align"\n-# linesToProcess = [ "chunk1" + "\\t" + "95535" + "\\t" + "95570" + "\\t" + "sbj2" + "\\t" + "125423" + "\\t" + "125467" + "\\t" + "7e-15" + "\\t" + "82" + "\\t" + "97.78" + "\\n", \n-# "chunk2" + "\\t" + "5544" + "\\t" + "5575" + "\\t" + "sbj2" + "\\t" + "125457" + "\\t" + "133465" + "\\t" + "2e-38" + "\\t" + "83" + "\\t" + "65" + "\\n"\n-# "chunk2" + "\\t" + "5540" + "\\t" + "5573" + "\\t" + "sbj2" + "\\t" + "125454" + "\\t" +"125750" + "\\t" + "8e-58" + "\\t" + "224" + "\\t" + "86.43" + "\\n" ]\n-# _MockAlignFile( file2Process, linesToProcess )\n-# \n-# convCoord = ConvCoord( file2Process, "q", self._mapFile, self._resultFile, "", 0, self._db )\n-# convCoord.run()\n-#\n-# refLine = ["dmel_chr4" + "\\t" + "95535" + "\\t" + "95575" + "\\t" + "sbj2" + "\\t" + "125423" + "\\t" + "133465" + "\\t" + "8e-58" + "\\t" + "224" + "\\t" + "97.78" + "\\n"]\n-# _MockAlignFile( self._refFileToCompare, refLine )\n-# \n-# self.assertTrue( FileUtils.are2FilesIdentical( self._refFileToCompare, self._resultFile ) )\n-# os.remove( file2Process )\n-#\n-# \n-# def test_run_HitsOnDifferentStrandsAndDifferentSubjects( self ):\n-# file2Process = "hits_on_different_strands_and_differ'..b'vCoord.run()\n-# \n-# refLine = ["dmel_chr4" + "\\t" + "175000"+ "\\t" + "185000"+ "\\t" + "sbj2"+ "\\t" + "125454"+ "\\t" + "133465"+ "\\t" + "8e-58"+ "\\t" + "224"+ "\\t" + "86.43"+"\\n"]\n-# _MockAlignFile( self._refFileToCompare, refLine )\n-# \n-# self.assertTrue( FileUtils.are2FilesIdentical( self._refFileToCompare, self._resultFile ) )\n-# os.remove( file2Process )\n-#\n-# \n-# def test_run_TwoHitsOnChunks_And_OnOverlap_OnReverseStrand_ForSubject( self ):\n-# file2Process = "two_hits_on_chunks_and_on_overlap_on_reverse_strand_for_subject.align" \n-# linesToProcess = [ "chunk2" + "\\t" + "85000" + "\\t" + "95000" + "\\t" + "sbj2" + "\\t" + "133465" + "\\t" + "125457" + "\\t" + "2e-38" + "\\t" + "83" + "\\t" + "65" + "\\n",\n-# "chunk3" + "\\t" + "1000" + "\\t" + "5000" + "\\t" + "sbj2" + "\\t" + "125750" + "\\t" + "125454" + "\\t" + "8e-58" + "\\t" + "224" + "\\t" + "86.43" + "\\n" ] \n-# _MockAlignFile( file2Process, linesToProcess )\n-# \n-# convCoord = ConvCoord( file2Process, "q", self._mapFile, self._resultFile, "", 0, self._db )\n-# convCoord.run()\n-# \n-# refLine = ["dmel_chr4" + "\\t" + "175000"+ "\\t" + "185000" + "\\t" + "sbj2"+ "\\t" + "133465" + "\\t" + "125454" + "\\t" + "8e-58"+ "\\t" + "224"+ "\\t" + "86.43"+"\\n"]\n-# _MockAlignFile( self._refFileToCompare, refLine )\n-# \n-# self.assertTrue( FileUtils.are2FilesIdentical( self._refFileToCompare, self._resultFile ) ) \n-# os.remove( file2Process )\n-# \n-# \n-# def test_run_ThreeHitsAllByAllWithTwoHitsWithinAChunkOverlap( self ):\n-# file2Process = "dummyAlignFile_%s" % ( self._uniqId )\n-# linesToProcess = [ "chunk1"+"\\t"+"192"+"\\t"+"197"+"\\t"+"chunk2"+"\\t"+"2"+"\\t"+"7"+"\\t"+"8e-58"+"\\t"+"11"+"\\t"+"97.8"+"\\n",\n-# "chunk1"+"\\t"+"192"+"\\t"+"197"+"\\t"+"chunk2"+"\\t"+"51"+"\\t"+"56"+"\\t"+"8e-58"+"\\t"+"11"+"\\t"+"97.8"+"\\n",\n-# "chunk2"+"\\t"+"2"+"\\t"+"7"+"\\t"+"chunk2"+"\\t"+"51"+"\\t"+"56"+"\\t"+"8e-58"+"\\t"+"11"+"\\t"+"97.8"+"\\n" ]\n-# _MockAlignFile( file2Process, linesToProcess )\n-# \n-# mapFileName = "dummyMapFile_%s" % ( self._uniqId )\n-# mapF = open( mapFileName, "w" )\n-# mapF.write( "chunk1\\tdmel_chr4\\t1\\t200\\n" )\n-# mapF.write( "chunk2\\tdmel_chr4\\t191\\t390\\n" )\n-# mapF.close()\n-# \n-# convCoord = ConvCoord( file2Process, "qs", mapFileName, self._resultFile, "", 0, self._db )\n-# convCoord.run()\n-# \n-# refLine = [ "dmel_chr4"+"\\t"+"192"+"\\t"+"197"+"\\t"+"dmel_chr4"+"\\t"+"241"+"\\t"+"246"+"\\t"+"8e-58"+"\\t"+"11"+"\\t"+"97.8"+"\\n" ]\n-# _MockAlignFile( self._refFileToCompare, refLine )\n-# \n-# self.assertTrue( FileUtils.are2FilesIdentical( self._refFileToCompare, self._resultFile ) )\n-# os.remove( file2Process )\n-# os.remove( mapFileName )\n-# \n-# \n-#class _MockAlignFile:\n-# \n-# def __init__(self, fileName, lines):\n-# alignF = open(fileName, "w");\n-# for line in lines:\n-# alignF.write(line)\n-# alignF.close \n-#\n-#\n-#class _MockMapFile:\n-# \n-# def __init__ (self, fileName):\n-# mapF = open(fileName, "w")\n-# line1 = "chunk1" + \'\\t\' + "dmel_chr4" + \'\\t\' + "1" + \'\\t\'+ "100000" + "\\n"\n-# line2 = "chunk2" + \'\\t\' + "dmel_chr4" + \'\\t\' + "90001" + \'\\t\'+ "190000" + "\\n"\n-# line3 = "chunk3" + \'\\t\' + "dmel_chr4" + \'\\t\' + "180001" + \'\\t\' + "280000" + "\\n" \n-# mapF.write(line1)\n-# mapF.write(line2)\n-# mapF.write(line3)\n-# mapF.close\n-\n-\n-test_suite = unittest.TestSuite()\n-test_suite.addTest( unittest.makeSuite( Test_ConvCoordWithOverlaps ) )\n-if __name__ == "__main__":\n- unittest.TextTestRunner(verbosity=2).run( test_suite )\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/convCoord/test/Test_ConvMapChr2Chunk.py --- a/commons/pyRepetUnit/convCoord/test/Test_ConvMapChr2Chunk.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,109 +0,0 @@ -from commons.core.sql.DbFactory import DbFactory -from commons.core.utils.FileUtils import FileUtils -from commons.pyRepetUnit.convCoord.ConvMapChr2Chunk import ConvMapChr2Chunk -import unittest -import os - -class Test_ConvMapChr2Chunk(unittest.TestCase): - - def setUp(self): - self._mapfilename="dummy.map" - self._maptablename="dummy_map" - - self._chunkmapfilename="chunk.map" - self._chunkmaptable="test_chunk_map" - - self._resfilename="dummy_res.map" - - map4convData="chunk1\tchr1\t1\t100\n" - map4convData+="chunk2\tchr1\t90\t200\n" - map4convData+="chunk3\tchr1\t190\t300\n" - - map4conv=open(self._chunkmapfilename,"w") - map4conv.write(map4convData) - map4conv.close() - - self._db = DbFactory.createInstance() - self._db.createTable(self._chunkmaptable, "map", self._chunkmapfilename, True) - - map2convData="reg1\tchr1\t10\t80\n" - map2convData+="reg1\tchr1\t90\t110\n" - map2convData+="reg2\tchr1\t150\t160\n" - - map2convData+="reg3\tchr1\t70\t210\n" - map2convData+="reg4\tchr1\t85\t100\n" - map2convData+="reg5\tchr1\t85\t110\n" - - map2convData+="reg6\tchr1\t80\t10\n" - map2convData+="reg6\tchr1\t110\t90\n" - map2convData+="reg7\tchr1\t160\t150\n" - map2convData+="reg8\tchr1\t190\t300\n" - - map2convData+="reg9\tchr1\t210\t70\n" - map2convData+="reg10\tchr1\t100\t85\n" - map2convData+="reg11\tchr1\t110\t85\n" - map2convData+="reg12\tchr1\t300\t190\n" - - map2conv=open(self._mapfilename,"w") - map2conv.write(map2convData) - map2conv.close() - - self._db.createTable(self._maptablename, "map", self._mapfilename, True) - - mapResData="reg1\tchunk1\t10\t80\n" - mapResData+="reg1\tchunk1\t90\t100\n" - mapResData+="reg1\tchunk2\t1\t21\n" - mapResData+="reg2\tchunk2\t61\t71\n" - - mapResData+="reg3\tchunk1\t70\t100\n" - mapResData+="reg3\tchunk2\t1\t111\n" - mapResData+="reg3\tchunk3\t1\t21\n" - - mapResData+="reg4\tchunk1\t85\t100\n" - mapResData+="reg4\tchunk2\t1\t11\n" - mapResData+="reg5\tchunk1\t85\t100\n" - mapResData+="reg5\tchunk2\t1\t21\n" - - mapResData+="reg6\tchunk1\t80\t10\n" - mapResData+="reg6\tchunk1\t100\t90\n" - mapResData+="reg6\tchunk2\t21\t1\n" - mapResData+="reg7\tchunk2\t71\t61\n" - mapResData+="reg8\tchunk2\t101\t111\n" - mapResData+="reg8\tchunk3\t1\t111\n" - - mapResData+="reg9\tchunk1\t100\t70\n" - mapResData+="reg9\tchunk2\t111\t1\n" - mapResData+="reg9\tchunk3\t21\t1\n" - - mapResData+="reg10\tchunk1\t100\t85\n" - mapResData+="reg10\tchunk2\t11\t1\n" - mapResData+="reg11\tchunk1\t100\t85\n" - mapResData+="reg11\tchunk2\t21\t1\n" - mapResData+="reg12\tchunk2\t111\t101\n" - mapResData+="reg12\tchunk3\t111\t1\n" - - mapRes=open(self._resfilename,"w") - mapRes.write(mapResData) - mapRes.close() - - def tearDown(self): - self._db.dropTable(self._chunkmaptable) - self._db.dropTable(self._maptablename) - self._db.close() - os.remove(self._resfilename) - os.remove(self._mapfilename) - os.remove(self._chunkmapfilename) - - def test_convert(self): - conv = ConvMapChr2Chunk(self._db,self._maptablename, self._chunkmaptable, self._maptablename+"_onchk") - conv.convert() - obsFileName = "dummy_map.onchk" - self._db.exportDataToFile("dummy_map_onchk", obsFileName) - self._db.dropTable("dummy_map_onchk") - self.assertTrue(FileUtils.are2FilesIdentical(self._resfilename, obsFileName)) - os.remove(obsFileName) - -test_suite = unittest.TestSuite() -test_suite.addTest( unittest.makeSuite( Test_ConvMapChr2Chunk ) ) -if __name__ == '__main__': - unittest.TextTestRunner(verbosity=2).run( test_suite ) \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/convCoord/test/Test_ConvPathChr2Chunk.py --- a/commons/pyRepetUnit/convCoord/test/Test_ConvPathChr2Chunk.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,110 +0,0 @@ -from commons.core.utils.FileUtils import FileUtils -from commons.core.sql.DbFactory import DbFactory -from commons.pyRepetUnit.convCoord.ConvPathChr2Chunk import ConvPathChr2Chunk -import unittest -import os - -class Test_ConvPathChr2Chunk(unittest.TestCase): - - def setUp(self): - self._pathfilename="dummy.path" - self._pathtablename="dummy_path" - - self._chunkmapfilename="chunk.map" - self._chunkmaptable="test_chunk_map" - - self._resfilename="dummy_res.path" - - map4convData="chunk1\tchr1\t1\t100\n" - map4convData+="chunk2\tchr1\t90\t200\n" - map4convData+="chunk3\tchr1\t190\t300\n" - - map4conv=open(self._chunkmapfilename,"w") - map4conv.write(map4convData) - map4conv.close() - - self._db = DbFactory.createInstance() - self._db.createTable(self._chunkmaptable, "map", self._chunkmapfilename, True) - - path2convData="1\tchr1\t10\t80\tsub1\t10\t50\t0.01\t1000\t99\n" - path2convData+="1\tchr1\t90\t110\tsub1\t10\t50\t0.01\t1000\t99\n" - path2convData+="2\tchr1\t150\t160\tsub1\t10\t50\t0.01\t1000\t99\n" - - path2convData+="3\tchr1\t70\t210\tsub1\t10\t50\t0.01\t1000\t99\n" - path2convData+="4\tchr1\t85\t100\tsub1\t10\t50\t0.01\t1000\t99\n" - path2convData+="5\tchr1\t85\t110\tsub1\t10\t50\t0.01\t1000\t99\n" - - path2convData+="6\tchr1\t10\t80\tsub1\t10\t50\t0.01\t1000\t99\n" - path2convData+="6\tchr1\t90\t110\tsub1\t10\t50\t0.01\t1000\t99\n" - path2convData+="7\tchr1\t150\t160\tsub1\t10\t50\t0.01\t1000\t99\n" - path2convData+="8\tchr1\t190\t300\tsub1\t10\t50\t0.01\t1000\t99\n" - - path2convData+="9\tchr1\t70\t210\tsub1\t10\t50\t0.01\t1000\t99\n" - path2convData+="10\tchr1\t85\t100\tsub1\t10\t50\t0.01\t1000\t99\n" - path2convData+="11\tchr1\t85\t110\tsub1\t10\t50\t0.01\t1000\t99\n" - path2convData+="12\tchr1\t190\t300\tsub1\t10\t50\t0.01\t1000\t99\n" - - path2conv=open(self._pathfilename,"w") - path2conv.write(path2convData) - path2conv.close() - - self._db.createTable(self._pathtablename, "path", self._pathfilename) - - pathResData="1\tchunk1\t10\t80\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="1\tchunk1\t90\t100\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="1\tchunk2\t1\t21\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="2\tchunk2\t61\t71\tsub1\t10\t50\t0.01\t1000\t99\n" - - pathResData+="3\tchunk1\t70\t100\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="3\tchunk2\t1\t111\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="3\tchunk3\t1\t21\tsub1\t10\t50\t0.01\t1000\t99\n" - - pathResData+="4\tchunk1\t85\t100\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="4\tchunk2\t1\t11\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="5\tchunk1\t85\t100\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="5\tchunk2\t1\t21\tsub1\t10\t50\t0.01\t1000\t99\n" - - pathResData+="6\tchunk1\t10\t80\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="6\tchunk1\t90\t100\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="6\tchunk2\t1\t21\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="7\tchunk2\t61\t71\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="8\tchunk2\t101\t111\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="8\tchunk3\t1\t111\tsub1\t10\t50\t0.01\t1000\t99\n" - - pathResData+="9\tchunk1\t70\t100\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="9\tchunk2\t1\t111\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="9\tchunk3\t1\t21\tsub1\t10\t50\t0.01\t1000\t99\n" - - pathResData+="10\tchunk1\t85\t100\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="10\tchunk2\t1\t11\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="11\tchunk1\t85\t100\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="11\tchunk2\t1\t21\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="12\tchunk2\t101\t111\tsub1\t10\t50\t0.01\t1000\t99\n" - pathResData+="12\tchunk3\t1\t111\tsub1\t10\t50\t0.01\t1000\t99\n" - - pathRes=open(self._resfilename,"w") - pathRes.write(pathResData) - pathRes.close() - - def tearDown(self): - self._db.dropTable(self._chunkmaptable) - self._db.dropTable(self._pathtablename) - self._db.close() - os.remove(self._resfilename) - os.remove(self._pathfilename) - os.remove(self._chunkmapfilename) - - def test_convert(self): - conv=ConvPathChr2Chunk(self._db,self._pathtablename, self._chunkmaptable, self._pathtablename+"_onchk") - conv.convert() - expPath = self._resfilename - obsPath = "dummy_path.onchk" - self._db.exportDataToFile("dummy_path_onchk", obsPath) - self._db.dropTable("dummy_path_onchk") - self.assertTrue(FileUtils.are2FilesIdentical(expPath, obsPath)) - os.remove(obsPath) - -test_suite = unittest.TestSuite() -test_suite.addTest( unittest.makeSuite( Test_ConvPathChr2Chunk ) ) -if __name__ == '__main__': - unittest.TextTestRunner(verbosity=2).run( test_suite ) \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/convCoord/test/Test_ConvSetChr2Chunk.py --- a/commons/pyRepetUnit/convCoord/test/Test_ConvSetChr2Chunk.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,109 +0,0 @@ -from commons.core.sql.DbFactory import DbFactory -from commons.core.utils.FileUtils import FileUtils -from commons.pyRepetUnit.convCoord.ConvSetChr2Chunk import ConvSetChr2Chunk -import unittest -import os - -class Test_ConvSetChr2Chunk(unittest.TestCase): - - def setUp(self): - self._setfilename="dummy.set" - self._settablename="dummy_set" - - self._chunkmapfilename="chunk.map" - self._chunkmaptable="test_chunk_map" - - self._resfilename="dummy_res.set" - - map4convData="chunk1\tchr1\t1\t100\n" - map4convData+="chunk2\tchr1\t90\t200\n" - map4convData+="chunk3\tchr1\t190\t300\n" - - map4conv=open(self._chunkmapfilename,"w") - map4conv.write(map4convData) - map4conv.close() - - self._db = DbFactory.createInstance() - self._db.createTable(self._chunkmaptable, "map", self._chunkmapfilename, True) - - set2convData="1\treg1\tchr1\t10\t80\n" - set2convData+="1\treg1\tchr1\t90\t110\n" - set2convData+="2\treg2\tchr1\t150\t160\n" - - set2convData+="3\treg3\tchr1\t70\t210\n" - set2convData+="4\treg4\tchr1\t85\t100\n" - set2convData+="5\treg5\tchr1\t85\t110\n" - - set2convData+="6\treg6\tchr1\t80\t10\n" - set2convData+="6\treg6\tchr1\t110\t90\n" - set2convData+="7\treg7\tchr1\t160\t150\n" - set2convData+="8\treg8\tchr1\t190\t300\n" - - set2convData+="9\treg9\tchr1\t210\t70\n" - set2convData+="10\treg10\tchr1\t100\t85\n" - set2convData+="11\treg11\tchr1\t110\t85\n" - set2convData+="12\treg12\tchr1\t300\t190\n" - - set2conv=open(self._setfilename,"w") - set2conv.write(set2convData) - set2conv.close() - - self._db.createTable(self._settablename, "set", self._setfilename, True) - - setResData="1\treg1\tchunk1\t10\t80\n" - setResData+="1\treg1\tchunk1\t90\t100\n" - setResData+="1\treg1\tchunk2\t1\t21\n" - setResData+="2\treg2\tchunk2\t61\t71\n" - - setResData+="3\treg3\tchunk1\t70\t100\n" - setResData+="3\treg3\tchunk2\t1\t111\n" - setResData+="3\treg3\tchunk3\t1\t21\n" - - setResData+="4\treg4\tchunk1\t85\t100\n" - setResData+="4\treg4\tchunk2\t1\t11\n" - setResData+="5\treg5\tchunk1\t85\t100\n" - setResData+="5\treg5\tchunk2\t1\t21\n" - - setResData+="6\treg6\tchunk1\t80\t10\n" - setResData+="6\treg6\tchunk1\t100\t90\n" - setResData+="6\treg6\tchunk2\t21\t1\n" - setResData+="7\treg7\tchunk2\t71\t61\n" - setResData+="8\treg8\tchunk2\t101\t111\n" - setResData+="8\treg8\tchunk3\t1\t111\n" - - setResData+="9\treg9\tchunk1\t100\t70\n" - setResData+="9\treg9\tchunk2\t111\t1\n" - setResData+="9\treg9\tchunk3\t21\t1\n" - - setResData+="10\treg10\tchunk1\t100\t85\n" - setResData+="10\treg10\tchunk2\t11\t1\n" - setResData+="11\treg11\tchunk1\t100\t85\n" - setResData+="11\treg11\tchunk2\t21\t1\n" - setResData+="12\treg12\tchunk2\t111\t101\n" - setResData+="12\treg12\tchunk3\t111\t1\n" - - setRes=open(self._resfilename,"w") - setRes.write(setResData) - setRes.close() - - def tearDown(self): - self._db.dropTable(self._chunkmaptable) - self._db.dropTable(self._settablename) - self._db.close() - os.remove(self._resfilename) - os.remove(self._setfilename) - os.remove(self._chunkmapfilename) - - def test_convert(self): - conv = ConvSetChr2Chunk(self._db,self._settablename, self._chunkmaptable, self._settablename+"_onchk") - conv.convert() - obsFileName = "dummy_set.onchk" - self._db.exportDataToFile("dummy_set_onchk", obsFileName) - self._db.dropTable("dummy_set_onchk") - self.assertTrue(FileUtils.are2FilesIdentical(self._resfilename, obsFileName)) - os.remove(obsFileName) - -test_suite = unittest.TestSuite() -test_suite.addTest( unittest.makeSuite( Test_ConvSetChr2Chunk ) ) -if __name__ == '__main__': - unittest.TextTestRunner(verbosity=2).run( test_suite ) \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/convCoord/test/Test_PathChunkConnector.py --- a/commons/pyRepetUnit/convCoord/test/Test_PathChunkConnector.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,121 +0,0 @@ -import unittest -import time -import os -from commons.core.sql.TablePathAdaptator import TablePathAdaptator -from commons.pyRepetUnit.convCoord.PathChunkConnector import PathChunkConnector -from commons.core.sql.DbMySql import DbMySql - - -class Test_PathChunkConnector( unittest.TestCase ): - - def setUp(self): - self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S") , os.getpid() ) - self._configFileName = "dummyConfigFile_%s" % ( self._uniqId ) - configF = open(self._configFileName, "w" ) - configF.write( "[repet_env]\n" ) - configF.write( "repet_host: %s\n" % ( os.environ["REPET_HOST"] ) ) - configF.write( "repet_user: %s\n" % ( os.environ["REPET_USER"] ) ) - configF.write( "repet_pw: %s\n" % ( os.environ["REPET_PW"] ) ) - configF.write( "repet_db: %s\n" % ( os.environ["REPET_DB"] ) ) - configF.write( "repet_port: %s\n" % ( os.environ["REPET_PORT"] ) ) - configF.close() - self._db = DbMySql( cfgFileName=self._configFileName ) - self._table = "dummyPathTable_%s" % ( self._uniqId ) - self._tpA = TablePathAdaptator( self._db, self._table ) - self._mapDict = {'chunk1': ('dmel_chr4', 1, 100000),'chunk2': ('dmel_chr4', 90001, 190000),'chunk3': ('dmel_chr4', 180001, 280000), } - self._mapFileName = "map_file.map" - - def tearDown(self): - self._db.close() - - def testTwoQueryOverlapsOnPlusStrand (self): - lines = [ - "1\tdmel_chr4\t95535\t95570\tsbj2\t125423\t125467\t7e-15\t82\t97.78\n", - "2\tdmel_chr4\t95545\t95576\tsbj2\t125457\t133465\t2e-38\t83\t65\n" - ] - - expectedList =[("dmel_chr4", 95535, 95576, "sbj2", 125423, 133465, 2e-38, 83,97.78)] - self._templateTest(lines, expectedList) - - def testTwoQueryOverlapsOnReverseStrand (self): - lines = [ - "1\tdmel_chr4\t95535\t95570\tsbj2\t125467\t125423\t7e-15\t82\t97.78\n", - "2\tdmel_chr4\t95545\t95576\tsbj2\t133465\t125457\t2e-38\t83\t65\n" - ] - - expectedList =[("dmel_chr4", 95535, 95576, "sbj2", 133465, 125423, 2e-38, 83,97.78)] - self._templateTest(lines, expectedList) - - def testTwoQueryOverlapsOnDifferentStrands (self): - lines = [ - "1\tdmel_chr4\t95535\t95570\tsbj2\t125423\t125467\t7e-15\t82\t97.78\n", - "2\tdmel_chr4\t95545\t95576\tsbj2\t133465\t125457\t2e-38\t83\t65\n" - ] - expectedList =[ - ("dmel_chr4", 95535, 95570, "sbj2", 125423, 125467, 7e-15, 82,97.78), - ("dmel_chr4", 95545, 95576, "sbj2", 133465, 125457, 2e-38, 83,65) - ] - self._templateTest(lines, expectedList) - - def _templateTest(self, datas2TestList, expectedList ): - pathFileName = "dummyPathFile_%s" % ( self._uniqId ) - _MockPathFile(pathFileName, datas2TestList) - - - self._db.createTable( self._table, "path", pathFileName ) - - _MockMapFile(self._mapFileName) - chunkConnector = PathChunkConnector(self._mapFileName, self._db, self._table, 0) - chunkConnector.run() - - sql_cmd = 'select * from %s' % (self._table) - self._db.execute(sql_cmd) - res = self._db.fetchall() - - for i in xrange(len(expectedList)): - resultTuple = res[i] - expectedTuple = expectedList[i] - self._assertExpectedTupleEqualsObsTuple(expectedTuple, resultTuple) - - self._db.dropTable( self._table ) - os.remove(pathFileName) - os.remove(self._mapFileName) - - def _assertExpectedTupleEqualsObsTuple(self, expectedTuple, resultTuple): - self.assertEquals(expectedTuple[0], resultTuple[1]) - self.assertEquals(expectedTuple[1], resultTuple[2]) - self.assertEquals(expectedTuple[2], resultTuple[3]) - self.assertEquals(expectedTuple[3], resultTuple[4]) - self.assertEquals(expectedTuple[4], resultTuple[5]) - self.assertEquals(expectedTuple[5], resultTuple[6]) - self.assertEquals(expectedTuple[6], resultTuple[7]) - self.assertEquals(expectedTuple[7], resultTuple[8]) - self.assertEquals(expectedTuple[8], resultTuple[9]) - - -class _MockPathFile: - - def __init__(self, fileName, lines): - path = open(fileName, "w"); - for line in lines: - path.write(line) - path.close - - -class _MockMapFile: - - def __init__ (self, fileName): - map = open(fileName, "w") - line1 = "chunk1" + '\t' + "dmel_chr4" + '\t' + "1" + '\t'+ "100000" + "\n" - line2 = "chunk2" + '\t' + "dmel_chr4" + '\t' + "90001" + '\t'+ "190000" + "\n" - line3 = "chunk3" + '\t' + "dmel_chr4" + '\t' + "180001" + '\t' + "280000" + "\n" - map.write(line1) - map.write(line2) - map.write(line3) - map.close - - -test_suite = unittest.TestSuite() -test_suite.addTest( unittest.makeSuite( Test_PathChunkConnector ) ) -if __name__ == "__main__": - unittest.TextTestRunner(verbosity=2).run( test_suite ) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/convCoord/test/convCoordTestSuite.py --- a/commons/pyRepetUnit/convCoord/test/convCoordTestSuite.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,18 +0,0 @@ -import unittest -import sys -import TestConvCoordWithOverlapps -import TestConvMapChr2Chunk -import TestConvSetChr2Chunk -import TestConvPathChr2Chunk - -def main(): - commonsTestSuite = unittest.TestSuite() - commonsTestSuite.addTest(unittest.makeSuite(TestConvCoordWithOverlapps.Test_ConvCoordWithOverlaps,'test')) - commonsTestSuite.addTest(unittest.makeSuite(TestConvMapChr2Chunk.Test_ConvMapChr2Chunk,'test')) - commonsTestSuite.addTest(unittest.makeSuite(TestConvSetChr2Chunk.Test_ConvSetChr2Chunk,'test')) - commonsTestSuite.addTest(unittest.makeSuite(TestConvPathChr2Chunk.Test_ConvPathChr2Chunk,'test')) - runner = unittest.TextTestRunner(sys.stderr, 2, 2) - runner.run(commonsTestSuite) - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/api-objects.txt --- a/commons/pyRepetUnit/doc/api-objects.txt Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,36 +0,0 @@ -commons.Checker commons.Checker-module.html -commons.Checker.DEFAULT_LOGGER_NAME commons.Checker-module.html#DEFAULT_LOGGER_NAME -commons.Checker.LOG_FILE commons.Checker-module.html#LOG_FILE -commons.IComponentWrapper commons.IComponentWrapper-module.html -commons.IDataProcessor commons.IDataProcessor-module.html -commons.Checker.Checker commons.Checker.Checker-class.html -commons.Checker.Checker.getLogger commons.Checker.Checker-class.html#getLogger -commons.Checker.Checker.__init__ commons.Checker.Checker-class.html#__init__ -commons.Checker.Checker.setLogger commons.Checker.Checker-class.html#setLogger -commons.Checker.Checker._handle commons.Checker.Checker-class.html#_handle -commons.Checker.IChecker.check commons.Checker.IChecker-class.html#check -commons.Checker.CheckerException commons.Checker.CheckerException-class.html -commons.Checker.CheckerException.msg commons.Checker.CheckerException-class.html#msg -commons.Checker.CheckerException.__init__ commons.Checker.CheckerException-class.html#__init__ -commons.Checker.ConfigChecker commons.Checker.ConfigChecker-class.html -commons.Checker.ConfigChecker.optionsDict commons.Checker.ConfigChecker-class.html#optionsDict -commons.Checker.ConfigChecker.check commons.Checker.ConfigChecker-class.html#check -commons.Checker.ConfigChecker.__init__ commons.Checker.ConfigChecker-class.html#__init__ -commons.Checker.ConfigChecker.sectionName commons.Checker.ConfigChecker-class.html#sectionName -commons.Checker.ConfigException commons.Checker.ConfigException-class.html -commons.Checker.ConfigException.messages commons.Checker.ConfigException-class.html#messages -commons.Checker.ConfigException.msg commons.Checker.ConfigException-class.html#msg -commons.Checker.ConfigException.__init__ commons.Checker.ConfigException-class.html#__init__ -commons.Checker.IChecker commons.Checker.IChecker-class.html -commons.Checker.IChecker.check commons.Checker.IChecker-class.html#check -commons.Checker._Logger commons.Checker._Logger-class.html -commons.Checker._Logger.getLogger commons.Checker._Logger-class.html#getLogger -commons.Checker._Logger._Logger__single commons.Checker._Logger-class.html#_Logger__single -commons.Checker._Logger.__init__ commons.Checker._Logger-class.html#__init__ -commons.IComponentWrapper.IComponentWrapper commons.IComponentWrapper.IComponentWrapper-class.html -commons.IComponentWrapper.IComponentWrapper.loadConfig commons.IComponentWrapper.IComponentWrapper-class.html#loadConfig -commons.IComponentWrapper.IComponentWrapper.run commons.IComponentWrapper.IComponentWrapper-class.html#run -commons.IComponentWrapper.IComponentWrapper.getComponent commons.IComponentWrapper.IComponentWrapper-class.html#getComponent -commons.IComponentWrapper.IComponentWrapper.clean commons.IComponentWrapper.IComponentWrapper-class.html#clean -commons.IDataProcessor.IDataProcessor commons.IDataProcessor.IDataProcessor-class.html -commons.IDataProcessor.IDataProcessor.run commons.IDataProcessor.IDataProcessor-class.html#run |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/class-tree.html --- a/commons/pyRepetUnit/doc/class-tree.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,138 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Class Hierarchy</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th bgcolor="#70b0f0" class="navbar-select" - > Trees </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table width="100%" cellpadding="0" cellspacing="0"> - <tr valign="top"> - <td width="100%"> </td> - <td> - <table cellpadding="0" cellspacing="0"> - <!-- hide/show private --> - <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span></td></tr> - <tr><td align="right"><span class="options" - >[<a href="frames.html" target="_top">frames</a - >] | <a href="class-tree.html" - target="_top">no frames</a>]</span></td></tr> - </table> - </td> - </tr> -</table> -<center><b> - [ <a href="module-tree.html">Module Hierarchy</a> - | <a href="class-tree.html">Class Hierarchy</a> ] -</b></center><br /> -<h1 class="epydoc">Class Hierarchy</h1> -<ul class="nomargin-top"> - <li> <strong class="uidlink"><a href="commons.Checker.IChecker-class.html">commons.Checker.IChecker</a></strong>: - <em class="summary">Interface emulation for a checker</em> - <ul> - <li> <strong class="uidlink"><a href="commons.Checker.Checker-class.html">commons.Checker.Checker</a></strong>: - <em class="summary">A concrete checker implementation with a logging.</em> - </li> - <li> <strong class="uidlink"><a href="commons.Checker.ConfigChecker-class.html">commons.Checker.ConfigChecker</a></strong>: - <em class="summary">A checker for config file.</em> - </li> - </ul> - </li> - <li> <strong class="uidlink"><a href="commons.IComponentWrapper.IComponentWrapper-class.html">commons.IComponentWrapper.IComponentWrapper</a></strong>: - <em class="summary">A interface wrapper for all pipelines component</em> - </li> - <li> <strong class="uidlink"><a href="commons.IDataProcessor.IDataProcessor-class.html">commons.IDataProcessor.IDataProcessor</a></strong>: - <em class="summary">A interface for all pipelines data processor</em> - </li> - <li> <strong class="uidlink"><a href="commons.Checker._Logger-class.html" onclick="show_private();">commons.Checker._Logger</a></strong> - </li> - <li> <strong class="uidlink">object</strong>: - <em class="summary">The most base type</em> - <ul> - <li> <strong class="uidlink">exceptions.BaseException</strong>: - <em class="summary">Common base class for all exceptions</em> - <ul> - <li> <strong class="uidlink">exceptions.Exception</strong>: - <em class="summary">Common base class for all non-exit exceptions.</em> - <ul> - <li> <strong class="uidlink"><a href="commons.Checker.CheckerException-class.html">commons.Checker.CheckerException</a></strong>: - <em class="summary">Exception raised during check.</em> - </li> - <li> <strong class="uidlink"><a href="commons.Checker.ConfigException-class.html">commons.Checker.ConfigException</a></strong>: - <em class="summary">A exception raised by check method class ConfigChecker</em> - </li> - </ul> - </li> - </ul> - </li> - </ul> - </li> -</ul> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th bgcolor="#70b0f0" class="navbar-select" - > Trees </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table border="0" cellpadding="0" cellspacing="0" width="100%%"> - <tr> - <td align="left" class="footer"> - Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009 - </td> - <td align="right" class="footer"> - <a target="mainFrame" href="http://epydoc.sourceforge.net" - >http://epydoc.sourceforge.net</a> - </td> - </tr> -</table> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.Checker-module.html --- a/commons/pyRepetUnit/doc/commons.Checker-module.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,240 +0,0 @@\n-<?xml version="1.0" encoding="ascii"?>\n-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n- "DTD/xhtml1-transitional.dtd">\n-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n-<head>\n- <title>commons.Checker</title>\n- <link rel="stylesheet" href="epydoc.css" type="text/css" />\n- <script type="text/javascript" src="epydoc.js"></script>\n-</head>\n-\n-<body bgcolor="white" text="black" link="blue" vlink="#204080"\n- alink="#204080">\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table width="100%" cellpadding="0" cellspacing="0">\n- <tr valign="top">\n- <td width="100%">\n- <span class="breadcrumbs">\n- Package commons ::\n- Module Checker\n- </span>\n- </td>\n- <td>\n- <table cellpadding="0" cellspacing="0">\n- <!-- hide/show private -->\n- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"\n- onclick="toggle_private();">hide private</a>]</span></td></tr>\n- <tr><td align="right"><span class="options"\n- >[<a href="frames.html" target="_top">frames</a\n- >] | <a href="commons.Checker-module.html"\n- target="_top">no frames</a>]</span></td></tr>\n- </table>\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== MODULE DESCRIPTION ==================== -->\n-<h1 class="epydoc">Module Checker</h1><p class="nomargin-top"><span class="codelink"><a href="commons.Checker-pysrc.html">source code</a></span></p>\n-<p>Created on 9 avr. 2009</p>\n-\n-<hr />\n-<div class="fields"> <p><strong>Author:</strong>\n- oinizan\n- </p>\n-</div><!-- ==================== CLASSES ==================== -->\n-<a name="section-Classes"></a>\n-<table class="summary" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Classes</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-Classes"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <a href="commons.Checker.Checker-class.html" class="summary-name">Checker</a><br />\n- A concrete checker implementation with a logging.\n- </td>\n- </tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <a href="commons.Checker.CheckerException-class.html" class="summary-name">CheckerException</a><br />\n- Exception raised during check.\n- </td>\n- </tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <a href="commons.Checker.ConfigChecker-class.html" class="summary-name">ConfigChecker</a><br />\n- A checker for config file.\n- </td>\n- </tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summ'..b'<span class="table-header">Variables</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-Variables"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <a name="DEFAULT_LOGGER_NAME"></a><span class="summary-name">DEFAULT_LOGGER_NAME</span> = <code title="\'log02\'"><code class="variable-quote">\'</code><code class="variable-string">log02</code><code class="variable-quote">\'</code></code>\n- </td>\n- </tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <a href="commons.Checker-module.html#LOG_FILE" class="summary-name">LOG_FILE</a> = <code title="\'/home/oinizan/workspace/repet_pipe/pyRepetUnit/blaster/check/longconf\\\n-.ini\'"><code class="variable-quote">\'</code><code class="variable-string">/home/oinizan/workspace/repet_pipe/pyRepetUnit/bla</code><code class="variable-ellipsis">...</code></code>\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== VARIABLES DETAILS ==================== -->\n-<a name="section-VariablesDetails"></a>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Variables Details</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-VariablesDetails"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-</table>\n-<a name="LOG_FILE"></a>\n-<div>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr><td>\n- <h3 class="epydoc">LOG_FILE</h3>\n- \n- <dl class="fields">\n- </dl>\n- <dl class="fields">\n- <dt>Value:</dt>\n- <dd><table><tr><td><pre class="variable">\n-<code class="variable-quote">\'</code><code class="variable-string">/home/oinizan/workspace/repet_pipe/pyRepetUnit/blaster/check/longconf</code><span class="variable-linewrap"><img src="crarr.png" alt="\\" /></span>\n-<code class="variable-string">.ini</code><code class="variable-quote">\'</code>\n-</pre></td></tr></table>\n-</dd>\n- </dl>\n-</td></tr></table>\n-</div>\n-<br />\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table border="0" cellpadding="0" cellspacing="0" width="100%%">\n- <tr>\n- <td align="left" class="footer">\n- Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009\n- </td>\n- <td align="right" class="footer">\n- <a target="mainFrame" href="http://epydoc.sourceforge.net"\n- >http://epydoc.sourceforge.net</a>\n- </td>\n- </tr>\n-</table>\n-\n-<script type="text/javascript">\n- <!--\n- // Private objects are initially displayed (because if\n- // javascript is turned off then we want them to be\n- // visible); but by default, we want to hide them. So hide\n- // them unless we have a cookie that says to show them.\n- checkCookie();\n- // -->\n-</script>\n-</body>\n-</html>\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.Checker-pysrc.html --- a/commons/pyRepetUnit/doc/commons.Checker-pysrc.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,259 +0,0 @@\n-<?xml version="1.0" encoding="ascii"?>\n-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n- "DTD/xhtml1-transitional.dtd">\n-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n-<head>\n- <title>commons.Checker</title>\n- <link rel="stylesheet" href="epydoc.css" type="text/css" />\n- <script type="text/javascript" src="epydoc.js"></script>\n-</head>\n-\n-<body bgcolor="white" text="black" link="blue" vlink="#204080"\n- alink="#204080">\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table width="100%" cellpadding="0" cellspacing="0">\n- <tr valign="top">\n- <td width="100%">\n- <span class="breadcrumbs">\n- Package commons ::\n- Module Checker\n- </span>\n- </td>\n- <td>\n- <table cellpadding="0" cellspacing="0">\n- <!-- hide/show private -->\n- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"\n- onclick="toggle_private();">hide private</a>]</span></td></tr>\n- <tr><td align="right"><span class="options"\n- >[<a href="frames.html" target="_top">frames</a\n- >] | <a href="commons.Checker-pysrc.html"\n- target="_top">no frames</a>]</span></td></tr>\n- </table>\n- </td>\n- </tr>\n-</table>\n-<h1 class="epydoc">Source Code for <a href="commons.Checker-module.html">Module commons.Checker</a></h1>\n-<pre class="py-src">\n-<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-docstring">\'\'\'</tt> </tt>\n-<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-docstring">Created on 9 avr. 2009</tt> </tt>\n-<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>\n-<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-docstring">@author: oinizan</tt> </tt>\n-<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-docstring">\'\'\'</tt> </tt>\n-<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">config</tt> </tt>\n-<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">ConfigParser</tt> </tt>\n-<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">ConfigParser</tt> <tt class="py-keyword">import</tt> <tt class="py-name">NoSectionError</tt> </tt>\n-<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">ConfigParser</tt> <tt class="py-keyword">import</tt> <tt class="py-name">NoOptionError</tt> </tt>\n-<a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"> </tt>\n-<a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt id="link-0" class="py-name" targets="Variable commons.Checker.LOG_FILE=commons.Checker-module.html#LOG_FILE"><a title="commons.Checker.LOG_FILE" class="py-name" href="#" onclick="return doclink(\'link-0\', \'LOG_FILE\', \'link-0\');">LOG_FILE</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"/home/oinizan/workspace/repet_pipe/pyRepetUnit/blaster/check/longconf.ini"</tt> </tt>\n-<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="p'..b'ame">logging</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="commons.Checker.Checker.getLogger\n-commons.Checker._Logger.getLogger" class="py-name" href="#" onclick="return doclink(\'link-14\', \'getLogger\', \'link-5\');">getLogger</a></tt><tt class="py-op">(</tt><tt class="py-name">loggerName</tt><tt class="py-op">)</tt> </tt>\n-<a name="L138"></a><tt class="py-lineno">138</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>\n-<a name="L139"></a><tt class="py-lineno">139</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__log</tt> <tt class="py-op">=</tt> <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name"><a title="commons.Checker.Checker.getLogger\n-commons.Checker._Logger.getLogger" class="py-name" href="#" onclick="return doclink(\'link-15\', \'getLogger\', \'link-5\');">getLogger</a></tt><tt class="py-op">(</tt><tt id="link-16" class="py-name"><a title="commons.Checker.DEFAULT_LOGGER_NAME" class="py-name" href="#" onclick="return doclink(\'link-16\', \'DEFAULT_LOGGER_NAME\', \'link-1\');">DEFAULT_LOGGER_NAME</a></tt><tt class="py-op">)</tt> </tt>\n-<a name="L140"></a><tt class="py-lineno">140</tt> <tt class="py-line"> <tt id="link-17" class="py-name"><a title="commons.Checker._Logger" class="py-name" href="#" onclick="return doclink(\'link-17\', \'_Logger\', \'link-2\');">_Logger</a></tt><tt class="py-op">.</tt><tt class="py-name">__single</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt> </tt>\n-</div><a name="L141"></a><tt class="py-lineno">141</tt> <tt class="py-line"> </tt>\n-<a name="_Logger.getLogger"></a><div id="_Logger.getLogger-def"><a name="L142"></a><tt class="py-lineno">142</tt> <a class="py-toggle" href="#" id="_Logger.getLogger-toggle" onclick="return toggle(\'_Logger.getLogger\');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="commons.Checker._Logger-class.html#getLogger">getLogger</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>\n-</div><div id="_Logger.getLogger-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="_Logger.getLogger-expanded"><a name="L143"></a><tt class="py-lineno">143</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__log</tt> </tt>\n-</div></div><a name="L144"></a><tt class="py-lineno">144</tt> <tt class="py-line"> </tt><script type="text/javascript">\n-<!--\n-expandto(location.href);\n-// -->\n-</script>\n-</pre>\n-<br />\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table border="0" cellpadding="0" cellspacing="0" width="100%%">\n- <tr>\n- <td align="left" class="footer">\n- Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009\n- </td>\n- <td align="right" class="footer">\n- <a target="mainFrame" href="http://epydoc.sourceforge.net"\n- >http://epydoc.sourceforge.net</a>\n- </td>\n- </tr>\n-</table>\n-\n-<script type="text/javascript">\n- <!--\n- // Private objects are initially displayed (because if\n- // javascript is turned off then we want them to be\n- // visible); but by default, we want to hide them. So hide\n- // them unless we have a cookie that says to show them.\n- checkCookie();\n- // -->\n-</script>\n-</body>\n-</html>\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.Checker.Checker-class.html --- a/commons/pyRepetUnit/doc/commons.Checker.Checker-class.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,244 +0,0 @@\n-<?xml version="1.0" encoding="ascii"?>\n-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n- "DTD/xhtml1-transitional.dtd">\n-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n-<head>\n- <title>commons.Checker.Checker</title>\n- <link rel="stylesheet" href="epydoc.css" type="text/css" />\n- <script type="text/javascript" src="epydoc.js"></script>\n-</head>\n-\n-<body bgcolor="white" text="black" link="blue" vlink="#204080"\n- alink="#204080">\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table width="100%" cellpadding="0" cellspacing="0">\n- <tr valign="top">\n- <td width="100%">\n- <span class="breadcrumbs">\n- Package commons ::\n- <a href="commons.Checker-module.html">Module Checker</a> ::\n- Class Checker\n- </span>\n- </td>\n- <td>\n- <table cellpadding="0" cellspacing="0">\n- <!-- hide/show private -->\n- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"\n- onclick="toggle_private();">hide private</a>]</span></td></tr>\n- <tr><td align="right"><span class="options"\n- >[<a href="frames.html" target="_top">frames</a\n- >] | <a href="commons.Checker.Checker-class.html"\n- target="_top">no frames</a>]</span></td></tr>\n- </table>\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== CLASS DESCRIPTION ==================== -->\n-<h1 class="epydoc">Class Checker</h1><p class="nomargin-top"><span class="codelink"><a href="commons.Checker-pysrc.html#Checker">source code</a></span></p>\n-<pre class="base-tree">\n-<a href="commons.Checker.IChecker-class.html">IChecker</a> --+\n- |\n- <strong class="uidshort">Checker</strong>\n-</pre>\n-\n-<hr />\n-<p>A concrete checker implementation with a logging. Logger instance is a\n- singleton of logging module</p>\n-\n-<!-- ==================== INSTANCE METHODS ==================== -->\n-<a name="section-InstanceMethods"></a>\n-<table class="summary" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Instance Methods</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-InstanceMethods"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr>\n- <td><span class="summary-sig"><a name="__init__"></a><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>)</span></td>\n- <td align="right" valign="top">\n- <span class="codelink"><a href="commons.Checker-pysrc.html#Checker.__init__">source code</a></span>\n- \n- </td>\n- </tr>\n- </table>\n- \n- </td>\n- </tr>\n-<tr class="private">\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="s'..b'dth="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr>\n- <td><span class="summary-sig"><a href="commons.Checker.Checker-class.html#setLogger" class="summary-sig-name">setLogger</a>(<span class="summary-sig-arg">self</span>,\n- <span class="summary-sig-arg">logger</span>)</span><br />\n- set (change) default logger</td>\n- <td align="right" valign="top">\n- <span class="codelink"><a href="commons.Checker-pysrc.html#Checker.setLogger">source code</a></span>\n- \n- </td>\n- </tr>\n- </table>\n- \n- </td>\n- </tr>\n- <tr>\n- <td colspan="2" class="summary">\n- <p class="indent-wrapped-lines"><b>Inherited from <code><a href="commons.Checker.IChecker-class.html">IChecker</a></code></b>:\n- <code><a href="commons.Checker.IChecker-class.html#check">check</a></code>\n- </p>\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== METHOD DETAILS ==================== -->\n-<a name="section-MethodDetails"></a>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Method Details</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-MethodDetails"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-</table>\n-<a name="setLogger"></a>\n-<div>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr><td>\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr valign="top"><td>\n- <h3 class="epydoc"><span class="sig"><span class="sig-name">setLogger</span>(<span class="sig-arg">self</span>,\n- <span class="sig-arg">logger</span>)</span>\n- </h3>\n- </td><td align="right" valign="top"\n- ><span class="codelink"><a href="commons.Checker-pysrc.html#Checker.setLogger">source code</a></span> \n- </td>\n- </tr></table>\n- \n- <p>set (change) default logger</p>\n- <dl class="fields">\n- <dt>Parameters:</dt>\n- <dd><ul class="nomargin-top">\n- <li><strong class="pname"><code>logger</code></strong> (class Logger) - a new logger</li>\n- </ul></dd>\n- </dl>\n-</td></tr></table>\n-</div>\n-<br />\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table border="0" cellpadding="0" cellspacing="0" width="100%%">\n- <tr>\n- <td align="left" class="footer">\n- Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009\n- </td>\n- <td align="right" class="footer">\n- <a target="mainFrame" href="http://epydoc.sourceforge.net"\n- >http://epydoc.sourceforge.net</a>\n- </td>\n- </tr>\n-</table>\n-\n-<script type="text/javascript">\n- <!--\n- // Private objects are initially displayed (because if\n- // javascript is turned off then we want them to be\n- // visible); but by default, we want to hide them. So hide\n- // them unless we have a cookie that says to show them.\n- checkCookie();\n- // -->\n-</script>\n-</body>\n-</html>\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.Checker.CheckerException-class.html --- a/commons/pyRepetUnit/doc/commons.Checker.CheckerException-class.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,270 +0,0 @@\n-<?xml version="1.0" encoding="ascii"?>\n-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n- "DTD/xhtml1-transitional.dtd">\n-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n-<head>\n- <title>commons.Checker.CheckerException</title>\n- <link rel="stylesheet" href="epydoc.css" type="text/css" />\n- <script type="text/javascript" src="epydoc.js"></script>\n-</head>\n-\n-<body bgcolor="white" text="black" link="blue" vlink="#204080"\n- alink="#204080">\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table width="100%" cellpadding="0" cellspacing="0">\n- <tr valign="top">\n- <td width="100%">\n- <span class="breadcrumbs">\n- Package commons ::\n- <a href="commons.Checker-module.html">Module Checker</a> ::\n- Class CheckerException\n- </span>\n- </td>\n- <td>\n- <table cellpadding="0" cellspacing="0">\n- <!-- hide/show private -->\n- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"\n- onclick="toggle_private();">hide private</a>]</span></td></tr>\n- <tr><td align="right"><span class="options"\n- >[<a href="frames.html" target="_top">frames</a\n- >] | <a href="commons.Checker.CheckerException-class.html"\n- target="_top">no frames</a>]</span></td></tr>\n- </table>\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== CLASS DESCRIPTION ==================== -->\n-<h1 class="epydoc">Class CheckerException</h1><p class="nomargin-top"><span class="codelink"><a href="commons.Checker-pysrc.html#CheckerException">source code</a></span></p>\n-<pre class="base-tree">\n- object --+ \n- | \n-exceptions.BaseException --+ \n- | \n- exceptions.Exception --+\n- |\n- <strong class="uidshort">CheckerException</strong>\n-</pre>\n-\n-<hr />\n-<p>Exception raised during check.</p>\n-\n-<!-- ==================== INSTANCE METHODS ==================== -->\n-<a name="section-InstanceMethods"></a>\n-<table class="summary" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Instance Methods</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-InstanceMethods"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr>\n- <td><span class="summary-sig"><a href="commons.Checker.CheckerException-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,\n- <span class="summary-sig-arg">msg</span>=<span class="summary-sig-default"><code class="variable-quote">\'</code><code class="variable-string"></code><code class="variable-quote">\'</code></span>)</span><'..b'ite">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Properties</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-Properties"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n- <tr>\n- <td colspan="2" class="summary">\n- <p class="indent-wrapped-lines"><b>Inherited from <code>exceptions.BaseException</code></b>:\n- <code>args</code>,\n- <code>message</code>\n- </p>\n- <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:\n- <code>__class__</code>\n- </p>\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== METHOD DETAILS ==================== -->\n-<a name="section-MethodDetails"></a>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Method Details</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-MethodDetails"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-</table>\n-<a name="__init__"></a>\n-<div>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr><td>\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr valign="top"><td>\n- <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\n- <span class="sig-arg">msg</span>=<span class="sig-default"><code class="variable-quote">\'</code><code class="variable-string"></code><code class="variable-quote">\'</code></span>)</span>\n- <br /><em class="fname">(Constructor)</em>\n- </h3>\n- </td><td align="right" valign="top"\n- ><span class="codelink"><a href="commons.Checker-pysrc.html#CheckerException.__init__">source code</a></span> \n- </td>\n- </tr></table>\n- \n- <p>x.__init__(...) initializes x; see x.__class__.__doc__ for \n- signature</p>\n- <dl class="fields">\n- <dt>Overrides:\n- object.__init__\n- <dd><em class="note">(inherited documentation)</em></dd>\n- </dt>\n- </dl>\n-</td></tr></table>\n-</div>\n-<br />\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table border="0" cellpadding="0" cellspacing="0" width="100%%">\n- <tr>\n- <td align="left" class="footer">\n- Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009\n- </td>\n- <td align="right" class="footer">\n- <a target="mainFrame" href="http://epydoc.sourceforge.net"\n- >http://epydoc.sourceforge.net</a>\n- </td>\n- </tr>\n-</table>\n-\n-<script type="text/javascript">\n- <!--\n- // Private objects are initially displayed (because if\n- // javascript is turned off then we want them to be\n- // visible); but by default, we want to hide them. So hide\n- // them unless we have a cookie that says to show them.\n- checkCookie();\n- // -->\n-</script>\n-</body>\n-</html>\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.Checker.ConfigChecker-class.html --- a/commons/pyRepetUnit/doc/commons.Checker.ConfigChecker-class.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,244 +0,0 @@\n-<?xml version="1.0" encoding="ascii"?>\n-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n- "DTD/xhtml1-transitional.dtd">\n-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n-<head>\n- <title>commons.Checker.ConfigChecker</title>\n- <link rel="stylesheet" href="epydoc.css" type="text/css" />\n- <script type="text/javascript" src="epydoc.js"></script>\n-</head>\n-\n-<body bgcolor="white" text="black" link="blue" vlink="#204080"\n- alink="#204080">\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table width="100%" cellpadding="0" cellspacing="0">\n- <tr valign="top">\n- <td width="100%">\n- <span class="breadcrumbs">\n- Package commons ::\n- <a href="commons.Checker-module.html">Module Checker</a> ::\n- Class ConfigChecker\n- </span>\n- </td>\n- <td>\n- <table cellpadding="0" cellspacing="0">\n- <!-- hide/show private -->\n- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"\n- onclick="toggle_private();">hide private</a>]</span></td></tr>\n- <tr><td align="right"><span class="options"\n- >[<a href="frames.html" target="_top">frames</a\n- >] | <a href="commons.Checker.ConfigChecker-class.html"\n- target="_top">no frames</a>]</span></td></tr>\n- </table>\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== CLASS DESCRIPTION ==================== -->\n-<h1 class="epydoc">Class ConfigChecker</h1><p class="nomargin-top"><span class="codelink"><a href="commons.Checker-pysrc.html#ConfigChecker">source code</a></span></p>\n-<pre class="base-tree">\n-<a href="commons.Checker.IChecker-class.html">IChecker</a> --+\n- |\n- <strong class="uidshort">ConfigChecker</strong>\n-</pre>\n-\n-<hr />\n-<p>A checker for config file.</p>\n-\n-<!-- ==================== INSTANCE METHODS ==================== -->\n-<a name="section-InstanceMethods"></a>\n-<table class="summary" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Instance Methods</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-InstanceMethods"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr>\n- <td><span class="summary-sig"><a name="__init__"></a><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,\n- <span class="summary-sig-arg">sectionName</span>,\n- <span class="summary-sig-arg">optionsDict</span>)</span></td>\n- <td align="right" valign="top">\n- <span class="codelink"><a href="commons.Checker-pysrc.html#ConfigChecker.__init__">source code</a></span>\n- \n- </td>\n- </tr>\n- </table>\n- \n- </td>\n- </tr>\n-<tr>\n- <td width="1'..b'ction-InstanceVariables"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type">class Dict</span>\n- </td><td class="summary">\n- <a name="optionsDict"></a><span class="summary-name">optionsDict</span><br />\n- dict with option to check as keys and empty strings "" as \n- values\n- </td>\n- </tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type">str</span>\n- </td><td class="summary">\n- <a name="sectionName"></a><span class="summary-name">sectionName</span><br />\n- section to check in config file\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== METHOD DETAILS ==================== -->\n-<a name="section-MethodDetails"></a>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Method Details</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-MethodDetails"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-</table>\n-<a name="check"></a>\n-<div>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr><td>\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr valign="top"><td>\n- <h3 class="epydoc"><span class="sig"><span class="sig-name">check</span>(<span class="sig-arg">self</span>,\n- <span class="sig-arg">configFile</span>)</span>\n- </h3>\n- </td><td align="right" valign="top"\n- ><span class="codelink"><a href="commons.Checker-pysrc.html#ConfigChecker.check">source code</a></span> \n- </td>\n- </tr></table>\n- \n- <p>perform check, raise a CheckerException if error occured</p>\n- <dl class="fields">\n- <dt>Parameters:</dt>\n- <dd><ul class="nomargin-top">\n- <li><strong class="pname"><code>arg</code></strong> - a collecting parameter: put here all you need to perform check</li>\n- </ul></dd>\n- <dt>Overrides:\n- <a href="commons.Checker.IChecker-class.html#check">IChecker.check</a>\n- <dd><em class="note">(inherited documentation)</em></dd>\n- </dt>\n- </dl>\n-</td></tr></table>\n-</div>\n-<br />\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table border="0" cellpadding="0" cellspacing="0" width="100%%">\n- <tr>\n- <td align="left" class="footer">\n- Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009\n- </td>\n- <td align="right" class="footer">\n- <a target="mainFrame" href="http://epydoc.sourceforge.net"\n- >http://epydoc.sourceforge.net</a>\n- </td>\n- </tr>\n-</table>\n-\n-<script type="text/javascript">\n- <!--\n- // Private objects are initially displayed (because if\n- // javascript is turned off then we want them to be\n- // visible); but by default, we want to hide them. So hide\n- // them unless we have a cookie that says to show them.\n- checkCookie();\n- // -->\n-</script>\n-</body>\n-</html>\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.Checker.ConfigException-class.html --- a/commons/pyRepetUnit/doc/commons.Checker.ConfigException-class.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,280 +0,0 @@\n-<?xml version="1.0" encoding="ascii"?>\n-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n- "DTD/xhtml1-transitional.dtd">\n-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n-<head>\n- <title>commons.Checker.ConfigException</title>\n- <link rel="stylesheet" href="epydoc.css" type="text/css" />\n- <script type="text/javascript" src="epydoc.js"></script>\n-</head>\n-\n-<body bgcolor="white" text="black" link="blue" vlink="#204080"\n- alink="#204080">\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table width="100%" cellpadding="0" cellspacing="0">\n- <tr valign="top">\n- <td width="100%">\n- <span class="breadcrumbs">\n- Package commons ::\n- <a href="commons.Checker-module.html">Module Checker</a> ::\n- Class ConfigException\n- </span>\n- </td>\n- <td>\n- <table cellpadding="0" cellspacing="0">\n- <!-- hide/show private -->\n- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"\n- onclick="toggle_private();">hide private</a>]</span></td></tr>\n- <tr><td align="right"><span class="options"\n- >[<a href="frames.html" target="_top">frames</a\n- >] | <a href="commons.Checker.ConfigException-class.html"\n- target="_top">no frames</a>]</span></td></tr>\n- </table>\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== CLASS DESCRIPTION ==================== -->\n-<h1 class="epydoc">Class ConfigException</h1><p class="nomargin-top"><span class="codelink"><a href="commons.Checker-pysrc.html#ConfigException">source code</a></span></p>\n-<pre class="base-tree">\n- object --+ \n- | \n-exceptions.BaseException --+ \n- | \n- exceptions.Exception --+\n- |\n- <strong class="uidshort">ConfigException</strong>\n-</pre>\n-\n-<hr />\n-<p>A exception raised by check method class ConfigChecker</p>\n-\n-<!-- ==================== INSTANCE METHODS ==================== -->\n-<a name="section-InstanceMethods"></a>\n-<table class="summary" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Instance Methods</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-InstanceMethods"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr>\n- <td><span class="summary-sig"><a href="commons.Checker.ConfigException-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,\n- <span class="summary-sig-arg">msg</span>,\n- <span class="summary-sig-arg">messages</span>=<span class="summary-sig-default"><code class="variable-group">[</code><code class="vari'..b' bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Properties</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-Properties"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n- <tr>\n- <td colspan="2" class="summary">\n- <p class="indent-wrapped-lines"><b>Inherited from <code>exceptions.BaseException</code></b>:\n- <code>args</code>,\n- <code>message</code>\n- </p>\n- <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:\n- <code>__class__</code>\n- </p>\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== METHOD DETAILS ==================== -->\n-<a name="section-MethodDetails"></a>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Method Details</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-MethodDetails"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-</table>\n-<a name="__init__"></a>\n-<div>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr><td>\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr valign="top"><td>\n- <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\n- <span class="sig-arg">msg</span>,\n- <span class="sig-arg">messages</span>=<span class="sig-default"><code class="variable-group">[</code><code class="variable-group">]</code></span>)</span>\n- <br /><em class="fname">(Constructor)</em>\n- </h3>\n- </td><td align="right" valign="top"\n- ><span class="codelink"><a href="commons.Checker-pysrc.html#ConfigException.__init__">source code</a></span> \n- </td>\n- </tr></table>\n- \n- <p>x.__init__(...) initializes x; see x.__class__.__doc__ for \n- signature</p>\n- <dl class="fields">\n- <dt>Overrides:\n- object.__init__\n- <dd><em class="note">(inherited documentation)</em></dd>\n- </dt>\n- </dl>\n-</td></tr></table>\n-</div>\n-<br />\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table border="0" cellpadding="0" cellspacing="0" width="100%%">\n- <tr>\n- <td align="left" class="footer">\n- Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009\n- </td>\n- <td align="right" class="footer">\n- <a target="mainFrame" href="http://epydoc.sourceforge.net"\n- >http://epydoc.sourceforge.net</a>\n- </td>\n- </tr>\n-</table>\n-\n-<script type="text/javascript">\n- <!--\n- // Private objects are initially displayed (because if\n- // javascript is turned off then we want them to be\n- // visible); but by default, we want to hide them. So hide\n- // them unless we have a cookie that says to show them.\n- checkCookie();\n- // -->\n-</script>\n-</body>\n-</html>\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.Checker.IChecker-class.html --- a/commons/pyRepetUnit/doc/commons.Checker.IChecker-class.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,187 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>commons.Checker.IChecker</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table width="100%" cellpadding="0" cellspacing="0"> - <tr valign="top"> - <td width="100%"> - <span class="breadcrumbs"> - Package commons :: - <a href="commons.Checker-module.html">Module Checker</a> :: - Class IChecker - </span> - </td> - <td> - <table cellpadding="0" cellspacing="0"> - <!-- hide/show private --> - <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span></td></tr> - <tr><td align="right"><span class="options" - >[<a href="frames.html" target="_top">frames</a - >] | <a href="commons.Checker.IChecker-class.html" - target="_top">no frames</a>]</span></td></tr> - </table> - </td> - </tr> -</table> -<!-- ==================== CLASS DESCRIPTION ==================== --> -<h1 class="epydoc">Class IChecker</h1><p class="nomargin-top"><span class="codelink"><a href="commons.Checker-pysrc.html#IChecker">source code</a></span></p> -<dl><dt>Known Subclasses:</dt> -<dd> - <ul class="subclass-list"> -<li><a href="commons.Checker.Checker-class.html">Checker</a></li><li>, <a href="commons.Checker.ConfigChecker-class.html">ConfigChecker</a></li> </ul> -</dd></dl> - -<hr /> -<p>Interface emulation for a checker</p> - -<!-- ==================== INSTANCE METHODS ==================== --> -<a name="section-InstanceMethods"></a> -<table class="summary" border="1" cellpadding="3" - cellspacing="0" width="100%" bgcolor="white"> -<tr bgcolor="#70b0f0" class="table-header"> - <td colspan="2" class="table-header"> - <table border="0" cellpadding="0" cellspacing="0" width="100%"> - <tr valign="top"> - <td align="left"><span class="table-header">Instance Methods</span></td> - <td align="right" valign="top" - ><span class="options">[<a href="#section-InstanceMethods" - class="privatelink" onclick="toggle_private();" - >hide private</a>]</span></td> - </tr> - </table> - </td> -</tr> -<tr> - <td width="15%" align="right" valign="top" class="summary"> - <span class="summary-type"> </span> - </td><td class="summary"> - <table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr> - <td><span class="summary-sig"><a href="commons.Checker.IChecker-class.html#check" class="summary-sig-name">check</a>(<span class="summary-sig-arg">self</span>, - <span class="summary-sig-arg">arg</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span><br /> - perform check, raise a CheckerException if error occured</td> - <td align="right" valign="top"> - <span class="codelink"><a href="commons.Checker-pysrc.html#IChecker.check">source code</a></span> - - </td> - </tr> - </table> - - </td> - </tr> -</table> -<!-- ==================== METHOD DETAILS ==================== --> -<a name="section-MethodDetails"></a> -<table class="details" border="1" cellpadding="3" - cellspacing="0" width="100%" bgcolor="white"> -<tr bgcolor="#70b0f0" class="table-header"> - <td colspan="2" class="table-header"> - <table border="0" cellpadding="0" cellspacing="0" width="100%"> - <tr valign="top"> - <td align="left"><span class="table-header">Method Details</span></td> - <td align="right" valign="top" - ><span class="options">[<a href="#section-MethodDetails" - class="privatelink" onclick="toggle_private();" - >hide private</a>]</span></td> - </tr> - </table> - </td> -</tr> -</table> -<a name="check"></a> -<div> -<table class="details" border="1" cellpadding="3" - cellspacing="0" width="100%" bgcolor="white"> -<tr><td> - <table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr valign="top"><td> - <h3 class="epydoc"><span class="sig"><span class="sig-name">check</span>(<span class="sig-arg">self</span>, - <span class="sig-arg">arg</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span> - </h3> - </td><td align="right" valign="top" - ><span class="codelink"><a href="commons.Checker-pysrc.html#IChecker.check">source code</a></span> - </td> - </tr></table> - - <p>perform check, raise a CheckerException if error occured</p> - <dl class="fields"> - <dt>Parameters:</dt> - <dd><ul class="nomargin-top"> - <li><strong class="pname"><code>arg</code></strong> (choose the appropriate type) - a collecting parameter: put here all you need to perform check</li> - </ul></dd> - </dl> -</td></tr></table> -</div> -<br /> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table border="0" cellpadding="0" cellspacing="0" width="100%%"> - <tr> - <td align="left" class="footer"> - Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009 - </td> - <td align="right" class="footer"> - <a target="mainFrame" href="http://epydoc.sourceforge.net" - >http://epydoc.sourceforge.net</a> - </td> - </tr> -</table> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.Checker._Logger-class.html --- a/commons/pyRepetUnit/doc/commons.Checker._Logger-class.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,175 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>commons.Checker._Logger</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table width="100%" cellpadding="0" cellspacing="0"> - <tr valign="top"> - <td width="100%"> - <span class="breadcrumbs"> - Package commons :: - <a href="commons.Checker-module.html">Module Checker</a> :: - Class _Logger - </span> - </td> - <td> - <table cellpadding="0" cellspacing="0"> - <!-- hide/show private --> - <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span></td></tr> - <tr><td align="right"><span class="options" - >[<a href="frames.html" target="_top">frames</a - >] | <a href="commons.Checker._Logger-class.html" - target="_top">no frames</a>]</span></td></tr> - </table> - </td> - </tr> -</table> -<!-- ==================== CLASS DESCRIPTION ==================== --> -<h1 class="epydoc">Class _Logger</h1><p class="nomargin-top"><span class="codelink"><a href="commons.Checker-pysrc.html#_Logger">source code</a></span></p> -<!-- ==================== INSTANCE METHODS ==================== --> -<a name="section-InstanceMethods"></a> -<table class="summary" border="1" cellpadding="3" - cellspacing="0" width="100%" bgcolor="white"> -<tr bgcolor="#70b0f0" class="table-header"> - <td colspan="2" class="table-header"> - <table border="0" cellpadding="0" cellspacing="0" width="100%"> - <tr valign="top"> - <td align="left"><span class="table-header">Instance Methods</span></td> - <td align="right" valign="top" - ><span class="options">[<a href="#section-InstanceMethods" - class="privatelink" onclick="toggle_private();" - >hide private</a>]</span></td> - </tr> - </table> - </td> -</tr> -<tr> - <td width="15%" align="right" valign="top" class="summary"> - <span class="summary-type"> </span> - </td><td class="summary"> - <table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr> - <td><span class="summary-sig"><a name="__init__"></a><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>, - <span class="summary-sig-arg">loggerName</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span></td> - <td align="right" valign="top"> - <span class="codelink"><a href="commons.Checker-pysrc.html#_Logger.__init__">source code</a></span> - - </td> - </tr> - </table> - - </td> - </tr> -<tr> - <td width="15%" align="right" valign="top" class="summary"> - <span class="summary-type"> </span> - </td><td class="summary"> - <table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr> - <td><span class="summary-sig"><a name="getLogger"></a><span class="summary-sig-name">getLogger</span>(<span class="summary-sig-arg">self</span>)</span></td> - <td align="right" valign="top"> - <span class="codelink"><a href="commons.Checker-pysrc.html#_Logger.getLogger">source code</a></span> - - </td> - </tr> - </table> - - </td> - </tr> -</table> -<!-- ==================== CLASS VARIABLES ==================== --> -<a name="section-ClassVariables"></a> -<table class="summary" border="1" cellpadding="3" - cellspacing="0" width="100%" bgcolor="white"> -<tr bgcolor="#70b0f0" class="table-header"> - <td colspan="2" class="table-header"> - <table border="0" cellpadding="0" cellspacing="0" width="100%"> - <tr valign="top"> - <td align="left"><span class="table-header">Class Variables</span></td> - <td align="right" valign="top" - ><span class="options">[<a href="#section-ClassVariables" - class="privatelink" onclick="toggle_private();" - >hide private</a>]</span></td> - </tr> - </table> - </td> -</tr> -<tr class="private"> - <td width="15%" align="right" valign="top" class="summary"> - <span class="summary-type"> </span> - </td><td class="summary"> - <a name="_Logger__single"></a><span class="summary-name">_Logger__single</span> = <code title="None">None</code> - </td> - </tr> -</table> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table border="0" cellpadding="0" cellspacing="0" width="100%%"> - <tr> - <td align="left" class="footer"> - Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009 - </td> - <td align="right" class="footer"> - <a target="mainFrame" href="http://epydoc.sourceforge.net" - >http://epydoc.sourceforge.net</a> - </td> - </tr> -</table> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.IComponentWrapper-module.html --- a/commons/pyRepetUnit/doc/commons.IComponentWrapper-module.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,124 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>commons.IComponentWrapper</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table width="100%" cellpadding="0" cellspacing="0"> - <tr valign="top"> - <td width="100%"> - <span class="breadcrumbs"> - Package commons :: - Module IComponentWrapper - </span> - </td> - <td> - <table cellpadding="0" cellspacing="0"> - <!-- hide/show private --> - <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span></td></tr> - <tr><td align="right"><span class="options" - >[<a href="frames.html" target="_top">frames</a - >] | <a href="commons.IComponentWrapper-module.html" - target="_top">no frames</a>]</span></td></tr> - </table> - </td> - </tr> -</table> -<!-- ==================== MODULE DESCRIPTION ==================== --> -<h1 class="epydoc">Module IComponentWrapper</h1><p class="nomargin-top"><span class="codelink"><a href="commons.IComponentWrapper-pysrc.html">source code</a></span></p> -<!-- ==================== CLASSES ==================== --> -<a name="section-Classes"></a> -<table class="summary" border="1" cellpadding="3" - cellspacing="0" width="100%" bgcolor="white"> -<tr bgcolor="#70b0f0" class="table-header"> - <td colspan="2" class="table-header"> - <table border="0" cellpadding="0" cellspacing="0" width="100%"> - <tr valign="top"> - <td align="left"><span class="table-header">Classes</span></td> - <td align="right" valign="top" - ><span class="options">[<a href="#section-Classes" - class="privatelink" onclick="toggle_private();" - >hide private</a>]</span></td> - </tr> - </table> - </td> -</tr> -<tr> - <td width="15%" align="right" valign="top" class="summary"> - <span class="summary-type"> </span> - </td><td class="summary"> - <a href="commons.IComponentWrapper.IComponentWrapper-class.html" class="summary-name">IComponentWrapper</a><br /> - A interface wrapper for all pipelines component - </td> - </tr> -</table> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table border="0" cellpadding="0" cellspacing="0" width="100%%"> - <tr> - <td align="left" class="footer"> - Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009 - </td> - <td align="right" class="footer"> - <a target="mainFrame" href="http://epydoc.sourceforge.net" - >http://epydoc.sourceforge.net</a> - </td> - </tr> -</table> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.IComponentWrapper-pysrc.html --- a/commons/pyRepetUnit/doc/commons.IComponentWrapper-pysrc.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,136 +0,0 @@\n-<?xml version="1.0" encoding="ascii"?>\n-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n- "DTD/xhtml1-transitional.dtd">\n-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n-<head>\n- <title>commons.IComponentWrapper</title>\n- <link rel="stylesheet" href="epydoc.css" type="text/css" />\n- <script type="text/javascript" src="epydoc.js"></script>\n-</head>\n-\n-<body bgcolor="white" text="black" link="blue" vlink="#204080"\n- alink="#204080">\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table width="100%" cellpadding="0" cellspacing="0">\n- <tr valign="top">\n- <td width="100%">\n- <span class="breadcrumbs">\n- Package commons ::\n- Module IComponentWrapper\n- </span>\n- </td>\n- <td>\n- <table cellpadding="0" cellspacing="0">\n- <!-- hide/show private -->\n- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"\n- onclick="toggle_private();">hide private</a>]</span></td></tr>\n- <tr><td align="right"><span class="options"\n- >[<a href="frames.html" target="_top">frames</a\n- >] | <a href="commons.IComponentWrapper-pysrc.html"\n- target="_top">no frames</a>]</span></td></tr>\n- </table>\n- </td>\n- </tr>\n-</table>\n-<h1 class="epydoc">Source Code for <a href="commons.IComponentWrapper-module.html">Module commons.IComponentWrapper</a></h1>\n-<pre class="py-src">\n-<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"> </tt>\n-<a name="IComponentWrapper"></a><div id="IComponentWrapper-def"><a name="L2"></a><tt class="py-lineno"> 2</tt> <a class="py-toggle" href="#" id="IComponentWrapper-toggle" onclick="return toggle(\'IComponentWrapper\');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="commons.IComponentWrapper.IComponentWrapper-class.html">IComponentWrapper</a><tt class="py-op">:</tt> </tt>\n-</div><div id="IComponentWrapper-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="IComponentWrapper-expanded"><a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>\n-<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-docstring"> A interface wrapper for all pipelines component</tt> </tt>\n-<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>\n-<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"> </tt>\n-<a name="IComponentWrapper.run"></a><div id="IComponentWrapper.run-def"><a name="L7"></a><tt class="py-lineno"> 7</tt> <a class="py-toggle" href="#" id="IComponentWrapper.run-toggle" onclick="return toggle(\'IComponentWrapper.run\');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="commons.IComponentWrapper.IComponentWrapper-class.html#run">run</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>\n-</div><div id="IComponentWrapper.run-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="IComponentWrapper.run-expanded"><a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>\n-<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line">'..b'ss="py-line"> <tt class="py-keyword">pass</tt> </tt>\n-</div><a name="L21"></a><tt class="py-lineno">21</tt> <tt class="py-line"> </tt>\n-<a name="IComponentWrapper.clean"></a><div id="IComponentWrapper.clean-def"><a name="L22"></a><tt class="py-lineno">22</tt> <a class="py-toggle" href="#" id="IComponentWrapper.clean-toggle" onclick="return toggle(\'IComponentWrapper.clean\');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="commons.IComponentWrapper.IComponentWrapper-class.html#clean">clean</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>\n-</div><div id="IComponentWrapper.clean-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="IComponentWrapper.clean-expanded"><a name="L23"></a><tt class="py-lineno">23</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>\n-<a name="L24"></a><tt class="py-lineno">24</tt> <tt class="py-line"><tt class="py-docstring"> clean files generated by run method</tt> </tt>\n-<a name="L25"></a><tt class="py-lineno">25</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>\n-<a name="L26"></a><tt class="py-lineno">26</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>\n-</div><a name="L27"></a><tt class="py-lineno">27</tt> <tt class="py-line"> </tt>\n-<a name="IComponentWrapper.getComponent"></a><div id="IComponentWrapper.getComponent-def"><a name="L28"></a><tt class="py-lineno">28</tt> <a class="py-toggle" href="#" id="IComponentWrapper.getComponent-toggle" onclick="return toggle(\'IComponentWrapper.getComponent\');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="commons.IComponentWrapper.IComponentWrapper-class.html#getComponent">getComponent</a> <tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>\n-</div><div id="IComponentWrapper.getComponent-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="IComponentWrapper.getComponent-expanded"><a name="L29"></a><tt class="py-lineno">29</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>\n-<a name="L30"></a><tt class="py-lineno">30</tt> <tt class="py-line"><tt class="py-docstring"> return component wrapped</tt> </tt>\n-<a name="L31"></a><tt class="py-lineno">31</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>\n-</div></div><a name="L32"></a><tt class="py-lineno">32</tt> <tt class="py-line"> </tt><script type="text/javascript">\n-<!--\n-expandto(location.href);\n-// -->\n-</script>\n-</pre>\n-<br />\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table border="0" cellpadding="0" cellspacing="0" width="100%%">\n- <tr>\n- <td align="left" class="footer">\n- Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009\n- </td>\n- <td align="right" class="footer">\n- <a target="mainFrame" href="http://epydoc.sourceforge.net"\n- >http://epydoc.sourceforge.net</a>\n- </td>\n- </tr>\n-</table>\n-\n-<script type="text/javascript">\n- <!--\n- // Private objects are initially displayed (because if\n- // javascript is turned off then we want them to be\n- // visible); but by default, we want to hide them. So hide\n- // them unless we have a cookie that says to show them.\n- checkCookie();\n- // -->\n-</script>\n-</body>\n-</html>\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.IComponentWrapper.IComponentWrapper-class.html --- a/commons/pyRepetUnit/doc/commons.IComponentWrapper.IComponentWrapper-class.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,231 +0,0 @@\n-<?xml version="1.0" encoding="ascii"?>\n-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n- "DTD/xhtml1-transitional.dtd">\n-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n-<head>\n- <title>commons.IComponentWrapper.IComponentWrapper</title>\n- <link rel="stylesheet" href="epydoc.css" type="text/css" />\n- <script type="text/javascript" src="epydoc.js"></script>\n-</head>\n-\n-<body bgcolor="white" text="black" link="blue" vlink="#204080"\n- alink="#204080">\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table width="100%" cellpadding="0" cellspacing="0">\n- <tr valign="top">\n- <td width="100%">\n- <span class="breadcrumbs">\n- Package commons ::\n- <a href="commons.IComponentWrapper-module.html">Module IComponentWrapper</a> ::\n- Class IComponentWrapper\n- </span>\n- </td>\n- <td>\n- <table cellpadding="0" cellspacing="0">\n- <!-- hide/show private -->\n- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"\n- onclick="toggle_private();">hide private</a>]</span></td></tr>\n- <tr><td align="right"><span class="options"\n- >[<a href="frames.html" target="_top">frames</a\n- >] | <a href="commons.IComponentWrapper.IComponentWrapper-class.html"\n- target="_top">no frames</a>]</span></td></tr>\n- </table>\n- </td>\n- </tr>\n-</table>\n-<!-- ==================== CLASS DESCRIPTION ==================== -->\n-<h1 class="epydoc">Class IComponentWrapper</h1><p class="nomargin-top"><span class="codelink"><a href="commons.IComponentWrapper-pysrc.html#IComponentWrapper">source code</a></span></p>\n-<p>A interface wrapper for all pipelines component</p>\n-\n-<!-- ==================== INSTANCE METHODS ==================== -->\n-<a name="section-InstanceMethods"></a>\n-<table class="summary" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Instance Methods</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-InstanceMethods"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr>\n- <td><span class="summary-sig"><a name="clean"></a><span class="summary-sig-name">clean</span>(<span class="summary-sig-arg">self</span>)</span><br />\n- clean files generated by run method</td>\n- <td align="right" valign="top">\n- <span class="codelink"><a href="commons.IComponentWrapper-pysrc.html#IComponentWrapper.clean">source code</a></span>\n- \n- </td>\n- </tr>\n- </table>\n- \n- </td>\n- </tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <table width="100%"'..b'</td>\n- <td align="right" valign="top">\n- <span class="codelink"><a href="commons.IComponentWrapper-pysrc.html#IComponentWrapper.loadConfig">source code</a></span>\n- \n- </td>\n- </tr>\n- </table>\n- \n- </td>\n- </tr>\n-<tr>\n- <td width="15%" align="right" valign="top" class="summary">\n- <span class="summary-type"> </span>\n- </td><td class="summary">\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr>\n- <td><span class="summary-sig"><a name="run"></a><span class="summary-sig-name">run</span>(<span class="summary-sig-arg">self</span>)</span><br />\n- run the component</td>\n- <td align="right" valign="top">\n- <span class="codelink"><a href="commons.IComponentWrapper-pysrc.html#IComponentWrapper.run">source code</a></span>\n- \n- </td>\n- </tr>\n- </table>\n- \n- </td>\n- </tr>\n-</table>\n-<!-- ==================== METHOD DETAILS ==================== -->\n-<a name="section-MethodDetails"></a>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr bgcolor="#70b0f0" class="table-header">\n- <td colspan="2" class="table-header">\n- <table border="0" cellpadding="0" cellspacing="0" width="100%">\n- <tr valign="top">\n- <td align="left"><span class="table-header">Method Details</span></td>\n- <td align="right" valign="top"\n- ><span class="options">[<a href="#section-MethodDetails"\n- class="privatelink" onclick="toggle_private();"\n- >hide private</a>]</span></td>\n- </tr>\n- </table>\n- </td>\n-</tr>\n-</table>\n-<a name="loadConfig"></a>\n-<div>\n-<table class="details" border="1" cellpadding="3"\n- cellspacing="0" width="100%" bgcolor="white">\n-<tr><td>\n- <table width="100%" cellpadding="0" cellspacing="0" border="0">\n- <tr valign="top"><td>\n- <h3 class="epydoc"><span class="sig"><span class="sig-name">loadConfig</span>(<span class="sig-arg">self</span>,\n- <span class="sig-arg">configParserInstance</span>)</span>\n- </h3>\n- </td><td align="right" valign="top"\n- ><span class="codelink"><a href="commons.IComponentWrapper-pysrc.html#IComponentWrapper.loadConfig">source code</a></span> \n- </td>\n- </tr></table>\n- \n- <p>load component config</p>\n- <dl class="fields">\n- <dt>Parameters:</dt>\n- <dd><ul class="nomargin-top">\n- <li><strong class="pname"><code>configParserInstance</code></strong> (class ConfigParser) - config parser where config file is loaded</li>\n- </ul></dd>\n- </dl>\n-</td></tr></table>\n-</div>\n-<br />\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table border="0" cellpadding="0" cellspacing="0" width="100%%">\n- <tr>\n- <td align="left" class="footer">\n- Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009\n- </td>\n- <td align="right" class="footer">\n- <a target="mainFrame" href="http://epydoc.sourceforge.net"\n- >http://epydoc.sourceforge.net</a>\n- </td>\n- </tr>\n-</table>\n-\n-<script type="text/javascript">\n- <!--\n- // Private objects are initially displayed (because if\n- // javascript is turned off then we want them to be\n- // visible); but by default, we want to hide them. So hide\n- // them unless we have a cookie that says to show them.\n- checkCookie();\n- // -->\n-</script>\n-</body>\n-</html>\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.IDataProcessor-module.html --- a/commons/pyRepetUnit/doc/commons.IDataProcessor-module.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,124 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>commons.IDataProcessor</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table width="100%" cellpadding="0" cellspacing="0"> - <tr valign="top"> - <td width="100%"> - <span class="breadcrumbs"> - Package commons :: - Module IDataProcessor - </span> - </td> - <td> - <table cellpadding="0" cellspacing="0"> - <!-- hide/show private --> - <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span></td></tr> - <tr><td align="right"><span class="options" - >[<a href="frames.html" target="_top">frames</a - >] | <a href="commons.IDataProcessor-module.html" - target="_top">no frames</a>]</span></td></tr> - </table> - </td> - </tr> -</table> -<!-- ==================== MODULE DESCRIPTION ==================== --> -<h1 class="epydoc">Module IDataProcessor</h1><p class="nomargin-top"><span class="codelink"><a href="commons.IDataProcessor-pysrc.html">source code</a></span></p> -<!-- ==================== CLASSES ==================== --> -<a name="section-Classes"></a> -<table class="summary" border="1" cellpadding="3" - cellspacing="0" width="100%" bgcolor="white"> -<tr bgcolor="#70b0f0" class="table-header"> - <td colspan="2" class="table-header"> - <table border="0" cellpadding="0" cellspacing="0" width="100%"> - <tr valign="top"> - <td align="left"><span class="table-header">Classes</span></td> - <td align="right" valign="top" - ><span class="options">[<a href="#section-Classes" - class="privatelink" onclick="toggle_private();" - >hide private</a>]</span></td> - </tr> - </table> - </td> -</tr> -<tr> - <td width="15%" align="right" valign="top" class="summary"> - <span class="summary-type"> </span> - </td><td class="summary"> - <a href="commons.IDataProcessor.IDataProcessor-class.html" class="summary-name">IDataProcessor</a><br /> - A interface for all pipelines data processor - </td> - </tr> -</table> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table border="0" cellpadding="0" cellspacing="0" width="100%%"> - <tr> - <td align="left" class="footer"> - Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009 - </td> - <td align="right" class="footer"> - <a target="mainFrame" href="http://epydoc.sourceforge.net" - >http://epydoc.sourceforge.net</a> - </td> - </tr> -</table> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.IDataProcessor-pysrc.html --- a/commons/pyRepetUnit/doc/commons.IDataProcessor-pysrc.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,114 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>commons.IDataProcessor</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table width="100%" cellpadding="0" cellspacing="0"> - <tr valign="top"> - <td width="100%"> - <span class="breadcrumbs"> - Package commons :: - Module IDataProcessor - </span> - </td> - <td> - <table cellpadding="0" cellspacing="0"> - <!-- hide/show private --> - <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span></td></tr> - <tr><td align="right"><span class="options" - >[<a href="frames.html" target="_top">frames</a - >] | <a href="commons.IDataProcessor-pysrc.html" - target="_top">no frames</a>]</span></td></tr> - </table> - </td> - </tr> -</table> -<h1 class="epydoc">Source Code for <a href="commons.IDataProcessor-module.html">Module commons.IDataProcessor</a></h1> -<pre class="py-src"> -<a name="IDataProcessor"></a><div id="IDataProcessor-def"><a name="L1"></a><tt class="py-lineno"> 1</tt> <a class="py-toggle" href="#" id="IDataProcessor-toggle" onclick="return toggle('IDataProcessor');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="commons.IDataProcessor.IDataProcessor-class.html">IDataProcessor</a><tt class="py-op">:</tt> </tt> -</div><div id="IDataProcessor-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="IDataProcessor-expanded"><a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt> -<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-docstring"> A interface for all pipelines data processor</tt> </tt> -<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt> -<a name="IDataProcessor.run"></a><div id="IDataProcessor.run-def"><a name="L5"></a><tt class="py-lineno"> 5</tt> <a class="py-toggle" href="#" id="IDataProcessor.run-toggle" onclick="return toggle('IDataProcessor.run');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="commons.IDataProcessor.IDataProcessor-class.html#run">run</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> -</div><div id="IDataProcessor.run-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="IDataProcessor.run-expanded"><a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt> -<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-docstring"> run: process the data</tt> </tt> -<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt> -<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt> -</div></div><a name="L10"></a><tt class="py-lineno">10</tt> <tt class="py-line"> </tt><script type="text/javascript"> -<!-- -expandto(location.href); -// --> -</script> -</pre> -<br /> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table border="0" cellpadding="0" cellspacing="0" width="100%%"> - <tr> - <td align="left" class="footer"> - Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009 - </td> - <td align="right" class="footer"> - <a target="mainFrame" href="http://epydoc.sourceforge.net" - >http://epydoc.sourceforge.net</a> - </td> - </tr> -</table> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/commons.IDataProcessor.IDataProcessor-class.html --- a/commons/pyRepetUnit/doc/commons.IDataProcessor.IDataProcessor-class.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,136 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>commons.IDataProcessor.IDataProcessor</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table width="100%" cellpadding="0" cellspacing="0"> - <tr valign="top"> - <td width="100%"> - <span class="breadcrumbs"> - Package commons :: - <a href="commons.IDataProcessor-module.html">Module IDataProcessor</a> :: - Class IDataProcessor - </span> - </td> - <td> - <table cellpadding="0" cellspacing="0"> - <!-- hide/show private --> - <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span></td></tr> - <tr><td align="right"><span class="options" - >[<a href="frames.html" target="_top">frames</a - >] | <a href="commons.IDataProcessor.IDataProcessor-class.html" - target="_top">no frames</a>]</span></td></tr> - </table> - </td> - </tr> -</table> -<!-- ==================== CLASS DESCRIPTION ==================== --> -<h1 class="epydoc">Class IDataProcessor</h1><p class="nomargin-top"><span class="codelink"><a href="commons.IDataProcessor-pysrc.html#IDataProcessor">source code</a></span></p> -<p>A interface for all pipelines data processor</p> - -<!-- ==================== INSTANCE METHODS ==================== --> -<a name="section-InstanceMethods"></a> -<table class="summary" border="1" cellpadding="3" - cellspacing="0" width="100%" bgcolor="white"> -<tr bgcolor="#70b0f0" class="table-header"> - <td colspan="2" class="table-header"> - <table border="0" cellpadding="0" cellspacing="0" width="100%"> - <tr valign="top"> - <td align="left"><span class="table-header">Instance Methods</span></td> - <td align="right" valign="top" - ><span class="options">[<a href="#section-InstanceMethods" - class="privatelink" onclick="toggle_private();" - >hide private</a>]</span></td> - </tr> - </table> - </td> -</tr> -<tr> - <td width="15%" align="right" valign="top" class="summary"> - <span class="summary-type"> </span> - </td><td class="summary"> - <table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr> - <td><span class="summary-sig"><a name="run"></a><span class="summary-sig-name">run</span>(<span class="summary-sig-arg">self</span>)</span><br /> - run: process the data</td> - <td align="right" valign="top"> - <span class="codelink"><a href="commons.IDataProcessor-pysrc.html#IDataProcessor.run">source code</a></span> - - </td> - </tr> - </table> - - </td> - </tr> -</table> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th> <a - href="module-tree.html">Trees</a> </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table border="0" cellpadding="0" cellspacing="0" width="100%%"> - <tr> - <td align="left" class="footer"> - Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009 - </td> - <td align="right" class="footer"> - <a target="mainFrame" href="http://epydoc.sourceforge.net" - >http://epydoc.sourceforge.net</a> - </td> - </tr> -</table> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/crarr.png |
b |
Binary file commons/pyRepetUnit/doc/crarr.png has changed |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/epydoc.css --- a/commons/pyRepetUnit/doc/epydoc.css Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b"@@ -1,322 +0,0 @@\n-\n-\n-/* Epydoc CSS Stylesheet\n- *\n- * This stylesheet can be used to customize the appearance of epydoc's\n- * HTML output.\n- *\n- */\n-\n-/* Default Colors & Styles\n- * - Set the default foreground & background color with 'body'; and \n- * link colors with 'a:link' and 'a:visited'.\n- * - Use bold for decision list terms.\n- * - The heading styles defined here are used for headings *within*\n- * docstring descriptions. All headings used by epydoc itself use\n- * either class='epydoc' or class='toc' (CSS styles for both\n- * defined below).\n- */\n-body { background: #ffffff; color: #000000; }\n-p { margin-top: 0.5em; margin-bottom: 0.5em; }\n-a:link { color: #0000ff; }\n-a:visited { color: #204080; }\n-dt { font-weight: bold; }\n-h1 { font-size: +140%; font-style: italic;\n- font-weight: bold; }\n-h2 { font-size: +125%; font-style: italic;\n- font-weight: bold; }\n-h3 { font-size: +110%; font-style: italic;\n- font-weight: normal; }\n-code { font-size: 100%; }\n-/* N.B.: class, not pseudoclass */\n-a.link { font-family: monospace; }\n- \n-/* Page Header & Footer\n- * - The standard page header consists of a navigation bar (with\n- * pointers to standard pages such as 'home' and 'trees'); a\n- * breadcrumbs list, which can be used to navigate to containing\n- * classes or modules; options links, to show/hide private\n- * variables and to show/hide frames; and a page title (using\n- * <h1>). The page title may be followed by a link to the\n- * corresponding source code (using 'span.codelink').\n- * - The footer consists of a navigation bar, a timestamp, and a\n- * pointer to epydoc's homepage.\n- */ \n-h1.epydoc { margin: 0; font-size: +140%; font-weight: bold; }\n-h2.epydoc { font-size: +130%; font-weight: bold; }\n-h3.epydoc { font-size: +115%; font-weight: bold;\n- margin-top: 0.2em; }\n-td h3.epydoc { font-size: +115%; font-weight: bold;\n- margin-bottom: 0; }\n-table.navbar { background: #a0c0ff; color: #000000;\n- border: 2px groove #c0d0d0; }\n-table.navbar table { color: #000000; }\n-th.navbar-select { background: #70b0ff;\n- color: #000000; } \n-table.navbar a { text-decoration: none; } \n-table.navbar a:link { color: #0000ff; }\n-table.navbar a:visited { color: #204080; }\n-span.breadcrumbs { font-size: 85%; font-weight: bold; }\n-span.options { font-size: 70%; }\n-span.codelink { font-size: 85%; }\n-td.footer { font-size: 85%; }\n-\n-/* Table Headers\n- * - Each summary table and details section begins with a 'header'\n- * row. This row contains a section title (marked by\n- * 'span.table-header') as well as a show/hide private link\n- * (marked by 'span.options', defined above).\n- * - Summary tables that contain user-defined groups mark those\n- * groups using 'group header' rows.\n- */\n-td.table-header { background: #70b0ff; color: #000000;\n- border: 1px solid #608090; }\n-td.table-header table { color: #000000; }\n-td.table-header table a:link { color: #0000ff; }\n-td.table-header table a:visited { color: #204080; }\n-span.table-header { font-size: 120%; font-weight: bold; }\n-th.group-header { background: #c0e0f8; color: #000000;\n- text-align: left; font-style: italic; \n- font-size: 115%; \n- border: 1px solid #608"..b"border-left: 2px solid #000000; \n- margin-left: .2em; padding-left: .4em; }\n-.py-lineno { font-style: italic; font-size: 90%;\n- padding-left: .5em; }\n-a.py-toggle { text-decoration: none; }\n-div.py-highlight-hdr { border-top: 2px solid #000000;\n- border-bottom: 2px solid #000000;\n- background: #d8e8e8; }\n-div.py-highlight { border-bottom: 2px solid #000000;\n- background: #d0e0e0; }\n-.py-prompt { color: #005050; font-weight: bold;}\n-.py-more { color: #005050; font-weight: bold;}\n-.py-string { color: #006030; }\n-.py-comment { color: #003060; }\n-.py-keyword { color: #600000; }\n-.py-output { color: #404040; }\n-.py-name { color: #000050; }\n-.py-name:link { color: #000050 !important; }\n-.py-name:visited { color: #000050 !important; }\n-.py-number { color: #005000; }\n-.py-defname { color: #000060; font-weight: bold; }\n-.py-def-name { color: #000060; font-weight: bold; }\n-.py-base-class { color: #000060; }\n-.py-param { color: #000060; }\n-.py-docstring { color: #006030; }\n-.py-decorator { color: #804020; }\n-/* Use this if you don't want links to names underlined: */\n-/*a.py-name { text-decoration: none; }*/\n-\n-/* Graphs & Diagrams\n- * - These CSS styles are used for graphs & diagrams generated using\n- * Graphviz dot. 'img.graph-without-title' is used for bare\n- * diagrams (to remove the border created by making the image\n- * clickable).\n- */\n-img.graph-without-title { border: none; }\n-img.graph-with-title { border: 1px solid #000000; }\n-span.graph-title { font-weight: bold; }\n-span.graph-caption { }\n-\n-/* General-purpose classes\n- * - 'p.indent-wrapped-lines' defines a paragraph whose first line\n- * is not indented, but whose subsequent lines are.\n- * - The 'nomargin-top' class is used to remove the top margin (e.g.\n- * from lists). The 'nomargin' class is used to remove both the\n- * top and bottom margin (but not the left or right margin --\n- * for lists, that would cause the bullets to disappear.)\n- */\n-p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em; \n- margin: 0; }\n-.nomargin-top { margin-top: 0; }\n-.nomargin { margin-top: 0; margin-bottom: 0; }\n-\n-/* HTML Log */\n-div.log-block { padding: 0; margin: .5em 0 .5em 0;\n- background: #e8f0f8; color: #000000;\n- border: 1px solid #000000; }\n-div.log-error { padding: .1em .3em .1em .3em; margin: 4px;\n- background: #ffb0b0; color: #000000;\n- border: 1px solid #000000; }\n-div.log-warning { padding: .1em .3em .1em .3em; margin: 4px;\n- background: #ffffb0; color: #000000;\n- border: 1px solid #000000; }\n-div.log-info { padding: .1em .3em .1em .3em; margin: 4px;\n- background: #b0ffb0; color: #000000;\n- border: 1px solid #000000; }\n-h2.log-hdr { background: #70b0ff; color: #000000;\n- margin: 0; padding: 0em 0.5em 0em 0.5em;\n- border-bottom: 1px solid #000000; font-size: 110%; }\n-p.log { font-weight: bold; margin: .5em 0 .5em 0; }\n-tr.opt-changed { color: #000000; font-weight: bold; }\n-tr.opt-default { color: #606060; }\n-pre.log { margin: 0; padding: 0; padding-left: 1em; }\n" |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/epydoc.js --- a/commons/pyRepetUnit/doc/epydoc.js Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,293 +0,0 @@\n-function toggle_private() {\n- // Search for any private/public links on this page. Store\n- // their old text in "cmd," so we will know what action to\n- // take; and change their text to the opposite action.\n- var cmd = "?";\n- var elts = document.getElementsByTagName("a");\n- for(var i=0; i<elts.length; i++) {\n- if (elts[i].className == "privatelink") {\n- cmd = elts[i].innerHTML;\n- elts[i].innerHTML = ((cmd && cmd.substr(0,4)=="show")?\n- "hide private":"show private");\n- }\n- }\n- // Update all DIVs containing private objects.\n- var elts = document.getElementsByTagName("div");\n- for(var i=0; i<elts.length; i++) {\n- if (elts[i].className == "private") {\n- elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block");\n- }\n- else if (elts[i].className == "public") {\n- elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"block":"none");\n- }\n- }\n- // Update all table rows containing private objects. Note, we\n- // use "" instead of "block" becaue IE & firefox disagree on what\n- // this should be (block vs table-row), and "" just gives the\n- // default for both browsers.\n- var elts = document.getElementsByTagName("tr");\n- for(var i=0; i<elts.length; i++) {\n- if (elts[i].className == "private") {\n- elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"");\n- }\n- }\n- // Update all list items containing private objects.\n- var elts = document.getElementsByTagName("li");\n- for(var i=0; i<elts.length; i++) {\n- if (elts[i].className == "private") {\n- elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?\n- "none":"");\n- }\n- }\n- // Update all list items containing private objects.\n- var elts = document.getElementsByTagName("ul");\n- for(var i=0; i<elts.length; i++) {\n- if (elts[i].className == "private") {\n- elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block");\n- }\n- }\n- // Set a cookie to remember the current option.\n- document.cookie = "EpydocPrivate="+cmd;\n- }\n-function show_private() {\n- var elts = document.getElementsByTagName("a");\n- for(var i=0; i<elts.length; i++) {\n- if (elts[i].className == "privatelink") {\n- cmd = elts[i].innerHTML;\n- if (cmd && cmd.substr(0,4)=="show")\n- toggle_private();\n- }\n- }\n- }\n-function getCookie(name) {\n- var dc = document.cookie;\n- var prefix = name + "=";\n- var begin = dc.indexOf("; " + prefix);\n- if (begin == -1) {\n- begin = dc.indexOf(prefix);\n- if (begin != 0) return null;\n- } else\n- { begin += 2; }\n- var end = document.cookie.indexOf(";", begin);\n- if (end == -1)\n- { end = dc.length; }\n- return unescape(dc.substring(begin + prefix.length, end));\n- }\n-function setFrame(url1, url2) {\n- parent.frames[1].location.href = url1;\n- parent.frames[2].location.href = url2;\n- }\n-function checkCookie() {\n- var cmd=getCookie("EpydocPrivate");\n- if (cmd && cmd.substr(0,4)!="show" && location.href.indexOf("#_") < 0)\n- toggle_private();\n- }\n-function toggleCallGraph(id) {\n- var elt = document.getElementById(id);\n- if (elt.style.display == "none")\n- elt.style.display = "block";\n- else\n- elt.style.display = "none";\n- }\n-function expand(id) {\n- var elt = document.getElementById(id+"-expanded");\n- if (elt) elt.style.display = "block";\n- var elt = document.getElementById(id+"-expanded-linenums");\n- if (elt) elt.style'..b'd);\n- highlight(id);\n- }\n- }\n-}\n-\n-function kill_doclink(id) {\n- var parent = document.getElementById(id);\n- parent.removeChild(parent.childNodes.item(0));\n-}\n-function auto_kill_doclink(ev) {\n- if (!ev) var ev = window.event;\n- if (!this.contains(ev.toElement)) {\n- var parent = document.getElementById(this.parentID);\n- parent.removeChild(parent.childNodes.item(0));\n- }\n-}\n-\n-function doclink(id, name, targets_id) {\n- var elt = document.getElementById(id);\n-\n- // If we already opened the box, then destroy it.\n- // (This case should never occur, but leave it in just in case.)\n- if (elt.childNodes.length > 1) {\n- elt.removeChild(elt.childNodes.item(0));\n- }\n- else {\n- // The outer box: relative + inline positioning.\n- var box1 = document.createElement("div");\n- box1.style.position = "relative";\n- box1.style.display = "inline";\n- box1.style.top = 0;\n- box1.style.left = 0;\n- \n- // A shadow for fun\n- var shadow = document.createElement("div");\n- shadow.style.position = "absolute";\n- shadow.style.left = "-1.3em";\n- shadow.style.top = "-1.3em";\n- shadow.style.background = "#404040";\n- \n- // The inner box: absolute positioning.\n- var box2 = document.createElement("div");\n- box2.style.position = "relative";\n- box2.style.border = "1px solid #a0a0a0";\n- box2.style.left = "-.2em";\n- box2.style.top = "-.2em";\n- box2.style.background = "white";\n- box2.style.padding = ".3em .4em .3em .4em";\n- box2.style.fontStyle = "normal";\n- box2.onmouseout=auto_kill_doclink;\n- box2.parentID = id;\n-\n- // Get the targets\n- var targets_elt = document.getElementById(targets_id);\n- var targets = targets_elt.getAttribute("targets");\n- var links = "";\n- target_list = targets.split(",");\n- for (var i=0; i<target_list.length; i++) {\n- var target = target_list[i].split("=");\n- links += "<li><a href=\'" + target[1] + \n- "\' style=\'text-decoration:none\'>" +\n- target[0] + "</a></li>";\n- }\n- \n- // Put it all together.\n- elt.insertBefore(box1, elt.childNodes.item(0));\n- //box1.appendChild(box2);\n- box1.appendChild(shadow);\n- shadow.appendChild(box2);\n- box2.innerHTML =\n- "Which <b>"+name+"</b> do you want to see documentation for?" +\n- "<ul style=\'margin-bottom: 0;\'>" +\n- links + \n- "<li><a href=\'#\' style=\'text-decoration:none\' " +\n- "onclick=\'kill_doclink(\\""+id+"\\");return false;\'>"+\n- "<i>None of the above</i></a></li></ul>";\n- }\n- return false;\n-}\n-\n-function get_anchor() {\n- var href = location.href;\n- var start = href.indexOf("#")+1;\n- if ((start != 0) && (start != href.length))\n- return href.substring(start, href.length);\n- }\n-function redirect_url(dottedName) {\n- // Scan through each element of the "pages" list, and check\n- // if "name" matches with any of them.\n- for (var i=0; i<pages.length; i++) {\n-\n- // Each page has the form "<pagename>-m" or "<pagename>-c";\n- // extract the <pagename> portion & compare it to dottedName.\n- var pagename = pages[i].substring(0, pages[i].length-2);\n- if (pagename == dottedName.substring(0,pagename.length)) {\n-\n- // We\'ve found a page that matches `dottedName`;\n- // construct its URL, using leftover `dottedName`\n- // content to form an anchor.\n- var pagetype = pages[i].charAt(pages[i].length-1);\n- var url = pagename + ((pagetype=="m")?"-module.html":\n- "-class.html");\n- if (dottedName.length > pagename.length)\n- url += "#" + dottedName.substring(pagename.length+1,\n- dottedName.length);\n- return url;\n- }\n- }\n- }\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/frames.html --- a/commons/pyRepetUnit/doc/frames.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" - "DTD/xhtml1-frameset.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title> API Documentation </title> -</head> -<frameset cols="20%,80%"> - <frameset rows="30%,70%"> - <frame src="toc.html" name="moduleListFrame" - id="moduleListFrame" /> - <frame src="toc-everything.html" name="moduleFrame" - id="moduleFrame" /> - </frameset> - <frame src="module-tree.html" name="mainFrame" id="mainFrame" /> -</frameset> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/help.html --- a/commons/pyRepetUnit/doc/help.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,262 +0,0 @@\n-<?xml version="1.0" encoding="ascii"?>\n-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n- "DTD/xhtml1-transitional.dtd">\n-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n-<head>\n- <title>Help</title>\n- <link rel="stylesheet" href="epydoc.css" type="text/css" />\n- <script type="text/javascript" src="epydoc.js"></script>\n-</head>\n-\n-<body bgcolor="white" text="black" link="blue" vlink="#204080"\n- alink="#204080">\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th bgcolor="#70b0f0" class="navbar-select"\n- > Help </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table width="100%" cellpadding="0" cellspacing="0">\n- <tr valign="top">\n- <td width="100%"> </td>\n- <td>\n- <table cellpadding="0" cellspacing="0">\n- <!-- hide/show private -->\n- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"\n- onclick="toggle_private();">hide private</a>]</span></td></tr>\n- <tr><td align="right"><span class="options"\n- >[<a href="frames.html" target="_top">frames</a\n- >] | <a href="help.html"\n- target="_top">no frames</a>]</span></td></tr>\n- </table>\n- </td>\n- </tr>\n-</table>\n-\n-<h1 class="epydoc"> API Documentation </h1>\n-\n-<p> This document contains the API (Application Programming Interface)\n-documentation for this project. Documentation for the Python\n-objects defined by the project is divided into separate pages for each\n-package, module, and class. The API documentation also includes two\n-pages containing information about the project as a whole: a trees\n-page, and an index page. </p>\n-\n-<h2> Object Documentation </h2>\n-\n- <p>Each <strong>Package Documentation</strong> page contains: </p>\n- <ul>\n- <li> A description of the package. </li>\n- <li> A list of the modules and sub-packages contained by the\n- package. </li>\n- <li> A summary of the classes defined by the package. </li>\n- <li> A summary of the functions defined by the package. </li>\n- <li> A summary of the variables defined by the package. </li>\n- <li> A detailed description of each function defined by the\n- package. </li>\n- <li> A detailed description of each variable defined by the\n- package. </li>\n- </ul>\n- \n- <p>Each <strong>Module Documentation</strong> page contains:</p>\n- <ul>\n- <li> A description of the module. </li>\n- <li> A summary of the classes defined by the module. </li>\n- <li> A summary of the functions defined by the module. </li>\n- <li> A summary of the variables defined by the module. </li>\n- <li> A detailed description of each function defined by the\n- module. </li>\n- <li> A detailed description of each variable defined by the\n- module. </li>\n- </ul>\n- \n- <p>Each <strong>Class Documentation</strong> page contains: </p>\n- <ul>\n- <li> A class inheritance diagram. </li>\n- <li> A list of known subclasses. </li>\n- <li> A description of the class. </li>\n- <li> A summary of the methods defined by the class. </li>\n- <li> A summary of the instance variables defined by the class. </li>\n- <li> A summary of the class (static) variables defined by the\n- class. </li> \n- <li> A detailed description of each method defined by the\n- class. </li>\n- <li> A detailed description of each instance variable defined by the\n- class. </li> \n- <li> A detailed description of each class (static'..b'ong>" buttons below the top\n-navigation bar can be used to control whether the table of contents is\n-displayed or not. </p>\n-\n-<h2> The Navigation Bar </h2>\n-\n-<p> A navigation bar is located at the top and bottom of every page.\n-It indicates what type of page you are currently viewing, and allows\n-you to go to related pages. The following table describes the labels\n-on the navigation bar. Note that not some labels (such as\n-[Parent]) are not displayed on all pages. </p>\n-\n-<table class="summary" border="1" cellspacing="0" cellpadding="3" width="100%">\n-<tr class="summary">\n- <th>Label</th>\n- <th>Highlighted when...</th>\n- <th>Links to...</th>\n-</tr>\n- <tr><td valign="top"><strong>[Parent]</strong></td>\n- <td valign="top"><em>(never highlighted)</em></td>\n- <td valign="top"> the parent of the current package </td></tr>\n- <tr><td valign="top"><strong>[Package]</strong></td>\n- <td valign="top">viewing a package</td>\n- <td valign="top">the package containing the current object\n- </td></tr>\n- <tr><td valign="top"><strong>[Module]</strong></td>\n- <td valign="top">viewing a module</td>\n- <td valign="top">the module containing the current object\n- </td></tr> \n- <tr><td valign="top"><strong>[Class]</strong></td>\n- <td valign="top">viewing a class </td>\n- <td valign="top">the class containing the current object</td></tr>\n- <tr><td valign="top"><strong>[Trees]</strong></td>\n- <td valign="top">viewing the trees page</td>\n- <td valign="top"> the trees page </td></tr>\n- <tr><td valign="top"><strong>[Index]</strong></td>\n- <td valign="top">viewing the index page</td>\n- <td valign="top"> the index page </td></tr>\n- <tr><td valign="top"><strong>[Help]</strong></td>\n- <td valign="top">viewing the help page</td>\n- <td valign="top"> the help page </td></tr>\n-</table>\n-\n-<p> The "<strong>show private</strong>" and "<strong>hide private</strong>" buttons below\n-the top navigation bar can be used to control whether documentation\n-for private objects is displayed. Private objects are usually defined\n-as objects whose (short) names begin with a single underscore, but do\n-not end with an underscore. For example, "<code>_x</code>",\n-"<code>__pprint</code>", and "<code>epydoc.epytext._tokenize</code>"\n-are private objects; but "<code>re.sub</code>",\n-"<code>__init__</code>", and "<code>type_</code>" are not. However,\n-if a module defines the "<code>__all__</code>" variable, then its\n-contents are used to decide which objects are private. </p>\n-\n-<p> A timestamp below the bottom navigation bar indicates when each\n-page was last updated. </p>\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th> <a\n- href="identifier-index.html">Indices</a> </th>\n-\n- <!-- Help link -->\n- <th bgcolor="#70b0f0" class="navbar-select"\n- > Help </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table border="0" cellpadding="0" cellspacing="0" width="100%%">\n- <tr>\n- <td align="left" class="footer">\n- Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009\n- </td>\n- <td align="right" class="footer">\n- <a target="mainFrame" href="http://epydoc.sourceforge.net"\n- >http://epydoc.sourceforge.net</a>\n- </td>\n- </tr>\n-</table>\n-\n-<script type="text/javascript">\n- <!--\n- // Private objects are initially displayed (because if\n- // javascript is turned off then we want them to be\n- // visible); but by default, we want to hide them. So hide\n- // them unless we have a cookie that says to show them.\n- checkCookie();\n- // -->\n-</script>\n-</body>\n-</html>\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/identifier-index.html --- a/commons/pyRepetUnit/doc/identifier-index.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,267 +0,0 @@\n-<?xml version="1.0" encoding="ascii"?>\n-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n- "DTD/xhtml1-transitional.dtd">\n-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n-<head>\n- <title>Identifier Index</title>\n- <link rel="stylesheet" href="epydoc.css" type="text/css" />\n- <script type="text/javascript" src="epydoc.js"></script>\n-</head>\n-\n-<body bgcolor="white" text="black" link="blue" vlink="#204080"\n- alink="#204080">\n-<!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th bgcolor="#70b0f0" class="navbar-select"\n- > Indices </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table width="100%" cellpadding="0" cellspacing="0">\n- <tr valign="top">\n- <td width="100%"> </td>\n- <td>\n- <table cellpadding="0" cellspacing="0">\n- <!-- hide/show private -->\n- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"\n- onclick="toggle_private();">hide private</a>]</span></td></tr>\n- <tr><td align="right"><span class="options"\n- >[<a href="frames.html" target="_top">frames</a\n- >] | <a href="identifier-index.html"\n- target="_top">no frames</a>]</span></td></tr>\n- </table>\n- </td>\n- </tr>\n-</table>\n-<table border="0" width="100%">\n-<tr valign="bottom"><td>\n-<h1 class="epydoc">Identifier Index</h1>\n-</td><td>\n-[\n- A\n- B\n- <a href="#C">C</a>\n- <a href="#D">D</a>\n- E\n- F\n- <a href="#G">G</a>\n- H\n- <a href="#I">I</a>\n- J\n- K\n- <a href="#L">L</a>\n- M\n- N\n- O\n- P\n- Q\n- <a href="#R">R</a>\n- <a href="#S">S</a>\n- T\n- U\n- V\n- W\n- X\n- Y\n- Z\n- <a href="#_">_</a>\n-]\n-</td></table>\n-<table border="0" width="100%">\n-<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="C">C</a></h2></td>\n-<td valign="top">\n-<table class="link-index" width="100%" border="1">\n-<tr>\n-<td width="33%" class="link-index"><a href="commons.Checker.ConfigChecker-class.html#check">check()</a><br />\n-<span class="index-where">(in <a href="commons.Checker.ConfigChecker-class.html">ConfigChecker</a>)</span></td>\n-<td width="33%" class="link-index"><a href="commons.Checker.Checker-class.html">Checker</a><br />\n-<span class="index-where">(in <a href="commons.Checker-module.html">commons.Checker</a>)</span></td>\n-<td width="33%" class="link-index"><a href="commons.Checker.ConfigChecker-class.html">ConfigChecker</a><br />\n-<span class="index-where">(in <a href="commons.Checker-module.html">commons.Checker</a>)</span></td>\n-</tr>\n-<tr>\n-<td width="33%" class="link-index"><a href="commons.Checker.IChecker-class.html#check">check()</a><br />\n-<span class="index-where">(in <a href="commons.Checker.IChecker-class.html">IChecker</a>)</span></td>\n-<td width="33%" class="link-index"><a href="commons.Checker.CheckerException-class.html">CheckerException</a><br />\n-<span class="index-where">(in <a href="commons.Checker-module.html">commons.Checker</a>)</span></td>\n-<td width="33%" class="link-index"><a href="commons.Checker.ConfigException-class.html">ConfigException</a><br />\n-<span class="index-where">(in <a href="commons.Checker-module.html">commons.Checker</a>)</span></td>\n-</tr>\n-<tr>\n-<td width="33%" class="link-index"><a href="commons.Checker-module.html">Checker</a><br />\n-<span class="index-where">(in commons)</span></td>\n-<td width="33%" class="link-index"><a href="commons.IComponentWrapper.IComponentWrapper-class.html#clean">clean()<'..b'\n-<table class="link-index" width="100%" border="1">\n-<tr>\n-<td width="33%" class="link-index"><a href="commons.Checker.Checker-class.html#setLogger">setLogger()</a><br />\n-<span class="index-where">(in <a href="commons.Checker.Checker-class.html">Checker</a>)</span></td>\n-<td width="33%" class="link-index"> </td>\n-<td width="33%" class="link-index"> </td>\n-</tr>\n-<tr><td class="link-index"> </td><td class="link-index"> </td><td class="link-index"> </td></tr>\n-</table>\n-</td></tr>\n-<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="_">_</a></h2></td>\n-<td valign="top">\n-<table class="link-index" width="100%" border="1">\n-<tr>\n-<td width="33%" class="link-index"><a href="commons.Checker.Checker-class.html#__init__">__init__()</a><br />\n-<span class="index-where">(in <a href="commons.Checker.Checker-class.html">Checker</a>)</span></td>\n-<td width="33%" class="link-index"><a href="commons.Checker.ConfigException-class.html#__init__">__init__()</a><br />\n-<span class="index-where">(in <a href="commons.Checker.ConfigException-class.html">ConfigException</a>)</span></td>\n-<td width="33%" class="link-index"><a href="commons.Checker._Logger-class.html">_Logger</a><br />\n-<span class="index-where">(in <a href="commons.Checker-module.html">commons.Checker</a>)</span></td>\n-</tr>\n-<tr>\n-<td width="33%" class="link-index"><a href="commons.Checker.CheckerException-class.html#__init__">__init__()</a><br />\n-<span class="index-where">(in <a href="commons.Checker.CheckerException-class.html">CheckerException</a>)</span></td>\n-<td width="33%" class="link-index"><a href="commons.Checker._Logger-class.html#__init__">__init__()</a><br />\n-<span class="index-where">(in <a href="commons.Checker._Logger-class.html" onclick="show_private();">_Logger</a>)</span></td>\n-<td width="33%" class="link-index"><a href="commons.Checker._Logger-class.html#_Logger__single">_Logger__single</a><br />\n-<span class="index-where">(in <a href="commons.Checker._Logger-class.html" onclick="show_private();">_Logger</a>)</span></td>\n-</tr>\n-<tr>\n-<td width="33%" class="link-index"><a href="commons.Checker.ConfigChecker-class.html#__init__">__init__()</a><br />\n-<span class="index-where">(in <a href="commons.Checker.ConfigChecker-class.html">ConfigChecker</a>)</span></td>\n-<td width="33%" class="link-index"><a href="commons.Checker.Checker-class.html#_handle">_handle()</a><br />\n-<span class="index-where">(in <a href="commons.Checker.Checker-class.html">Checker</a>)</span></td>\n-<td width="33%" class="link-index"> </td>\n-</tr>\n-</table>\n-</td></tr>\n-</table>\n-<br /><br /><!-- ==================== NAVIGATION BAR ==================== -->\n-<table class="navbar" border="0" width="100%" cellpadding="0"\n- bgcolor="#a0c0ff" cellspacing="0">\n- <tr valign="middle">\n-\n- <!-- Tree link -->\n- <th> <a\n- href="module-tree.html">Trees</a> </th>\n-\n- <!-- Index link -->\n- <th bgcolor="#70b0f0" class="navbar-select"\n- > Indices </th>\n-\n- <!-- Help link -->\n- <th> <a\n- href="help.html">Help</a> </th>\n-\n- <th class="navbar" width="100%"></th>\n- </tr>\n-</table>\n-<table border="0" cellpadding="0" cellspacing="0" width="100%%">\n- <tr>\n- <td align="left" class="footer">\n- Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009\n- </td>\n- <td align="right" class="footer">\n- <a target="mainFrame" href="http://epydoc.sourceforge.net"\n- >http://epydoc.sourceforge.net</a>\n- </td>\n- </tr>\n-</table>\n-\n-<script type="text/javascript">\n- <!--\n- // Private objects are initially displayed (because if\n- // javascript is turned off then we want them to be\n- // visible); but by default, we want to hide them. So hide\n- // them unless we have a cookie that says to show them.\n- checkCookie();\n- // -->\n-</script>\n-</body>\n-</html>\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/index.html --- a/commons/pyRepetUnit/doc/index.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" - "DTD/xhtml1-frameset.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title> API Documentation </title> -</head> -<frameset cols="20%,80%"> - <frameset rows="30%,70%"> - <frame src="toc.html" name="moduleListFrame" - id="moduleListFrame" /> - <frame src="toc-everything.html" name="moduleFrame" - id="moduleFrame" /> - </frameset> - <frame src="module-tree.html" name="mainFrame" id="mainFrame" /> -</frameset> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/module-tree.html --- a/commons/pyRepetUnit/doc/module-tree.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,101 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Module Hierarchy</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th bgcolor="#70b0f0" class="navbar-select" - > Trees </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table width="100%" cellpadding="0" cellspacing="0"> - <tr valign="top"> - <td width="100%"> </td> - <td> - <table cellpadding="0" cellspacing="0"> - <!-- hide/show private --> - <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span></td></tr> - <tr><td align="right"><span class="options" - >[<a href="frames.html" target="_top">frames</a - >] | <a href="module-tree.html" - target="_top">no frames</a>]</span></td></tr> - </table> - </td> - </tr> -</table> -<center><b> - [ <a href="module-tree.html">Module Hierarchy</a> - | <a href="class-tree.html">Class Hierarchy</a> ] -</b></center><br /> -<h1 class="epydoc">Module Hierarchy</h1> -<ul class="nomargin-top"> - <li> <strong class="uidlink"><a href="commons.Checker-module.html">commons.Checker</a></strong>: <em class="summary">Created on 9 avr.</em> </li> - <li> <strong class="uidlink"><a href="commons.IComponentWrapper-module.html">commons.IComponentWrapper</a></strong> </li> - <li> <strong class="uidlink"><a href="commons.IDataProcessor-module.html">commons.IDataProcessor</a></strong> </li> -</ul> -<!-- ==================== NAVIGATION BAR ==================== --> -<table class="navbar" border="0" width="100%" cellpadding="0" - bgcolor="#a0c0ff" cellspacing="0"> - <tr valign="middle"> - - <!-- Tree link --> - <th bgcolor="#70b0f0" class="navbar-select" - > Trees </th> - - <!-- Index link --> - <th> <a - href="identifier-index.html">Indices</a> </th> - - <!-- Help link --> - <th> <a - href="help.html">Help</a> </th> - - <th class="navbar" width="100%"></th> - </tr> -</table> -<table border="0" cellpadding="0" cellspacing="0" width="100%%"> - <tr> - <td align="left" class="footer"> - Generated by Epydoc 3.0.1 on Fri Apr 10 16:39:01 2009 - </td> - <td align="right" class="footer"> - <a target="mainFrame" href="http://epydoc.sourceforge.net" - >http://epydoc.sourceforge.net</a> - </td> - </tr> -</table> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/redirect.html --- a/commons/pyRepetUnit/doc/redirect.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,38 +0,0 @@ -<html><head><title>Epydoc Redirect Page</title> -<meta http-equiv="cache-control" content="no-cache" /> -<meta http-equiv="expires" content="0" /> -<meta http-equiv="pragma" content="no-cache" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> -<body> -<script type="text/javascript"> -<!-- -var pages = ["commons.IComponentWrapper.IComponentWrapper-c", "commons.IDataProcessor.IDataProcessor-c", "commons.Checker.CheckerException-c", "commons.Checker.ConfigException-c", "commons.Checker.ConfigChecker-c", "commons.IComponentWrapper-m", "commons.Checker.IChecker-c", "commons.Checker.Checker-c", "commons.Checker._Logger-c", "commons.IDataProcessor-m", "commons.Checker-m"]; -var dottedName = get_anchor(); -if (dottedName) { - var target = redirect_url(dottedName); - if (target) window.location.replace(target); -} -// --> -</script> - -<h3>Epydoc Auto-redirect page</h3> - -<p>When javascript is enabled, this page will redirect URLs of -the form <tt>redirect.html#<i>dotted.name</i></tt> to the -documentation for the object with the given fully-qualified -dotted name.</p> -<p><a id="message"> </a></p> - -<script type="text/javascript"> -<!-- -if (dottedName) { - var msg = document.getElementById("message"); - msg.innerHTML = "No documentation found for <tt>"+ - dottedName+"</tt>"; -} -// --> -</script> - -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/toc-commons.Checker-module.html --- a/commons/pyRepetUnit/doc/toc-commons.Checker-module.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Checker</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<h1 class="toc">Module Checker</h1> -<hr /> - <h2 class="toc">Classes</h2> - <a target="mainFrame" href="commons.Checker.Checker-class.html" - >Checker</a><br /> <a target="mainFrame" href="commons.Checker.CheckerException-class.html" - >CheckerException</a><br /> <a target="mainFrame" href="commons.Checker.ConfigChecker-class.html" - >ConfigChecker</a><br /> <a target="mainFrame" href="commons.Checker.ConfigException-class.html" - >ConfigException</a><br /> <a target="mainFrame" href="commons.Checker.IChecker-class.html" - >IChecker</a><br /> <div class="private"> - <a target="mainFrame" href="commons.Checker._Logger-class.html" - >_Logger</a><br /> </div> - <h2 class="toc">Variables</h2> - <a target="mainFrame" href="commons.Checker-module.html#DEFAULT_LOGGER_NAME" - >DEFAULT_LOGGER_NAME</a><br /> <a target="mainFrame" href="commons.Checker-module.html#LOG_FILE" - >LOG_FILE</a><br /><hr /> -<span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/toc-commons.IComponentWrapper-module.html --- a/commons/pyRepetUnit/doc/toc-commons.IComponentWrapper-module.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>IComponentWrapper</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<h1 class="toc">Module IComponentWrapper</h1> -<hr /> - <h2 class="toc">Classes</h2> - <a target="mainFrame" href="commons.IComponentWrapper.IComponentWrapper-class.html" - >IComponentWrapper</a><br /><hr /> -<span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/toc-commons.IDataProcessor-module.html --- a/commons/pyRepetUnit/doc/toc-commons.IDataProcessor-module.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>IDataProcessor</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<h1 class="toc">Module IDataProcessor</h1> -<hr /> - <h2 class="toc">Classes</h2> - <a target="mainFrame" href="commons.IDataProcessor.IDataProcessor-class.html" - >IDataProcessor</a><br /><hr /> -<span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/toc-everything.html --- a/commons/pyRepetUnit/doc/toc-everything.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Everything</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<h1 class="toc">Everything</h1> -<hr /> - <h2 class="toc">All Classes</h2> - <a target="mainFrame" href="commons.Checker.Checker-class.html" - >commons.Checker.Checker</a><br /> <a target="mainFrame" href="commons.Checker.CheckerException-class.html" - >commons.Checker.CheckerException</a><br /> <a target="mainFrame" href="commons.Checker.ConfigChecker-class.html" - >commons.Checker.ConfigChecker</a><br /> <a target="mainFrame" href="commons.Checker.ConfigException-class.html" - >commons.Checker.ConfigException</a><br /> <a target="mainFrame" href="commons.Checker.IChecker-class.html" - >commons.Checker.IChecker</a><br /> <div class="private"> - <a target="mainFrame" href="commons.Checker._Logger-class.html" - >commons.Checker._Logger</a><br /> </div> - <a target="mainFrame" href="commons.IComponentWrapper.IComponentWrapper-class.html" - >commons.IComponentWrapper.IComponentWrapper</a><br /> <a target="mainFrame" href="commons.IDataProcessor.IDataProcessor-class.html" - >commons.IDataProcessor.IDataProcessor</a><br /> <h2 class="toc">All Variables</h2> - <a target="mainFrame" href="commons.Checker-module.html#DEFAULT_LOGGER_NAME" - >commons.Checker.DEFAULT_LOGGER_NAME</a><br /> <a target="mainFrame" href="commons.Checker-module.html#LOG_FILE" - >commons.Checker.LOG_FILE</a><br /><hr /> -<span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/doc/toc.html --- a/commons/pyRepetUnit/doc/toc.html Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="ascii"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Table of Contents</title> - <link rel="stylesheet" href="epydoc.css" type="text/css" /> - <script type="text/javascript" src="epydoc.js"></script> -</head> - -<body bgcolor="white" text="black" link="blue" vlink="#204080" - alink="#204080"> -<h1 class="toc">Table of Contents</h1> -<hr /> - <a target="moduleFrame" href="toc-everything.html">Everything</a> - <br /> - <h2 class="toc">Modules</h2> - <a target="moduleFrame" href="toc-commons.Checker-module.html" - onclick="setFrame('toc-commons.Checker-module.html','commons.Checker-module.html');" >commons.Checker</a><br /> <a target="moduleFrame" href="toc-commons.IComponentWrapper-module.html" - onclick="setFrame('toc-commons.IComponentWrapper-module.html','commons.IComponentWrapper-module.html');" >commons.IComponentWrapper</a><br /> <a target="moduleFrame" href="toc-commons.IDataProcessor-module.html" - onclick="setFrame('toc-commons.IDataProcessor-module.html','commons.IDataProcessor-module.html');" >commons.IDataProcessor</a><br /><hr /> - <span class="options">[<a href="javascript:void(0);" class="privatelink" - onclick="toggle_private();">hide private</a>]</span> - -<script type="text/javascript"> - <!-- - // Private objects are initially displayed (because if - // javascript is turned off then we want them to be - // visible); but by default, we want to hide them. So hide - // them unless we have a cookie that says to show them. - checkCookie(); - // --> -</script> -</body> -</html> |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/fastaTranslation/allFrames/TranslateInAllFramesAndReplaceStopByX.py --- a/commons/pyRepetUnit/fastaTranslation/allFrames/TranslateInAllFramesAndReplaceStopByX.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,26 +0,0 @@ -from commons.core.utils.FileUtils import FileUtils -from commons.core.seq.BioseqUtils import BioseqUtils - -class TranslateInAllFramesAndReplaceStopByX(object): - - def __init__(self): - self._inputFile = "" - self._outputFile = "" - - def setInputFile(self, input): - self._inputFile = input - - def setOutputFile(self, output): - self._outputFile = output - - def run(self): - """ - read a fasta file with nucleotide sequences and translate all sequences in all frames, write the result in a file - """ - if not FileUtils.isRessourceExists(self._inputFile): - raise Exception("Warning your input file %s does not exist!\n" % self._inputFile) - bioseqList = BioseqUtils.extractBioseqListFromFastaFile(self._inputFile) - bioseqListInAllFrames = BioseqUtils.translateBioseqListInAllFrames(bioseqList) - bioseqListTranslatedAndStopsReplace = BioseqUtils.replaceStopCodonsByXInBioseqList(bioseqListInAllFrames) - BioseqUtils.writeBioseqListIntoFastaFile(bioseqListTranslatedAndStopsReplace, self._outputFile) - \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_F_TranslateAfastaFileInAllFrameAndReplaceStopsByX.py --- a/commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_F_TranslateAfastaFileInAllFrameAndReplaceStopsByX.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,23 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils - -class Test_F_TranslateAfastaFileInAllFrameAndReplaceStopsByX(unittest.TestCase): - - def setUp(self): - self._inputFile = "./datas/ConsensusTestFile_nt.fsa" - self._outputFile = "./datas/PreprocessOuputFile" - self._prg = "translateAfastaFileInAllFrameAndReplaceStopsByX_script.py" - - - def testAcceptanceTranslateAfastaFileInAllFrameAndReplaceStopsByX_script(self): - cmd = self._prg - cmd += " -i %s" % ( self._inputFile ) - cmd += " -o %s" % ( self._outputFile ) - os.system( cmd ) - self.assertTrue(FileUtils.are2FilesIdentical( self._outputFile, "./datas/ConsensusTestFile_aaWithoutStop.fsa")) - os.system( "rm " + self._outputFile ) - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_F_TranslateInAllFramesAndReplaceStopByX.py --- a/commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_F_TranslateInAllFramesAndReplaceStopByX.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,24 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.fastaTranslation.allFrames.TranslateInAllFramesAndReplaceStopByX import TranslateInAllFramesAndReplaceStopByX -from commons.core.seq.Bioseq import Bioseq -from commons.core.utils.FileUtils import FileUtils - -class Test_F_TranslateInAllFramesAndReplaceStopByX(unittest.TestCase): - - def setUp(self): - self.bioseq = Bioseq() - self.preProcess = TranslateInAllFramesAndReplaceStopByX() - self._inputFile = "./datas/test_input_nt.fa" - self._outputFile = "./datas/PreProcessResult.fa" - - - def testAcceptanceTranslateAfastaFileInAllFrame(self): - self.preProcess.setInputFile(self._inputFile) - self.preProcess.setOutputFile(self._outputFile) - self.preProcess.run() - self.assertTrue(FileUtils.are2FilesIdentical(self._outputFile, "./datas/test_input_aa.fa")) - os.system("rm " + self._outputFile) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_TranslateAfastaFileInAllFrameAndReplaceStopsByX.py --- a/commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_TranslateAfastaFileInAllFrameAndReplaceStopsByX.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,80 +0,0 @@ -import os -import unittest -from commons.core.utils.FileUtils import FileUtils - -class Test_TranslateAfastaFileInAllFrameAndReplaceStopsByX(unittest.TestCase): - - def setUp(self): - self._inputFile = "dummyInputFile" - self._outputFile = "dummyOuputFile" - self._prg = "translateAfastaFileInAllFrameAndReplaceStopsByX_script.py" - - - def testTranslateAfastaFileInAllFrameAndReplaceStopsByX_script(self): - f = open(self._inputFile, "w") - f.write(">header1 description\n") - f.write("TGTGGCTTCTAGTTGATCAGTTTATGATCACAATGATTTCACGTAGGTGTCTCGTGGCTC\n") - f.write("CGACTAATCAACAATATAATGCGAGTAGAGCTTGA\n") - f.write(">header2\n") - f.write("TGTGGCTTCTAGTTGATCAGTTTATGATCACAATGATTTCACGTAGGTGTCTCGTGGCTA\n") - f.write("CGACTAATCAACAATATAATGCGAGTAGAGCTTGA") - f.close() - # expected fasta translated file - f = open("expectedTranslated.fa", "w") - f.write(">header1_1 description\n") - f.write("CGFXLISLXSQXFHVGVSWLRLINNIMRVEL\n") - f.write(">header1_2 description\n") - f.write("VASSXSVYDHNDFTXVSRGSDXSTIXCEXSL\n") - f.write(">header1_3 description\n") - f.write("WLLVDQFMITMISRRCLVAPTNQQYNASRAX\n") - f.write(">header1_4 description\n") - f.write("SSSTRIILLISRSHETPTXNHCDHKLINXKP\n") - f.write(">header1_5 description\n") - f.write("QALLALYCXLVGATRHLREIIVIINXSTRSH\n") - f.write(">header1_6 description\n") - f.write("KLYSHYIVDXSEPRDTYVKSLXSXTDQLEAT\n") - f.write(">header2_1\n") - f.write("CGFXLISLXSQXFHVGVSWLRLINNIMRVEL\n") - f.write(">header2_2\n") - f.write("VASSXSVYDHNDFTXVSRGYDXSTIXCEXSL\n") - f.write(">header2_3\n") - f.write("WLLVDQFMITMISRRCLVATTNQQYNASRAX\n") - f.write(">header2_4\n") - f.write("SSSTRIILLISRSHETPTXNHCDHKLINXKP\n") - f.write(">header2_5\n") - f.write("QALLALYCXLVVATRHLREIIVIINXSTRSH\n") - f.write(">header2_6\n") - f.write("KLYSHYIVDXSXPRDTYVKSLXSXTDQLEAT\n") - f.close() - - #normal launch - cmd = self._prg - cmd += " -i %s" % ( self._inputFile ) - cmd += " -o %s" % ( self._outputFile ) - os.system( cmd ) - self.assertTrue(FileUtils.are2FilesIdentical( self._outputFile, "expectedTranslated.fa")) - os.system( "rm " + self._outputFile ) - - #verbose option - cmd = self._prg - cmd += " -i %s" % ( self._inputFile ) - cmd += " -o %s" % ( self._outputFile ) - cmd += " -v 1" - os.system( cmd ) - self.assertTrue(FileUtils.are2FilesIdentical( self._outputFile, "expectedTranslated.fa")) - os.system( "rm " + self._outputFile ) - - #clean option - cmd = self._prg - cmd += " -i %s" % ( self._inputFile ) - cmd += " -o %s" % ( self._outputFile ) - cmd += " -c" - os.system( cmd ) - self.assertTrue( FileUtils.are2FilesIdentical( self._outputFile, "expectedTranslated.fa" ) ) - self.assertFalse( FileUtils.isRessourceExists( self._inputFile ) ) - os.system( "rm " + self._outputFile) - os.system("rm expectedTranslated.fa") - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_TranslateInAllFramesAndReplaceStopByX.py --- a/commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_TranslateInAllFramesAndReplaceStopByX.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,65 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.fastaTranslation.allFrames.TranslateInAllFramesAndReplaceStopByX import TranslateInAllFramesAndReplaceStopByX -from commons.core.seq.Bioseq import Bioseq -from commons.core.utils.FileUtils import FileUtils - -class Test_TranslateInAllFramesAndReplaceStopByX(unittest.TestCase): - - def setUp(self): - self.bioseq = Bioseq() - self.preProcess = TranslateInAllFramesAndReplaceStopByX() - self._inputFile = "./datas/dummy.fa" - self._outputFile = "./datas/dummyoutput.fa" - - - def testRun(self): - self.preProcess.setInputFile(self._inputFile) - self.preProcess.setOutputFile(self._outputFile) - # real fasta file - f = open(self._inputFile, "w") - f.write(">header1 description\n") - f.write("TGTGGCTTCTAGTTGATCAGTTTATGATCACAATGATTTCACGTAGGTGTCTCGTGGCTC\n") - f.write("CGACTAATCAACAATATAATGCGAGTAGAGCTTGA\n") - f.write(">header2\n") - f.write("TGTGGCTTCTAGTTGATCAGTTTATGATCACAATGATTTCACGTAGGTGTCTCGTGGCTA\n") - f.write("CGACTAATCAACAATATAATGCGAGTAGAGCTTGA") - f.close() - # expected fasta translated file - f = open("./datas/expectedTranslated.fa", "w") - f.write(">header1_1 description\n") - f.write("CGFXLISLXSQXFHVGVSWLRLINNIMRVEL\n") - f.write(">header1_2 description\n") - f.write("VASSXSVYDHNDFTXVSRGSDXSTIXCEXSL\n") - f.write(">header1_3 description\n") - f.write("WLLVDQFMITMISRRCLVAPTNQQYNASRAX\n") - f.write(">header1_4 description\n") - f.write("SSSTRIILLISRSHETPTXNHCDHKLINXKP\n") - f.write(">header1_5 description\n") - f.write("QALLALYCXLVGATRHLREIIVIINXSTRSH\n") - f.write(">header1_6 description\n") - f.write("KLYSHYIVDXSEPRDTYVKSLXSXTDQLEAT\n") - f.write(">header2_1\n") - f.write("CGFXLISLXSQXFHVGVSWLRLINNIMRVEL\n") - f.write(">header2_2\n") - f.write("VASSXSVYDHNDFTXVSRGYDXSTIXCEXSL\n") - f.write(">header2_3\n") - f.write("WLLVDQFMITMISRRCLVATTNQQYNASRAX\n") - f.write(">header2_4\n") - f.write("SSSTRIILLISRSHETPTXNHCDHKLINXKP\n") - f.write(">header2_5\n") - f.write("QALLALYCXLVVATRHLREIIVIINXSTRSH\n") - f.write(">header2_6\n") - f.write("KLYSHYIVDXSXPRDTYVKSLXSXTDQLEAT\n") - f.close() - self.preProcess.run() - self.assertTrue(FileUtils.are2FilesIdentical("./datas/expectedTranslated.fa", self._outputFile)) - os.system("rm " + self._inputFile) - os.system("rm " + self._outputFile) - os.system("rm ./datas/expectedTranslated.fa") - # empty fasta file - #self.preProcess.translateAfastaFileInAllFrame() - #self.assertFalse(FileUtils.isRessourceExists(self._outputFile)) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/ConsensusTestFile_aaWithoutStop.fsa --- a/commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/ConsensusTestFile_aaWithoutStop.fsa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,48 +0,0 @@ ->blumeria_Grouper_590_20:NoCat_1 -FRSYXNVXPTTXFVDLLVEGSLCNNEGXKDVNSTTLLNTDTRLLLIPIDSPCGISYXQQX -TTLTQGIRNLRSPNTSLSGLLIIEPSRIDNVYPNIEIIESSTPKPLINNCHXSSPDLSLY -SIISTLKNIC ->blumeria_Grouper_590_20:NoCat_2 -FDXIEMYNPLLSSWTCWXREAYAIMKDKRMSIRLLFXTQIPDSFXSQXIARAGSPINSSK -QRXHRVYAISVRQTPVCRDYXLSSLVGSTMCIPTXKXXKAQHPNPSSITAINHHLTYLCT -PXFQHXRIFV ->blumeria_Grouper_590_20:NoCat_3 -SIXLKCITHYLVRGLVGRGKLMQXXRIKGCQFDYSSKHRYQTPFNPNRXPVRDLLLTAVN -NANTGYTQSPFAKHQSVGTTNYRAXXDRQCVSQHRNNRKLNTQTPHQXLPLIITXLISVL -HNFNTXEYL ->blumeria_Grouper_590_20:NoCat_4 -YKYSXVLKLWSTEISQVMINGSYXXGVWVLSFLLFLCWDTHCRSYXARXLVVPTDWCLAN -GDCVYPVLALFTAVNRRSRTGYLLGLKGVWYLCLEEXSNXHPFILHYCISFPLPTSPRTK -XWVIHFNXIE ->blumeria_Grouper_590_20:NoCat_5 -TNILXCXNYGVQRXVRXXLMAVIDEGFGCXAFYYFYVGIHIVDPTRLDNXXSRQTGVWRT -EIAYTLCXRCLLLLIGDPARAIYWDXKESGICVXKSSRIDILLSFIIAXASLYQQVHELS -SGLYISIXSK ->blumeria_Grouper_590_20:NoCat_6 -QIFXSVEIMEYRDKSGDDXWQLLMRGLGVELSIISMLGYTLSILLGSIISSPDRLVFGER -RLRIPCVSVVYCCXXEIPHGLSIGIKRSLVSVFRRVVELTSFYPSLLHKLPSTNKSTNXV -VGYTFQXDR ->blumeria_Grouper_4152_12:NoCat_1 -GPAATNCAIAARKXTLMESTKFLSSPVESGXRAASTLLIAVEHIVNCAAFCLALRSSASI -AASNSGGCVFFLPAASSAGGCGASGGFSAPAALVDGVSALFAGLTSAGRGSAGTVMRFSG -ATTVFLGDPVGSKTCSASSGLEDAQTESARVFSFSTSASTISTSGTL ->blumeria_Grouper_4152_12:NoCat_2 -DRPPRIARLLLASRLXWSLQNFCLHRWRAVEELPRHCXXPSSILXIARLFVLPCAPPLRS -LQAILEGVYFFCLLLLVLEAAGPVEGFRLLLPXWMVFQPFSRASLLQVAVVLEPXCASRV -RRRFFWGIRWDPRLALRLLGWRMPKLNRRGFLASRLLRPPYLPRGH ->blumeria_Grouper_4152_12:NoCat_3 -TGRHELRDCCSQVDFDGVYKIFVFTGGERLKSCLDTANSRRAYCELRGFLSCPALLRFDR -CKQFWRVCIFSACCFXCWRLRGQWRVFGSCCLSGWCFSPFRGPHFCRSRXCWNRDALLGC -DDGFSGGSGGIQDLLCVFWAGGCPNXIGEGFXLLDFCVHHIYLGDI ->blumeria_Grouper_4152_12:NoCat_4 -QCPRGRYGGRRSREAKNPRRFSLGILQPRRRRASLGSHRIPQKNRRRTREAHHGSSTTAT -CRSEAREKGXNTIHXGSRSRKPSTGPAASSTRSSRQKKYTPSRIACSDRSGGAQGKTKSR -AIHNMLDGYXQCRGSSSTALHRXRQKFCRLHQSLLASSNRAIRGGRS ->blumeria_Grouper_4152_12:NoCat_5 -NVPEVDMVDAEVEKLKTLADSVWASSSPEDAEQVLDPTGSPRKTVVAPEKRITVPALPRP -AEVRPAKRAETPSTKAAGAENPPLAPQPPALEAAGRKNTHPPELLAAIEAEERRARQKAA -QFTICSTAISSVEAALQPLSTGEDKNFVDSIKVYLRAAIAQFVAAG ->blumeria_Grouper_4152_12:NoCat_6 -MSPRXIWWTQKSRSXKPSPIQFGHPPAQKTQSKSWIPPDPPEKPSSHPRSASRFQHYRDL -QKXGPRKGLKHHPLRQQEPKTLHWPRSLQHXKQQAEKIHTLQNCLQRSKRRSAGQDKKPR -NSQYARRLLAVSRQLFNRSPPVKTKILXTPSKSTCEQQSRNSWRPV |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/ConsensusTestFile_nt.fsa --- a/commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/ConsensusTestFile_nt.fsa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,18 +0,0 @@ ->blumeria_Grouper_590_20:NoCat -TTTCGATCNTATTGAAATGTATAACCCACTACTTAGTTCGTGGACTTGTTGGTAGAGGGA -AGCTTATGCAATAATGAAGGATAAAAGGATGTCAATTCGACTACTCTTCTAAACACAGAT -ACCAGACTCCTTTTAATCCCAATAGATAGCCCGTGCGGGATCTCCTATTAACAGCAGTAA -ACAACGCTAACACAGGGTATACGCAATCTCCGTTCGCCAAACACCAGTCTGTCGGGACTA -CTAATTATCGAGCCTAGTAGGATCGACAATGTGTATCCCAACATAGAAATAATAGAAAGC -TCAACACCCAAACCCCTCATCAATAACTGCCATTAATCATCACCTGACTTATCTCTGTAC -TCCATAATTTCAACACTNAAGAATATTTGTA ->blumeria_Grouper_4152_12:NoCat -GGACCGGCCGCCACGAATTGCGCGATTGCTGCTCGCAAGTAGACTTTGATGGAGTCTACA -AAATTTTTGTCTTCACCGGTGGAGAGCGGTTGAAGAGCTGCCTCGACACTGCTAATAGCC -GTCGAGCATATTGTGAATTGCGCGGCTTTTTGTCTTGCCCTGCGCTCCTCCGCTTCGATC -GCTGCAAGCAATTCTGGAGGGTGTGTATTTTTTCTGCCTGCTGCTTCTAGTGCTGGAGGC -TGCGGGGCCAGTGGAGGGTTTTCGGCTCCTGCTGCCTTAGTGGATGGTGTTTCAGCCCTT -TTCGCGGGCCTCACTTCTGCAGGTCGCGGTAGTGCTGGAACCGTGATGCGCTTCTCGGGT -GCGACGACGGTTTTTCTGGGGGATCCGGTGGGATCCAAGACTTGCTCTGCGTCTTCTGGG -CTGGAGGATGCCCAAACTGAATCGGCGAGGGTTTTTAGCTTCTCGACTTCTGCGTCCACC -ATATCTACCTCGGGGACATTG |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/test_input_aa.fa --- a/commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/test_input_aa.fa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,258 +0,0 @@\n->blumeria_Grouper_28830_3_1\n-CGFXLISLXSQXFHVGVSWLRLINNIMRVELETNKTXIXFYNTGSPTYLNIPPHHVSQST\n-AHNLHGRVSINWDPQTIPLLKTSCPQLIXITSXLEILLWYHSNXILAEFLSVFLSCSSIR\n-RLPYHRLRTGCPSRTYAGNRFVPLYLLPNLYPPGDIKEXVLLLXQAATAHGPSXXGSILC\n-LRWRTRSTQSPGAXVRISAFSSWRXARILSLVAFILLTXERAIGAGCFLPSSSAQRRSSD\n-SVASRVYTGXEFSSSGGXVPKSKKXGLYPLGETLRLKFITASERAPASVILGESRRTLTS\n-MAFRTPFACSTLPFPLGLAGVVWTTCSCWLAXNRCASMPPKQPALSLIICFGFPKFWIIY\n-VSRGTVLAKSALGTKRDSSQPVAYSIALSKTWGPTXVXSIPHRVRGGAGTIGVKLPSNGS\n-GGFMSXQDLHFRTASXAARISSGCQNLRPNSRIVLPIDAWPWPSXTFTAVDTRSSYSKIS\n-SRVAAPDGPGASPTCCDGFFLMRCNLELYIAKLSRTQVAAIFRGSASPKVRNSVMHCRSM\n-RLSSCGCFISSISSSLSAPLWILEFSLSSVATFPSPSSLERNRTSQGRERKSARTFAFPR\n-RXIILILKCSIASKKRTILTGCSALVXIVRRDSWSVITVTSPPSTQXRQCCSDSKIPSNS\n-LSCAEXRCWVSFSFLEKXAMGCSTERSELLEHRMYGWSMTAPTNFWEASVSNMTGSLQSN\n-FFTTGDVVSASLILFHDXIDWSVRMTGQFLGPEDWSVSGPASWEKFLMRQRRXPAAFTNP\n-LISEVVVGIGLSLIAETFSGSAAMPCLEIWKPRKIPSETNSLHFEALRRRPXEANLEKIS\n-INRECNSAIESAQTATSSRSPATNGRNGSRTSSIKHWKVAGALHRPKGITSHSXTPKGVT\n-NAVFSEESLCIRICQNPFSRSRNAXKLCPAARXISSXAFGRGWACFFVILLSSLXSTQIR\n-QTVWLVWVSVFFWCXXQRCSPWSLTFAYELSRSCVAQESPRMACCCAGAISPRRGVLNWV\n-DNYPVSMRVFLSWESFIPFGGRDLSKSXRGIXLXYCREKLXCGMKGGLGAIXPLEYLKXX\n-RLFGLGEYXLXDXELVGQLSXEVAVCHLINIVAPVHGIKFVQVSHLLGMCHLGQLLETLX\n-IPESRMIQGDSSKETVQLKLHPXKLLGQGHQCLTFXKXXMYYKKSNIXRKTVKHNMLKSR\n-SQKKLKIGHRENELFVQKTFCVACHILPVEVVLLGVAQICPFLRPQSRYSGCPIHKFLHF\n-AFDIEWLQFRHRAAHLLFGLQGLFALDPNLLAQQGKXKXQALMNDRVVLQVLHIFYFSLI\n-GKFSXIYRXNATRCIXRLVHIPFVLLIPPALFSSTGSLSPSGLSFRNXSIRNACRELGMI\n-YLFLQCLVTQRRLAHTTLDQLWMRQMLEAFRLLTLRSELVHWTRNVXIHHPQVSTLXYRV\n-XLEPLDPQAPRWXVWGDYWKXWSRYVEVRVEYAASVYLXSEALPXHPKVGXRKLSGVVAQ\n-IVIESRRFLQLFVQMLSKATRVHHCRTVFXGYSLQLLPNRGVDXXLFFAPRXNLHPFPLQ\n-FXXPKQNMEAYVESSMIACGIIYSLCSHQQSAISIVVGIPRVFFYLPLLKGRADFQLRNA\n-KRNLGSTALFFALVQXHSMVRXLTGGINXXSHLCFAHHCLGWALFHRIAPRXRVFSXAET\n-RLAWLRVARRCLLKSQIAPPGMVFYFQMALLPKVERGLNFSKKFLFPRLHFYLLVWKLSR\n-SLQTFVXLEEKFVIGSLQTFDRFSWRDLLSLPLQLHXLRKNFRWLWFARQCDPSSSFPTE\n-HYSGRPXXLNRWXNAXKIWRRLKLGXPRIVRFSQQKYIILWLLVDQFMITMISRRCLVAP\n-TNQQYNASRAXDXXNVNFILXYRTANLFKYSPAPREPINSTQFARSGFHQLGST\n->blumeria_Grouper_28830_3_2\n-VASSXSVYDHNDFTXVSRGSDXSTIXCEXSLRLIKREFXSIIQDRQLIXIFPRTTXANQQ\n-RTICTVGFPSIGIHKLSPFSKLAVHSLFKLQVNXKFYYGITQTKSLLNFXVSFYPAPAYG\n-GYHTIDYELGVLHVHMPGIGLCRCTCCLICIHPVILRSRYYYYDKLLRPMARHSRAPSCV\n-FAGVLAVPSLRGRKYVXVPFLPGGKPVFYPXLLSYYXRRSVLLVRGVSFRVLRPRGAPLI\n-LWLHGYILDKNFPPPGAECRRVRSKGYTRWVRLFDXNSLPRVRERQLVXFXENPGELXPV\n-WLSERHLPVRLCHFLLAXLVWYGQPAVVGXLEIVVLLCLRSSQHCHXXSALAFQSSGXYT\n-XAEAQCXRSLHWELSGIPASLLRTQLHXARLGVLLEYDLYPTVSEEVLVLXELSFPVTGL\n-EVSXADRTCIFGQLREPRGSVRGAKTYALIPAXYCRLTHGLGPHEHLRPSILDPHIPRFL\n-VGLRRQMDQVHRLLVATGSFXXDAIWNCTSQNYLGPKWQLYLGEVPLLRLEIRXCTAGRC\n-GXVRVGALFPPSQVLFLHHFGFXSFRCRQXLHSLPLLPXREIEHHRDGRENQREHLLFRD\n-GRXSXYXNALXHLKNGPFXRAARLWSEXFVEIHGQLSPLRRRLLPSDANVVVTVKSQVIP\n-SLVLNNAAGYRLVFLRSKLWDAALNDRNCWSIACTVGVXLHPRTFGKRQFPIXREVSNQI\n-FLQLVMLXALVXYFSMIESIGPSEXQGNFXVQRIGPXVALLVGRNFXXDNVGNQLHLQIL\n-LFPRXLLAXACLXSLKLFRGLLQCHVXKYGNQGRFPLKQIACTLKHXGGDHRKRIXKKXV\n-STVSAILPLSLPRQLHRPGALRQMDGMALELLPXNTGKXLVRCIGRKAXLAIHRHRKESQ\n-MLFSLKSLCAYVSAKIRFPGRGMHRSYVLLRAEFHLEHLVGDGRVSSXSCXALYSQHKYA\n-KRFGXSGLASFFGVNNRGAAHGPLHLRMNXAGHVLHKKVPGWLVVAPGLYRLGGEFXIGL\n-TITPFLCGCFCLGRVLSHLAGEIYRKVEGEFNFDIVGKNCNAEXRVGWVPFDHWNIXSSE\n-DFSVWESINYRIKNWLVNXVEKLQFAIXXTSXPQFMEXSLSKCHICWECAIWDNSXRHCE\n-FLSPEXFKVIRAKKLCSXNCILRNCWARATNAXHFRNNRCIIRSQIFRERLXNITCXRAV\n-VKKNXKLDIGKMSYSCKKHSVWLAISFPXRLSFWGWLKFALSYGHKVGIRAVLFINFFIS\n-HSIXNGFNFVIELLIFYLAFRAYLLLIQIFWLNKESRSDRLXXTIVWCYRFYIFFIFHXL\n-VSFPEFIAETRRGVFSVWCIFPLFFXFHRRCFHQPAVFRPVACLSAIEAFVTLVVNWVXF\n-ICFCNVLXRKDVLPIRPWISYGCVKCWKLFAFXRXDRNWCIGLGMFEYIILKCPPCNTAC\n-DLNHSIRKLRAGEFGEIIGNDGPGTWKXESNMLPQYISSLRPYHDIRRXAKESFPESSRK\n-LXLSLVVSCSYSCKCCQRRPEYIIVEQYFKDTVYSSCPIEVLTDDCSSRRDEIFIHFHCN\n-SDSPSRIWKHMLNHQXLHVVXYIHYVLISKVQFPLWWEYRACFSICLFXRAVRIFSFGTR\n-KEIWEVPLYFSLLFSNIQWFVNXLAVXINSPIFVLLIIAXVGRCFIELRRGKGSFLRLKH\n-DWPGCGSRGAACXKVKXLLPVWFFIFRWPCFRKLKGDXIFRRSFCFHVFISTYXFGNXVV\n-HCRHLFDXKRNLXLGLFKPLIDSLGEIFCHCLCSFISFGKIFVGFGLPGNVILHQAFQLS\n-IIQADHDDXIGGEMRKKFGDVLNWDDLELXGSLNKNIXFCGFXLISLXSQXFHVGVSWLR\n-QINNIMRVELETNKTXISFYNT'..b'YATHQLLSSVLWKKFXSHSVHLSQGSWTMXLSGQTQWQNCTHGXYLFFLDS\n-LPMVSSSMLQSAGYLFQRESSLVSIFLNMALQQTPKKFQRSETGLCQQLPRKXEDLXMQL\n-VTYVVSLKISPNXQGHSRTNPLDLKIALSFXRTNRFNHGKVSNXRLQHHQLXKNLIGDFP\n-SYWKLTLPKSSWVQSYSNRTCDAPTIPIVQCCIPXLTSQENXTIPSSVIQHKRGNYLGFY\n-CHYNIGVTGXKAATXRXXLTMNLYELFRPKPSSPSEWSVFXMLXSILISGLSTVAEKQMF\n-SLIFSPVPVMFYFSLGKKGKGMXLLTTTKTLESKVVQKENLRWRKXSTHTNSTASTCSAS\n-PNFXPXERHFPXIXLPLGSEIILRCTIPNCISSKRTRRNKXAMHLVHLAPQPYXKSWNMR\n-IXYRRPXMFMRAKAMRQSAILCGNXGVGFGTPNXSSRLTKLSENASPVSSXNLQTRYWEA\n-XLLXYQHLLXHGGVXIILKXDPKSCSMQLSTQQAGWNPAXFPMQTSLTLCLCSRILSRTL\n-ESQSRLSVTMLAASEAXKHNDFKLANNCRLSIPHQLGQEEMAKSNRQMAFXKPYWSEFSW\n-ILLKLHXLALSHSRXXISIEESHPAGIALTSYSSALSPRRRKILIQYIPVKPQNQRSASG\n-PKNSEGNTPHQXHAPTLVVXKQLGIKYGLTSRKKRHLYVLTPPETGYCEYASEDTRWSPT\n-MTGHGPXQLVIIIIPTPXYHRVDTNXATSTTAQTYSRHMYVKDTQFVVYGMVAAVCWSRI\n-ERHSKIQQGFSLSDTIIKFLINLXFKXAVDSXFXEGGXFVDPNXWKPDRANCALLIGSRG\n-AGEYLNKLAILYYRXKFTFYXSQALLALYCXLVGATRHLREIIVIINXSTRSH\n->blumeria_Grouper_14770_3_1\n-GXTDTVSLVXSCGRKNXLETSVLRCMVLSKTELIRVRLRVRISYQLRFLTSIYQSPWIIS\n-YDPCRCKSIYVQIYEPEIXSXIHVCRXXIRETFNLHLIHNHLMECXCEINANVRXTFREE\n-CADDNDIGRXIXXPNXPDLQMSYPWHSRIYNISTPLLTLHRGXIHKXKTVSIFIVISHLM\n-LVWXTRQWLYXYQKLKCINRCALVSVSLLYIYLRDFXLKEHVIVXASRLQFFPLXNDKRC\n-RYVXKHHLVLDCEQVQWQPYCQSRLLLGCCLQGIGEVRAKSRYIVWMRALLPCTQLRRLN\n->blumeria_Grouper_14770_3_2\n-VRPIQXVSYEVVEGRIDWKQVYXDVWFXVKLSXXEXDCVCAYLINXGFXPVFINLHGSXV\n-MIPVDVNLYTYRYMSQKYKAKYMCVGNRSEKPLTCIXYIIIXWNASVKXMPMYVKLSVRN\n-VLMTMIXEGEFDNLISRTYKXVILGIPGYTIFQHPSSLCIEDRYISEKLLVYLLSFLIXC\n-WYGRHASGCTSTKNXSAXIGVPWSRXAFCTYICEIFSXRNMXXCKRAVFNSFPCKMISDV\n-DMFRSIIXFWIVSKFNGSRIVSRDCCWDAVSKESVKSAQNPDILFGCERYCHVLSFAGXM\n->blumeria_Grouper_14770_3_3\n-LDRYSKSRMKLWKEELTGNKCIEMYGSEXNXADKSEIACAHILSTEVFDQYLSISMDHKL\n-XSLXMXIYIRTDIXARNIKLNTCVSVIDPRNLXPAFDTXSSDGMLVXNKCQCTLNFPXGM\n-CXXQXYRKVNLITXLAGLTNELSLAFQDIQYFNTPPHFASRIDTXVKNCXYIYCHFSSNA\n-GMVDTPVVVLVPKTEVHKSVCLGLGKPFVHISARFLAEGTCNSVSEPSSILSLVKXXAMS\n-ICLEASFSFGLXASSMAAVLSVEIAAGMLSPRNRXSPRKIQIYCLDASAIAMYSASQVE\n->blumeria_Grouper_14770_3_4\n-HSTCEAEYMAIALASKQYIWILRGLHRFLGDSIPAAISTDNTAAIELAHNPKLNDASKHI\n-DIAYHFTRERIEDGSLTLLHVPSAKNLADICTKGLPRPRHTDLCTSVFGTSTTTGVSTIP\n-ALDEKXQXIYXQFFTYVSILDAKXGGVLKYCISWNAKDNSFVSPANXVIKFTFLYHCHQH\n-IPHGKFNVHWHLFHTSIPSDDYVSNAGXRFLGSITDTHVFSFIFLAHISVRIXIYIYRDH\n-NLXSMEIDKYWSKTSVDKICAHAISLLSAQFYSEPYISIHLFPVNSSFHNFIRDLLYRSN\n->blumeria_Grouper_14770_3_5\n-IQPAKLSTWQXRSHPNNISGFCADFTDSLETASQQQSRLTIRLPLNLLTIQNXMMLLNIS\n-TSLIILQGKELKTARLHYYMFLQLKISQIYVQKAYRDQGTPIYALQFLVLVQPLACLPYQ\n-HXMRNDNKYTNSFSLMYLSSMQSEEGCXNIVYPGMPRITHLXVRLIRLSNSPSYIIVIST\n-FLTESLTYIGIYFTLAFHQMIMYQMQVKGFSDLLPTHMYLALYFWLIYLYVYRFTSTGII\n-TYDPWRLINTGQKPQLIRYAHTQSHSYQLSFTQNHTSQYTCFQSILPSTTSYETYCIGLT\n->blumeria_Grouper_14770_3_6\n-FNLRSXVHGNSARIQTIYLDFARTSPIPWRQHPSSNLDXQYGCHXTCSQSKTKXCFXTYR\n-HRLSFYKGKNXRRLAYTITCSFSXKSRRYMYKRLTETKAHRFMHFSFWYXYNHWRVYHTS\n-IRXEMTINILTVFHLCIYPRCKVRRGVEILYILECQGXLICKSGXLGYQIHLPISLSSAH\n-SSRKVXRTLAFISHXHSIRXLCIKCRLKVSRIYYRHTCIXLYISGSYICTYIDLHLQGSX\n-LMIHGDXXILVKNLSXXDMRTRNLTLISSVLLRTIHLNTLVSSQFFLPQLHTRLTVSVX\n->blumeria_Grouper_1717_12_1\n-ISSILPXRASKSXSNSFRSLSSVTGSNSLQNPMMKRSACAERVWNILPCSARNLVATIXG\n-DGVCWCGELRXLASXIGSTNCCVGCCDGGCGPLRTISTSXRVEHXVGRGGQEPASAEDWG\n-GMSEXGLWQCEIVDGIRRAXR\n->blumeria_Grouper_1717_12_2\n-FPVSCPEGPVSPDRIVFEVSRQXLVPTACRTQXXSALLVRSASGISCPVRRGIWSRRFEA\n-TEFVGAVSFDDSPRRLALQIVVWVVVMAVVARXGPFRRLDASNIELGGGAKSQPLRRTGA\n-AXVSEVCGSVRSXMVYGALEG\n->blumeria_Grouper_1717_12_3\n-FQYLALKGQXVLIEXFSKSLVSDWFQQLAEPNDEALCLCGARLEYPALFGEEFGRDDLRR\n-RSLLVRXASMTRLVDWLYKLLCGLLXWRLWPVKDHFDVLTRRTLSWEGGPRASLCGGLGR\n-HEXVRFVAVXDRRWYTARLK\n->blumeria_Grouper_1717_12_4\n-PFKRAVYHLRSHTATNLTHSCRPSPPQRLALGPPSQLNVRRVKTSKWSLTGHNRHHNNPH\n-NNLXSQSTRRVIEAHRTNKLRRLKSSRPNSSPNRAGYSRRAPHKQSASSLGSASCWNQSL\n-TRDFENYSIRTYWPFRARYWK\n->blumeria_Grouper_1717_12_5\n-PSSAPYTIYDLTLPQTSLTHAAPVLRRGWLLAPPPNSMFDASRRRNGPXRATTAITTTHT\n-TICRANLRGESSKLTAPTNSVASNRRDQIPRRTGQDIPDALRTSRALHHWVLQAVGTSHX\n-RETSKTIRSGLTGPSGQDTGN\n->blumeria_Grouper_1717_12_6\n-LQARRIPSTISHCHKPHSLMPPQSSAEAGSWPPLPTQCSTRQDVEMVLNGPQPPSQQPTQ\n-QFVEPIYEASHRSSPHQQTPSPQIVATKFLAEQGRIFQTRSAQAERFIIGFCKLLEPVTD\n-ERLRKLFDQDLLALQGKILE\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/test_input_nt.fa --- a/commons/pyRepetUnit/fastaTranslation/allFrames/tests/datas/test_input_nt.fa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,124 +0,0 @@ ->blumeria_Grouper_28830_3 -TGTGGCTTCTAGTTGATCAGTTTATGATCACAATGATTTCACGTAGGTGTCTCGTGGCTC -CGACTAATCAACAATATAATGCGAGTAGAGCTTGAGACTAATAAAACGTGAATTTNATTC -TATAATACAGGATCGCCAACTTATTTAAATATTCCCCCGCACCACGTGAGCCAATCAACA -GCGCACAATTTGCACGGTCGGGTTTCCATCAATTGGGATCCACAAACTATCCCCCTTCTC -AAAACTAGCTGTCCACAGCTTATTTAAATTACAAGTTAATTAGAAATTTTATTATGGTAT -CACTCAAACTAAATCCTTGCTGAATTTTTGAGTGTCTTTCTATCCTGCTCCAGCATACGG -CGGCTACCATACCATAGACTACGAACTGGGTGTCCTTCACGTACATATGCCGGGAATAGG -TTTGTGCCGTTGTACTTGTTGCCTAATTTGTATCCACCCGGTGATATTAAGGAGTAGGTA -TTATTATTATGACAAGCTGCTACGGCCCATGGCCCGTCATAGTAGGGCTCCATCTTGTGT -CTTCGCTGGCGTACTCGCAGTACCCAGTCTCCGGGGGCGTAAGTACGTATAAGTGCCTTT -TCTTCCTGGAGGTAAGCCCGTATTTTATCCCTAGTTGCTTTCATACTACTAACGTAGGAG -CGTGCTATTGGTGCGGGGTGTTTCCTTCCGAGTTCTTCGGCCCAGAGGCGCTCCTCTGAT -TCTGTGGCTTCACGGGTATATACTGGATAAGAATTTTCCTCCTCCGGGGGCTGAGTGCCG -AAGAGTAAGAAGTAAGGGCTATACCCGCTGGGTGAGACTCTTCGATTGAAATTCATTACC -GCGAGTGAGAGAGCGCCAGCTAGTGTAATTTTAGGAGAATCCAGGAGAACTCTGACCAGT -ATGGCTTTCAGAACGCCATTTGCCTGTTCGACTTTGCCATTTCCTCTTGGCCTAGCTGGT -GTGGTATGGACAACCTGCAGTTGTTGGCTAGCTTGAAATCGTTGTGCTTCTATGCCTCCG -AAGCAGCCAGCATTGTCACTGATAATCTGCTTTGGCTTTCCAAAGTTCTGGATAATATAC -GTGAGCAGAGGCACAGTGTTAGCGAAGTCTGCATTGGGAACTAAGCGGGATTCCAGCCAG -CCTGTTGCGTACTCAATTGCATTGAGCAAGACTTGGGGTCCTACTTGAGTATGATCTATA -CCCCACCGTGTCAGAGGAGGTGCTGGTACTATAGGAGTTAAGCTTCCCAGTAACGGGTCT -GGAGGTTTCATGAGCTGACAGGACTTGCATTTTCGGACAGCTTCGTGAGCCGCGAGGATC -AGTTCGGGGTGCCAAAACCTACGCCCTAATTCCCGCATAGTATTGCCGATTGACGCATGG -CCTTGGCCCTCATGAACATTTACGGCCGTCGATACTAGATCCTCATATTCCAAGATTTCT -AGTAGGGTTGCGGCGCCAGATGGACCAGGTGCATCGCCTACTTGTTGCGACGGGTTCTTT -TTGATGAGATGCAATTTGGAATTGTACATCGCAAAATTATCTCGGACCCAAGTGGCAGCT -ATATTTAGGGGAAGTGCCTCTCCTAAGGTTAGAAATTCGGTGATGCACTGCAGGTCGATG -CGGTTGAGTTCGTGTGGGTGCTTTATTTCCTCCATCTCAAGTTCTCTTTCTGCACCACTT -TGGATTCTAGAGTTTTCGTTGTCGTCAGTAGCTACATTCCCTTCCCCTTCTTCCCTAGAG -AGAAATAGAACATCACAGGGACGGGAGAGAAAATCAGCGAGAACATTTGCTTTTCCGCGA -CGGTAGATAATCCTGATATTAAAATGCTCTATAGCATCTAAAAAACGGACCATTCTGACG -GGCTGCTCGGCTTTGGTCTGAATAGTTCGTAGAGATTCATGGTCAGTTATCACCGTTACG -TCGCCGCCTTCTACCCAGTGACGCCAATGTTGTAGTGACAGTAAAATCCCAAGTAATTCC -CTCTCTTGTGCTGAATAACGCTGCTGGGTATCGTTTAGTTTTCTTGAGAAGTAAGCTATG -GGATGCAGCACTGAACGATCGGAATTGTTGGAGCATCGCATGTACGGTTGGAGTATGACT -GCACCCACGAACTTTTGGGAAGCGTCAGTTTCCAATATGACGGGAAGTCTCCAATCAAAT -TTTTTTACAACTGGTGATGTTGTAAGCGCTAGTTTGATACTTTTCCATGATTGAATCGAT -TGGTCCGTCAGAATGACAGGGCAATTTTTAGGTCCAGAGGATTGGTCCGTGAGTGGCCCT -GCTAGTTGGGAGAAATTTTTAATGAGACAACGTAGGTAACCAGCTGCATTTACAAATCCT -CTTATTTCCGAGGTAGTTGTTGGCATAGGCCTGTCTCTGATCGCTGAAACTTTTTCGGGG -TCTGCTGCAATGCCATGTTTAGAAATATGGAAACCAAGGAAGATTCCCTCTGAAACAAAT -AGCCTGCACTTTGAAGCATTGAGGAGGAGACCATAGGAAGCGAATCTAGAAAAAATAAGT -ATCAACCGTGAGTGCAATTCTGCCATTGAGTCTGCCCAGACAGCTACATCGTCCAGGAGC -CCTGCGACAAATGGACGGAATGGCTCTAGAACTTCTTCCATAAAACACTGGAAAGTAGCT -GGTGCGTTGCATAGGCCGAAAGGCATAACTAGCCATTCATAGACACCGAAAGGAGTCACA -AATGCTGTTTTCTCTGAAGAGTCTTTGTGCATACGTATCTGCCAAAATCCGTTTTCCAGG -TCGAGGAATGCATAGAAGTTATGTCCTGCTGCGCGCTGAATTTCATCTTGAGCATTTGGT -AGGGGATGGGCGTGTTTCTTCGTAATCTTGTTAAGCTCTCTATAGTCAACACAAATACGC -CAAACGGTTTGGTTAGTCTGGGTTAGCGTCTTTTTTTGGTGTTAATAACAGAGGTGCAGC -CCATGGTCCCTTACATTTGCGTATGAATTGAGCCGGTCATGTGTTGCACAAGAAAGTCCC -CGGATGGCTTGTTGTTGCGCCGGGGCTATATCGCCTCGGAGGGGAGTTTTAAATTGGGTT -GACAATTACCCCGTTTCTATGCGGGTGTTTCTGTCTTGGGAGAGTTTTATCCCATTTGGC -GGGAGAGATTTATCGAAAAGTTGAAGGGGAATTTAACTTTGATATTGTAGGGAAAAACTG -TAATGCGGAATGAAGGGTGGGCTGGGTGCCATTTGACCATTGGAATATTTGAAGTAGTGA -AGACTTTTCGGTTTGGGAGAGTATTAATTATAGGATTAAGAATTGGTTGGTCAATTAAGT -TGAGAAGTTGCAGTTTGCCATTTGATAAACATCGTAGCCCCAGTTCATGGAATAAAGTTT -GTCCAAGTGTCACATCTGCTGGGAATGTGCCATCTGGGACAACTCCTAGAGACACTGTGA -ATTCCTGAGTCCAGAATGATTCAAGGTGATTCGAGCAAAGAAACTGTGCAGTTAAAATTG -CATCCTTAGAAATTGTTGGGCCAGGGCCACCAATGCCTGACATTTTAGAAATAATAGATG -TATTATAAGAAGTCAAATATTTAGAGAAAGACTGTGAAACATAACATGCTGAAGAGCCGT -AGTCAAAAAAAACTGAAAATTGGACATAGGGAAAATGAGTTATTCGTGCAAAAAACATTC -TGTGTGGCTTGCCATATCCTTCCCGTAGAGGTTGTCCTTTTGGGGGTGGCTCAAATTTGC -CCTTTCCTACGGCCACAAAGTAGGTATTCGGGCTGTCCTATTCATAAATTTCTTCATTTC -GCATTCGATATAGAATGGCTTCAATTTCGTCATCGAGCTGCTCATCTTCTATTTGGCCTT -CAGGGCTTATTTGCTCTTGATCCAAATCTTCTGGCTCAACAAGGAAAGTAGAAGTGACAG -GCTTTGATGAACGATCGTGTGGTGTTACAGGTTTTACATATTTTTTATTTTTCATTGATT -GGTAAGTTTTCCTGAATTTATCGCTGAAACGCGACGAGGTGTATTTAGCGTTTGGTGCAT -ATTCCCTTTGTTCTTTTGATTCCACCGGCGCTGTTTTCATCAACCGGCAGTCTTTCGCCC -AGTGGCCTGTCTTTCCGCAATTGAAGCATTCGTAACGCTTGTCGTGAATTGGGTATGATT -TATCTGTTTCTGCAATGTCTTGTGACGCAAAGACGTCTTGCCCATACGACCTTGGATCAG -CTATGGATGCGTCAAATGCTGGAAGCTTTTCGCCTTTTGACGCTGAGATCGGAATTGGTG -CATTGGACTCGGAATGTTTGAATACATCATCCTCAAGTGTCCACCTTGTAATACCGCGTG -TGACTTGAACCACTCGATCCGCAAGCTCCGCGCTGGTGAGTTTGGGGAGATTATTGGAAA -TGATGGTCCAGGTACGTGGAAGTGAGAGTCGAATATGCTGCCTCAGTATATCTCTAGTCT -GAGGCCCTACCATGACATCCGAAGGTAGGCTAAAGAAAGCTTTCCGGAGTCGTCGCGCAA -ATTGTAATTGAGTCTCGTCGTTTCTTGCAGTTATTCGTGCAAATGTTGTCAAAGGCGACC -CGAGTACATCATTGTCGAACAGTATTTTAAGGATACAGTCTACAGCTCCTGCCCAATCGA -GGTGTTGACTGATGATTGTTCTTCGCGCCGAGATGAAATCTTCATCCATTTCCATTGCAA -TTCTGATAGCCCAAGCAGAATATGGAAGCATATGTTGAATCATCAATGATTGCATGTGGT -ATAATATATTCATTATGTTCTCATCAGCAAAGTGCAATTTCCATTGTGGTGGGAATACCG -CGCGTGTTTTTCTATTTGCCTCTTTTAAAGGGCCGTGCGGATTTTCAGCTTCGGAACGCG -AAAAGAAATCTGGGAAGTACCGCTTTATTTTTCGCTCTTGTTCAGTAACATTCAATGGTT -CGTTAACTGACTGGCGGTATAAATTAATAGTCCCATCTTTGTTTTGCTCATCATTGCTTA -GGTTGGGCGTTGTTTCATAGAATTGCGCCGAGGTAAAGGGTCTTTTCTTAGGCTGAAACA -CGATTGGCCTGGTTGCGGGTCGCGAGGCGCTGCCTGCTGAAAAGTCAAATAGCTCCTCCC -GGTATGGTTTTTTATTTTCAGATGGCCCTGCTTCCGAAAGTTGAAAGGGGACTGAATTTT -TCGAAGAAGTTTTTGTTTCCACGTCTTCATTTCTACTTACTAGTTTGGAAATTAAGTCGT -TCATTGCAGACATTTGTTTGACTAGAAGAGAAATTTGTGATTGGGTCTCTTCAAACCTTT -GATCGATTCTCTTGGAGAGATCTTTTGTCACTGCCTTTGCAGCTTCATTAGCTTCGGAAA -AATTTTCGTTGGCTTTGGTTTGCCCGGCAATGTGATCCTTCATCAAGCTTTCCAACTGAG -CATTATTCAGGCCGACCATGATGATTGAATAGGTGGTGAAATGCGTAAAAAATTTGGAGA -CGTCTTAAATTGGGATGACCTAGAATTGTGAGGTTCTCTCAACAAAAATATATAATTTTG -TGGCTTCTAGTTGATCAGTTTATGATCACAATGATTTCACGTAGGTGTCTCGTGGCTCCG -ACAAATCAACAATATAATGCGAGTAGAGCTTGAGACTAATAAAACGTGAATTTCATTCTA -TAATACAGGACCGCCAACTTATTTAAATATTCCCCCGCACCACGTGAGCCAATCAACAGC -ACACAATTTGCACGGTCGGGTTTCCATCAATTGGGATCCACA ->blumeria_Grouper_14770_3 -GGTTAGACCGATACAGTAAGTCTCGTATGAAGTTGTGGAAGGAAGAATTGACTGGAAACA -AGTGTATTGAGATGTATGGTTCTGAGTAAAACTGAGCTGATAAGAGTGAGATTGCGTGTG -CGCATATCTTATCAACTGAGGTTTTTGACCAGTATTTATCAATCTCCATGGATCATAAGT -TATGATCCCTGTAGATGTAAATCTATATACGTACAGATATATGAGCCAGAAATATAAAGC -TAAATACATGTGTGTCGGTAATAGATCCGAGAAACCTTTAACCTGCATTTGATACATAAT -CATCTGATGGAATGCTAGTGTGAAATAAATGCCAATGTACGTTAAACTTTCCGTGAGGAA -TGTGCTGATGACAATGATATAGGAAGGTGAATTTGATAACCTAATTAGCCGGACTTACAA -ATGAGTTATCCTTGGCATTCCAGGATATACAATATTTCAACACCCCTCCTCACTTTGCAT -CGAGGATAGATACATAAGTGAAAAACTGTTAGTATATTTATTGTCATTTCTCATCTAATG -CTGGTATGGTAGACACGCCAGTGGTTGTACTAGTACCAAAAACTGAAGTGCATAAATCGG -TGTGCCTTGGTCTCGGTAAGCCTTTTGTACATATATCTGCGAGATTTTTAGCTGAAGGAA -CATGTAATAGTGTAAGCGAGCCGTCTTCAATTCTTTCCCTTGTAAAATGATAAGCGATGT -CGATATGTTTAGAAGCATCATTTAGTTTTGGATTGTGAGCAAGTTCAATGGCAGCCGTAT -TGTCAGTCGAGATTGCTGCTGGGATGCTGTCTCCAAGGAATCGGTGAAGTCCGCGCAAAA -TCCAGATATATTGTTTGGATGCGAGCGCTATTGCCATGTACTCAGCTTCGCAGGTTGAAT -G ->blumeria_Grouper_1717_12 -ATTTCCAGTATCTTGCCCTGAAGGGCCAGTAAGTCCTGATCGAATAGTTTTCGAAGTCTC -TCGTCAGTGACTGGTTCCAACAGCTTGCAGAACCCAATGATGAAGCGCTCTGCTTGTGCG -GAGCGCGTCTGGAATATCCTGCCCTGTTCGGCGAGGAATTTGGTCGCGACGATTTGAGGC -GACGGAGTTTGTTGGTGCGGTGAGCTTCGATGACTCGCCTCGTAGATTGGCTCTACAAAT -TGTTGTGTGGGTTGTTGTGATGGCGGTTGTGGCCCGTTAAGGACCATTTCGACGTCTTGA -CGCGTCGAACATTGAGTTGGGAGGGGGGGCCAAGAGCCAGCCTCTGCGGAGGACTGGGGC -GGCATGAGTGAGTGAGGTTTGTGGCAGTGTGAGATCGTAGATGGTATACGGCGCGCTTGA -AGGG - |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/fastaTranslation/allFrames/translateAfastaFileInAllFrameAndReplaceStopsByX_script.py --- a/commons/pyRepetUnit/fastaTranslation/allFrames/translateAfastaFileInAllFrameAndReplaceStopsByX_script.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,88 +0,0 @@ -#!/usr/bin/env python - -from commons.pyRepetUnit.fastaTranslation.allFrames.TranslateInAllFramesAndReplaceStopByX import TranslateInAllFramesAndReplaceStopByX -from commons.core.utils.FileUtils import FileUtils -import os -import sys -import getopt - -#------------------------------------------------------------------------------ - -def help(): - - """ - Give the command-line parameters. - """ - - print "" - print "usage: ",sys.argv[0],"[ options ]" - print "options:" - print " -h: this help" - print " -i: name of the nucleotidic input file (format='fasta')" - print " -o: name of the output file (default=inFileName+'_aa')" - print " -v: verbose (default=0/1/2)" - print " -c: clean" - print "" - -#------------------------------------------------------------------------------ - -def main(): - - inFileName = "" - outFileName = "" - verbose = 0 - clean = False - - try: - opts = getopt.getopt(sys.argv[1:],"hi:o:v:c")[0] - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-o": - outFileName = a - elif o == "-v": - verbose = int(a) - elif o == "-c": - clean = True - - if inFileName == "": - print "*** Error: missing compulsory options" - help() - sys.exit(1) - - if verbose > 0: - print "beginning of %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - if outFileName == "": - outFileName = "%s_aa" % ( inFileName ) - - iTIAFARSBX = TranslateInAllFramesAndReplaceStopByX() - iTIAFARSBX.setInputFile( inFileName ) - iTIAFARSBX.setOutputFile( outFileName ) - iTIAFARSBX.run( ) - - if clean == True: - os.remove( inFileName ) - - if verbose > 0: - if FileUtils.isRessourceExists( outFileName ) and not(FileUtils.isEmpty( outFileName )): - print "%s finished successfully" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - else: - print "warning %s execution failed" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - -#------------------------------------------------------------------------------ - -if __name__ == '__main__': - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/HmmpfamClusterComponent.py --- a/commons/pyRepetUnit/hmmer/HmmpfamClusterComponent.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,91 +0,0 @@ -import os -from pyRepet.launcher.Launcher import HmmpfamLauncher - - -class HmmpfamClusterComponent( object ): - - def __init__(self): - self._component = None - self._profilDatabank = "" - self._resultDir = "" - self._queryDir = "" - self._tmpDir = "" - self._jobDb = None - self._SGEQueue = "" - self._SGEGroupId = "" - - def loadConfig( self, config ): - self._profilDatabank = config.get( "profil_search","ProfilDatabank" ) - self._queryDir = config.get( "hmmer_config","query_dir" ) - self._tmpDir = config.get( "hmmer_config", "tmp_dir" ) - self._resultDir = config.get( "hmmer_config", "result_dir" ) - self._SGEQueue = config.get( "sge_config", "queue" ) - self._SGEGroupId = config.get( "sge_config", "groupid" ) - - def run(self): - params = {"param":"--informat FASTA -E 10", - "profilDB": self._profilDatabank, - "outputDir": self._resultDir, - "query": self._queryDir, - "job_table":"jobs", - "queue" : self._SGEQueue, - "groupid" : self._SGEGroupId, - "tmpDir": self._tmpDir, - "cDir" : "."} - self._component = HmmpfamLauncher(self._jobDb, params) - self._component.run() - - def clean (self): - dirToClean = self._tmpDir - os.system("rm " + dirToClean + "/*") - dirToClean = self._resultDir - os.system("rm " + dirToClean + "/*") - - def setProfilDatabank (self, profilDatabank): - self._profilDatabank = profilDatabank - - def getProfilDatabank(self): - return self._profilDatabank - - def setQueryDir(self, input): - self._queryDir = input - - def getQueryDir( self ): - return self._queryDir - - def setSubjectDir(self, input): - self._subjectDir = input - - def getSubjectDir( self ): - return self._subjectDir - - def setSGEQueue(self, queue): - self._SGEQueue = queue - - def getSGEQueue( self ): - return self._SGEQueue - - def setSGEGrouId(self, id): - self._SGEGroupId = id - - def getSGEGroupId( self ): - return self._SGEGroupId; - - def setTmpDir(self, tmpDir): - self._tmpDir = tmpDir - - def getTmpDir( self ): - return self._tmpDir - - def setResultDir(self, wkDir): - self._resultDir = wkDir - - def getResultDir(self): - return self._resultDir - - def setJobDb (self, jobDb): - self._jobDb = jobDb - - def getJobDb (self): - return self._jobDb - \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/LaunchPreProcessHmmpfamPostProcessNotInParallel.py --- a/commons/pyRepetUnit/hmmer/LaunchPreProcessHmmpfamPostProcessNotInParallel.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,122 +0,0 @@ -import os -import unittest -from pyRepet.launcher.programLauncher import * -from pyRepet.util.file.FileUtils import * -import commons.pyRepetUnit.fastaTranslation.allFrames.TranslateInAllFramesAndReplaceStopByX -import commons.pyRepetUnit.hmmer.hmmOutput.HmmpfamOutputProcessing -import ConfigParser - -class LaunchPreProcessHmmpfamPostProcessNotInParallel: - - def __init__( self ): - - #for global analysis - self._configFile = "" - self._inputFile = "" - self._outputFile = "" - self.fileUtils = FileUtils() - self._programLauncherInstance = programLauncher() - #specific to PreProcess - self.bioseq = Bioseq() - self.preProcess = commons.pyRepetUnit.fastaTranslation.allFrames.TranslateInAllFramesAndReplaceStopByX.TranslateInAllFramesAndReplaceStopByX() - self._outputFilePreprocess = "" - #specific to PostProcess - self.hmmpfamOutputProcess = commons.pyRepetUnit.hmmer.hmmOutput.HmmpfamOutputProcessing.HmmpfamOutputProcessing() - - def _cleanTemporaryFiles(self, outputFilePreProcess, outputFileHmmpfam): - os.remove( outputFilePreProcess ) - os.remove( outputFileHmmpfam ) - - def _launchPostProcess(self, outputFileHmmpfam): - return self.hmmpfamOutputProcess.readHmmOutputsAndWriteAlignFile(outputFileHmmpfam, self._outputFile) - - - def _launchHmmpfam(self, outputFilePreprocess): - config = ConfigParser.ConfigParser() - config.readfp(open(self._configFile)) - self._programLauncherInstance.reset(outputFilePreprocess) - outputFileHmmpfam = outputFilePreprocess + ".hmmpfamOut" - self._programLauncherInstance.setOutputFileName(outputFileHmmpfam) - self._programLauncherInstance.launchHmmpfam(evalFilter=config.get("profil_search", "Evalue"), inputFormat=config.get("profil_search", "InputFormat"), profilDatabank=config.get("profil_search", "ProfilDatabank")) - return outputFileHmmpfam - - - def _launchHmmpfamPreProcess(self): - self.preProcess.setInputFile(self._inputFile) - outputFilePreprocess = self._inputFile + ".translated" - self.preProcess.setOutputFile(outputFilePreprocess) - self.preProcess.run() - return outputFilePreprocess - - def setInputFile( self, input ): - self._inputFile = input; - - def setOutputFile( self, output ): - self._outputFile = output; - - def setConfigFile ( self, configFile ): - self._configFile = configFile - - def checkInputFile(self): - return self._checkFileExitsAndNotEmpty( self._inputFile ) - - def checkConfigFile(self): - return self._checkFileExitsAndNotEmpty( self._configFile ) - - def _checkFileExitsAndNotEmpty(self, fileName): - fileUtils = FileUtils() - if fileUtils.isRessourceExists(fileName) and not fileUtils.isFileEmpty(fileName): - return 1 - return 0 - - def run(self): - - if not self.checkInputFile(): - print "Warning : there is no input file : " + self._inputFile + "\n" - return 0 - if not self.checkConfigFile(): - print "Warning : there is no config file : " + self._configFile + "\n" - return 0 - outputFilePreProcess = self._launchHmmpfamPreProcess() - outputFileHmmpfam = self._launchHmmpfam(outputFilePreProcess) - self._launchPostProcess(outputFileHmmpfam) - self._cleanTemporaryFiles(outputFilePreProcess, outputFileHmmpfam) - - -if __name__ == "__main__": - main() - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -if __name__ == "__main__": - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/check/OldDetectFeatureConfigChecker.py --- a/commons/pyRepetUnit/hmmer/check/OldDetectFeatureConfigChecker.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,57 +0,0 @@ -''' -Created on 14 avr. 2009 - -@author: oinizan -''' -import re -from commons.core.checker.IChecker import IChecker -from commons.core.checker.OldConfigChecker import ConfigChecker -from commons.core.checker.ConfigException import ConfigException -from commons.core.checker.CheckerException import CheckerException - -class DetectFeatureConfigChecker (IChecker): - ''' - classdocs - ''' - def __init__(self): - ''' - Constructor - ''' - self._dict = {"te_hmmer" : "", - "te_blrn" : "" - } - self._specifiqueDict = {"te_hmmer_evalue" : "", - "te_hmm_profiles" : "" - } - - def _appendMessageToConfigExceptionMessage(self, messages): - appendedMessages = [] - for msg in messages: - if (re.match("\[detect_features\] - No option 'te_hmm_profiles' in section: 'detect_features'", msg)): - appendedMessages.append(msg + " whereas te_hmmer is set") - - if (re.match("\[detect_features\] - No option 'te_hmmer_evalue' in section: 'detect_features'", msg)): - appendedMessages.append(msg + " whereas te_hmmer is set - Default value will be set") - - return appendedMessages - - - def check(self, configFile): - chk = ConfigChecker("detect_features", self._dict) - try : - chk.check(configFile) - except ConfigException, e : - raise e - - if self._dict["te_hmmer"] == "yes": - isErrorOccured = False - try: - chk = ConfigChecker("detect_features", self._specifiqueDict) - chk.check(configFile) - except ConfigException, e: - appendedMessages = self._appendMessageToConfigExceptionMessage(e.messages) - raise ConfigException("", appendedMessages) - - -if __name__ == "__main__": - pass |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/check/test/Test_OldDetectFeaturesConfigChecker.py --- a/commons/pyRepetUnit/hmmer/check/test/Test_OldDetectFeaturesConfigChecker.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,138 +0,0 @@ -import unittest -import re -import os -from commons.pyRepetUnit.hmmer.check.OldDetectFeatureConfigChecker import DetectFeatureConfigChecker -from commons.core.checker.ConfigException import ConfigException - -class Test_DetectFeaturesConfigChecker(unittest.TestCase): - - def setUp(self): - self._detectFeatureConfigChecker = DetectFeatureConfigChecker() - - def testWithDefaultLogger (self): - lineFound = False - try: - self._detectFeatureConfigChecker.check("dummyConfig") - except ConfigException, e: - for msg in e.messages: - if (re.match("CONFIG FILE not found.*", msg)): - lineFound = True - self.assertTrue(lineFound) - - def testWithNoConfigFile(self): - lineFound = False - try: - self._detectFeatureConfigChecker.check("dummyConfig") - except ConfigException, e: - for msg in e.messages: - if (re.match("CONFIG FILE not found.*", msg)): - lineFound = True - self.assertTrue(lineFound) - - def testWithNoSectionInConfigFile(self): - config = open("config.cfg", "w"); - config.close() - lineFound = False - try: - self._detectFeatureConfigChecker.check("config.cfg") - except ConfigException, e: - for msg in e.messages: - if (re.match("\[detect_features\] section not found.*", msg)): - lineFound = True - self.assertTrue(lineFound) - os.remove("config.cfg") - - def testMissingOptionsInConfig (self): - dict = {} - MockConfigFile("config.cfg", dict) - hmmProfilsFound = False - TE_BLRnFound = False - try : - self._detectFeatureConfigChecker.check("config.cfg") - except ConfigException, e: - for msg in e.messages: - if (re.match("\[detect_features\] - No option 'te_hmmer' in section: 'detect_features'", msg)): - hmmProfilsFound = True - if (re.match("\[detect_features\] - No option 'te_blrn' in section: 'detect_features'", msg)): - TE_BLRnFound = True - self.assertTrue(hmmProfilsFound) - self.assertTrue(TE_BLRnFound) - os.remove("config.cfg") - - def testOptionsIfHmmProfilsSetAtYESInConfig (self): - - dict = { - "TE_HMMER" : "yes", - "TE_BLRn" : "no" - } - - profilDatabankFound = False - evalueFound = False - MockConfigFile("config.cfg", dict) - try : - self._detectFeatureConfigChecker.check("config.cfg") - except ConfigException, e: - for msg in e.messages: - print msg - if (re.match("\[detect_features\] - No option 'te_hmm_profiles' in section: 'detect_features' whereas te_hmmer is set", msg)): - profilDatabankFound = True - if (re.match("\[detect_features\] - No option 'te_hmmer_evalue' in section: 'detect_features' whereas te_hmmer is set - Default value will be set", msg)): - evalueFound = True - self.assertTrue(profilDatabankFound) - self.assertTrue(evalueFound) - os.remove("config.cfg") - - - def testOptionsIfHmmProfilsSetAtNOInConfig (self): - profilDatabankFound = False - inputFormatFound = False - evalueFound = False - dict = { - "TE_HMMER" : "no" - } - MockConfigFile("config.cfg", dict) - try : - self._detectFeatureConfigChecker.check("config.cfg") - except ConfigException, e: - for msg in e.messages: - if (re.match(".+INFO \[detect_features\] - No option 'te_hmm_profiles' in section: 'detect_features' whereas te_hmmer is set", msg)): - profilDatabankFound = True - if (re.match(".+INFO \[detect_features\] - No option 'te_hmmer_evalue' in section: 'detect_features' whereas te_hmmer is set - Default value will be set", msg)): - evalueFound = True - self.assertFalse(profilDatabankFound) - self.assertFalse(inputFormatFound) - self.assertFalse(evalueFound) - os.remove("config.cfg") - - def testTE_BLRnAndTE_hmmerAtNoInConfig (self): - - dict = { - "TE_HMMER" : "no", - "TE_BLRn" : "no" - } - - exceptionNotRaised = True - MockConfigFile("config.cfg", dict) - try : - self._detectFeatureConfigChecker.check("config.cfg") - except ConfigException: - exceptionNotRaised = False - - self.assertTrue(exceptionNotRaised) - - os.remove("config.cfg") - -class MockConfigFile: - - def __init__ (self, fileName, optionsDict): - - self._fileName = fileName - config = open(fileName, "w"); - config.write("[detect_features]\n") - for key in optionsDict.keys(): - config.write(key + ":" + optionsDict[key] + "\n") - config.close() - - -if __name__ == "__main__": - unittest.main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/check/test/detectFeatureConfigCheckerTestSuite.py --- a/commons/pyRepetUnit/hmmer/check/test/detectFeatureConfigCheckerTestSuite.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,22 +0,0 @@ -''' -Created on 29 mai 2009 - -@author: oinizan -''' -import unittest -import sys -import TestDetectFeaturesConfigChecker - - - - -def main(): - - commonsTestSuite = unittest.TestSuite() - commonsTestSuite.addTest(unittest.makeSuite(TestDetectFeaturesConfigChecker.TestDetectFeaturesConfigChecker,'test')) - runner = unittest.TextTestRunner(sys.stderr, 2, 2) - runner.run(commonsTestSuite) - - -if __name__ == '__main__': - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/HmmOutput.py --- a/commons/pyRepetUnit/hmmer/hmmOutput/HmmOutput.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,30 +0,0 @@ -## List of Hmmpfam or Hmmscan Output (that are too lists). -# -class HmmOutput( object ): - - list; - - def __init__( self ): - self._hmmpfamOutput = [] - - ## append an output in the list of output - # - # @param list name of the list - # - def append( self, list ): - self._hmmpfamOutput.append(list) - - ## return the length of the list of output - def len (self): - return len(self._hmmpfamOutput) - - ## return the output corresponding at the element number index in the list of output - # - # @param index number of index - # - def get(self, index): - return self._hmmpfamOutput[index] - - ## return the list of output - def getList(self): - return self._hmmpfamOutput |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/HmmOutputProcessing.py --- a/commons/pyRepetUnit/hmmer/hmmOutput/HmmOutputProcessing.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,39 +0,0 @@ -import os -from commons.pyRepetUnit.hmmer.hmmOutput.HmmOutput import HmmOutput - -##Concrete implementation for hmmscan and hmmpfam output methods -# -class HmmOutputProcessing (object): - - ## write a align file from a HmmOutput object - # - # @param fout handle of align file - # @param HmmOutput HmmOutput object in fact a list of hmmOutput containing datas required - # - def writeHmmOutputToAlignFile( self, pfamOutput, fout ): - for item in pfamOutput.getList(): - for i in item: - fout.write(i + "\t") - fout.write("0\n") - - ## read an output file from hmm profiles search program and write the corresponding .align file - # - # @param inputFile file - # @param outputFile file - # - def readHmmOutputsAndWriteAlignFile( self, inputFile, outputFile ): - if not os.path.exists(inputFile): - print "Warning your input file " + inputFile + " does not exist!\n" - return - file2parse = open( inputFile ) - pfamOutput = HmmOutput() - if outputFile == "": - print "Warning have to specify an output name file!\n" - return - fout = open(outputFile, "w") - while pfamOutput != None: - pfamOutput = self.readHmmOutput(file2parse) - if pfamOutput != None: - self.writeHmmOutputToAlignFile(pfamOutput, fout) - fout.close() - file2parse.close() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/HmmpfamOutputProcessing.py --- a/commons/pyRepetUnit/hmmer/hmmOutput/HmmpfamOutputProcessing.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,36 +0,0 @@ -from commons.pyRepetUnit.hmmer.hmmOutput.HmmOutput import HmmOutput -import re -from commons.pyRepetUnit.hmmer.hmmOutput.HmmOutputProcessing import HmmOutputProcessing - -##Concrete implementation for specific methods -# -class HmmpfamOutputProcessing (HmmOutputProcessing): - - ##read an output from hmmpfam and return a array with results useful to build a .align file - # - # @param file handle of file generated by software searching hmm profiles - # - def readHmmOutput( self, hmmerOutputFile ): - #Tested with HMMER 2.3.2 on Linux (Debian) and on Unix (Solaris) - line = hmmerOutputFile.readline() - tabResult = None - aRecup = 0 - if (line == ""): - tabResult = None - return tabResult - tabResult = HmmOutput() - while not re.match("Alignments of top-scoring domains:.*", line): - line = hmmerOutputFile.readline() - m = re.match("Query sequence:\s*(.*)", line) - if m: - seqName = m.group(1) - #warning : do no use a return character because they change between several OS - if re.match("--------\s+-------\s+-----\s+-----\s+-----\s+-----\s+-----\s+-------.*", line): - aRecup = 1 - m = re.match("(\S+)\s+\d+\/\d+\s+(\d+)\s+(\d+)\s+.+\s+(\d+)\s+(\d+)\s+.+\s+(.+\.\d)\s+(.+)", line) - if m and aRecup == 1: - tabResult.append([seqName, m.group(2), m.group(3), m.group(1), m.group(4), m.group(5), m.group(7), m.group(6)]) - if line == "": - tabResult = None - return tabResult - return tabResult |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/HmmscanOutputProcessing.py --- a/commons/pyRepetUnit/hmmer/hmmOutput/HmmscanOutputProcessing.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,36 +0,0 @@ -import re -from commons.pyRepetUnit.hmmer.hmmOutput.HmmOutput import HmmOutput -from commons.pyRepetUnit.hmmer.hmmOutput.HmmOutputProcessing import HmmOutputProcessing - -##Concrete implementation for hmmscan output specific methods -# -class HmmscanOutputProcessing (HmmOutputProcessing): - - ## read an hmmscan output from a file, return a array with results useful to build a .align file - # - # @param file handle of file generated by software searching hmm profiles - # - def readHmmOutput( self, hmmerOutputFile ): - #Tested with HMMER 3 on Linux - line = hmmerOutputFile.readline() - tabResult = None - if (line == ""): - tabResult = None - return tabResult - tabResult = HmmOutput() - - while line != "": - line = hmmerOutputFile.readline() - if not(re.match("^#.*$", line)) and line != "": - lLines = re.split("\s+", line) - seqName = lLines[3] - profilName = lLines[0] - iValue = lLines[12] - score = lLines[13] - queryCoordStart =lLines[17] - queryCoordEnd = lLines[18] - subjectCoordStart = lLines[15] - subjectCoordEnd = lLines[16] - tabResult.append([seqName, queryCoordStart, queryCoordEnd, profilName, subjectCoordStart, subjectCoordEnd, iValue, score]) - return tabResult - |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/tests/TestHmmOutputProcessing.py --- a/commons/pyRepetUnit/hmmer/hmmOutput/tests/TestHmmOutputProcessing.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,36 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.hmmer.hmmOutput.HmmOutput import HmmOutput -from commons.pyRepetUnit.hmmer.hmmOutput.HmmOutputProcessing import HmmOutputProcessing -from commons.pyRepetUnit.hmmer.hmmOutput.HmmpfamOutputProcessing import HmmpfamOutputProcessing -from commons.pyRepetUnit.hmmer.hmmOutput.HmmscanOutputProcessing import HmmscanOutputProcessing -from commons.core.utils.FileUtils import FileUtils - -class TestHmmOutputProcessing(unittest.TestCase): - - def setUp(self): - self.hmmOutput = HmmOutputProcessing() - self._inputFile = "./datas/test_hmmpfam_output" - self._outputFile = "./datas/dummyoutput.align" - self._inputFileScan2 = "./datas/hmmscanOutput" - self._outputFileScan2 = "./datas/hmmscanOutput.align" - - def test_writeHmmOutputToAlignFile(self): - output = open("./datas/output.align", "w") - output.write("SAR:satellite:satellite_5\t3\t9\tDUF751\t5\t11\t5.4\t5.4\t0\n") - output.write("SAR:satellite:satellite_5\t17\t23\tDUF751\t5\t11\t5.1\t5.5\t0\n") - output.write("SAR:satellite:satellite_5\t3\t21\tClenterotox\t173\t191\t0.66\t7.4\t0\n") - output.close() - pfamOutput = HmmOutput() - pfamOutput.append(["SAR:satellite:satellite_5", "3", "9", "DUF751", "5", "11", "5.4", "5.4"]) - pfamOutput.append(["SAR:satellite:satellite_5", "17", "23", "DUF751", "5", "11", "5.1", "5.5"]) - pfamOutput.append(["SAR:satellite:satellite_5", "3", "21", "Clenterotox", "173", "191", "0.66", "7.4"]) - fout = open("./datas/outputGen.align", "w") - self.hmmOutput.writeHmmOutputToAlignFile(pfamOutput, fout) - fout.close() - self.assertTrue(FileUtils.are2FilesIdentical("./datas/output.align", "./datas/outputGen.align")) - os.remove("./datas/output.align") - os.remove("./datas/outputGen.align") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/tests/TestHmmpfamOutputProcessing.py --- a/commons/pyRepetUnit/hmmer/hmmOutput/tests/TestHmmpfamOutputProcessing.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,58 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.hmmer.hmmOutput.HmmpfamOutputProcessing import HmmpfamOutputProcessing -from commons.core.utils.FileUtils import FileUtils - -class TestHmmpfamOutputProcessing(unittest.TestCase): - - def setUp(self): - self.fileUtils = FileUtils() - self.hmmpfamOutputProcess = HmmpfamOutputProcessing() - self._inputFile = "./datas/Outputhmmpfam" - self._inputFile2 = "./datas/test_hmmpfam_output" - self._outputFile = "./datas/dummyAlignFile.align" - - def testReadHmmOutput(self): - file = open( self._inputFile ) - pfamOutput = self.hmmpfamOutputProcess.readHmmOutput(file) - self.assertEqual(["7LES_DROME", "437", "522", "fn3", "1", "84", "8.8e-15", "48.3"], pfamOutput.get(0)) - self.assertEqual(["7LES_DROME", "825", "914", "fn3", "1", "84", "2.2e-06", "13.4"], pfamOutput.get(1)) - self.assertEqual(["7LES_DROME", "1292", "1389", "fn3", "1", "84", "1.2e-06", "15.9"], pfamOutput.get(2)) - self.assertEqual(["7LES_DROME", "1799", "1891", "fn3", "1", "84", "2.3e-19", "63.5"], pfamOutput.get(3)) - self.assertEqual(["7LES_DROME", "1899", "1978", "fn3", "1", "84", "1.5e-06", "15.2"], pfamOutput.get(4)) - self.assertEqual(["7LES_DROME", "1993", "2107", "fn3", "1", "84", "4.3e-07", "20.3"], pfamOutput.get(5)) - self.assertEqual(["7LES_DROME", "2209", "2483", "pkinase", "1", "294", "6e-95", "314.6"], pfamOutput.get(6)) - self.assertEqual(["7LES_DROME", "2223", "2284", "rrm", "1", "77", "0.72", "-40.4"], pfamOutput.get(7)) - file.close() - - def test_readHmmOutput_empty_file(self): - file = open( "./datas/OutputhmmpfamEmpty", "w" ) - file.close() - file = open( "./datas/OutputhmmpfamEmpty") - pfamOutput = self.hmmpfamOutputProcess.readHmmOutput(file) - file.close() - self.assertEqual(None, pfamOutput) - os.system("rm ./datas/OutputhmmpfamEmpty") - - def testParseHmmpfamOutput2Align(self): - self.hmmpfamOutputProcess.readHmmOutputsAndWriteAlignFile(self._inputFile2, self._outputFile) - self.assertTrue(FileUtils.isRessourceExists(self._outputFile)) - self.assertEqual(18, FileUtils.getNbLinesInSingleFile(self._outputFile)) - os.system("rm " + self._outputFile) - - def test_parseHmmpfamOutput2Align_empty_file(self): - file = open("./datas/dummy_hmmpfam_output", "w") - file.close() - self._inputFile = "./datas/dummy_hmmpfam_output" - self.hmmpfamOutputProcess.readHmmOutputsAndWriteAlignFile( self._inputFile, self._outputFile ) - self.assertTrue(FileUtils.isEmpty(self._outputFile)) - os.system("rm " + self._inputFile) - os.system("rm " + self._outputFile) - - def test_parseHmmpfamOutput2Align_file_not_exists(self): - self._inputFile = "./datas/dummy_hmmpfam_output" - self.hmmpfamOutputProcess.readHmmOutputsAndWriteAlignFile(self._inputFile, self._outputFile ) - self.assertFalse(FileUtils.isRessourceExists(self._outputFile)) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/tests/TestHmmscanOutputProcessing.py --- a/commons/pyRepetUnit/hmmer/hmmOutput/tests/TestHmmscanOutputProcessing.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,58 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.hmmer.hmmOutput.HmmscanOutputProcessing import HmmscanOutputProcessing -from commons.core.utils.FileUtils import FileUtils - -class TestHmmscanOutputProcessing(unittest.TestCase): - - def setUp(self): - self.hmmscanOutputProcess = HmmscanOutputProcessing() - self._inputFile = "./datas/hmmscanOutputTab.txt" - self._inputFileScan2 = "./datas/hmmscanOutput" - self._outputFileScan2 = "./datas/hmmscanOutput.align" - self._outputFile = "./datas/dummyFile.align" - - def tearDown(self): - if os.path.exists(self._outputFile): - os.remove(self._outputFile) - - def testReadHmmerscanOutput(self): - file = open( self._inputFile ) - pfamOutput = self.hmmscanOutputProcess.readHmmOutput(file) - self.assertEqual(["Polinton-1_DY:classII:Polinton_4", "2742", "2766", "rve", "50", "78", "2.4e+03", "-3.3"], pfamOutput.get(0)) - self.assertEqual(["Polinton-1_DY:classII:Polinton_4", "2951", "3101", "rve", "4", "168", "6.7e-30", "103.4"], pfamOutput.get(1)) - self.assertEqual(["Polinton-1_DY:classII:Polinton_4", "3198", "3228", "Chromo", "4", "51", "8.5e-06", "24.7"], pfamOutput.get(2)) - self.assertEqual(["Polinton-1_DY:classII:Polinton_4", "2117", "2125", "GARS_A", "196", "204", "11", "2.5"], pfamOutput.get(3)) - file.close() - - def test_readHmmerscanOutput_empty_file(self): - file = open( "./datas/OutputhmmscanEmpty", "w" ) - file.close() - file = open( "./datas/OutputhmmscanEmpty") - pfamOutput = self.hmmscanOutputProcess.readHmmOutput(file) - file.close() - self.assertEqual(None, pfamOutput) - os.system("rm ./datas/OutputhmmscanEmpty") - - def testParseHmmscanOutput2Align(self): - self.hmmscanOutputProcess.readHmmOutputsAndWriteAlignFile(self._inputFileScan2, self._outputFile) - self.assertTrue(FileUtils.isRessourceExists(self._outputFile)) - self.assertTrue(FileUtils.are2FilesIdentical(self._outputFileScan2, self._outputFile)) - os.system("rm " + self._outputFile) - - def test_parseHmmscanOutput2Align_empty_file(self): - file = open("./datas/dummy_hmmpfam_output", "w") - file.close() - self._inputFile = "./datas/dummy_hmmpfam_output" - self.hmmscanOutputProcess.readHmmOutputsAndWriteAlignFile( self._inputFile, self._outputFile ) - self.assertTrue(FileUtils.isEmpty(self._outputFile)) - os.system("rm " + self._inputFile) - os.system("rm " + self._outputFile) - - def test_parseHmmscanOutput2Align_file_not_exists(self): - self._inputFile = "./datas/dummy_hmmpfam_output" - self.hmmscanOutputProcess.readHmmOutputsAndWriteAlignFile(self._inputFile, self._outputFile ) - self.assertFalse(FileUtils.isRessourceExists(self._outputFile)) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/tests/Test_HmmOutput.py --- a/commons/pyRepetUnit/hmmer/hmmOutput/tests/Test_HmmOutput.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,15 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.hmmer.hmmOutput.HmmOutput import HmmOutput - -class Test_HmmOutput(unittest.TestCase): - - def testAppend(self): - hmmpfamOutput = HmmOutput() - self.assertEquals(0, hmmpfamOutput.len()) - list = ["a","b"] - hmmpfamOutput.append(list) - self.assertEquals(1, hmmpfamOutput.len()) - list2 = ["c","d"] - hmmpfamOutput.append(list2) - self.assertEquals(2, hmmpfamOutput.len()) \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/Outputhmmpfam --- a/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/Outputhmmpfam Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,148 +0,0 @@ -hmmpfam - search one or more sequences against HMM database -HMMER 2.3.2 (Oct 2003) -Copyright (C) 1992-2003 HHMI/Washington University School of Medicine -Freely distributed under the GNU General Public License (GPL) -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -HMM file: myhmms -Sequence file: 7LES_DROME -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Query sequence: 7LES_DROME -Accession: P13368 -Description: SEVENLESS PROTEIN (EC 2.7.1.112). - -Scores for sequence family classification (score includes all domains): -Model Description Score E-value N --------- ----------- ----- ------- --- -pkinase Protein kinase domain 314.6 6e-95 1 -fn3 Fibronectin type III domain 176.6 2e-53 6 -rrm -40.4 0.72 1 - -Parsed for domains: -Model Domain seq-f seq-t hmm-f hmm-t score E-value --------- ------- ----- ----- ----- ----- ----- ------- -fn3 1/6 437 522 .. 1 84 [] 48.3 8.8e-15 -fn3 2/6 825 914 .. 1 84 [] 13.4 2.2e-06 -fn3 3/6 1292 1389 .. 1 84 [] 15.9 1.2e-06 -fn3 4/6 1799 1891 .. 1 84 [] 63.5 2.3e-19 -fn3 5/6 1899 1978 .. 1 84 [] 15.2 1.5e-06 -fn3 6/6 1993 2107 .. 1 84 [] 20.3 4.3e-07 -pkinase 1/1 2209 2483 .. 1 294 [] 314.6 6e-95 -rrm 1/1 2223 2284 .. 1 77 [] -40.4 0.72 - -Alignments of top-scoring domains: -fn3: domain 1 of 6, from 437 to 522: score 48.3, E = 8.8e-15 - CS C CCCCEEEEEECCTTCCEEEEECCC CCCCCCCEEEEE.ECCCCCC - *->P.saPtnltvtdvtstsltlsWsppt.gngpitgYevtyRqpkngge - P saP + +++ ++ l ++W p + ngpi+gY++++ +++ g+ - 7LES_DROME 437 PiSAPVIEHLMGLDDSHLAVHWHPGRfTNGPIEGYRLRL-SSSEGNA 482 - - CS CCCCEEECCCCCECECCEEEEECCCCEEEEEECCC CCCC - wneltvpgtttsytltgLkPgteYevrVqAvnggG.GpeS<-* - + e+ vp sy+++ L++gt+Y++ + +n +G+Gp - 7LES_DROME 483 TSEQLVPAGRGSYIFSQLQAGTNYTLALSMINKQGeGPVA 522 - -fn3: domain 2 of 6, from 825 to 914: score 13.4, E = 2.2e-06 - CS CCCCCEEEEEECCTTCCEEEEECCC CCCCCCCEEEEE.EC - *->PsaPtnltvtdvtstsltlsWsppt.......gngpitgYevtyRqp - ++P l++ ++ + +sW+ p++++ ++ + + +Ye+++ + - 7LES_DROME 825 GGKPHSLKALL-GAQAAKISWKEPErnpyqsaDAARSWSYELEV-LD 869 - - CS CCCCCCCCCE EECCCCCECECCEEEEECCCCEEEEEECCC CCCC - knggewnelt.vpgtttsytltgLkPgteYevrVqAvnggG..GpeS<-* - + +++ ++++++ g+ + l+ L+P+ Y++rV+A+n +G++G+++ - 7LES_DROME 870 VASQSAFSIRnIRGPI--FGLQRLQPDNLYQLRVRAINVDGepGEWT 914 - -fn3: domain 3 of 6, from 1292 to 1389: score 15.9, E = 1.2e-06 - CS CCCCCEEEE EEC CTTCCEEEEECCC CCCCCCCEEE - *->PsaPtnltv......tdv..tstsltlsWsppt....gngpitgYev - Ps+P++l+v ++ t++++ s++l+W++p+++++ Y + - 7LES_DROME 1292 PSQPRRLRVfverlaTALqeANVSAVLRWDAPEqgqeAPMQALEYHI 1338 - - CS EE.ECCCCCCCCCCEEECCCC CECECCEEEEECCCCEEEEEECCC - tyRqpknggewneltvpgttt.sytltgLkPgteYevrVqAvnggG.... - ++ + g e +e +++ ++ ++ L+P+ +Y+++V A+ ++++ - 7LES_DROME 1339 SC-W--VGSELHEELRLNQSAlEARVEHLQPDQTYHFQVEARVAATgaaa 1385 - - CS CCCC - GpeS<-* - G++S - 7LES_DROME 1386 GAAS 1389 - -fn3: domain 4 of 6, from 1799 to 1891: score 63.5, E = 2.3e-19 - CS CCCCCEEEEEECCTTCCEEEEECCC CCCCCCCEEEEE.ECCCCCC - *->PsaPtnltvtdvtstsltlsWsppt.gngpitgYevtyRqpkngge. - Ps+P+n++v+ +++ +l +sW pp++ +++ +Y++++ q++ +ge+ - 7LES_DROME 1799 PSPPRNFSVRVLSPRELEVSWLPPEqLRSESVYYTLHW-QQELDGEn 1844 - - CS CCCCEEECCCCCECECCEEEEECCCCEEEEEECCC CCCC - .......wneltvpgtttsytltgLkPgteYevrVqAvnggG.GpeS<-* - +++++ + + + t+ ++ ltg kPg+ Y+++VqA+ + +++ S - 7LES_DROME 1845 vqdrrewEAHERRLETAGTHRLTGIKPGSGYSLWVQAHATPTkSNSS 1891 - -fn3: domain 5 of 6, from 1899 to 1978: score 15.2, E = 1.5e-06 - CS CCCCCEEEEEECCTTCCEEEEECCCCCCCCCCEEEEE.ECCCCCCCC - *->PsaPtnltvtdvtstsltlsWspptgngpitgYevtyRqpknggewn - + l+ +++++sl+l+W p+ + ++++R ++ e - 7LES_DROME 1899 FAELPELQLLELGPYSLSLTWAGT--PDPLGSLQLECR---SSAEQL 1940 - - CS CCEEECCCCCECECCEEEEECCCCEEEEEECCC CCCC - eltvpgtttsytltgLkPgteYevrVqAvnggG.GpeS<-* - +++v g+ t ++++ L+P t+Y+ r+ ++++G++ - 7LES_DROME 1941 RRNVAGNHTKMVVEPLQPRTRYQCRLLLGYAATpGAPL 1978 - -fn3: domain 6 of 6, from 1993 to 2107: score 20.3, E = 4.3e-07 - CS CCCCCEEEEEECCTTCCEEEEECCC CCCCCCCEEEEE.ECCCCCC - *->PsaPtnltvtdvtstsltlsWsppt.gngpitgYevtyRqpkngge. - Ps+P+ ++ + + + ++++W++++++++pi Y+++ ++++ + - 7LES_DROME 1993 PSQPGKPQLEHIAEEVFRVTWTAARgNGAPIALYNLEA-LQARSDIr 2038 - - CS CCCCEEECCCC CECECCEEEEE - ...........................wneltvpgttt.sytltgLkPgt - +++++++++++++ ++ + +++ ++++l+ +tt s++++ L + - 7LES_DROME 2039 rrrrrrrrnsggsleqlpwaeepvvveDQWLDFCNTTElSCIVKSLHSSR 2088 - - CS CCCCEEEEEE CCC CCCC - eYevrVqAvn.ggG.GpeS<-* - +rV+A++ ++G Gp+S - 7LES_DROME 2089 LLLFRVRARSlEHGwGPYS 2107 - -pkinase: domain 1 of 1, from 2209 to 2483: score 314.6, E = 6e-95 - *->yelleklGeGsfGkVykakhkd...ktgkiVAvKilkkekesikekr - ++ll+ lG+G+fG+Vy++++k+++++ ++VA+K l+k+++++ e - 7LES_DROME 2209 LKLLRFLGSGAFGEVYEGQLKTedsEEPQRVAIKSLRKGASEFAE-- 2253 - - flrEiqilkrLsHpNIvrligvfedtddhlylvmEymegGdLfdylrrng - +l E+q++ +++H+NIvrl g++ + +++ l+mE+me GdL++ylr+ + - 7LES_DROME 2254 LLQEAQLMSNFKHENIVRLVGICF-DTESISLIMEHMEAGDLLSYLRAAR 2302 - - ..........gplsekeakkialQilrGleYLHsngivHRDLKpeNILld - +++++++++ ls e++ ++ ++++G +YL+++++vHRDL+ +N+L++ - 7LES_DROME 2303 atstqepqptAGLSLSELLAMCIDVANGCSYLEDMHFVHRDLACRNCLVT 2352 - - en......dgtvKiaDFGLArlle..sssklttfvGTpwYmmAPEvileg - e +++++++ tvKi+DFGLAr++++++++++ + + p+++m+PE l + - 7LES_DROME 2353 EStgstdrRRTVKIGDFGLARDIYksDYYRKEGEGLLPVRWMSPES-LVD 2401 - - rgysskvDvWSlGviLyElltggplfpgadlpaftggdevdqliifvlkl - +++++DvW++Gv+++E+lt g ++ - 7LES_DROME 2402 GLFTTQSDVWAFGVLCWEILTLG-------------------------QQ 2426 - - PfsdelpktridpleelfriikrpglrlplpsncSeelkdLlkkcLnkDP - P+ ++ +e+++++k+ g+rl +p+ c e l++Ll c++ DP - 7LES_DROME 2427 PYAA-------RNNFEVLAHVKE-GGRLQQPPMCTEKLYSLLLLCWRTDP 2468 - - skRpGsatakeilnhpwf<-* - ++Rp +++ + n + - 7LES_DROME 2469 WERP---SFRRCYNTLHA 2483 - -rrm: domain 1 of 1, from 2223 to 2284: score -40.4, E = 0.72 - *->lfVgNL.......ppdvteedLkdlFskfGpi.vsikivkDhkektk - ++ g L+++++++p+ v + L++ s+f + +++++ + - 7LES_DROME 2223 VYEGQLktedseePQRVAIKSLRKGASEFAELlQEAQLMSN------ 2263 - - etgkskGfaFVeFeseedAekAlealnGkelggrklrv<-* - F+ e+ ++ l G+ ++ + - 7LES_DROME 2264 ------------FKH----ENIVR-LVGICFDTESISL 2284 - -// |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput --- a/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,13 +0,0 @@ -# --- full sequence --- -------------- this domain ------------- hmm coord ali coord env coord -# target name accession tlen query name accession qlen E-value score bias # of c-Evalue i-Evalue score bias from to from to from to acc description of target -#------------------- ---------- ----- -------------------- ---------- ----- --------- ------ ----- --- --- --------- --------- ------ ----- ----- ----- ----- ----- ----- ----- ---- --------------------- -DNA_pol_B_2 PF03175.5 531 Polinton-1_DY:classII:Polinton_1 - 4927 3.7e-06 24.2 16.0 1 3 1.4e-09 3.7e-06 24.2 11.1 13 252 992 1214 987 1218 0.76 DNA polymerase type B, organellar and viral -DNA_pol_B_2 PF03175.5 531 Polinton-1_DY:classII:Polinton_1 - 4927 3.7e-06 24.2 16.0 2 3 0.11 2.9e+02 -2.0 0.2 393 433 1367 1397 1364 1398 0.85 DNA polymerase type B, organellar and viral -DNA_pol_B_2 PF03175.5 531 Polinton-1_DY:classII:Polinton_1 - 4927 3.7e-06 24.2 16.0 3 3 0.33 8.5e+02 -3.5 0.2 175 193 2832 2850 2827 2852 0.85 DNA polymerase type B, organellar and viral -ASFV_p27 PF06556.3 131 Polinton-1_DY:classII:Polinton_1 - 4927 2.4 5.8 1.6 1 1 0.0023 6 4.5 1.1 59 74 2633 2648 2626 2652 0.90 IAP-like protein p27 C-terminus -Ribosomal_S4 PF00163.11 110 Polinton-1_DY:classII:Polinton_1 - 4927 5.5 5.7 1.1 1 1 0.0068 18 4.1 0.7 39 72 3008 3041 3002 3043 0.92 Ribosomal protein S4/S9 N-terminal domain -Homo_sperm_syn PF06408.3 487 Polinton-1_DY:classII:Polinton_1 - 4927 6.3 2.4 0.3 1 1 0.0034 8.8 2.0 0.2 49 68 3966 3985 3960 3987 0.88 Homospermidine synthase -rve PF00665.18 169 Polinton-1_DY:classII:Polinton_4 - 4927 5.4e-30 103.7 1.8 1 2 0.7 2.4e+03 -3.3 0.0 50 78 2742 2766 2739 2766 0.80 Integrase core domain -rve PF00665.18 169 Polinton-1_DY:classII:Polinton_4 - 4927 5.4e-30 103.7 1.8 2 2 1.9e-33 6.7e-30 103.4 0.7 4 168 2951 3101 2947 3102 0.92 Integrase core domain -Chromo PF00385.16 69 Polinton-1_DY:classII:Polinton_4 - 4927 3.3e-06 26.0 0.0 1 1 2.5e-09 8.5e-06 24.7 0.0 4 51 3198 3228 3195 3239 0.75 'chromo' (CHRromatin Organisation MOdifier) domain -GARS_A PF01071.11 208 Polinton-1_DY:classII:Polinton_4 - 4927 7.6 3.0 0.7 1 1 0.0031 11 2.5 0.5 196 204 2117 2125 2117 2125 0.95 Phosphoribosylglycinamide synthetase, ATP-grasp (A) domain \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput.align --- a/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput.align Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,10 +0,0 @@ -Polinton-1_DY:classII:Polinton_1 992 1214 DNA_pol_B_2 13 252 3.7e-06 24.2 0 -Polinton-1_DY:classII:Polinton_1 1367 1397 DNA_pol_B_2 393 433 2.9e+02 -2.0 0 -Polinton-1_DY:classII:Polinton_1 2832 2850 DNA_pol_B_2 175 193 8.5e+02 -3.5 0 -Polinton-1_DY:classII:Polinton_1 2633 2648 ASFV_p27 59 74 6 4.5 0 -Polinton-1_DY:classII:Polinton_1 3008 3041 Ribosomal_S4 39 72 18 4.1 0 -Polinton-1_DY:classII:Polinton_1 3966 3985 Homo_sperm_syn 49 68 8.8 2.0 0 -Polinton-1_DY:classII:Polinton_4 2742 2766 rve 50 78 2.4e+03 -3.3 0 -Polinton-1_DY:classII:Polinton_4 2951 3101 rve 4 168 6.7e-30 103.4 0 -Polinton-1_DY:classII:Polinton_4 3198 3228 Chromo 4 51 8.5e-06 24.7 0 -Polinton-1_DY:classII:Polinton_4 2117 2125 GARS_A 196 204 11 2.5 0 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutputTab.txt --- a/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutputTab.txt Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,7 +0,0 @@ -# --- full sequence --- -------------- this domain ------------- hmm coord ali coord env coord -# target name accession tlen query name accession qlen E-value score bias # of c-Evalue i-Evalue score bias from to from to from to acc description of target -#------------------- ---------- ----- -------------------- ---------- ----- --------- ------ ----- --- --- --------- --------- ------ ----- ----- ----- ----- ----- ----- ----- ---- --------------------- -rve PF00665.18 169 Polinton-1_DY:classII:Polinton_4 - 4927 5.4e-30 103.7 1.8 1 2 0.7 2.4e+03 -3.3 0.0 50 78 2742 2766 2739 2766 0.80 Integrase core domain -rve PF00665.18 169 Polinton-1_DY:classII:Polinton_4 - 4927 5.4e-30 103.7 1.8 2 2 1.9e-33 6.7e-30 103.4 0.7 4 168 2951 3101 2947 3102 0.92 Integrase core domain -Chromo PF00385.16 69 Polinton-1_DY:classII:Polinton_4 - 4927 3.3e-06 26.0 0.0 1 1 2.5e-09 8.5e-06 24.7 0.0 4 51 3198 3228 3195 3239 0.75 'chromo' (CHRromatin Organisation MOdifier) domain -GARS_A PF01071.11 208 Polinton-1_DY:classII:Polinton_4 - 4927 7.6 3.0 0.7 1 1 0.0031 11 2.5 0.5 196 204 2117 2125 2117 2125 0.95 Phosphoribosylglycinamide synthetase, ATP-grasp (A) domain \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/test_hmmpfam_output --- a/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/test_hmmpfam_output Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,321 +0,0 @@\n-hmmpfam - search one or more sequences against HMM database\n-HMMER 2.3.2 (Oct 2003)\n-Copyright (C) 1992-2003 HHMI/Washington University School of Medicine\n-Freely distributed under the GNU General Public License (GPL)\n-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n-HMM file: myhmms\n-Sequence file: test.fa\n-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n-\n-Query sequence: pkinase_full\n-Accession: [none]\n-Description: Dario rerio\n-\n-Scores for sequence family classification (score includes all domains):\n-Model Description Score E-value N \n--------- ----------- ----- ------- ---\n-pkinase Protein kinase domain 266.6 3.3e-80 1\n-pkinase Protein kinase domain 265.4 7.6e-80 1\n-rrm -42.5 2.5 1\n-rrm -8.7 3.7 1\n-fn3 Fibronectin type III domain -45.8 3.7 1\n-fn3 Fibronectin type III domain -9.0 3.8 1\n-\n-Parsed for domains:\n-Model Domain seq-f seq-t hmm-f hmm-t score E-value\n--------- ------- ----- ----- ----- ----- ----- -------\n-rrm 1/1 169 180 .. 66 77 .] -8.7 3.7\n-fn3 1/1 197 200 .. 81 84 .] -9.0 3.8\n-rrm 1/1 256 319 .. 1 77 [] -42.5 2.5\n-pkinase 1/1 258 540 .. 1 294 [] 266.6 3.3e-80\n-pkinase 1/1 258 537 .. 1 289 [. 265.4 7.6e-80\n-fn3 1/1 434 506 .. 1 84 [] -45.8 3.7\n-\n-Alignments of top-scoring domains:\n-rrm: domain 1 of 1, from 169 to 180: score -8.7, E = 3.7\n- *->nGkelggrklrv<-*\n- n++ ++l v \n- pkinase_fu 169 NKQDPHQHRLSV 180 \n-\n-fn3: domain 1 of 1, from 197 to 200: score -9.0, E = 3.8\n- CS CCCC \n- *->GpeS<-*\n- G eS \n- pkinase_fu 197 GGES 200 \n-\n-rrm: domain 1 of 1, from 256 to 319: score -42.5, E = 2.5\n- *->lfVgNL..ppdvteedLkdlFsk.fGpivsikivkDhkektketgks\n- +N++ +d+ e + F+ + +++ +\n- pkinase_fu 256 ---NNIeyVRDIGEGAFGRVFQArAPGL----LPTE----------P 285 \n-\n- kGfaFVeFeseedAekAlealnG.kelggrklrv<-*\n- + V++ +ee+ ++ ++++ + l++ + \n- pkinase_fu 286 FTMVAVKMLKEEASTDMQNDFQReAALMSEFDHP 319 \n-\n-pkinase: domain 1 of 1, from 258 to 540: score 266.6, E = 3.3e-80\n- *->yelleklGeGsfGkVykakhkd....ktgkiVAvKilkkekesikek\n- +e ++ +GeG+fG+V++a+ +++ VAvK+lk e+ s++ \n- pkinase_fu 258 IEYVRDIGEGAFGRVFQARAPGllptEPFTMVAVKMLK-EEASTDMQ 303 \n-\n- .rflrEiqilkrLsHpNIvrligvfedtddhlylvmEymegGdLfdylrr\n- ++f+rE++++ +++HpNIvrl+gv+ +++++l +Eym GdL+++lrr\n- pkinase_fu 304 nDFQREAALMSEFDHPNIVRLLGVCA-VGKPMCLMFEYMAYGDLNEFLRR 352 \n-\n- ng........................gplsekeakkialQilrGleYLHs\n- + +++++ ++++ ++++ +++++ pls +e ++i +Q++ G++YL +\n- pkinase_fu 353 RCatqqpslsrdtltssslvseperyPPLSCQEQLSISKQVAAGMAYLSE 402 \n-\n- ngivHRDLKpeNILldendgtvKiaDFGLArlle..sssklttfvGTpwY\n- +++vHRDL+++N+L+ en +vKiaDFGL+r ++ +++k++ + p +\n- pkinase_fu 403 RKFVHRDLATRNCLVAEN-LVVKIADFGLSRNIYaaDYYKASENDAIPIR 451 \n-\n- mmAPEvilegrgysskvDvWSlGviLyElltggplfpgadlpaftggdev\n- +m+PE ++++ y+s++DvW++Gv+L+E++++g \n- pkinase_fu 452 WMPPES-IFYNRYTSESDVWAYGVVLWEIFSYG----------------- 483 \n-\n- dqliifvlklPfsdelpktridpleelfriikrpglrlplpsncSeelkd\n- ++P+++ + ee+ + +++ g l +p+nc+ el+ \n- pkinase_fu 484 --------MQPYYG-------'..b'III domain -39.7 1.2 1\n-pkinase Protein kinase domain -9.2 1.8 1\n-fn3 Fibronectin type III domain -7.5 1.9 1\n-\n-Parsed for domains:\n-Model Domain seq-f seq-t hmm-f hmm-t score E-value\n--------- ------- ----- ----- ----- ----- ----- -------\n-fn3 1/1 143 224 .. 1 84 [] -39.7 1.2\n-pkinase 1/1 233 241 .. 1 9 [. -9.2 1.8\n-rrm 1/1 440 456 .. 1 17 [. -6.1 0.92\n-rrm 1/1 669 731 .. 1 77 [] -32.5 0.26\n-pkinase 1/1 906 1127 .. 1 294 [] -171.6 0.19\n-fn3 1/1 923 934 .. 1 12 [. -7.5 1.9\n-\n-Alignments of top-scoring domains:\n-fn3: domain 1 of 1, from 143 to 224: score -39.7, E = 1.2\n- CS C CCCCEEEEEECCTTCCEEEEECCCCCCCCCCEEEEE.ECCCCCCC\n- *->P.saPtnltvtdvtstsltlsWspptgngpitgYevtyRqpknggew\n- + ++t+l++ dv ++ sWs+ +g+ + tg v R + ng +\n- S13421 143 IdLEVTGLSCVDVAN--IQESWSKVSGDLKTTGSVVFQR-MINGH-P 185 \n-\n- CS CCCEEECCCCCECECCEEEEECCCCEEEEEECCC CCCC \n- neltvpgtttsytltgLkPgteYevrVqAvnggG.GpeS<-*\n- +++ ++ + + l L + + V v ++ +G \n- S13421 186 EYQQLFRQFRDVDLDKLGESNSFVAHVFRVVAAFdGIIH 224 \n-\n-pkinase: domain 1 of 1, from 233 to 241: score -9.2, E = 1.8\n- *->yelleklGe<-*\n- +l+klGe \n- S13421 233 VSTLKKLGE 241 \n-\n-rrm: domain 1 of 1, from 440 to 456: score -6.1, E = 0.92\n- *->lfVgNLppdvteedLkd<-*\n- + ++ L++ + d+ d \n- S13421 440 VIISFLNEGLRQADIVD 456 \n-\n-rrm: domain 1 of 1, from 669 to 731: score -32.5, E = 0.26\n- *->lfVgNL.ppdvteedLkdlFskfGpivsikivkDhkektketgkskG\n- V L+++d+ + + f i k++ D +\n- S13421 669 --VEELpSTDAFHYHISLVMNRFSSI--GKVIDD------------N 699 \n-\n- faFVeFeseedAekAlealnGkelggr.klrv<-*\n- + FV ++ + e+ ++ l k+++ +l++ \n- S13421 700 VSFVYLLKKLGREHIKRGLSRKQFDQFvELYI 731 \n-\n-pkinase: domain 1 of 1, from 906 to 1127: score -171.6, E = 0.19\n- *->yelleklGeGsfGkVykakhkd........ktgkiVAvKilkkekes\n- ++l G++ ++ + ++ ++ ++ + ++VAv + ++\n- S13421 906 FKLMH-------GVIEEGLLQLerinpitgLSAREVAVVKQ---TWN 942 \n-\n- ikekrflrEiqilkrLsHpNIvrligvfedtddhlylvmEymegGdLfdy\n- + + L+ ++ fe + + v++ +d \n- S13421 943 LVK----------PDLMGVGMRIFKSLFE-AFPAYQAVFPKFSD-VPLDK 980 \n-\n- lrrng....gplsekeakkialQilrGleYLHsngivHRDLKpeNILlde\n- l + +++ +s ++ Q+ lde\n- S13421 981 LEDTPavgkHSISVTTKLDELIQT-----------------------LDE 1007 \n-\n- ndgtvKiaDFGLArlle........sssklttfvGTpwYmmAPEvi...l\n- + ++ + LAr+l +++ + + +++++f+ +++ ++++l\n- S13421 1008 P-ANLAL----LARQLGedhivlrvNKPMFKSFGKVLVRL-----LendL 1047 \n-\n- egrgysskvDvW..SlGviLyElltggplfpgadlpaftggdevdqliif\n- +r s ++ W++++ vi+ ++ g \n- S13421 1048 GQRFSSFASRSWhkAYDVIVEYIEEG------------------------ 1073 \n-\n- vlklPfsdelpktridpleelfriikrpglrlplpsncSeelkdLlkkcL\n- l++ +++ dp + + k l + ++++ ++l+ L +k++\n- S13421 1074 -LQQSYKQ-------DPVTGITDAEKA--LVQESWDLLKPDLLGLGRKIF 1113 \n-\n- nkDPskRpGsatakeilnhpwf<-*\n- +k +k p +i f \n- S13421 1114 TKVFTKHP----DYQI----LF 1127 \n-\n-fn3: domain 1 of 1, from 923 to 934: score -7.5, E = 1.9\n- CS CCCCCEEEEEEC \n- *->PsaPtnltvtdv<-*\n- + t+l++++v \n- S13421 923 INPITGLSAREV 934 \n-\n-//\n-\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/hmmOutput/tests/hmmOutputTestSuite.py --- a/commons/pyRepetUnit/hmmer/hmmOutput/tests/hmmOutputTestSuite.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,21 +0,0 @@ -import unittest -import sys -import TestHmmOutputProcessing -import Test_HmmOutput -import TestHmmpfamOutputProcessing -import TestHmmscanOutputProcessing - - -def main(): - - hmmOutputTestSuite = unittest.TestSuite() - hmmOutputTestSuite.addTest(unittest.makeSuite(TestHmmOutputProcessing.TestHmmOutputProcessing,'test')) - hmmOutputTestSuite.addTest(unittest.makeSuite(Test_HmmOutput.Test_HmmOutput,'test')) - hmmOutputTestSuite.addTest(unittest.makeSuite(TestHmmpfamOutputProcessing.TestHmmpfamOutputProcessing,'test')) - hmmOutputTestSuite.addTest(unittest.makeSuite(TestHmmscanOutputProcessing.TestHmmscanOutputProcessing,'test')) - runner = unittest.TextTestRunner(sys.stderr, 2, 2) - runner.run(hmmOutputTestSuite) - - -if __name__ == '__main__': - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/ProfilesSearch.py --- a/commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/ProfilesSearch.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,103 +0,0 @@ -import subprocess -import os -import sys - -## Prepare profiles databank and create command to search profiles from a profiles databank in a nucleotides databank -# -class ProfilesSearch(object): - - ## launch command to prepare profiles bank - # - # @param launch_1 string corresponding to pre command - # @param launch_2 string corresponding to post command - # @param config configParser object instance - # @param cDir string current directory - # @param verbose int (default = 0) - # - def prepareProfilesBank(self, launch_1, launch_2, config, cDir, verbose = 0): - bank = self._getBankBaseName(config) - prg = "hmmpress" - if verbose > 0: - print "prepare bank '%s'..." % ( bank ); sys.stdout.flush() - cmd = "" - cmd += prg + " -f " - cmd += "%s/%s " % ( cDir, bank ) - process = subprocess.Popen(cmd, shell = True) - process.communicate() - if process.returncode != 0: - raise Exception("ERROR when launching '%s'" % cmd) - - ## create command to detect Hmm profiles in a nt sequence file - # - # @param inFileName string name of input file - # @param launch_1 string corresponding to pre command - # @param launch_2 string corresponding to post command - # @param cDir string current directory - # @param tmpDir string temporary directory - # @param config configParser object instance - # @return cmd string command to launch - # - def detectHmmProfiles(self, inFileName, launch_1, launch_2, cDir, tmpDir, config): - bank = self._getBankBaseName(config) - evalueMax = config.get("detect_features","TE_HMMER_evalue") - - cmd = "" - - cmd += launch_1 - cmd += os.environ["REPET_PATH"] + "/bin/translateAfastaFileInAllFrameAndReplaceStopsByX_script.py" - cmd += " -i %s" % ( inFileName ) - cmd += " -o %s_translated" % ( inFileName ) - cmd += launch_2 - - cmd += launch_1 - cmd += "hmmscan " - cmd += " -o %s_tr.hmmScanOut" % ( inFileName ) - cmd += " --domtblout %s_tr.hmmScanOutTab" % ( inFileName ) - cmd += " --noali -E " + evalueMax - cmd += " --cpu 1 " - cmd += "%s/%s" % ( cDir, bank ) + " " + "%s_translated" % ( inFileName ) - cmd += launch_2 - - cmd += "if os.path.exists( \"%s_translated\" ):\n" % ( inFileName ) - cmd += "\tos.remove( \"%s_translated\" )\n" % ( inFileName ) - - cmd += launch_1 - cmd += os.environ["REPET_PATH"] + "/bin/HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py" - cmd += " -i %s_tr.hmmScanOutTab" % ( inFileName ) - cmd += " -o %s_profiles_%s.align" % ( inFileName, bank ) - cmd += " -T %s" % ( inFileName ) - cmd += " -p hmmscan" - cmd += " -c" - cmd += launch_2 - - cmd += launch_1 - cmd += os.environ["REPET_PATH"] + "/bin/matcher" - cmd += " -m %s_profiles_%s.align" % ( inFileName, bank ) - cmd += " -j" - cmd += " -E 10" - cmd += " -L 0" - cmd += " -v 1" - cmd += launch_2 - - cmd += "if not os.path.exists( \"%s/%s_profiles_%s.align.clean_match.path\" ):\n" % ( cDir, inFileName, bank ) - cmd += "\tos.system( \"mv %s_profiles_%s.align.clean_match.path %s\" )\n" % ( inFileName, bank, cDir ) - cmd += "if not os.path.exists( \"%s/%s_profiles_%s.align.clean_match.param\" ):\n" % ( cDir, inFileName, bank ) - cmd += "\tos.system( \"mv %s_profiles_%s.align.clean_match.param %s\" )\n" % ( inFileName, bank, cDir ) - cmd += "if os.path.exists( \"%s_profiles_%s.align\" ):\n" % ( inFileName, bank ) - cmd += "\tos.remove( \"%s_profiles_%s.align\" )\n" % ( inFileName, bank ) - cmd += "if os.path.exists( \"%s_profiles_%s.align.clean_match.map\" ):\n" % ( inFileName, bank ) - cmd += "\tos.remove( \"%s_profiles_%s.align.clean_match.map\" )\n" % ( inFileName, bank ) - cmd += "if os.path.exists( \"%s_hmmScanOut\" ):\n" % ( inFileName ) - cmd += "\tos.remove( \"%s_hmmScanOut\" )\n" % ( inFileName ) - - if tmpDir != cDir: - cmd += "if os.path.exists( \"%s\" ):\n" % ( bank ) - cmd += "\tos.remove( \"%s\" )\n" % ( bank ) - - return cmd - - def _getBankBaseName(self, config): - profilsHmmBank = config.get("detect_features", "TE_HMM_profiles") - bank = os.path.basename(profilsHmmBank) - return bank - |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/Test_ProfilesSearch.py --- a/commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/Test_ProfilesSearch.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,106 +0,0 @@ -import unittest -import os -import ConfigParser -import shutil -from commons.pyRepetUnit.hmmer.profilsSearchInTEClassifier.ProfilesSearch import ProfilesSearch - -class Test_ProfilesSearch(unittest.TestCase): - - - def setUp(self): - self._section = 'detect_features' - self._option1 = 'TE_HMM_profiles' - self._option2 = 'TE_HMMER_evalue' - self._config = ConfigParser.ConfigParser() - self._config.add_section(self._section) - self._config.set(self._section, self._option1, './datas/hmmbank_test') - self._config.set(self._section, self._option2, '10') - self._iProfilesSearch = ProfilesSearch() - self._launch1 = 'First Command\n' - self._launch2 = '\nSecond Command\n' - self._cDir = '.' - self._profileBank = self._config.get(self._section, self._option1) - self._bank = os.path.basename(self._profileBank) - shutil.copy(self._profileBank, self._cDir + "/" + self._bank) - - def tearDown(self): - os.remove(self._cDir + "/" + self._bank) - - def test_prepareProfilesBank(self): - hmmpressLaunched = False - self._iProfilesSearch.prepareProfilesBank( self._launch1, self._launch2, self._config, self._cDir ) - if ( os.path.exists(self._cDir + "/" + self._bank + ".h3m") \ - and os.path.exists(self._cDir + "/" + self._bank + ".h3i") \ - and os.path.exists(self._cDir + "/" + self._bank + ".h3f") \ - and os.path.exists(self._cDir + "/" + self._bank + ".h3p")) : - hmmpressLaunched = True - os.remove(self._cDir + "/" + self._bank + ".h3m") - os.remove(self._cDir + "/" + self._bank + ".h3i") - os.remove(self._cDir + "/" + self._bank + ".h3f") - os.remove(self._cDir + "/" + self._bank + ".h3p") - self.assertTrue(hmmpressLaunched) - - def test_detectHmmProfiles(self): - inputFileName = ' FileName' - dirTemp = 'Tempory directory' - eValueMax = self._config.get(self._section, self._option2) - - expCommand = self._launch1 - expCommand += os.environ["REPET_PATH"] + "/bin/translateAfastaFileInAllFrameAndReplaceStopsByX_script.py" - expCommand += " -i %s" % ( inputFileName ) + " -o %s_translated" % ( inputFileName ) - expCommand += self._launch2 - - expCommand += self._launch1 - expCommand += "hmmscan " - expCommand += " -o %s_tr.hmmScanOut" % ( inputFileName ) - expCommand += " --domtblout %s_tr.hmmScanOutTab" % ( inputFileName ) - expCommand += " --noali " - expCommand += "-E " + eValueMax - expCommand += " --cpu 1" - expCommand += " " + self._cDir + "/" + self._bank + " " + "%s_translated" % ( inputFileName ) - - expCommand += self._launch2 - - expCommand += "if os.path.exists( \"%s_translated\" ):\n" % ( inputFileName ) - expCommand += "\tos.remove( \"%s_translated\" )\n" % ( inputFileName ) - - expCommand += self._launch1 - expCommand += os.environ["REPET_PATH"] + "/bin/HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py" - expCommand += " -i %s_tr.hmmScanOutTab" % ( inputFileName ) - expCommand += " -o %s_profiles_%s.align" % ( inputFileName, self._bank ) - expCommand += " -T %s" % ( inputFileName ) - expCommand += " -p hmmscan" - expCommand += " -c" - expCommand += self._launch2 - - expCommand += self._launch1 - expCommand += os.environ["REPET_PATH"] + "/bin/matcher" - expCommand += " -m %s_profiles_%s.align" % ( inputFileName, self._bank ) - expCommand += " -j" - expCommand += " -E 10" - expCommand += " -L 0" - expCommand += " -v 1" - expCommand += self._launch2 - - expCommand += "if not os.path.exists( \"%s/%s_profiles_%s.align.clean_match.path\" ):\n" % ( self._cDir, inputFileName, self._bank ) - expCommand += "\tos.system( \"mv %s_profiles_%s.align.clean_match.path %s\" )\n" % ( inputFileName, self._bank, self._cDir ) - expCommand += "if not os.path.exists( \"%s/%s_profiles_%s.align.clean_match.param\" ):\n" % ( self._cDir, inputFileName, self._bank ) - expCommand += "\tos.system( \"mv %s_profiles_%s.align.clean_match.param %s\" )\n" % ( inputFileName, self._bank, self._cDir ) - expCommand += "if os.path.exists( \"%s_profiles_%s.align\" ):\n" % ( inputFileName, self._bank ) - expCommand += "\tos.remove( \"%s_profiles_%s.align\" )\n" % ( inputFileName, self._bank ) - expCommand += "if os.path.exists( \"%s_profiles_%s.align.clean_match.map\" ):\n" % ( inputFileName, self._bank ) - expCommand += "\tos.remove( \"%s_profiles_%s.align.clean_match.map\" )\n" % ( inputFileName, self._bank ) - expCommand += "if os.path.exists( \"%s_hmmScanOut\" ):\n" % ( inputFileName ) - expCommand += "\tos.remove( \"%s_hmmScanOut\" )\n" % ( inputFileName ) - - if dirTemp != dir: - expCommand += "if os.path.exists( \"%s\" ):\n" % ( self._bank ) - expCommand += "\tos.remove( \"%s\" )\n" % ( self._bank ) - - obsCommand = self._iProfilesSearch.detectHmmProfiles( inputFileName, self._launch1, self._launch2, self._cDir, dirTemp, self._config ) - self.assertEquals(expCommand, obsCommand) - - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/ConsensusFile_test.fa --- a/commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/ConsensusFile_test.fa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,141 +0,0 @@\n->blumeria_Grouper_590_20:NoCat\n-TTTCGATCNTATTGAAATGTATAACCCACTACTTAGTTCGTGGACTTGTTGGTAGAGGGA\n-AGCTTATGCAATAATGAAGGATAAAAGGATGTCAATTCGACTACTCTTCTAAACACAGAT\n-ACCAGACTCCTTTTAATCCCAATAGATAGCCCGTGCGGGATCTCCTATTAACAGCAGTAA\n-ACAACGCTAACACAGGGTATACGCAATCTCCGTTCGCCAAACACCAGTCTGTCGGGACTA\n-CTAATTATCGAGCCTAGTAGGATCGACAATGTGTATCCCAACATAGAAATAATAGAAAGC\n-TCAACACCCAAACCCCTCATCAATAACTGCCATTAATCATCACCTGACTTATCTCTGTAC\n-TCCATAATTTCAACACTNAAGAATATTTGTA\n->blumeria_Grouper_4152_12:NoCat\n-GGACCGGCCGCCACGAATTGCGCGATTGCTGCTCGCAAGTAGACTTTGATGGAGTCTACA\n-AAATTTTTGTCTTCACCGGTGGAGAGCGGTTGAAGAGCTGCCTCGACACTGCTAATAGCC\n-GTCGAGCATATTGTGAATTGCGCGGCTTTTTGTCTTGCCCTGCGCTCCTCCGCTTCGATC\n-GCTGCAAGCAATTCTGGAGGGTGTGTATTTTTTCTGCCTGCTGCTTCTAGTGCTGGAGGC\n-TGCGGGGCCAGTGGAGGGTTTTCGGCTCCTGCTGCCTTAGTGGATGGTGTTTCAGCCCTT\n-TTCGCGGGCCTCACTTCTGCAGGTCGCGGTAGTGCTGGAACCGTGATGCGCTTCTCGGGT\n-GCGACGACGGTTTTTCTGGGGGATCCGGTGGGATCCAAGACTTGCTCTGCGTCTTCTGGG\n-CTGGAGGATGCCCAAACTGAATCGGCGAGGGTTTTTAGCTTCTCGACTTCTGCGTCCACC\n-ATATCTACCTCGGGGACATTG\n->blumeria_Grouper_28830_3\n-TGTGGCTTCTAGTTGATCAGTTTATGATCACAATGATTTCACGTAGGTGTCTCGTGGCTC\n-CGACTAATCAACAATATAATGCGAGTAGAGCTTGAGACTAATAAAACGTGAATTTNATTC\n-TATAATACAGGATCGCCAACTTATTTAAATATTCCCCCGCACCACGTGAGCCAATCAACA\n-GCGCACAATTTGCACGGTCGGGTTTCCATCAATTGGGATCCACAAACTATCCCCCTTCTC\n-AAAACTAGCTGTCCACAGCTTATTTAAATTACAAGTTAATTAGAAATTTTATTATGGTAT\n-CACTCAAACTAAATCCTTGCTGAATTTTTGAGTGTCTTTCTATCCTGCTCCAGCATACGG\n-CGGCTACCATACCATAGACTACGAACTGGGTGTCCTTCACGTACATATGCCGGGAATAGG\n-TTTGTGCCGTTGTACTTGTTGCCTAATTTGTATCCACCCGGTGATATTAAGGAGTAGGTA\n-TTATTATTATGACAAGCTGCTACGGCCCATGGCCCGTCATAGTAGGGCTCCATCTTGTGT\n-CTTCGCTGGCGTACTCGCAGTACCCAGTCTCCGGGGGCGTAAGTACGTATAAGTGCCTTT\n-TCTTCCTGGAGGTAAGCCCGTATTTTATCCCTAGTTGCTTTCATACTACTAACGTAGGAG\n-CGTGCTATTGGTGCGGGGTGTTTCCTTCCGAGTTCTTCGGCCCAGAGGCGCTCCTCTGAT\n-TCTGTGGCTTCACGGGTATATACTGGATAAGAATTTTCCTCCTCCGGGGGCTGAGTGCCG\n-AAGAGTAAGAAGTAAGGGCTATACCCGCTGGGTGAGACTCTTCGATTGAAATTCATTACC\n-GCGAGTGAGAGAGCGCCAGCTAGTGTAATTTTAGGAGAATCCAGGAGAACTCTGACCAGT\n-ATGGCTTTCAGAACGCCATTTGCCTGTTCGACTTTGCCATTTCCTCTTGGCCTAGCTGGT\n-GTGGTATGGACAACCTGCAGTTGTTGGCTAGCTTGAAATCGTTGTGCTTCTATGCCTCCG\n-AAGCAGCCAGCATTGTCACTGATAATCTGCTTTGGCTTTCCAAAGTTCTGGATAATATAC\n-GTGAGCAGAGGCACAGTGTTAGCGAAGTCTGCATTGGGAACTAAGCGGGATTCCAGCCAG\n-CCTGTTGCGTACTCAATTGCATTGAGCAAGACTTGGGGTCCTACTTGAGTATGATCTATA\n-CCCCACCGTGTCAGAGGAGGTGCTGGTACTATAGGAGTTAAGCTTCCCAGTAACGGGTCT\n-GGAGGTTTCATGAGCTGACAGGACTTGCATTTTCGGACAGCTTCGTGAGCCGCGAGGATC\n-AGTTCGGGGTGCCAAAACCTACGCCCTAATTCCCGCATAGTATTGCCGATTGACGCATGG\n-CCTTGGCCCTCATGAACATTTACGGCCGTCGATACTAGATCCTCATATTCCAAGATTTCT\n-AGTAGGGTTGCGGCGCCAGATGGACCAGGTGCATCGCCTACTTGTTGCGACGGGTTCTTT\n-TTGATGAGATGCAATTTGGAATTGTACATCGCAAAATTATCTCGGACCCAAGTGGCAGCT\n-ATATTTAGGGGAAGTGCCTCTCCTAAGGTTAGAAATTCGGTGATGCACTGCAGGTCGATG\n-CGGTTGAGTTCGTGTGGGTGCTTTATTTCCTCCATCTCAAGTTCTCTTTCTGCACCACTT\n-TGGATTCTAGAGTTTTCGTTGTCGTCAGTAGCTACATTCCCTTCCCCTTCTTCCCTAGAG\n-AGAAATAGAACATCACAGGGACGGGAGAGAAAATCAGCGAGAACATTTGCTTTTCCGCGA\n-CGGTAGATAATCCTGATATTAAAATGCTCTATAGCATCTAAAAAACGGACCATTCTGACG\n-GGCTGCTCGGCTTTGGTCTGAATAGTTCGTAGAGATTCATGGTCAGTTATCACCGTTACG\n-TCGCCGCCTTCTACCCAGTGACGCCAATGTTGTAGTGACAGTAAAATCCCAAGTAATTCC\n-CTCTCTTGTGCTGAATAACGCTGCTGGGTATCGTTTAGTTTTCTTGAGAAGTAAGCTATG\n-GGATGCAGCACTGAACGATCGGAATTGTTGGAGCATCGCATGTACGGTTGGAGTATGACT\n-GCACCCACGAACTTTTGGGAAGCGTCAGTTTCCAATATGACGGGAAGTCTCCAATCAAAT\n-TTTTTTACAACTGGTGATGTTGTAAGCGCTAGTTTGATACTTTTCCATGATTGAATCGAT\n-TGGTCCGTCAGAATGACAGGGCAATTTTTAGGTCCAGAGGATTGGTCCGTGAGTGGCCCT\n-GCTAGTTGGGAGAAATTTTTAATGAGACAACGTAGGTAACCAGCTGCATTTACAAATCCT\n-CTTATTTCCGAGGTAGTTGTTGGCATAGGCCTGTCTCTGATCGCTGAAACTTTTTCGGGG\n-TCTGCTGCAATGCCATGTTTAGAAATATGGAAACCAAGGAAGATTCCCTCTGAAACAAAT\n-AGCCTGCACTTTGAAGCATTGAGGAGGAGACCATAGGAAGCGAATCTAGAAAAAATAAGT\n-ATCAACCGTGAGTGCAATTCTGCCATTGAGTCTGCCCAGACAGCTACATCGTCCAGGAGC\n-CCTGCGACAAATGGACGGAATGGCTCTAGAACTTCTTCCATAAAACACTGGAAAGTAGCT\n-GGTGCGTTGCATAGGCCGAAAGGCATAACTAGCCATTCATAGACACCGAAAGGAGTCACA\n-AATGCTGTTTTCTCTGAAGAGTCTTTGTGCATACGTATCTGCCAAAATCCGTTTTCCAGG\n-TCGAGGAATGCATAGAAGTTATGTCCTGCTGCGCGCTGAATTTCATCTTGAGCATTTGGT\n-AGGGGATGGGCGTGTTTCTTCGTAATCTTGTTAAGCTCTCTATAGTCAAC'..b'TGGGAGAGTATTAATTATAGGATTAAGAATTGGTTGGTCAATTAAGT\n-TGAGAAGTTGCAGTTTGCCATTTGATAAACATCGTAGCCCCAGTTCATGGAATAAAGTTT\n-GTCCAAGTGTCACATCTGCTGGGAATGTGCCATCTGGGACAACTCCTAGAGACACTGTGA\n-ATTCCTGAGTCCAGAATGATTCAAGGTGATTCGAGCAAAGAAACTGTGCAGTTAAAATTG\n-CATCCTTAGAAATTGTTGGGCCAGGGCCACCAATGCCTGACATTTTAGAAATAATAGATG\n-TATTATAAGAAGTCAAATATTTAGAGAAAGACTGTGAAACATAACATGCTGAAGAGCCGT\n-AGTCAAAAAAAACTGAAAATTGGACATAGGGAAAATGAGTTATTCGTGCAAAAAACATTC\n-TGTGTGGCTTGCCATATCCTTCCCGTAGAGGTTGTCCTTTTGGGGGTGGCTCAAATTTGC\n-CCTTTCCTACGGCCACAAAGTAGGTATTCGGGCTGTCCTATTCATAAATTTCTTCATTTC\n-GCATTCGATATAGAATGGCTTCAATTTCGTCATCGAGCTGCTCATCTTCTATTTGGCCTT\n-CAGGGCTTATTTGCTCTTGATCCAAATCTTCTGGCTCAACAAGGAAAGTAGAAGTGACAG\n-GCTTTGATGAACGATCGTGTGGTGTTACAGGTTTTACATATTTTTTATTTTTCATTGATT\n-GGTAAGTTTTCCTGAATTTATCGCTGAAACGCGACGAGGTGTATTTAGCGTTTGGTGCAT\n-ATTCCCTTTGTTCTTTTGATTCCACCGGCGCTGTTTTCATCAACCGGCAGTCTTTCGCCC\n-AGTGGCCTGTCTTTCCGCAATTGAAGCATTCGTAACGCTTGTCGTGAATTGGGTATGATT\n-TATCTGTTTCTGCAATGTCTTGTGACGCAAAGACGTCTTGCCCATACGACCTTGGATCAG\n-CTATGGATGCGTCAAATGCTGGAAGCTTTTCGCCTTTTGACGCTGAGATCGGAATTGGTG\n-CATTGGACTCGGAATGTTTGAATACATCATCCTCAAGTGTCCACCTTGTAATACCGCGTG\n-TGACTTGAACCACTCGATCCGCAAGCTCCGCGCTGGTGAGTTTGGGGAGATTATTGGAAA\n-TGATGGTCCAGGTACGTGGAAGTGAGAGTCGAATATGCTGCCTCAGTATATCTCTAGTCT\n-GAGGCCCTACCATGACATCCGAAGGTAGGCTAAAGAAAGCTTTCCGGAGTCGTCGCGCAA\n-ATTGTAATTGAGTCTCGTCGTTTCTTGCAGTTATTCGTGCAAATGTTGTCAAAGGCGACC\n-CGAGTACATCATTGTCGAACAGTATTTTAAGGATACAGTCTACAGCTCCTGCCCAATCGA\n-GGTGTTGACTGATGATTGTTCTTCGCGCCGAGATGAAATCTTCATCCATTTCCATTGCAA\n-TTCTGATAGCCCAAGCAGAATATGGAAGCATATGTTGAATCATCAATGATTGCATGTGGT\n-ATAATATATTCATTATGTTCTCATCAGCAAAGTGCAATTTCCATTGTGGTGGGAATACCG\n-CGCGTGTTTTTCTATTTGCCTCTTTTAAAGGGCCGTGCGGATTTTCAGCTTCGGAACGCG\n-AAAAGAAATCTGGGAAGTACCGCTTTATTTTTCGCTCTTGTTCAGTAACATTCAATGGTT\n-CGTTAACTGACTGGCGGTATAAATTAATAGTCCCATCTTTGTTTTGCTCATCATTGCTTA\n-GGTTGGGCGTTGTTTCATAGAATTGCGCCGAGGTAAAGGGTCTTTTCTTAGGCTGAAACA\n-CGATTGGCCTGGTTGCGGGTCGCGAGGCGCTGCCTGCTGAAAAGTCAAATAGCTCCTCCC\n-GGTATGGTTTTTTATTTTCAGATGGCCCTGCTTCCGAAAGTTGAAAGGGGACTGAATTTT\n-TCGAAGAAGTTTTTGTTTCCACGTCTTCATTTCTACTTACTAGTTTGGAAATTAAGTCGT\n-TCATTGCAGACATTTGTTTGACTAGAAGAGAAATTTGTGATTGGGTCTCTTCAAACCTTT\n-GATCGATTCTCTTGGAGAGATCTTTTGTCACTGCCTTTGCAGCTTCATTAGCTTCGGAAA\n-AATTTTCGTTGGCTTTGGTTTGCCCGGCAATGTGATCCTTCATCAAGCTTTCCAACTGAG\n-CATTATTCAGGCCGACCATGATGATTGAATAGGTGGTGAAATGCGTAAAAAATTTGGAGA\n-CGTCTTAAATTGGGATGACCTAGAATTGTGAGGTTCTCTCAACAAAAATATATAATTTTG\n-TGGCTTCTAGTTGATCAGTTTATGATCACAATGATTTCACGTAGGTGTCTCGTGGCTCCG\n-ACAAATCAACAATATAATGCGAGTAGAGCTTGAGACTAATAAAACGTGAATTTCATTCTA\n-TAATACAGGACCGCCAACTTATTTAAATATTCCCCCGCACCACGTGAGCCAATCAACAGC\n-ACACAATTTGCACGGTCGGGTTTCCATCAATTGGGATCCACA\n->blumeria_Grouper_14770_3\n-GGTTAGACCGATACAGTAAGTCTCGTATGAAGTTGTGGAAGGAAGAATTGACTGGAAACA\n-AGTGTATTGAGATGTATGGTTCTGAGTAAAACTGAGCTGATAAGAGTGAGATTGCGTGTG\n-CGCATATCTTATCAACTGAGGTTTTTGACCAGTATTTATCAATCTCCATGGATCATAAGT\n-TATGATCCCTGTAGATGTAAATCTATATACGTACAGATATATGAGCCAGAAATATAAAGC\n-TAAATACATGTGTGTCGGTAATAGATCCGAGAAACCTTTAACCTGCATTTGATACATAAT\n-CATCTGATGGAATGCTAGTGTGAAATAAATGCCAATGTACGTTAAACTTTCCGTGAGGAA\n-TGTGCTGATGACAATGATATAGGAAGGTGAATTTGATAACCTAATTAGCCGGACTTACAA\n-ATGAGTTATCCTTGGCATTCCAGGATATACAATATTTCAACACCCCTCCTCACTTTGCAT\n-CGAGGATAGATACATAAGTGAAAAACTGTTAGTATATTTATTGTCATTTCTCATCTAATG\n-CTGGTATGGTAGACACGCCAGTGGTTGTACTAGTACCAAAAACTGAAGTGCATAAATCGG\n-TGTGCCTTGGTCTCGGTAAGCCTTTTGTACATATATCTGCGAGATTTTTAGCTGAAGGAA\n-CATGTAATAGTGTAAGCGAGCCGTCTTCAATTCTTTCCCTTGTAAAATGATAAGCGATGT\n-CGATATGTTTAGAAGCATCATTTAGTTTTGGATTGTGAGCAAGTTCAATGGCAGCCGTAT\n-TGTCAGTCGAGATTGCTGCTGGGATGCTGTCTCCAAGGAATCGGTGAAGTCCGCGCAAAA\n-TCCAGATATATTGTTTGGATGCGAGCGCTATTGCCATGTACTCAGCTTCGCAGGTTGAAT\n-G\n->blumeria_Grouper_1717_12\n-ATTTCCAGTATCTTGCCCTGAAGGGCCAGTAAGTCCTGATCGAATAGTTTTCGAAGTCTC\n-TCGTCAGTGACTGGTTCCAACAGCTTGCAGAACCCAATGATGAAGCGCTCTGCTTGTGCG\n-GAGCGCGTCTGGAATATCCTGCCCTGTTCGGCGAGGAATTTGGTCGCGACGATTTGAGGC\n-GACGGAGTTTGTTGGTGCGGTGAGCTTCGATGACTCGCCTCGTAGATTGGCTCTACAAAT\n-TGTTGTGTGGGTTGTTGTGATGGCGGTTGTGGCCCGTTAAGGACCATTTCGACGTCTTGA\n-CGCGTCGAACATTGAGTTGGGAGGGGGGGCCAAGAGCCAGCCTCTGCGGAGGACTGGGGC\n-GGCATGAGTGAGTGAGGTTTGTGGCAGTGTGAGATCGTAGATGGTATACGGCGCGCTTGA\n-AGGG\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/DummyRepbase_aa.fa --- a/commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/DummyRepbase_aa.fa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,67 +0,0 @@ ->GYPSY11_AG1p:classI:LTR_retrotransposon -AATTTNVFKKVPYTCNFYGRSCINMQKLLEKIEILDRTYDQVRQLNKCYRLCALTTLRNN -TKELYDEIQELLRKHESSIKDEILTTLVKKSRHLYYEINKCIKIHFERHPDSLNTTLSEN -QFDITIETKSDKMADIIELIKITTSLISKYDGNEKDLKGVVSNLNVLKKIVKPENRETII -ELVLGRLTGKARIVVGEAPKSIEDIVNKLQDRCSIKVTPEIVVSKMDNTKQTGTIEDFGS -IIEKLTQQLEEAYIAEEITPEVARKKATKSGISALSYGLKDGETKIIMRSSKFETLHEAI -EQAVKLELEDRTKKGKNEQTKILYSNATRNNRGYGNNYQGRNNYNRFTNNNNNRYQTQNP -PRFPPARYGHNNNRNNNNYRNNNFNNTRNQHANRQNNSNRNQYVQSNQRNNSNLQNNRAP -IHNTVTAEEQNNFLGQPQASENTQY ->GYPSY10_AG2p:classI:LTR_retrotransposon -AIRQPKFFRATRATKSSALHSGGDPEPTGGPALHKPIRATYTINVQKSNFIKTRLGLADS -ICNLFVDSGSDISIIKGNKVRPTQTYKPKDIVDIISVGEGTITTHGSTITDVIVEGKKIQ -QLFHIVPDNFKIPADGILGRDFFMDHRCIINYDTWIFSVKHDGEFLETPIEDTINDKTLI -PPRCEVIRKLDKLKELDTDAVVCAEQLQEDVLVGNCIVNKNYPFIKIINTSNKAKLVNIS -HIKTIPLNEFEIVKTNNHKNENRLAIIKELIRKENISEDTDTSFEQLLLSYNDIFHLPND -HLTTNNFYKQDIKLEDKRPVYIPNYKQNHSQGPEIKKQIEKMLQDDVIEHSVSHYNSPIL -LVPKKSSDEKKWRLVVDFRQLNKKLLPDKFPLPRIDSILDQLGRAKFFSTLDLMSGFHQI -PLEESSKKYTAFSSTDGHYQFKRLPFGLNISPNSFQRMMTIAMTGLTPECAFVYVDDIVV -VGASENHHLKNLEKVFDRLRHYNLKLNPEKSCFFKKEVTYLGHKITDKGILPDDSKYDSI -KNYPIPQNADDVRRYVAFCNYYRKFIPNFALKAKPLNSLLKKNTKFEWTQECQEAFEYLK -NTLISPQVLQYPDFSKPFILTTDASTMACGAVLAQEHGGKDMPICFASRTFTKGEANKAI -IEKELAAIHWAIMHFKHYLYGKKFTVKTDHRPIVYLFGMKNPSSKLTRMRLDLEEFDFTV -EFVKGKQNVVADALSRIKITSDEIKSINVITKSMSKPVTSDNVLGNTSESDQLKMFHALA -YDEVKDLPKLESSVKKNEDTIELIGKILNKRKSKELLSVRDIHLKTDIGLQEPLLVKDFQ -RRKEKSAIVQFIKNIEKKLVMKSITQLAISETDEIFKEVHPNELKQIANNHLKNIQILIY -TKPQKITNEKTINDILDKVHNTPTGGHIGQYKMYKKIRREYSWNKMKKTIKEFLDKCLTC -KLNKHQTKTAEPFVKTDTPNTPFEAVSIDTVGPFQKTNNNNRYAVTIQCNLTKHVTVIAI -PNKEANTVARAVIEKIMLIYGTNIKKFRTDMGTEYKNEIFKNISEILKIEHKFSTPYHPQ -TIGALERNHRCLNEYLRIFTNEHKDDWDDWINYYSFAYNTTPNLDHGYTPFELVFGRNER -ITPNVKDTYSPLYNYDDYSKEFKYRLKIAHNRTRKHIEQVKFKLLKEQQNINQVNFEIGD -QIALTNENRTKLDPVYKGPYKVKEINGPNMIIENTEGVVQKIHKNRAIKL ->ORF1p_TCN4#2:classI:LTR_retrotransposon -ALLSHQKIFFDTITPIEDQSKPRLRQDTPFPEMTTPPTDKESLQRKIKQIEDERKREREE -HKREMAELQAQMRGLLKREAEKRDLPPHNPATSSLPAKSESPHPPIMYDSLPQPKYSFPV -LSEHADAAAIHQHISKLRSIFTLMAAGYRYEPTAFEARKLAHAAQSLTGIRHLQFLEGDG -LQCRTFDDWAKAFKSAMLPLGWVSETEKKIYSLQPQLLRLDKIPLAIMDFKQWFALLKDS -DSPMSEDVATHWLRNHMTPGLLAELERDFGGENQLRQASLAELLKHMEICATRLLRYQSA -FAPIAPTRTPIAAVSPEASSPIDIAQWLNPRLPLPKGGAGRRARAHLASEQRCFLCRQPG -HKSPDCPKRKEPTAIAAVSTFDHEEAEFEQEEGEMFAEVLATHLAPELSVPPILLECRIG -TNGSPFLALFDTGATVTLVDPSLITTHQLQTYPSEQRRVVSLAGGARGPALQRRVGVEVC -IQNQVFALHGYVMPLHARYKVILGLDFIRSHGLLSGASRLGNLAPDLLGPVVASVTTADG -YXDLRLAILHEYHDIFPDNIGEVANYPPICDANSKVRHHINLTPGAIPFKSASYRSPHMW -RQQLIEEIQKHREAGRLRPSSSPWAAPAFLVKKENGKFRFICDYRGLNKVTTPDSTPVPN -VDDILHRAACGKIFAKIDLSDAFFQTLMHEPDIEKTAITTELGLFEWVVMPQGACNSPAT -QQRRLNEALRGLLGDSCEAYVDDIIVWAADAEDLDKRLRAVLAALRKSGLVCSPTKSEFF -RHKVKFLGHVISANHIGPDPAKLRTIASWPLPQSVKELRSFLGLLQYLRKFIPSLATHTR -TLTALLPPTPAAEKAWEKQQRALRKGQSPKDVLSWVWAWSSEATAAFEILKAKVAEISGL -RPLDYAAALSGECPIYLFTDASNHGTGAWLGQGPDPDHAFPVAYDSRSLSAAERNYPTHE -KELLAIVRALKLWRPLLLDVPIQVQTDHFTLKWFLQQRDLSERQKRWLGXLSRFDLRIDH -ISGVNNFIADALSRLGGVDDEQDGMETAEVSVAVLGLLGQDTSTITKVAQGYAQDQVMGA -WLQEEDRAPGVTLENVENGQGRSTSGVAMGRQAMCARYQX ->Neptune2_Ap_1p:classI:LINE -ANTRPVVDSENIDKYRNTAKKIGKYRNTASKVDEIPKLQKRGIRRNLLKDFDLFARRMRL -KDIFSRERNKQHPFHVKSTWEPPVQQSVALETFLEEVEFELANSPSKRPKDNLSPGERRA -LHNLLGDKTIIVKKADKGTTTVIMSREQKIKEGQILLNDLDNYRPLEKQMADETVEKIKQ -LTTSMLTESHIDEMTVKWLSQTPNPPRIPEFYTLTKIHRPTLVGRPIISGCDGPTERISC -FVDRLIQPIAQQQESYLKDSKDFINFIENTKLPKNTILASKDVTSLYTNIPQEEGITTVC -KAYEDFYKNRLPIPTNFLRRMLCLILKENSFQFNKRHYLQTHGTAMGTKMAVAFANIFMA -KIEKGIISKSIIKPLVWKRYIDDVFCLWDTNEDNIKEFVTRANHYHDNIKFTAEISDSEI -AFLGHKSVQRREIQQRLPPSMCKRIINKQRPFNTRNFYSCHPPGVKKGFIKGEALHLLRT -NSSHSTFNKNMQSFKTRLKNRGYPNEFLEKKGPX ->ERV45_MD_I_2p:classI:LTR_retrotransposon -ASSKHATGKLQTGPGPGPSKQWGNNCGAQSEKPIPSPTIRSLHRATPGSAGLDLCAASGL -ILTPDSPPALIPTGVKGPLPEGTMGLIIGRSSVSLRGIVVTPGVIDSDFTGELQIIVQPP -XKTVTIMKGQRIAQLLILPYVQTXNPILKTSRGQGGFGSSNWAFWVQEIKNSRPMKILNI -SGKNIEGLLDTGADTSCIAGKHWPPTWPTKISPSNLIGIGKITNAAQSSQILTWSDGNLS -GQFCPHVVPSLPVTIWGRDILSQMKVSLVTPEEDAQTPPNDEPLDFPEGPSPR |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/DummyRepbase_nt.fa --- a/commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/DummyRepbase_nt.fa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,501 +0,0 @@\n->Polinton-1_DY:classII:Polinton\n-aaaaaaaaaacaagttgggtgtcattggaaaggatttttcaagccctttccaatggtatg\n-cttttcacgattctgaaattaaaaatacgacttttcataaaaactctcaaaattacaatt\n-gcacttcttcgcgcacaagcaatcttggaagggggtgtacctgcgcgcacaagcagtcat\n-aaggatgatcgcaagggtgggggtgagatttctgttcaaggctatgcaccttactgtgtc\n-ctcaattttctgggaaggtaactggtggttggattattagttgagaaatatttagaaata\n-tcaaacaaactggttatagggtcgtgtatacgtatatataaaaaatcatataatcataaa\n-accgttaaaaaaccgtcgttcccgtatattccagctactttcagctaaaagctatggagc\n-cgttgagaagaaaatctaaacaatctgaagtcatagcgactttcagcttaaggctaccca\n-cgttttaaatgtatgccttgcaaaatgttacttataaagtaacaatgactagtagtcacc\n-aataatttcatgatccctgactgcggtcatccgaaataattccctacagagatatgtatt\n-tcagattatctgtgatctgtctccattttcattatgctaggagaccccataaaatcaaat\n-atttatgactctttgaacctattatcgagaaagtcaagcggctatttacctgcatccaaa\n-cccatagctcgccctccttttctgacttccccattgcagtctgtgcagtctgcagtctgt\n-gaaggctccttaaatcgagaaccaatcaggtggattctaagagtagacaccccctgtaga\n-tgtcaaactctctaatcctcgtgtataaaaatggatccccttaaattgctcaggatcagt\n-tcttataatacctcagcactgcattcttataatataatttcggtcgaacttgctcgggat\n-atcacgtctaaccgttttaattgtttgtgtggactcaaaccatttactgtgaaaaatttt\n-aaaaacgaattaaaatatataaataaaatatatttataaaaaattcaaaatggaatcatc\n-agtggcttgtgatttgtgcaaccaatgcatcgaaattagtgagtttgtctctcattacgc\n-gaagtgctcagaacccagtaaagcctgcgaggctttaatgttaaactctaacattagatg\n-tgacttatgctctaatctagtaaaaaattgtgaatttgatgatcactaccaacgctgtga\n-aggaccccgaaatgcatttagcattttaatgggtagaggaaaactggatgaagaagaccg\n-ccctatgacatcagctaagtctataaaacgattgaggatggaagaggataaggaaatatc\n-taaccccccaaaaagaaaacaaattgacttaagaagggaactcttatgtcctactcagag\n-aacgtcaacatattttgaccgatatacataaaaatgcgtcggccagagaagttaagaaca\n-atgcgaatatcatattgcttacatcagagacgacatttccagtaaaatcatatcgaattg\n-atagtccattatttaaaagagtatataagtgtatatggtacatatataaagcaaacagat\n-gaaggagttacagtggaaacaatgaagcactttaaaactgcctacaaatctgtatacata\n-aatgaagacattattgatgagctaaattcggccatagattgcttacttacattaagcagc\n-gaatttcaagaaaaagactcaggctgggctattaaaaattttaactattttgaaactact\n-ataataaaactggaaaacattcctgccagcggatacattaaagctcctcaaaaaataaga\n-gcccgtaatgcgctaataaacgtgcagaatgccgacgtattttgtttcaagtggtgtata\n-ctagcatttatagctaatcaaaaccatgaaaataggacttttacaaccccccagcaaagg\n-aaatattcgagagaaaggatgacaaagcctcaaagctataacattaatattaatgatgaa\n-actattgtgtatggcggaatgactttagatttttcgggaattaaatttccaatcgaaaaa\n-ataggagttcgacattttgagaaaaacaatgtcaactttagcataaatatttatgaaatt\n-gatgaagcaggtgaaaaaattgttggtcccacgattaaaacaaaagaaagaaaacggaac\n-cacattaatatattgggaatcgataatattacccaaaacattatgcattatgcgtatata\n-acaaatctttatacattatgctcttcacaattttctaaaggaaaatcgggaggatatttt\n-tgtgagaactgtcttcagtgttatcacgtgaaaagcactactcacaacaaactggaatgc\n-ggaaaagtgtcctcattttatccggaccctaatacgacaacatcgtttaaaggatatcac\n-aaaaaattatctcctccagtggtaatttatgcagacattgaggctgttcttgaaaattac\n-aaaacatgcttgaattcttctgcttcctcgtcaaccacgcaagtacaaaagcatacggca\n-tgtgcagtatctttttatgttgcccataaagattatcctaatcttaacgagctgtggacc\n-tacgaaggtaaacagaacaacatttttataaaattatatttaacttacatatttaaattt\n-tataattttataggcgttgattgcatacaaacattttgtaaaactcttaaagaaaaaact\n-ttaagcctgtattacaaatattgggttaactccaagaaaccgagggatgacactttcgat\n-gaacagcttcaaaagggaaattgttgcgcctgcgagaaagaaataaatgcgagcgacctg\n-gacaaattctttgatcaattttctggagaatacgtaggtcctatccatagaaattgtaag\n-cctaagtttagattaagtgaccctttctttcctgtagtgttccataatttatctaaatat\n-gatattcatttatttattactgaattagagggggacttaagtcccataccttgcaataaa\n-gagctctatatagcacttacgcaaactataaaaatcaatgctacaagcagatacaaaata\n-agatacatagattcagtccgatttttaaattcaagtttagataaactatcaagctatatg\n-gaagataaagattttaaaattctaagtacgaaatttcagggagaaaaatttaagcaaatg\n-aggaggaagggggtgtttccctatgactacttagatagttttgaaaagtttaatgatacc\n-caacttccaagcattgatagtttttataattctcttagtgaagaaaattgtagtatagat\n-aactttaatttcgcacagaaagtctgggagacatttaactgtcgaactattaaagactat\n-ttaaaactatatttagaaagcgatgttttaattttagcagatgtgtttgaaaattttagg\n-aaaatttgcaaaaaaatttataagttagatcccattaattatgttactgcgccatcaata\n-tcatgggatgctatgcttaagttcactaatgtaaatttagaactaataagtgatggtgat\n-atgtataattttttaaaaagagcaattcggggagggttgactcaatgcactcagcgcatt\n-tctatagcaaataataaatacttaaaaaacttcgatccaaaaaaaccgaacaatttttta\n-agttatattgatgccaataatttatatgggtgggctatgagtcaacccttaccactatca\n-gggtttcagtttttggataaagaagaagttgattcattcga'..b'tatac\n-gcaaaacctaggtcctgaacccatggacgtcgatcccacatcacgttctaaattcaggag\n-cgaacggagagctcgcagtagtcaacggttgaaccagaacaagagcagtcaaatgaccag\n-gagtatagggtaaagtcatcctacgaagcagcggaaatcgaggctgataacacgtccgat\n-tccgaatcatgtaattttttaggggacgtccctgctcccccaaataattcgttcgatagc\n-ggggcgagaaattaggttactgttggatacagaagcctccaaaaattacataaaacctct\n-aacagaattaaaacacttcaaaccggtggaaacaccatttgaagtcacatcaatccatgg\n-tcatacaaaaatagaacaaaagtgtctgatccatctattcaatgttaagtcatacttctt\n-cttgttaaacaacctgaacgaatatgaaggaattgttagactggatttgccaaaaaaggt\n-caatgcaaaaattgatctaacaaaaaacatcatcgagcatgatcatggtacggagcaaat\n-tttttactcaaaatgcaggaatggtaactttattaacatcgatgacgtggacgtgccgaa\n-agccataaacgaaaatttcaaaaagatgatcaaaaacagatcaaaagcctttgcggaccc\n-aaacgattccctccccttcaaaatgaatacggtcgccacgatccgcactgacggggaacc\n-cgtatattcaaaactttacccatatccgatgggtgtagccgatttcgtcaatacggaggt\n-taagcaacatctagcagacggaataataaggccatcccggtcgccttacaataacccaat\n-ttgggttgttgataagaagggttttggcggagaaggtcataggaagaaacgtctcgttat\n-taacttcaggaaactgaatcaaaaaacaattgatgacaagtatcctataccattcatatc\n-gaccatactgtcgaactttggaaaagctcagtacttcacgactcttgatctgaagtcggg\n-cttccatcaaattgagccctcggagcgctttcgagaaaagacagctttttagtagtatga\n-attctgcagacttccctttgctttaaaaaatgcgcctagtattttccaatagacgatgtt\n-ctgagagaacacatcggcaaaactcgctatgtctacgtcgatgacgtaatatttttctcc\n-caaacaatggagagtcatgccaacgatataaacacggttctgaaaactttgtgcgatgca\n-ggtatgagagtgtctgtagaaaaatctatgttctttaaagagaacgtagaatatttggga\n-ttcatagtgtcccgagggggaattaaaacttcacccgaaagggttaaggctataaaacaa\n-tttaaacctccatcgacattgttaagtctcaggtcatttctgggattggccagttattat\n-ataatagatgtttcataaaggggctttttagcatcgcaagacctctgacgaatattctaa\n-aaggtgacaacggaaaaattggtgctaccactcaaagaaagtcaaactggaacgagcagc\n-gaaaatcattcgaaaaactaagaaacaccctggagtctgaggatgtcattttggcatacc\n-cagattccactcagccatttgacttgaaaactgacgcctctggaagcggcctaggggctg\n-ttcttttacagatttaatcggcagcggcagaaatcaccgcaaattgcagaacgtgttccg\n-aagcaaaacaccaatcgtcacccagtgcaacaaaccatagcggaaacatcaattcctggt\n-tacactggggaaagtatccacatagatatattttggactgatcaaaagcattttctaacc\n-tgtatcgacaagttttcaaaatccgctatagtccaaccaatcgattcaagagcaatcgta\n-gatatcaaaactccgatactacaactaataaatctgttcaccaaaataaaaacagtttac\n-tgcgacaatgaaagatctatcaattcacaaaccatacgaaccatcctagaaaataggtat\n-ggtatacgggtctcaaatgcgcacccgttgcacagcacatctaatggccaagttgagaga\n-tttcatagcaccctaggggaaatcgcacggtgcatcaagatagatcaaaacataaccgag\n-acgagcgaccttattctattcggaacaatagaataggacagaactgtccactcggttaca\n-attaaaaagggtcatgaaatagttcacgctattccaccagattttacgagcaccataaga\n-gacaaaatcaaagaggcccaagagaaaacacttaggtactcaaatgcacacaaatgcaat\n-aaacagtaccaaataggcgaaaaaatctggttaaaaaaccaacagacgcctgggtaccaa\n-attaacgccactctgctcagaagaggtcatcgaggctgatctcggcacgacagtgcttat\n-tatggagcaacgaacattacatcgtacgagacttacgcggacgagacgaaacacgcgatg\n-gatttcttcgagaaggagcacatgagacgggtacttgaaacggactaggaacgaatagag\n-actcttctggacacactaaaggtacgtcacagacatgcccgtagtcttaatttctcttaa\n-ttttctcttaatttctcttaatttgctttgaaagcaatagagtggacacctgactctgac\n-ggctgagaccaggtgaggttttgacaggaacagctaacggactcggtaaacggacagata\n-gatttaaacaacaaaatacaattgcaattaaacacaatgacctcgtccatgaattctatt\n-ttaaaatcggacgacttagacacagaacatttgtacgagacgattttggcaaaaaaccgt\n-attgtaattcaagaacttgaaaatttaatacttgcaatcaccctttccaaattaaacgta\n-ataagtccaataatcttgaatgacgttgacgtaagggagattgaaaaaacttttcaaaat\n-cgagacctattgtactttttaataaaatttccgaagcctttgttaacttgtagaaaaata\n-agaatattcccggtacagcatgaaaatagaatcttagatttcgaggacggtagcacggtc\n-gcggattgcgggacggaaaccttcgccgtcaaggactgcaatgtatcaccaccttctgca\n-ggagatcgaaagcgccaacctgcgcacaacaactcatctctggcatggtcgcccactgca\n-acacccagcctggacacttggacccactcaccatgatcgactagggaatgctcatcacga\n-acgatgtaacgataaatatcaccgacgaaaagggaataagccggataatatcaggaactt\n-acccggtatgatataccgaaaaaattaaaataaacggcacccttttacgttaacaatatc\n-ggaacatcaaagaagaaagccgcagtttcagctatggcccaagtaaacgttctgagacat\n-atagagcgccttactctgtcctggaaagaaagatgatgatctttcttatctaccgtttga\n-aagccaaaccaactaagaccattgaatccgaggacgaattcatcttaagacaaggagg\n->blumeria_Grouper_14770_3\n-GGTTAGACCGATACAGTAAGTCTCGTATGAAGTTGTGGAAGGAAGAATTGACTGGAAACA\n-AGTGTATTGAGATGTATGGTTCTGAGTAAAACTGAGCTGATAAGAGTGAGATTGCGTGTG\n-CGCATATCTTATCAACTGAGGTTTTTGACCAGTATTTATCAATCTCCATGGATCATAAGT\n-TATGATCCCTGTAGATGTAAATCTATATACGTACAGATATATGAGCCAGAAATATAAAGC\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/hmmbank_test --- a/commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/hmmbank_test Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,19248 +0,0 @@\n-HMMER2.0 [2.3.2]\n-NAME DUF234\n-ACC PF03008.6\n-DESC Archaea bacterial proteins of unknown function\n-LENG 100\n-ALPH Amino\n-RF no\n-CS no\n-MAP yes\n-COM hmmbuild -f -F HMM_fs.ann SEED.ann\n-COM hmmcalibrate --seed 0 HMM_fs.ann\n-NSEQ 19\n-DATE Tue Apr 22 17:16:17 2008\n-CKSUM 5535\n-GA 15.0000 15.0000;\n-TC 15.4000 15.4000;\n-NC 14.9000 14.9000;\n-XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \n-NULT -4 -8455\n-NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \n-EVD -8.994637 0.724738\n-HMM A C D E F G H I K L M N P Q R S T V W Y \n- m->m m->i m->d i->m i->i d->m d->d b->m m->e\n- -138 * -3458\n- 1 -4805 -3913 -5457 -5685 -185 -5282 -1653 -3657 -5166 -3035 1529 -4003 -5160 -4085 -4629 -4531 -4683 -3846 5759 2382 1\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -13 -8474 -9516 -894 -1115 -701 -1378 -1138 -7629 \n- 2 -4703 -3842 -5413 -5626 4193 -5234 1199 -3686 -5187 -3174 -3160 -3955 -5117 -4054 -4635 -4458 -4581 97 -875 1388 2\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -13 -8474 -9516 -894 -1115 -701 -1378 -7767 -7622 \n- 3 -2371 -3264 -2698 -1965 -4162 -3111 -1597 -3684 -469 -3509 -2752 -2006 -3258 923 3603 330 86 -3304 -3493 -3205 3\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -13 -8474 -9516 -894 -1115 -701 -1378 -7767 -7615 \n- 4 -2617 -2306 -4759 -4273 3096 -4141 -2245 160 -3894 547 -831 -3607 -4045 -3290 -3615 -3271 -2541 365 -1682 3149 4\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -13 -8474 -9516 -894 -1115 -701 -1378 -7767 -7607 \n- 5 -2826 -2347 -5502 -5177 -3043 -5232 -5201 2131 -5110 -1855 -1760 -4940 -5049 -5047 -5246 -4584 0 3252 -4681 -4169 5\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -14 -8475 -9517 -894 -1115 -701 -1378 -7767 -7601 \n- 6 -257 -1279 -2599 -2020 892 -2638 1046 -810 -1792 542 -474 -22 -338 -1580 -1919 -385 -1175 -710 -1648 3385 6\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -14 -8474 -9516 -894 -1115 -701 -1378 -7767 -7592 \n- 7 -3058 -3845 -2245 -2210 -4348 -3380 1529 -4491 177 -4262 -3625 -2331 3930 -1887 -1298 -2975 -3059 -4092 -3954 -3528 7\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -14 -8474 -9516 -894 -1115 -701 -1378 -7767 -7585 \n- 8 -1984 -3171 -1772 -1234 -3094 -2795 1043 -3212 -431 -3092 -2294 3505 -2878 756 909 -1867 -1870 -2866 -2958 1283 8\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -14 -8474 -9516 -894 -1115 -701 -1378 -7767 -7577 \n- 9 -240 -1075 -3406 -2780 332 -2753 -1615 1091 271 498 2206 -2344 -2804'..b'140 -5079 -4396 8\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -55 -11429 -12472 -894 -1115 -701 -1378 -5107 -4757 \n- 9 -712 -4440 -1806 1466 -633 -1548 -1315 -160 -363 -1082 1001 -933 2065 -1793 -142 -432 819 -302 -4473 -746 9\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -57 -11431 -12474 -894 -1115 -701 -1378 -5107 -4702 \n- 10 -3621 -7917 -257 -766 -2799 3663 -5030 -8037 -3067 -7859 -7302 -1529 -6174 -4722 -2416 -5451 -5952 -7471 -8058 -6924 10\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -60 -11435 -12477 -894 -1115 -701 -1378 -5107 -4647 \n- 11 -9856 -8225 -9114 -9499 -9330 -8179 5478 -10798 -9690 -10071 -10090 -9535 -8612 -9585 -9118 -10419 -9988 -10522 -8262 -9210 11\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -62 -11436 -12478 -894 -1115 -701 -1378 -5107 -4587 \n- 12 -3703 -3532 -6027 -5393 1774 -5248 -2191 1429 -354 717 1833 -2455 -5298 579 398 -2082 -829 470 2225 1129 12\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -65 -11439 -12482 -894 -1115 -701 -1378 -5107 -4527 \n- 13 2405 -4466 -3571 -1766 -2533 -1812 -3231 -1681 967 -2690 1010 -3283 -4633 469 -140 1477 -3419 -962 -4758 -4194 13\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -68 -11442 -12484 -894 -1115 -701 -1378 -5107 -4462 \n- 14 466 -4892 -1785 -2120 -1083 -4397 -1037 -1763 1748 -4907 -3981 48 -1842 -1695 2893 306 -581 -1839 -5076 -1979 14\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -71 -11445 -12487 -894 -1115 -701 -1378 -5107 -4395 \n- 15 -1558 -4443 2798 1932 -1194 -2341 -2946 -2873 -635 -4816 -1016 749 -4357 1472 -1620 -1163 -2311 -2885 -4430 -2016 15\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -75 -11449 -12492 -894 -1115 -701 -1378 -5107 -4326 \n- 16 -8641 5869 -9075 -9458 -2879 -7931 -8315 -10103 -9573 -9532 -9450 -9114 -8419 -9344 -9000 -9002 -8953 -9678 -7851 -7886 16\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -79 -11453 -12495 -894 -1115 -701 -1378 -5107 -4252 \n- 17 -1345 -4887 -463 -2725 -1179 -3060 -573 -4952 927 -2822 -1697 -2003 2836 -351 1498 -851 1103 -4507 661 -796 17\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -83 -11457 -12499 -894 -1115 -701 -1378 -5107 -4174 \n- 18 172 -4895 -1008 1064 -5216 -1138 569 -1324 1288 -2109 -325 1475 -4489 1525 -1288 838 -27 -1150 -5078 -4395 18\n- - * * * * * * * * * * * * * * * * * * * * \n- - * * * * * * * -5107 0 \n-//\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/hmmpfamOut.align.clean_match.path --- a/commons/pyRepetUnit/hmmer/profilsSearchInTEClassifier/tests/datas/hmmpfamOut.align.clean_match.path Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,16 +0,0 @@ -1 blumeria_Grouper_28830_3 2424 2882 RVT_1 242 23 4.1e-39 132 0 -10 blumeria_Grouper_4152_12:NoCat 428 478 DUF1602 23 39 0.0013 5 0 -11 blumeria_Grouper_4152_12:NoCat 382 407 V-ATPase_G 2 10 0.017 2 0 -12 blumeria_Grouper_4152_12:NoCat 136 228 XhoI 202 172 4.3e-05 9 0 -13 blumeria_Grouper_4152_12:NoCat 479 497 DUF1798 40 35 0.011 1 0 -14 blumeria_Grouper_4152_12:NoCat 294 365 DUF881 237 214 0.0052 4 0 -15 blumeria_Grouper_4152_12:NoCat 84 131 LBP_BPI_CETP 209 191 0.012 1 0 -16 blumeria_Grouper_4152_12:NoCat 230 247 SOCS_box 6 1 0.031 2 0 -2 blumeria_Grouper_28830_3 786 1229 rve 169 1 1.4e-23 77 0 -3 blumeria_Grouper_28830_3 4061 4108 zf-CCHC 18 3 1.7e-09 29 0 -4 blumeria_Grouper_590_20:NoCat 271 324 DUF234 5 22 0.0047 3 0 -5 blumeria_Grouper_590_20:NoCat 331 357 DUF1414 1 9 0.02 2 0 -6 blumeria_Grouper_590_20:NoCat 90 113 CPW_WPC 1 9 0.024 1 0 -7 blumeria_Grouper_590_20:NoCat 119 148 DUF46 182 173 0.00034 6 0 -8 blumeria_Grouper_4152_12:NoCat 337 381 Peptidase_S29 1 15 0.0034 4 0 -9 blumeria_Grouper_4152_12:NoCat 62 79 Toxin_18 50 55 0.014 4 0 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/TestAcceptanceHmmpfamAndParse2alignInparallel.py --- a/commons/pyRepetUnit/hmmer/tests/TestAcceptanceHmmpfamAndParse2alignInparallel.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,94 +0,0 @@ -import os -import sys -import unittest -import pyRepet.seq.fastaDB -from sets import Set -import ConfigParser -from pyRepet.launcher.programLauncher import * -from pyRepet.launcher.Launcher import HmmpfamAndParse2alignLauncher -from pyRepet.sql.RepetJobMySQL import * -from pyRepet.util.file.FileUtils import * -import commons.pyRepetUnit.dbSplit.LauncherDbSplit -import commons.pyRepetUnit.align.hmmOutputParsing.HmmpfamOutput2align - -CONFIG_FILE = "datas/configTestAcceptanceHmmpfamAndParse2alignLauncherInparallel.cfg" -CURRENT_DIR = os.getcwd() - -class TestAcceptanceHmmpfamLauncherAndParse2alignInparallel(unittest.TestCase): - - def setUp(self): - self._config = ConfigParser.ConfigParser() - self._config.readfp( open(CONFIG_FILE) ) - self._batchFilesList = [] - self._batchFilesBatchesList = [] - self._inputFile = self._config.get("dbSplit_config", "input_file") - self._programLauncherInstance = programLauncher() - self._outputFileNotInparallel = self._config.get("hmmer_config", "output_file") - self._hmmpfamOutput2align = commons.pyRepetUnit.align.hmmOutputParsing.HmmpfamOutput2align.HmmpfamOutput2align() - os.chdir(CURRENT_DIR) - - def _launchHmmpfamAndParseNotInParallel(self): - self._programLauncherInstance.reset(self._inputFile) - self._programLauncherInstance.setOutputFileName(self._outputFileNotInparallel) - self._programLauncherInstance.launchHmmpfam(evalFilter=self._config.get("profil_search", "Evalue"), inputFormat=self._config.get("profil_search", "InputFormat"), profilDatabank=self._config.get("profil_search", "ProfilDatabank")) - self._hmmpfamOutput2align.setInputFile(self._outputFileNotInparallel) - self._outputFileParsingNotInparallel = self._config.get("hmmpfam2align_config", "output_file") - self._hmmpfamOutput2align.setOutputFile(self._outputFileParsingNotInparallel) - self._hmmpfamOutput2align.run() - - - def _countNblinesInAllResultsFilesInParallel(self, fileUtils): - result_dir = self._config.get("hmmer_config", "result_dir") - dirFiles = fileUtils.listFilesInDir(result_dir) - listPath = [] - for file in dirFiles: - listPath.append(file) - - nbLinesInAlignFilesInparallel = fileUtils.countLinesInFiles(listPath) - return nbLinesInAlignFilesInparallel - - - def _launchHmmpfamAndParseInParallel(self): - user = self._config.get("db_config", "user") - host = self._config.get("db_config", "host") - passwd = self._config.get("db_config", "passwd") - dbName = self._config.get("db_config", "dbname") - jobDb = RepetJob(user, host, passwd, dbName) - params = {"param": "--informat " + self._config.get("profil_search", "InputFormat") + " -E " + self._config.get("profil_search", "Evalue"), "profilDB": self._config.get("profil_search", "ProfilDatabank"), "outputDir": self._config.get("hmmer_config", "result_dir"), "query": self._config.get("hmmer_config", "query_dir"), "job_table": "jobs", "queue": self._config.get("sge_config", "queue"), "groupid": self._config.get("sge_config", "groupid"), "tmpDir": self._config.get("hmmer_config", "tmp_dir"), "scriptToLaunch": self._config.get("parse_config", "scriptToLaunch"), "cDir" : "."} - self.hmmpfamAndParse2align = HmmpfamAndParse2alignLauncher(jobDb, params) - self.hmmpfamAndParse2align.run() - - - def _splitInputFile(self, dbSplit): - dbSplit.setInFileName(self._inputFile) - dbSplit.setIsNewDir(True) - dbSplit.setNbSequences(3) - dbSplit.run() - - def testAcceptanceHmmpfamAndParse2alignHasRunInparallel (self): - - dbSplit = commons.pyRepetUnit.dbSplit.LauncherDbSplit.LauncherDbSplit() - self._splitInputFile(dbSplit) - self._launchHmmpfamAndParseInParallel() - fileUtils = FileUtils() - nbLinesInAlignFilesInparallel = self._countNblinesInAllResultsFilesInParallel(fileUtils) - dbSplit.clean() - self._launchHmmpfamAndParseNotInParallel() - nbLinesInAlignFileNotInparallel = fileUtils.countLinesInAFile(self._outputFileParsingNotInparallel) - self.assertEqual(nbLinesInAlignFilesInparallel,nbLinesInAlignFileNotInparallel) - self._clean() - - def _clean(self): - - dirToClean = self._config.get( "hmmer_config", "tmp_dir" ) - os.system("rm " + dirToClean + "/*") - dirToClean = self._config.get( "hmmer_config", "result_dir" ) - os.system("rm " + dirToClean + "/*") - os.system("rm HmmpfamJob*.e*") - os.system("rm HmmpfamJob*.o*") - os.remove(self._outputFileNotInparallel) - os.remove(self._outputFileParsingNotInparallel) - - -if __name__ == "__main__": - unittest.main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/TestFunctionalHmmpfamAndParse2alignLauncherInParallel.py --- a/commons/pyRepetUnit/hmmer/tests/TestFunctionalHmmpfamAndParse2alignLauncherInParallel.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,56 +0,0 @@ -import os -import sys -import unittest -from sets import Set -import ConfigParser -from pyRepet.launcher.Launcher import HmmpfamAndParse2alignLauncher -from pyRepet.sql.RepetJobMySQL import * -from pyRepet.util.file.FileUtils import * - -CONFIG_FILE = "datas/configTestFunctionalHmmpfamLauncherInparallel.cfg" -CURRENT_DIR = os.getcwd() - -class TestFunctionalHmmpfamLauncherAndParse2alignInparallel(unittest.TestCase): - - def setUp(self): - self._config = ConfigParser.ConfigParser() - self._config.readfp( open(CONFIG_FILE) ) - os.chdir(CURRENT_DIR) - - def testHmmpfamAndParse2alignHasRunInparallel (self): - user = self._config.get( "db_config","user" ) - host = self._config.get( "db_config","host" ) - passwd = self._config.get( "db_config","passwd" ) - dbName = self._config.get( "db_config","dbname" ) - jobDb = RepetJob(user , host , passwd , dbName) - params = {"param":"--informat FASTA -E 10", - "profilDB": self._config.get("profil_search", "ProfilDatabank"), - "outputDir": self._config.get("hmmer_config", "result_dir"), - "query": self._config.get("hmmer_config", "query_dir"), - "job_table":"jobs", - "queue" : self._config.get("sge_config", "queue"), - "groupid" : self._config.get("sge_config", "groupid"), - "tmpDir": self._config.get("hmmer_config", "tmp_dir"), - "scriptToLaunch": self._config.get("parse_config", "scriptToLaunch"), - "cDir" : "."} - self.hmmpfamAndParse2align = HmmpfamAndParse2alignLauncher(jobDb, params) - self.hmmpfamAndParse2align.run() - fileUtils = FileUtils() - dirFiles = fileUtils.listDir(self._config.get("hmmer_config", "result_dir")) - dirSet = Set(dirFiles) - alignFileSet = Set([self._config.get("hmmer_config", "result_dir") + "/" + "batch_1.fa.hmmpfamOut.align", self._config.get("hmmer_config", "result_dir") + "/" + "batch_2.fa.hmmpfamOut.align"]) - self.assertTrue( alignFileSet.issubset(dirSet)) - self._clean() - - def _clean(self): - - dirToClean = self._config.get( "hmmer_config", "tmp_dir" ) - os.system("rm " + dirToClean + "/*") - dirToClean = self._config.get( "hmmer_config", "result_dir" ) - os.system("rm " + dirToClean + "/*") - os.system("rm HmmpfamJob*.e*") - os.system("rm HmmpfamJob*.o*") - - -if __name__ == "__main__": - unittest.main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/TestFunctionalHmmpfamClusterComponent.py --- a/commons/pyRepetUnit/hmmer/tests/TestFunctionalHmmpfamClusterComponent.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,38 +0,0 @@ -import os -import sys -import unittest -from sets import Set -import ConfigParser -from pyRepet.sql.RepetJobMySQL import * -from pyRepet.util.file.FileUtils import * -import commons.pyRepetUnit.hmmer.HmmpfamClusterComponent - -CONFIG_FILE = "datas/configTestFunctionalHmmpfamLauncherInparallel.cfg" -CURRENT_DIR = os.getcwd() - -class TestFunctionalHmmpfamClusterComponent(unittest.TestCase): - - def setUp(self): - os.chdir(CURRENT_DIR) - self._config = ConfigParser.ConfigParser() - self._config.readfp( open(CONFIG_FILE) ) - self._hmmer = commons.pyRepetUnit.hmmer.HmmpfamClusterComponent.HmmpfamClusterComponent() - - def testHmmpfamHasRunInparallel (self): - user = self._config.get( "db_config","user" ) - host = self._config.get( "db_config","host" ) - passwd = self._config.get( "db_config","passwd" ) - dbName = self._config.get( "db_config","dbname" ) - jobDb = RepetJob(user , host , passwd , dbName) - self._hmmer.setJobDb(jobDb) - self._hmmer.loadConfig(self._config) - self._hmmer.run() - fileUtils = FileUtils() - dirFiles = fileUtils.listDir(self._config.get("hmmer_config", "result_dir")) - dirSet = Set(dirFiles) - alignFileSet = Set([self._config.get("hmmer_config", "result_dir") + "/" + "batch_1.fa.hmmpfamOut", self._config.get("hmmer_config", "result_dir") + "/" + "batch_2.fa.hmmpfamOut"]) - self.assertTrue(alignFileSet.issubset(dirSet)) - self._hmmer.clean() - -if __name__ == "__main__": - unittest.main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/TestHmmpfamAndParse2alignLauncher.py --- a/commons/pyRepetUnit/hmmer/tests/TestHmmpfamAndParse2alignLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,87 +0,0 @@ -import unittest -import os -import sys - -if not os.environ.has_key( "REPET_PATH" ): - print "*** Error: no environment variable REPET_PATH" - sys.exit(1) -sys.path.append( os.environ["REPET_PATH"] ) - -from pyRepet.launcher.Launcher import HmmpfamAndParse2alignLauncher -from pyRepet.sql.RepetJobMySQL import * - -class TestHmmpfamAndParse2alignLauncher(unittest.TestCase): - - def testConstructor(self): - - params = { - "query" : "toto", - "job_table":"fakeTable", - "queue" : "fakeQueue", - "groupid" : "fakeId", - "tmpDir" : "fakeDir", - "cDir" : "." - } - - hmmpfam = HmmpfamAndParse2alignLauncher("toto", params) - - self.assertEquals("toto", hmmpfam.query) - self.assertEquals("fakeTable", hmmpfam.job_table) - self.assertEquals("fakeQueue", hmmpfam.queue) - self.assertEquals("fakeId", hmmpfam.groupid) - self.assertEquals("fakeDir", hmmpfam.tmpdir) - - - def testCmd_start(self): - - fullInFileName = "/workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas/test_input_aa.fa" - expectedCmdStart = "hmmpfam --informat FASTA -E 10 /workspace/repet_pipe/pyRepet/launcher/datas/hmmpfam/myhmms test_input_aa.fa > /workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas/test_input_aa.fa.hmmpfamOut" - - user = "oinizan" - host = "pisano" - passwd = "oinizan" - dbName = "repet_oinizan" - jobDb = RepetJob(user , host , passwd , dbName) - params = {"param":"--informat FASTA -E 10", - "query" : "toto", - "job_table":"fake", - "queue" : "fake", - "groupid" : "fake", - "profilDB": "/workspace/repet_pipe/pyRepet/launcher/datas/hmmpfam/myhmms", - "tmpDir" : "fakeDir", - "outputDir": "/workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas", - "scriptToLaunch": "/workspace/repet_pipe/repet_base/HmmpfamOutput2align_script.py", - "cDir" : "." - } - self.hmmpfam = HmmpfamAndParse2alignLauncher(jobDb, params) - self.assertEquals(expectedCmdStart, self.hmmpfam.cmd_start ( fullInFileName )) - - - def testCmd_finish(self): - - fullInFileName = "/workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas/test_input_aa.fa" - user = "oinizan" - host = "pisano" - passwd = "oinizan" - dbName = "repet_oinizan" - jobDb = RepetJob(user , host , passwd , dbName) - params = {"param":"--informat FASTA -E 10", - "query" : "toto", - "job_table":"fake", - "queue" : "fake", - "groupid" : "fake", - "profilDB": "/workspace/repet_pipe/pyRepet/launcher/datas/hmmpfam/myhmms", - "tmpDir" : "fakeDir", - "outputDir": "/workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas", - "scriptToLaunch": "/workspace/repet_pipe/repet_base/HmmpfamOutput2align_script.py", - "cDir" : "." - } - self.hmmpfamAndParse2align = HmmpfamAndParse2alignLauncher(jobDb, params) - expectedCmdFinish = "os.system( \"/workspace/repet_pipe/repet_base/HmmpfamOutput2align_script.py -i /workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas/test_input_aa.fa.hmmpfamOut -o /workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas/test_input_aa.fa.hmmpfamOut.align -c\" )\n" - self.assertEquals(expectedCmdFinish, self.hmmpfamAndParse2align.cmd_finish ( fullInFileName )) - - - -if __name__ == "__main__": - unittest.main() - |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/TestHmmpfamClusterComponent.py --- a/commons/pyRepetUnit/hmmer/tests/TestHmmpfamClusterComponent.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,76 +0,0 @@ -import os -import unittest -import ConfigParser -import commons.pyRepetUnit.hmmer.HmmpfamClusterComponent -from pyRepet.sql.RepetJobMySQL import * -from pyRepet.util.file.FileUtils import * - -class TestHmmpfamClusterComponent(unittest.TestCase): - - def setUp(self): - - self.component = commons.pyRepetUnit.hmmer.HmmpfamClusterComponent.HmmpfamClusterComponent() - - def testLoadConfig(self): - config = open("tmpConfig.cfg", "w") - config.write("[profil_search]\n") - config.write("ProfilDatabank: /repet_pipe/commons/pyRepetUnit/hmmer/datas/myhmms\n") - config.write("[hmmer_config]\n") - config.write("result_dir: /repet_results\n") - config.write("query_dir: /repet_datas/hmmer_in_parallel\n") - config.write("tmp_dir: /repet_tmp\n") - config.write("[sge_config]\n") - config.write("queue: main.q\n") - config.write("groupid: fake\n") - config.close() - config = ConfigParser.ConfigParser() - config.readfp( open("tmpConfig.cfg") ) - self.component.loadConfig(config) - self.assertEquals( "/repet_pipe/commons/pyRepetUnit/hmmer/datas/myhmms", self.component.getProfilDatabank() ) - self.assertEquals( "/repet_results", self.component.getResultDir() ) - self.assertEquals( "/repet_datas/hmmer_in_parallel", self.component.getQueryDir() ) - self.assertEquals( "/repet_tmp", self.component.getTmpDir() ) - self.assertEquals( "main.q", self.component.getSGEQueue() ) - self.assertEquals( "fake", self.component.getSGEGroupId() ) - os.system("rm tmpConfig.cfg") - - def testClean (self): - fileUtils = FileUtils() - if (fileUtils.isRessourceExists("dummyTmpDir")): - os.system("rm -r dummyTmpDir") - - if (fileUtils.isRessourceExists("dummyResultDir")): - os.system("rm -r dummyResultDir") - - os.mkdir("dummyTmpDir") - os.system("touch dummyTmpDir/srptJob1_fake_HmmpfamJob1_2009-3-11_12394.py") - os.system("touch dummyTmpDir/srptJob2_fake_HmmpfamJob1_2009-3-11_12394.py") - os.system("touch dummyTmpDir/srptJob3_fake_HmmpfamJob1_2009-3-11_12394.py") - os.system("touch dummyTmpDir/srptJob4_fake_HmmpfamJob1_2009-3-11_12394.py") - - os.mkdir("dummyResultDir") - os.system("touch dummyResultDir/batch_1.fa.hmmpfamOut") - os.system("touch dummyResultDir/batch_2.fa.hmmpfamOut") - os.system("touch dummyResultDir/batch_3.fa.hmmpfamOut") - os.system("touch dummyResultDir/batch_4.fa.hmmpfamOut") - - self.component.setTmpDir("dummyTmpDir") - self.component.setResultDir("dummyResultDir") - - self.component.clean() - - self.assertFalse(fileUtils.isRessourceExists("dummyTmpDir/srptJob1_fake_HmmpfamJob1_2009-3-11_12394.py")) - self.assertFalse(fileUtils.isRessourceExists("dummyTmpDir/srptJob1_fake_HmmpfamJob2_2009-3-11_12394.py")) - self.assertFalse(fileUtils.isRessourceExists("dummyTmpDir/srptJob1_fake_HmmpfamJob3_2009-3-11_12394.py")) - self.assertFalse(fileUtils.isRessourceExists("dummyTmpDir/srptJob1_fake_HmmpfamJob4_2009-3-11_12394.py")) - self.assertFalse(fileUtils.isRessourceExists("dummyResultDir/batch_1.fa.hmmpfamOut")) - self.assertFalse(fileUtils.isRessourceExists("dummyResultDir/batch_2.fa.hmmpfamOut")) - self.assertFalse(fileUtils.isRessourceExists("dummyResultDir/batch_3.fa.hmmpfamOut")) - self.assertFalse(fileUtils.isRessourceExists("dummyResultDir/batch_4.fa.hmmpfamOut")) - - os.system("rm -r dummyTmpDir") - os.system("rm -r dummyResultDir") - - -if __name__ == "__main__": - unittest.main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/TestHmmpfamLauncher.py --- a/commons/pyRepetUnit/hmmer/tests/TestHmmpfamLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,80 +0,0 @@ -import unittest -import os -import sys - -if not os.environ.has_key( "REPET_PATH" ): - print "*** Error: no environment variable REPET_PATH" - sys.exit(1) -sys.path.append( os.environ["REPET_PATH"] ) - -from pyRepet.launcher.Launcher import HmmpfamLauncher -from pyRepet.sql.RepetJobMySQL import * - -class TestHmmpfamLauncher(unittest.TestCase): - - def testConstructor(self): - - params = { - "query" : "toto", - "job_table":"fakeTable", - "queue" : "fakeQueue", - "groupid" : "fakeId", - "tmpDir" : "fakeDir", - "cDir" : "." - } - - hmmpfam = HmmpfamLauncher("toto", params) - - self.assertEquals("toto", hmmpfam.query) - self.assertEquals("fakeTable", hmmpfam.job_table) - self.assertEquals("fakeQueue", hmmpfam.queue) - self.assertEquals("fakeId", hmmpfam.groupid) - self.assertEquals("fakeDir", hmmpfam.tmpdir) - - - def testCmd_start(self): - - fullInFileName = "/repet_pipe/commons/pyRepetUnit/hmmer/datas/test_input_aa.fa" - expectedCmdStart = "hmmpfam --informat FASTA -E 10 /workspace/repet_pipe/pyRepet/launcher/datas/hmmpfam/myhmms test_input_aa.fa > /workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas/test_input_aa.fa.hmmpfamOut" - user = "oinizan" - host = "pisano" - passwd = "oinizan" - dbName = "repet_oinizan" - jobDb = RepetJob(user , host , passwd , dbName) - params = {"param":"--informat FASTA -E 10", - "query" : "toto", - "job_table":"fake", - "queue" : "fake", - "groupid" : "fake", - "profilDB": "/workspace/repet_pipe/pyRepet/launcher/datas/hmmpfam/myhmms", - "tmpDir" : "fakeDir", - "outputDir": "/workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas", - "cDir" : "."} - self.hmmpfam = HmmpfamLauncher(jobDb, params) - self.assertEquals(expectedCmdStart, self.hmmpfam.cmd_start ( fullInFileName )) - - def testCmd_finish(self): - - fullInFileName = "/workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas/test_input_aa.fa" - expectedCmdFinish = "" - - user = "oinizan" - host = "pisano" - passwd = "oinizan" - dbName = "repet_oinizan" - jobDb = RepetJob(user , host , passwd , dbName) - params = {"param":"--informat FASTA -E 10", - "query" : "toto", - "job_table":"fake", - "queue" : "fake", - "groupid" : "fake", - "tmpDir" : "fakeDir", - "cDir" : "." - } - self.hmmpfam = HmmpfamLauncher(jobDb, params) - self.assertEquals(expectedCmdFinish, self.hmmpfam.cmd_finish ( fullInFileName )) - - -if __name__ == "__main__": - unittest.main() - |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/TestLaunchPreProcessHmmpfamPostProcessNotInParallel.py --- a/commons/pyRepetUnit/hmmer/tests/TestLaunchPreProcessHmmpfamPostProcessNotInParallel.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,63 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.hmmer.LaunchPreProcessHmmpfamPostProcessNotInParallel import * -from pyRepet.util.file.FileUtils import * -import ConfigParser - -if (not os.environ.has_key("REPET_PATH")): - print "*** Error: no environment variable REPET_PATH" - exit =1 - -if (not os.environ.has_key("PYTHONPATH")): - print "*** Error: no environment variable PYTHONPATH" - exit =1 - -if (exit == 1): - sys.exit(1) - -CONFIG_FILE = "datas/configTestLaunchPreProcessHmmpfamPostProcessNotInParallel.cfg" -CURRENT_DIR = os.getcwd() - -class TestLaunchPreProcessHmmpfamPostProcessNotInParallel(unittest.TestCase): - - def setUp( self ): - os.chdir(CURRENT_DIR) - self._LaunchPreProcessHmmpfamPostProcess = LaunchPreProcessHmmpfamPostProcessNotInParallel() - self._configFile = CONFIG_FILE - config = ConfigParser.ConfigParser() - config.readfp(open(self._configFile)) - self._InputFile = config.get("hmmer_config", "input_file") - self._OutputFile = config.get("hmmer_config", "output_file") - self.fileUtils = FileUtils() - - def testRun(self): - #Normal launch - self._LaunchPreProcessHmmpfamPostProcess.setInputFile( self._InputFile ) - self._LaunchPreProcessHmmpfamPostProcess.setOutputFile( self._OutputFile ) - self._LaunchPreProcessHmmpfamPostProcess.setConfigFile( self._configFile ) - self._LaunchPreProcessHmmpfamPostProcess.run() - self.assertTrue(self.fileUtils.isRessourceExists(self._OutputFile)) - self.assertFalse(self.fileUtils.isFileEmpty(self._OutputFile)) - os.system("rm " + self._OutputFile) - #without config file - configFile = "/workspace/repet_pipe/commons/pyRepetUnit/hmmer/datas/configdummy.cfg" - self._LaunchPreProcessHmmpfamPostProcess.setConfigFile( configFile ) - self._LaunchPreProcessHmmpfamPostProcess.run() - self.assertFalse(self.fileUtils.isRessourceExists(self._OutputFile)) - #without input file - InputFile = "" - self._LaunchPreProcessHmmpfamPostProcess.setInputFile( InputFile ) - self._LaunchPreProcessHmmpfamPostProcess.run() - self.assertFalse(self.fileUtils.isRessourceExists(self._OutputFile)) - #without output file - self._LaunchPreProcessHmmpfamPostProcess.setConfigFile( self._configFile ) - self._LaunchPreProcessHmmpfamPostProcess.setInputFile( self._InputFile ) - OutputFile = "" - self._LaunchPreProcessHmmpfamPostProcess.setOutputFile( OutputFile ) - self._LaunchPreProcessHmmpfamPostProcess.run() - self.assertFalse(self.fileUtils.isRessourceExists(self._OutputFile)) - - - -if __name__ == "__main__": - unittest.main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/TestProgramLauncher.py --- a/commons/pyRepetUnit/hmmer/tests/TestProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,65 +0,0 @@ -import os -import unittest -from pyRepet.launcher.programLauncher import * -from pyRepet.util.file.FileUtils import * -import ConfigParser - -if (not os.environ.has_key("REPET_PATH")): - print "*** Error: no environment variable REPET_PATH" - exit =1 - -if (not os.environ.has_key("PYTHONPATH")): - print "*** Error: no environment variable PYTHONPATH" - exit =1 - -if (exit == 1): - sys.exit(1) - -CONFIG_FILE = "datas/config.cfg" -CURRENT_DIR = os.getcwd() - -class TestProgramLauncher(unittest.TestCase): - - def setUp(self): - os.chdir(CURRENT_DIR) - self._programLauncherInstance = programLauncher() - self._configFile = CONFIG_FILE - config = ConfigParser.ConfigParser() - config.readfp( open(self._configFile) ) - self._configFile = CONFIG_FILE - config = ConfigParser.ConfigParser() - config.readfp(open(self._configFile)) - self._inputFile = config.get("hmmer_config", "input_file") - self._outputFile = config.get("hmmer_config", "output_file") - self.fileUtils = FileUtils() - - def testLaunchHmmpfam(self): - config = ConfigParser.ConfigParser() - config.readfp( open(self._configFile) ) - self._programLauncherInstance.reset( self._inputFile ) - self._programLauncherInstance.setOutputFileName( self._outputFile ) - self._programLauncherInstance.launchHmmpfam( evalFilter=config.get("profil_search","Evalue"), - inputFormat=config.get("profil_search","InputFormat"), - profilDatabank=config.get("profil_search","ProfilDatabank")) - self.assertTrue(self.fileUtils.isRessourceExists(self._outputFile)) - self.assertFalse(self.fileUtils.isFileEmpty(self._outputFile)) - os.system( "rm " + self._outputFile) - self._inputFile = "repet_pipe/pyRepet/launcher/datas/hmmpfam/test_input_aa2.fa" - self._programLauncherInstance.reset( self._inputFile ) - self._programLauncherInstance.launchHmmpfam( evalFilter=config.get("profil_search","Evalue"), - inputFormat=config.get("profil_search","InputFormat"), - profilDatabank=config.get("profil_search","ProfilDatabank")) - self.assertFalse(self.fileUtils.isRessourceExists(self._outputFile)) - #No output file - self._outputFile = "" - self._inputFile = "repet_pipe/pyRepet/launcher/datas/hmmpfam/test_input_aa.fa" - self._programLauncherInstance.reset( self._inputFile ) - self._programLauncherInstance.setOutputFileName( self._outputFile ) - self._programLauncherInstance.launchHmmpfam( evalFilter=config.get("profil_search","Evalue"), - inputFormat=config.get("profil_search","InputFormat"), - profilDatabank=config.get("profil_search","ProfilDatabank")) - self.assertFalse(self.fileUtils.isRessourceExists(self._outputFile)) - os.chdir(CURRENT_DIR) - -if __name__ == "__main__": - unittest.main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/datas/Outputhmmpfam --- a/commons/pyRepetUnit/hmmer/tests/datas/Outputhmmpfam Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,148 +0,0 @@ -hmmpfam - search one or more sequences against HMM database -HMMER 2.3.2 (Oct 2003) -Copyright (C) 1992-2003 HHMI/Washington University School of Medicine -Freely distributed under the GNU General Public License (GPL) -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -HMM file: myhmms -Sequence file: 7LES_DROME -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Query sequence: 7LES_DROME -Accession: P13368 -Description: SEVENLESS PROTEIN (EC 2.7.1.112). - -Scores for sequence family classification (score includes all domains): -Model Description Score E-value N --------- ----------- ----- ------- --- -pkinase Protein kinase domain 314.6 6e-95 1 -fn3 Fibronectin type III domain 176.6 2e-53 6 -rrm -40.4 0.72 1 - -Parsed for domains: -Model Domain seq-f seq-t hmm-f hmm-t score E-value --------- ------- ----- ----- ----- ----- ----- ------- -fn3 1/6 437 522 .. 1 84 [] 48.3 8.8e-15 -fn3 2/6 825 914 .. 1 84 [] 13.4 2.2e-06 -fn3 3/6 1292 1389 .. 1 84 [] 15.9 1.2e-06 -fn3 4/6 1799 1891 .. 1 84 [] 63.5 2.3e-19 -fn3 5/6 1899 1978 .. 1 84 [] 15.2 1.5e-06 -fn3 6/6 1993 2107 .. 1 84 [] 20.3 4.3e-07 -pkinase 1/1 2209 2483 .. 1 294 [] 314.6 6e-95 -rrm 1/1 2223 2284 .. 1 77 [] -40.4 0.72 - -Alignments of top-scoring domains: -fn3: domain 1 of 6, from 437 to 522: score 48.3, E = 8.8e-15 - CS C CCCCEEEEEECCTTCCEEEEECCC CCCCCCCEEEEE.ECCCCCC - *->P.saPtnltvtdvtstsltlsWsppt.gngpitgYevtyRqpkngge - P saP + +++ ++ l ++W p + ngpi+gY++++ +++ g+ - 7LES_DROME 437 PiSAPVIEHLMGLDDSHLAVHWHPGRfTNGPIEGYRLRL-SSSEGNA 482 - - CS CCCCEEECCCCCECECCEEEEECCCCEEEEEECCC CCCC - wneltvpgtttsytltgLkPgteYevrVqAvnggG.GpeS<-* - + e+ vp sy+++ L++gt+Y++ + +n +G+Gp - 7LES_DROME 483 TSEQLVPAGRGSYIFSQLQAGTNYTLALSMINKQGeGPVA 522 - -fn3: domain 2 of 6, from 825 to 914: score 13.4, E = 2.2e-06 - CS CCCCCEEEEEECCTTCCEEEEECCC CCCCCCCEEEEE.EC - *->PsaPtnltvtdvtstsltlsWsppt.......gngpitgYevtyRqp - ++P l++ ++ + +sW+ p++++ ++ + + +Ye+++ + - 7LES_DROME 825 GGKPHSLKALL-GAQAAKISWKEPErnpyqsaDAARSWSYELEV-LD 869 - - CS CCCCCCCCCE EECCCCCECECCEEEEECCCCEEEEEECCC CCCC - knggewnelt.vpgtttsytltgLkPgteYevrVqAvnggG..GpeS<-* - + +++ ++++++ g+ + l+ L+P+ Y++rV+A+n +G++G+++ - 7LES_DROME 870 VASQSAFSIRnIRGPI--FGLQRLQPDNLYQLRVRAINVDGepGEWT 914 - -fn3: domain 3 of 6, from 1292 to 1389: score 15.9, E = 1.2e-06 - CS CCCCCEEEE EEC CTTCCEEEEECCC CCCCCCCEEE - *->PsaPtnltv......tdv..tstsltlsWsppt....gngpitgYev - Ps+P++l+v ++ t++++ s++l+W++p+++++ Y + - 7LES_DROME 1292 PSQPRRLRVfverlaTALqeANVSAVLRWDAPEqgqeAPMQALEYHI 1338 - - CS EE.ECCCCCCCCCCEEECCCC CECECCEEEEECCCCEEEEEECCC - tyRqpknggewneltvpgttt.sytltgLkPgteYevrVqAvnggG.... - ++ + g e +e +++ ++ ++ L+P+ +Y+++V A+ ++++ - 7LES_DROME 1339 SC-W--VGSELHEELRLNQSAlEARVEHLQPDQTYHFQVEARVAATgaaa 1385 - - CS CCCC - GpeS<-* - G++S - 7LES_DROME 1386 GAAS 1389 - -fn3: domain 4 of 6, from 1799 to 1891: score 63.5, E = 2.3e-19 - CS CCCCCEEEEEECCTTCCEEEEECCC CCCCCCCEEEEE.ECCCCCC - *->PsaPtnltvtdvtstsltlsWsppt.gngpitgYevtyRqpkngge. - Ps+P+n++v+ +++ +l +sW pp++ +++ +Y++++ q++ +ge+ - 7LES_DROME 1799 PSPPRNFSVRVLSPRELEVSWLPPEqLRSESVYYTLHW-QQELDGEn 1844 - - CS CCCCEEECCCCCECECCEEEEECCCCEEEEEECCC CCCC - .......wneltvpgtttsytltgLkPgteYevrVqAvnggG.GpeS<-* - +++++ + + + t+ ++ ltg kPg+ Y+++VqA+ + +++ S - 7LES_DROME 1845 vqdrrewEAHERRLETAGTHRLTGIKPGSGYSLWVQAHATPTkSNSS 1891 - -fn3: domain 5 of 6, from 1899 to 1978: score 15.2, E = 1.5e-06 - CS CCCCCEEEEEECCTTCCEEEEECCCCCCCCCCEEEEE.ECCCCCCCC - *->PsaPtnltvtdvtstsltlsWspptgngpitgYevtyRqpknggewn - + l+ +++++sl+l+W p+ + ++++R ++ e - 7LES_DROME 1899 FAELPELQLLELGPYSLSLTWAGT--PDPLGSLQLECR---SSAEQL 1940 - - CS CCEEECCCCCECECCEEEEECCCCEEEEEECCC CCCC - eltvpgtttsytltgLkPgteYevrVqAvnggG.GpeS<-* - +++v g+ t ++++ L+P t+Y+ r+ ++++G++ - 7LES_DROME 1941 RRNVAGNHTKMVVEPLQPRTRYQCRLLLGYAATpGAPL 1978 - -fn3: domain 6 of 6, from 1993 to 2107: score 20.3, E = 4.3e-07 - CS CCCCCEEEEEECCTTCCEEEEECCC CCCCCCCEEEEE.ECCCCCC - *->PsaPtnltvtdvtstsltlsWsppt.gngpitgYevtyRqpkngge. - Ps+P+ ++ + + + ++++W++++++++pi Y+++ ++++ + - 7LES_DROME 1993 PSQPGKPQLEHIAEEVFRVTWTAARgNGAPIALYNLEA-LQARSDIr 2038 - - CS CCCCEEECCCC CECECCEEEEE - ...........................wneltvpgttt.sytltgLkPgt - +++++++++++++ ++ + +++ ++++l+ +tt s++++ L + - 7LES_DROME 2039 rrrrrrrrnsggsleqlpwaeepvvveDQWLDFCNTTElSCIVKSLHSSR 2088 - - CS CCCCEEEEEE CCC CCCC - eYevrVqAvn.ggG.GpeS<-* - +rV+A++ ++G Gp+S - 7LES_DROME 2089 LLLFRVRARSlEHGwGPYS 2107 - -pkinase: domain 1 of 1, from 2209 to 2483: score 314.6, E = 6e-95 - *->yelleklGeGsfGkVykakhkd...ktgkiVAvKilkkekesikekr - ++ll+ lG+G+fG+Vy++++k+++++ ++VA+K l+k+++++ e - 7LES_DROME 2209 LKLLRFLGSGAFGEVYEGQLKTedsEEPQRVAIKSLRKGASEFAE-- 2253 - - flrEiqilkrLsHpNIvrligvfedtddhlylvmEymegGdLfdylrrng - +l E+q++ +++H+NIvrl g++ + +++ l+mE+me GdL++ylr+ + - 7LES_DROME 2254 LLQEAQLMSNFKHENIVRLVGICF-DTESISLIMEHMEAGDLLSYLRAAR 2302 - - ..........gplsekeakkialQilrGleYLHsngivHRDLKpeNILld - +++++++++ ls e++ ++ ++++G +YL+++++vHRDL+ +N+L++ - 7LES_DROME 2303 atstqepqptAGLSLSELLAMCIDVANGCSYLEDMHFVHRDLACRNCLVT 2352 - - en......dgtvKiaDFGLArlle..sssklttfvGTpwYmmAPEvileg - e +++++++ tvKi+DFGLAr++++++++++ + + p+++m+PE l + - 7LES_DROME 2353 EStgstdrRRTVKIGDFGLARDIYksDYYRKEGEGLLPVRWMSPES-LVD 2401 - - rgysskvDvWSlGviLyElltggplfpgadlpaftggdevdqliifvlkl - +++++DvW++Gv+++E+lt g ++ - 7LES_DROME 2402 GLFTTQSDVWAFGVLCWEILTLG-------------------------QQ 2426 - - PfsdelpktridpleelfriikrpglrlplpsncSeelkdLlkkcLnkDP - P+ ++ +e+++++k+ g+rl +p+ c e l++Ll c++ DP - 7LES_DROME 2427 PYAA-------RNNFEVLAHVKE-GGRLQQPPMCTEKLYSLLLLCWRTDP 2468 - - skRpGsatakeilnhpwf<-* - ++Rp +++ + n + - 7LES_DROME 2469 WERP---SFRRCYNTLHA 2483 - -rrm: domain 1 of 1, from 2223 to 2284: score -40.4, E = 0.72 - *->lfVgNL.......ppdvteedLkdlFskfGpi.vsikivkDhkektk - ++ g L+++++++p+ v + L++ s+f + +++++ + - 7LES_DROME 2223 VYEGQLktedseePQRVAIKSLRKGASEFAELlQEAQLMSN------ 2263 - - etgkskGfaFVeFeseedAekAlealnGkelggrklrv<-* - F+ e+ ++ l G+ ++ + - 7LES_DROME 2264 ------------FKH----ENIVR-LVGICFDTESISL 2284 - -// |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/datas/config.cfg --- a/commons/pyRepetUnit/hmmer/tests/datas/config.cfg Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,10 +0,0 @@ -[profil_search] - -Evalue: 10 -InputFormat: FASTA -ProfilDatabank: ./datas/myhmms - -[hmmer_config] -input_file: ./datas/test_input_aa.fa -output_file: ./datas/hmmpfam_output - \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/datas/configTestAcceptanceHmmpfamAndParse2alignLauncherInparallel.cfg --- a/commons/pyRepetUnit/hmmer/tests/datas/configTestAcceptanceHmmpfamAndParse2alignLauncherInparallel.cfg Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,29 +0,0 @@ -[db_config] -user: oinizan -host: pisano -passwd: oinizan -dbname:repet_oinizan - -[profil_search] -Evalue: 10 -InputFormat: FASTA -ProfilDatabank: /home/oinizan/repet_integration/repet_pipe/pyRepetUnit/hmmer/tests/datas/myhmms - -[hmmer_config] -output_file: ./datas/hmmpfam_output -result_dir: /home/oinizan/repet_integration/repet_results -query_dir: /home/oinizan/repet_integration/repet_pipe/pyRepetUnit/hmmer/tests/batches -tmp_dir: /home/oinizan/repet_integration/repet_tmp - -[sge_config] -queue: main.q -groupid: fake - -[parse_config] -scriptToLaunch: /home/oinizan/repet_integration/repet_pipe/repet_base/HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py - -[dbSplit_config] -input_file: /home/oinizan/repet_integration/repet_pipe/pyRepetUnit/hmmer/tests/datas/test_input_aa.fa - -[hmmpfam2align_config] -output_file: ./datas/hmmpfam_outputNotInParallel.align |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/datas/configTestFunctionalHmmpfamLauncherInparallel.cfg --- a/commons/pyRepetUnit/hmmer/tests/datas/configTestFunctionalHmmpfamLauncherInparallel.cfg Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,24 +0,0 @@ -[db_config] -user: oinizan -host: pisano -passwd: oinizan -dbname:repet_oinizan - -[profil_search] -Evalue: 10 -InputFormat: FASTA -ProfilDatabank: /home/oinizan/repet_integration/repet_pipe/pyRepetUnit/hmmer/tests/datas/myhmms - -[hmmer_config] -input_file: ./datas/test_input_nt.fa -output_file: ./datas/hmmpfam_output.align -result_dir: /home/oinizan/repet_integration/repet_results -query_dir: /home/oinizan/repet_integration/repet_datas/hmmer_in_parallel -tmp_dir: /home/oinizan/repet_integration/repet_tmp - -[sge_config] -queue: main.q -groupid: fake - -[parse_config] -scriptToLaunch: /home/oinizan/repet_integration/repet_pipe/repet_base/HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/datas/configTestLaunchPreProcessHmmpfamPostProcessNotInParallel.cfg --- a/commons/pyRepetUnit/hmmer/tests/datas/configTestLaunchPreProcessHmmpfamPostProcessNotInParallel.cfg Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,9 +0,0 @@ -[profil_search] - -Evalue: 10 -InputFormat: FASTA -ProfilDatabank: ./datas/myhmms - -[hmmer_config] -input_file: ./datas/test_input_nt.fa -output_file: ./hmmpfam_output.align \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/datas/myhmms --- a/commons/pyRepetUnit/hmmer/tests/datas/myhmms Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1433 +0,0 @@\n-HMMER2.0 [2.3.2]\n-NAME rrm\n-LENG 77\n-ALPH Amino\n-RF no\n-CS no\n-MAP yes\n-COM hmmbuild -A myhmms rrm.sto\n-COM hmmcalibrate myhmms\n-NSEQ 90\n-DATE Thu Jan 8 17:50:18 2009\n-CKSUM 8325\n-XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \n-NULT -4 -8455\n-NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \n-EVD -45.953121 0.233439\n-HMM A C D E F G H I K L M N P Q R S T V W Y \n- m->m m->i m->d i->m i->i d->m d->d b->m m->e\n- -16 * -6492\n- 1 -1084 390 -8597 -8255 -5793 -8424 -8268 2395 -8202 2081 -1197 -8080 -8115 -8020 -8297 -7789 -5911 1827 -7525 -7140 1\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 -16 * \n- 2 -2140 -3785 -6293 -2251 3226 -2495 -727 -638 -2421 -545 -675 -5146 -5554 -4879 -1183 -2536 -1928 267 76 3171 2\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 3 -2542 458 -8584 -8273 -6055 -8452 -8531 2304 -8255 -324 101 -8104 -8170 -8221 -8440 -7840 -5878 3145 -7857 -7333 3\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 4 -1505 -5144 -1922 -558 -1842 2472 -3303 -2213 1099 -5160 -4233 372 -4738 -530 1147 168 498 -4766 -5327 -1476 4\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 5 -3724 -5184 300 -3013 -1655 1803 -3353 -5245 -1569 -2686 -4276 3495 -1963 -1331 -1054 -1472 -3664 -4803 -5369 -2 5\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 6 -1569 -6106 -8967 -8363 555 -8531 -7279 654 -8092 2953 -94 -8220 -7908 -1643 -7682 -7771 -6460 -59 -6191 -6284 6\n- - -151 -504 230 45 -380 399 101 -621 211 -470 -713 278 399 48 91 360 113 -364 -299 -254 \n- - -178 -3113 -12684 -1600 -578 -701 -1378 * * \n- 7 -409 -5130 -215 -2987 -1709 -956 690 -5188 -395 -5144 -4224 729 3054 -2862 -3409 354 1293 -1381 -5321 -4644 13\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 8 -3674 -5118 -1004 639 420 -4652 176 -2050 404 -1039 -935 16 1755 168 147 -275 198 -1472 1889 1977 14\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 9 -408 -5134 2415 1299 -950 -66 -767 -1296 -2889 -1843 -4224 1084 -968 -1439 -1854 540 -314 -2304 -5320 -60 15\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 '..b'246 -4848 -4187 461\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11183 -12226 -894 -1115 -186 -3045 * * \n- 285 2163 763 -1619 -5296 2250 -2060 -4007 1241 -4891 -489 484 -4781 -226 -4515 -4692 -678 -1688 -813 264 -3530 462\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11253 -12295 -894 -1115 -701 -1378 * * \n- 286 -268 -329 -158 917 -541 -1990 350 -4851 1273 -1075 388 -1130 233 840 993 -602 801 -595 -4964 -857 463\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11253 -12295 -894 -1115 -701 -1378 * * \n- 287 109 -243 672 2304 -5103 -4283 488 -4854 -1317 -2269 -656 -492 -1519 2679 -655 -618 -3248 -4404 -4965 -1114 464\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11253 -12295 -894 -1115 -701 -1378 * * \n- 288 1312 1294 -6215 -5593 -206 -1244 -4339 2188 -5201 1409 395 -5091 -5478 -4828 -5009 -4538 -3794 1162 -4188 -3846 465\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -23 -11253 -6022 -894 -1115 -701 -1378 * * \n- 289 -3562 799 -5767 -2054 -1235 -2075 318 138 237 2164 1713 -1454 -5145 -1272 -730 -4172 -1640 1071 -3865 -34 466\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11231 -12273 -894 -1115 -1470 -646 * * \n- 290 73 1351 -674 1236 -1549 -2008 1350 -4834 1049 -2498 -3851 1801 -4356 1813 -115 -223 -1582 -1052 -4945 -4262 467\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11231 -12273 -894 -1115 -369 -2147 * * \n- 291 -1739 -320 777 -2654 -1419 -2051 4360 -4707 -1358 -2412 -689 -1300 -4399 -224 537 531 -289 -2010 -4905 -1057 468\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11253 -12295 -894 -1115 -701 -1378 * * \n- 292 -3345 -4494 -233 -332 -563 -1986 -3051 333 99 1063 -3616 -3072 2953 -1026 -1490 -943 -1528 -1070 -4753 -4151 469\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -10815 -11857 -894 -1115 -701 -1378 * * \n- 293 -6409 -5751 -7614 -7636 2593 -7311 -4003 -5084 -7219 -150 -151 -6210 -7172 -849 -6723 -6510 -6299 -1387 4881 2807 470\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -10749 -11791 -894 -1115 -701 -1378 * * \n- 294 -4057 -3817 -6415 -5791 3203 -1638 -4541 1679 -5412 765 1434 -5333 -5617 -4930 -5182 -4791 -3987 1226 750 -3959 471\n- - * * * * * * * * * * * * * * * * * * * * \n- - * * * * * * * * 0 \n-//\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/datas/test_input_aa.fa --- a/commons/pyRepetUnit/hmmer/tests/datas/test_input_aa.fa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,258 +0,0 @@\n->blumeria_Grouper_28830_3_1\n-CGF*LISL*SQ*FHVGVSWLRLINNIMRVELETNKT*IXFYNTGSPTYLNIPPHHVSQST\n-AHNLHGRVSINWDPQTIPLLKTSCPQLI*ITS*LEILLWYHSN*ILAEFLSVFLSCSSIR\n-RLPYHRLRTGCPSRTYAGNRFVPLYLLPNLYPPGDIKE*VLLL*QAATAHGPS**GSILC\n-LRWRTRSTQSPGA*VRISAFSSWR*ARILSLVAFILLT*ERAIGAGCFLPSSSAQRRSSD\n-SVASRVYTG*EFSSSGG*VPKSKK*GLYPLGETLRLKFITASERAPASVILGESRRTLTS\n-MAFRTPFACSTLPFPLGLAGVVWTTCSCWLA*NRCASMPPKQPALSLIICFGFPKFWIIY\n-VSRGTVLAKSALGTKRDSSQPVAYSIALSKTWGPT*V*SIPHRVRGGAGTIGVKLPSNGS\n-GGFMS*QDLHFRTAS*AARISSGCQNLRPNSRIVLPIDAWPWPS*TFTAVDTRSSYSKIS\n-SRVAAPDGPGASPTCCDGFFLMRCNLELYIAKLSRTQVAAIFRGSASPKVRNSVMHCRSM\n-RLSSCGCFISSISSSLSAPLWILEFSLSSVATFPSPSSLERNRTSQGRERKSARTFAFPR\n-R*IILILKCSIASKKRTILTGCSALV*IVRRDSWSVITVTSPPSTQ*RQCCSDSKIPSNS\n-LSCAE*RCWVSFSFLEK*AMGCSTERSELLEHRMYGWSMTAPTNFWEASVSNMTGSLQSN\n-FFTTGDVVSASLILFHD*IDWSVRMTGQFLGPEDWSVSGPASWEKFLMRQRR*PAAFTNP\n-LISEVVVGIGLSLIAETFSGSAAMPCLEIWKPRKIPSETNSLHFEALRRRP*EANLEKIS\n-INRECNSAIESAQTATSSRSPATNGRNGSRTSSIKHWKVAGALHRPKGITSHS*TPKGVT\n-NAVFSEESLCIRICQNPFSRSRNA*KLCPAAR*ISS*AFGRGWACFFVILLSSL*STQIR\n-QTVWLVWVSVFFWC**QRCSPWSLTFAYELSRSCVAQESPRMACCCAGAISPRRGVLNWV\n-DNYPVSMRVFLSWESFIPFGGRDLSKS*RGI*L*YCREKL*CGMKGGLGAI*PLEYLK**\n-RLFGLGEY*L*D*ELVGQLS*EVAVCHLINIVAPVHGIKFVQVSHLLGMCHLGQLLETL*\n-IPESRMIQGDSSKETVQLKLHP*KLLGQGHQCLTF*K**MYYKKSNI*RKTVKHNMLKSR\n-SQKKLKIGHRENELFVQKTFCVACHILPVEVVLLGVAQICPFLRPQSRYSGCPIHKFLHF\n-AFDIEWLQFRHRAAHLLFGLQGLFALDPNLLAQQGK*K*QALMNDRVVLQVLHIFYFSLI\n-GKFS*IYR*NATRCI*RLVHIPFVLLIPPALFSSTGSLSPSGLSFRN*SIRNACRELGMI\n-YLFLQCLVTQRRLAHTTLDQLWMRQMLEAFRLLTLRSELVHWTRNV*IHHPQVSTL*YRV\n-*LEPLDPQAPRW*VWGDYWK*WSRYVEVRVEYAASVYL*SEALP*HPKVG*RKLSGVVAQ\n-IVIESRRFLQLFVQMLSKATRVHHCRTVF*GYSLQLLPNRGVD**LFFAPR*NLHPFPLQ\n-F**PKQNMEAYVESSMIACGIIYSLCSHQQSAISIVVGIPRVFFYLPLLKGRADFQLRNA\n-KRNLGSTALFFALVQ*HSMVR*LTGGIN**SHLCFAHHCLGWALFHRIAPR*RVFS*AET\n-RLAWLRVARRCLLKSQIAPPGMVFYFQMALLPKVERGLNFSKKFLFPRLHFYLLVWKLSR\n-SLQTFV*LEEKFVIGSLQTFDRFSWRDLLSLPLQLH*LRKNFRWLWFARQCDPSSSFPTE\n-HYSGRP**LNRW*NA*KIWRRLKLG*PRIVRFSQQKYIILWLLVDQFMITMISRRCLVAP\n-TNQQYNASRA*D**NVNFIL*YRTANLFKYSPAPREPINSTQFARSGFHQLGST\n->blumeria_Grouper_28830_3_2\n-VASS*SVYDHNDFT*VSRGSD*STI*CE*SLRLIKREFXSIIQDRQLI*IFPRTT*ANQQ\n-RTICTVGFPSIGIHKLSPFSKLAVHSLFKLQVN*KFYYGITQTKSLLNF*VSFYPAPAYG\n-GYHTIDYELGVLHVHMPGIGLCRCTCCLICIHPVILRSRYYYYDKLLRPMARHSRAPSCV\n-FAGVLAVPSLRGRKYV*VPFLPGGKPVFYP*LLSYY*RRSVLLVRGVSFRVLRPRGAPLI\n-LWLHGYILDKNFPPPGAECRRVRSKGYTRWVRLFD*NSLPRVRERQLV*F*ENPGEL*PV\n-WLSERHLPVRLCHFLLA*LVWYGQPAVVG*LEIVVLLCLRSSQHCH**SALAFQSSG*YT\n-*AEAQC*RSLHWELSGIPASLLRTQLH*ARLGVLLEYDLYPTVSEEVLVL*ELSFPVTGL\n-EVS*ADRTCIFGQLREPRGSVRGAKTYALIPA*YCRLTHGLGPHEHLRPSILDPHIPRFL\n-VGLRRQMDQVHRLLVATGSF**DAIWNCTSQNYLGPKWQLYLGEVPLLRLEIR*CTAGRC\n-G*VRVGALFPPSQVLFLHHFGF*SFRCRQ*LHSLPLLP*REIEHHRDGRENQREHLLFRD\n-GR*S*Y*NAL*HLKNGPF*RAARLWSE*FVEIHGQLSPLRRRLLPSDANVVVTVKSQVIP\n-SLVLNNAAGYRLVFLRSKLWDAALNDRNCWSIACTVGV*LHPRTFGKRQFPI*REVSNQI\n-FLQLVML*ALV*YFSMIESIGPSE*QGNF*VQRIGP*VALLVGRNF**DNVGNQLHLQIL\n-LFPR*LLA*ACL*SLKLFRGLLQCHV*KYGNQGRFPLKQIACTLKH*GGDHRKRI*KK*V\n-STVSAILPLSLPRQLHRPGALRQMDGMALELLP*NTGK*LVRCIGRKA*LAIHRHRKESQ\n-MLFSLKSLCAYVSAKIRFPGRGMHRSYVLLRAEFHLEHLVGDGRVSS*SC*ALYSQHKYA\n-KRFG*SGLASFFGVNNRGAAHGPLHLRMN*AGHVLHKKVPGWLVVAPGLYRLGGEF*IGL\n-TITPFLCGCFCLGRVLSHLAGEIYRKVEGEFNFDIVGKNCNAE*RVGWVPFDHWNI*SSE\n-DFSVWESINYRIKNWLVN*VEKLQFAI**TS*PQFME*SLSKCHICWECAIWDNS*RHCE\n-FLSPE*FKVIRAKKLCS*NCILRNCWARATNA*HFRNNRCIIRSQIFRERL*NITC*RAV\n-VKKN*KLDIGKMSYSCKKHSVWLAISFP*RLSFWGWLKFALSYGHKVGIRAVLFINFFIS\n-HSI*NGFNFVIELLIFYLAFRAYLLLIQIFWLNKESRSDRL**TIVWCYRFYIFFIFH*L\n-VSFPEFIAETRRGVFSVWCIFPLFF*FHRRCFHQPAVFRPVACLSAIEAFVTLVVNWV*F\n-ICFCNVL*RKDVLPIRPWISYGCVKCWKLFAF*R*DRNWCIGLGMFEYIILKCPPCNTAC\n-DLNHSIRKLRAGEFGEIIGNDGPGTWK*ESNMLPQYISSLRPYHDIRR*AKESFPESSRK\n-L*LSLVVSCSYSCKCCQRRPEYIIVEQYFKDTVYSSCPIEVLTDDCSSRRDEIFIHFHCN\n-SDSPSRIWKHMLNHQ*LHVV*YIHYVLISKVQFPLWWEYRACFSICLF*RAVRIFSFGTR\n-KEIWEVPLYFSLLFSNIQWFVN*LAV*INSPIFVLLIIA*VGRCFIELRRGKGSFLRLKH\n-DWPGCGSRGAAC*KVK*LLPVWFFIFRWPCFRKLKGD*IFRRSFCFHVFISTY*FGN*VV\n-HCRHLFD*KRNL*LGLFKPLIDSLGEIFCHCLCSFISFGKIFVGFGLPGNVILHQAFQLS\n-IIQADHDD*IGGEMRKKFGDVLNWDDLEL*GSLNKNI*FCGF*LISL*SQ*FHVGVSWLR\n-QINNIMRVELETNKT*ISFYNT'..b'YATHQLLSSVLWKKF*SHSVHLSQGSWTM*LSGQTQWQNCTHG*YLFFLDS\n-LPMVSSSMLQSAGYLFQRESSLVSIFLNMALQQTPKKFQRSETGLCQQLPRK*EDL*MQL\n-VTYVVSLKISPN*QGHSRTNPLDLKIALSF*RTNRFNHGKVSN*RLQHHQL*KNLIGDFP\n-SYWKLTLPKSSWVQSYSNRTCDAPTIPIVQCCIP*LTSQEN*TIPSSVIQHKRGNYLGFY\n-CHYNIGVTG*KAAT*R**LTMNLYELFRPKPSSPSEWSVF*ML*SILISGLSTVAEKQMF\n-SLIFSPVPVMFYFSLGKKGKGM*LLTTTKTLESKVVQKENLRWRK*STHTNSTASTCSAS\n-PNF*P*ERHFP*I*LPLGSEIILRCTIPNCISSKRTRRNK*AMHLVHLAPQPY*KSWNMR\n-I*YRRP*MFMRAKAMRQSAILCGN*GVGFGTPN*SSRLTKLSENASPVSS*NLQTRYWEA\n-*LL*YQHLL*HGGV*IILK*DPKSCSMQLSTQQAGWNPA*FPMQTSLTLCLCSRILSRTL\n-ESQSRLSVTMLAASEA*KHNDFKLANNCRLSIPHQLGQEEMAKSNRQMAF*KPYWSEFSW\n-ILLKLH*LALSHSR**ISIEESHPAGIALTSYSSALSPRRRKILIQYIPVKPQNQRSASG\n-PKNSEGNTPHQ*HAPTLVV*KQLGIKYGLTSRKKRHLYVLTPPETGYCEYASEDTRWSPT\n-MTGHGP*QLVIIIIPTP*YHRVDTN*ATSTTAQTYSRHMYVKDTQFVVYGMVAAVCWSRI\n-ERHSKIQQGFSLSDTIIKFLINL*FK*AVDS*F*EGG*FVDPN*WKPDRANCALLIGSRG\n-AGEYLNKLAILYYRXKFTFY*SQALLALYC*LVGATRHLREIIVIIN*STRSH\n->blumeria_Grouper_14770_3_1\n-G*TDTVSLV*SCGRKN*LETSVLRCMVLSKTELIRVRLRVRISYQLRFLTSIYQSPWIIS\n-YDPCRCKSIYVQIYEPEI*S*IHVCR**IRETFNLHLIHNHLMEC*CEINANVR*TFREE\n-CADDNDIGR*I**PN*PDLQMSYPWHSRIYNISTPLLTLHRG*IHK*KTVSIFIVISHLM\n-LVW*TRQWLY*YQKLKCINRCALVSVSLLYIYLRDF*LKEHVIV*ASRLQFFPL*NDKRC\n-RYV*KHHLVLDCEQVQWQPYCQSRLLLGCCLQGIGEVRAKSRYIVWMRALLPCTQLRRLN\n->blumeria_Grouper_14770_3_2\n-VRPIQ*VSYEVVEGRIDWKQVY*DVWF*VKLS**E*DCVCAYLIN*GF*PVFINLHGS*V\n-MIPVDVNLYTYRYMSQKYKAKYMCVGNRSEKPLTCI*YIII*WNASVK*MPMYVKLSVRN\n-VLMTMI*EGEFDNLISRTYK*VILGIPGYTIFQHPSSLCIEDRYISEKLLVYLLSFLI*C\n-WYGRHASGCTSTKN*SA*IGVPWSR*AFCTYICEIFS*RNM**CKRAVFNSFPCKMISDV\n-DMFRSII*FWIVSKFNGSRIVSRDCCWDAVSKESVKSAQNPDILFGCERYCHVLSFAG*M\n->blumeria_Grouper_14770_3_3\n-LDRYSKSRMKLWKEELTGNKCIEMYGSE*N*ADKSEIACAHILSTEVFDQYLSISMDHKL\n-*SL*M*IYIRTDI*ARNIKLNTCVSVIDPRNL*PAFDT*SSDGMLV*NKCQCTLNFP*GM\n-C**Q*YRKVNLIT*LAGLTNELSLAFQDIQYFNTPPHFASRIDT*VKNC*YIYCHFSSNA\n-GMVDTPVVVLVPKTEVHKSVCLGLGKPFVHISARFLAEGTCNSVSEPSSILSLVK**AMS\n-ICLEASFSFGL*ASSMAAVLSVEIAAGMLSPRNR*SPRKIQIYCLDASAIAMYSASQVE\n->blumeria_Grouper_14770_3_4\n-HSTCEAEYMAIALASKQYIWILRGLHRFLGDSIPAAISTDNTAAIELAHNPKLNDASKHI\n-DIAYHFTRERIEDGSLTLLHVPSAKNLADICTKGLPRPRHTDLCTSVFGTSTTTGVSTIP\n-ALDEK*Q*IY*QFFTYVSILDAK*GGVLKYCISWNAKDNSFVSPAN*VIKFTFLYHCHQH\n-IPHGKFNVHWHLFHTSIPSDDYVSNAG*RFLGSITDTHVFSFIFLAHISVRI*IYIYRDH\n-NL*SMEIDKYWSKTSVDKICAHAISLLSAQFYSEPYISIHLFPVNSSFHNFIRDLLYRSN\n->blumeria_Grouper_14770_3_5\n-IQPAKLSTWQ*RSHPNNISGFCADFTDSLETASQQQSRLTIRLPLNLLTIQN*MMLLNIS\n-TSLIILQGKELKTARLHYYMFLQLKISQIYVQKAYRDQGTPIYALQFLVLVQPLACLPYQ\n-H*MRNDNKYTNSFSLMYLSSMQSEEGC*NIVYPGMPRITHL*VRLIRLSNSPSYIIVIST\n-FLTESLTYIGIYFTLAFHQMIMYQMQVKGFSDLLPTHMYLALYFWLIYLYVYRFTSTGII\n-TYDPWRLINTGQKPQLIRYAHTQSHSYQLSFTQNHTSQYTCFQSILPSTTSYETYCIGLT\n->blumeria_Grouper_14770_3_6\n-FNLRS*VHGNSARIQTIYLDFARTSPIPWRQHPSSNLD*QYGCH*TCSQSKTK*CF*TYR\n-HRLSFYKGKN*RRLAYTITCSFS*KSRRYMYKRLTETKAHRFMHFSFWY*YNHWRVYHTS\n-IR*EMTINILTVFHLCIYPRCKVRRGVEILYILECQG*LICKSG*LGYQIHLPISLSSAH\n-SSRKV*RTLAFISH*HSIR*LCIKCRLKVSRIYYRHTCI*LYISGSYICTYIDLHLQGS*\n-LMIHGD**ILVKNLS**DMRTRNLTLISSVLLRTIHLNTLVSSQFFLPQLHTRLTVSV*\n->blumeria_Grouper_1717_12_1\n-ISSILP*RASKS*SNSFRSLSSVTGSNSLQNPMMKRSACAERVWNILPCSARNLVATI*G\n-DGVCWCGELR*LAS*IGSTNCCVGCCDGGCGPLRTISTS*RVEH*VGRGGQEPASAEDWG\n-GMSE*GLWQCEIVDGIRRA*R\n->blumeria_Grouper_1717_12_2\n-FPVSCPEGPVSPDRIVFEVSRQ*LVPTACRTQ**SALLVRSASGISCPVRRGIWSRRFEA\n-TEFVGAVSFDDSPRRLALQIVVWVVVMAVVAR*GPFRRLDASNIELGGGAKSQPLRRTGA\n-A*VSEVCGSVRS*MVYGALEG\n->blumeria_Grouper_1717_12_3\n-FQYLALKGQ*VLIE*FSKSLVSDWFQQLAEPNDEALCLCGARLEYPALFGEEFGRDDLRR\n-RSLLVR*ASMTRLVDWLYKLLCGLL*WRLWPVKDHFDVLTRRTLSWEGGPRASLCGGLGR\n-HE*VRFVAV*DRRWYTARLK\n->blumeria_Grouper_1717_12_4\n-PFKRAVYHLRSHTATNLTHSCRPSPPQRLALGPPSQLNVRRVKTSKWSLTGHNRHHNNPH\n-NNL*SQSTRRVIEAHRTNKLRRLKSSRPNSSPNRAGYSRRAPHKQSASSLGSASCWNQSL\n-TRDFENYSIRTYWPFRARYWK\n->blumeria_Grouper_1717_12_5\n-PSSAPYTIYDLTLPQTSLTHAAPVLRRGWLLAPPPNSMFDASRRRNGP*RATTAITTTHT\n-TICRANLRGESSKLTAPTNSVASNRRDQIPRRTGQDIPDALRTSRALHHWVLQAVGTSH*\n-RETSKTIRSGLTGPSGQDTGN\n->blumeria_Grouper_1717_12_6\n-LQARRIPSTISHCHKPHSLMPPQSSAEAGSWPPLPTQCSTRQDVEMVLNGPQPPSQQPTQ\n-QFVEPIYEASHRSSPHQQTPSPQIVATKFLAEQGRIFQTRSAQAERFIIGFCKLLEPVTD\n-ERLRKLFDQDLLALQGKILE\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/hmmer/tests/datas/test_input_nt.fa --- a/commons/pyRepetUnit/hmmer/tests/datas/test_input_nt.fa Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,124 +0,0 @@ ->blumeria_Grouper_28830_3 -TGTGGCTTCTAGTTGATCAGTTTATGATCACAATGATTTCACGTAGGTGTCTCGTGGCTC -CGACTAATCAACAATATAATGCGAGTAGAGCTTGAGACTAATAAAACGTGAATTTNATTC -TATAATACAGGATCGCCAACTTATTTAAATATTCCCCCGCACCACGTGAGCCAATCAACA -GCGCACAATTTGCACGGTCGGGTTTCCATCAATTGGGATCCACAAACTATCCCCCTTCTC -AAAACTAGCTGTCCACAGCTTATTTAAATTACAAGTTAATTAGAAATTTTATTATGGTAT -CACTCAAACTAAATCCTTGCTGAATTTTTGAGTGTCTTTCTATCCTGCTCCAGCATACGG -CGGCTACCATACCATAGACTACGAACTGGGTGTCCTTCACGTACATATGCCGGGAATAGG -TTTGTGCCGTTGTACTTGTTGCCTAATTTGTATCCACCCGGTGATATTAAGGAGTAGGTA -TTATTATTATGACAAGCTGCTACGGCCCATGGCCCGTCATAGTAGGGCTCCATCTTGTGT -CTTCGCTGGCGTACTCGCAGTACCCAGTCTCCGGGGGCGTAAGTACGTATAAGTGCCTTT -TCTTCCTGGAGGTAAGCCCGTATTTTATCCCTAGTTGCTTTCATACTACTAACGTAGGAG -CGTGCTATTGGTGCGGGGTGTTTCCTTCCGAGTTCTTCGGCCCAGAGGCGCTCCTCTGAT -TCTGTGGCTTCACGGGTATATACTGGATAAGAATTTTCCTCCTCCGGGGGCTGAGTGCCG -AAGAGTAAGAAGTAAGGGCTATACCCGCTGGGTGAGACTCTTCGATTGAAATTCATTACC -GCGAGTGAGAGAGCGCCAGCTAGTGTAATTTTAGGAGAATCCAGGAGAACTCTGACCAGT -ATGGCTTTCAGAACGCCATTTGCCTGTTCGACTTTGCCATTTCCTCTTGGCCTAGCTGGT -GTGGTATGGACAACCTGCAGTTGTTGGCTAGCTTGAAATCGTTGTGCTTCTATGCCTCCG -AAGCAGCCAGCATTGTCACTGATAATCTGCTTTGGCTTTCCAAAGTTCTGGATAATATAC -GTGAGCAGAGGCACAGTGTTAGCGAAGTCTGCATTGGGAACTAAGCGGGATTCCAGCCAG -CCTGTTGCGTACTCAATTGCATTGAGCAAGACTTGGGGTCCTACTTGAGTATGATCTATA -CCCCACCGTGTCAGAGGAGGTGCTGGTACTATAGGAGTTAAGCTTCCCAGTAACGGGTCT -GGAGGTTTCATGAGCTGACAGGACTTGCATTTTCGGACAGCTTCGTGAGCCGCGAGGATC -AGTTCGGGGTGCCAAAACCTACGCCCTAATTCCCGCATAGTATTGCCGATTGACGCATGG -CCTTGGCCCTCATGAACATTTACGGCCGTCGATACTAGATCCTCATATTCCAAGATTTCT -AGTAGGGTTGCGGCGCCAGATGGACCAGGTGCATCGCCTACTTGTTGCGACGGGTTCTTT -TTGATGAGATGCAATTTGGAATTGTACATCGCAAAATTATCTCGGACCCAAGTGGCAGCT -ATATTTAGGGGAAGTGCCTCTCCTAAGGTTAGAAATTCGGTGATGCACTGCAGGTCGATG -CGGTTGAGTTCGTGTGGGTGCTTTATTTCCTCCATCTCAAGTTCTCTTTCTGCACCACTT -TGGATTCTAGAGTTTTCGTTGTCGTCAGTAGCTACATTCCCTTCCCCTTCTTCCCTAGAG -AGAAATAGAACATCACAGGGACGGGAGAGAAAATCAGCGAGAACATTTGCTTTTCCGCGA -CGGTAGATAATCCTGATATTAAAATGCTCTATAGCATCTAAAAAACGGACCATTCTGACG -GGCTGCTCGGCTTTGGTCTGAATAGTTCGTAGAGATTCATGGTCAGTTATCACCGTTACG -TCGCCGCCTTCTACCCAGTGACGCCAATGTTGTAGTGACAGTAAAATCCCAAGTAATTCC -CTCTCTTGTGCTGAATAACGCTGCTGGGTATCGTTTAGTTTTCTTGAGAAGTAAGCTATG -GGATGCAGCACTGAACGATCGGAATTGTTGGAGCATCGCATGTACGGTTGGAGTATGACT -GCACCCACGAACTTTTGGGAAGCGTCAGTTTCCAATATGACGGGAAGTCTCCAATCAAAT -TTTTTTACAACTGGTGATGTTGTAAGCGCTAGTTTGATACTTTTCCATGATTGAATCGAT -TGGTCCGTCAGAATGACAGGGCAATTTTTAGGTCCAGAGGATTGGTCCGTGAGTGGCCCT -GCTAGTTGGGAGAAATTTTTAATGAGACAACGTAGGTAACCAGCTGCATTTACAAATCCT -CTTATTTCCGAGGTAGTTGTTGGCATAGGCCTGTCTCTGATCGCTGAAACTTTTTCGGGG -TCTGCTGCAATGCCATGTTTAGAAATATGGAAACCAAGGAAGATTCCCTCTGAAACAAAT -AGCCTGCACTTTGAAGCATTGAGGAGGAGACCATAGGAAGCGAATCTAGAAAAAATAAGT -ATCAACCGTGAGTGCAATTCTGCCATTGAGTCTGCCCAGACAGCTACATCGTCCAGGAGC -CCTGCGACAAATGGACGGAATGGCTCTAGAACTTCTTCCATAAAACACTGGAAAGTAGCT -GGTGCGTTGCATAGGCCGAAAGGCATAACTAGCCATTCATAGACACCGAAAGGAGTCACA -AATGCTGTTTTCTCTGAAGAGTCTTTGTGCATACGTATCTGCCAAAATCCGTTTTCCAGG -TCGAGGAATGCATAGAAGTTATGTCCTGCTGCGCGCTGAATTTCATCTTGAGCATTTGGT -AGGGGATGGGCGTGTTTCTTCGTAATCTTGTTAAGCTCTCTATAGTCAACACAAATACGC -CAAACGGTTTGGTTAGTCTGGGTTAGCGTCTTTTTTTGGTGTTAATAACAGAGGTGCAGC -CCATGGTCCCTTACATTTGCGTATGAATTGAGCCGGTCATGTGTTGCACAAGAAAGTCCC -CGGATGGCTTGTTGTTGCGCCGGGGCTATATCGCCTCGGAGGGGAGTTTTAAATTGGGTT -GACAATTACCCCGTTTCTATGCGGGTGTTTCTGTCTTGGGAGAGTTTTATCCCATTTGGC -GGGAGAGATTTATCGAAAAGTTGAAGGGGAATTTAACTTTGATATTGTAGGGAAAAACTG -TAATGCGGAATGAAGGGTGGGCTGGGTGCCATTTGACCATTGGAATATTTGAAGTAGTGA -AGACTTTTCGGTTTGGGAGAGTATTAATTATAGGATTAAGAATTGGTTGGTCAATTAAGT -TGAGAAGTTGCAGTTTGCCATTTGATAAACATCGTAGCCCCAGTTCATGGAATAAAGTTT -GTCCAAGTGTCACATCTGCTGGGAATGTGCCATCTGGGACAACTCCTAGAGACACTGTGA -ATTCCTGAGTCCAGAATGATTCAAGGTGATTCGAGCAAAGAAACTGTGCAGTTAAAATTG -CATCCTTAGAAATTGTTGGGCCAGGGCCACCAATGCCTGACATTTTAGAAATAATAGATG -TATTATAAGAAGTCAAATATTTAGAGAAAGACTGTGAAACATAACATGCTGAAGAGCCGT -AGTCAAAAAAAACTGAAAATTGGACATAGGGAAAATGAGTTATTCGTGCAAAAAACATTC -TGTGTGGCTTGCCATATCCTTCCCGTAGAGGTTGTCCTTTTGGGGGTGGCTCAAATTTGC -CCTTTCCTACGGCCACAAAGTAGGTATTCGGGCTGTCCTATTCATAAATTTCTTCATTTC -GCATTCGATATAGAATGGCTTCAATTTCGTCATCGAGCTGCTCATCTTCTATTTGGCCTT -CAGGGCTTATTTGCTCTTGATCCAAATCTTCTGGCTCAACAAGGAAAGTAGAAGTGACAG -GCTTTGATGAACGATCGTGTGGTGTTACAGGTTTTACATATTTTTTATTTTTCATTGATT -GGTAAGTTTTCCTGAATTTATCGCTGAAACGCGACGAGGTGTATTTAGCGTTTGGTGCAT -ATTCCCTTTGTTCTTTTGATTCCACCGGCGCTGTTTTCATCAACCGGCAGTCTTTCGCCC -AGTGGCCTGTCTTTCCGCAATTGAAGCATTCGTAACGCTTGTCGTGAATTGGGTATGATT -TATCTGTTTCTGCAATGTCTTGTGACGCAAAGACGTCTTGCCCATACGACCTTGGATCAG -CTATGGATGCGTCAAATGCTGGAAGCTTTTCGCCTTTTGACGCTGAGATCGGAATTGGTG -CATTGGACTCGGAATGTTTGAATACATCATCCTCAAGTGTCCACCTTGTAATACCGCGTG -TGACTTGAACCACTCGATCCGCAAGCTCCGCGCTGGTGAGTTTGGGGAGATTATTGGAAA -TGATGGTCCAGGTACGTGGAAGTGAGAGTCGAATATGCTGCCTCAGTATATCTCTAGTCT -GAGGCCCTACCATGACATCCGAAGGTAGGCTAAAGAAAGCTTTCCGGAGTCGTCGCGCAA -ATTGTAATTGAGTCTCGTCGTTTCTTGCAGTTATTCGTGCAAATGTTGTCAAAGGCGACC -CGAGTACATCATTGTCGAACAGTATTTTAAGGATACAGTCTACAGCTCCTGCCCAATCGA -GGTGTTGACTGATGATTGTTCTTCGCGCCGAGATGAAATCTTCATCCATTTCCATTGCAA -TTCTGATAGCCCAAGCAGAATATGGAAGCATATGTTGAATCATCAATGATTGCATGTGGT -ATAATATATTCATTATGTTCTCATCAGCAAAGTGCAATTTCCATTGTGGTGGGAATACCG -CGCGTGTTTTTCTATTTGCCTCTTTTAAAGGGCCGTGCGGATTTTCAGCTTCGGAACGCG -AAAAGAAATCTGGGAAGTACCGCTTTATTTTTCGCTCTTGTTCAGTAACATTCAATGGTT -CGTTAACTGACTGGCGGTATAAATTAATAGTCCCATCTTTGTTTTGCTCATCATTGCTTA -GGTTGGGCGTTGTTTCATAGAATTGCGCCGAGGTAAAGGGTCTTTTCTTAGGCTGAAACA -CGATTGGCCTGGTTGCGGGTCGCGAGGCGCTGCCTGCTGAAAAGTCAAATAGCTCCTCCC -GGTATGGTTTTTTATTTTCAGATGGCCCTGCTTCCGAAAGTTGAAAGGGGACTGAATTTT -TCGAAGAAGTTTTTGTTTCCACGTCTTCATTTCTACTTACTAGTTTGGAAATTAAGTCGT -TCATTGCAGACATTTGTTTGACTAGAAGAGAAATTTGTGATTGGGTCTCTTCAAACCTTT -GATCGATTCTCTTGGAGAGATCTTTTGTCACTGCCTTTGCAGCTTCATTAGCTTCGGAAA -AATTTTCGTTGGCTTTGGTTTGCCCGGCAATGTGATCCTTCATCAAGCTTTCCAACTGAG -CATTATTCAGGCCGACCATGATGATTGAATAGGTGGTGAAATGCGTAAAAAATTTGGAGA -CGTCTTAAATTGGGATGACCTAGAATTGTGAGGTTCTCTCAACAAAAATATATAATTTTG -TGGCTTCTAGTTGATCAGTTTATGATCACAATGATTTCACGTAGGTGTCTCGTGGCTCCG -ACAAATCAACAATATAATGCGAGTAGAGCTTGAGACTAATAAAACGTGAATTTCATTCTA -TAATACAGGACCGCCAACTTATTTAAATATTCCCCCGCACCACGTGAGCCAATCAACAGC -ACACAATTTGCACGGTCGGGTTTCCATCAATTGGGATCCACA ->blumeria_Grouper_14770_3 -GGTTAGACCGATACAGTAAGTCTCGTATGAAGTTGTGGAAGGAAGAATTGACTGGAAACA -AGTGTATTGAGATGTATGGTTCTGAGTAAAACTGAGCTGATAAGAGTGAGATTGCGTGTG -CGCATATCTTATCAACTGAGGTTTTTGACCAGTATTTATCAATCTCCATGGATCATAAGT -TATGATCCCTGTAGATGTAAATCTATATACGTACAGATATATGAGCCAGAAATATAAAGC -TAAATACATGTGTGTCGGTAATAGATCCGAGAAACCTTTAACCTGCATTTGATACATAAT -CATCTGATGGAATGCTAGTGTGAAATAAATGCCAATGTACGTTAAACTTTCCGTGAGGAA -TGTGCTGATGACAATGATATAGGAAGGTGAATTTGATAACCTAATTAGCCGGACTTACAA -ATGAGTTATCCTTGGCATTCCAGGATATACAATATTTCAACACCCCTCCTCACTTTGCAT -CGAGGATAGATACATAAGTGAAAAACTGTTAGTATATTTATTGTCATTTCTCATCTAATG -CTGGTATGGTAGACACGCCAGTGGTTGTACTAGTACCAAAAACTGAAGTGCATAAATCGG -TGTGCCTTGGTCTCGGTAAGCCTTTTGTACATATATCTGCGAGATTTTTAGCTGAAGGAA -CATGTAATAGTGTAAGCGAGCCGTCTTCAATTCTTTCCCTTGTAAAATGATAAGCGATGT -CGATATGTTTAGAAGCATCATTTAGTTTTGGATTGTGAGCAAGTTCAATGGCAGCCGTAT -TGTCAGTCGAGATTGCTGCTGGGATGCTGTCTCCAAGGAATCGGTGAAGTCCGCGCAAAA -TCCAGATATATTGTTTGGATGCGAGCGCTATTGCCATGTACTCAGCTTCGCAGGTTGAAT -G ->blumeria_Grouper_1717_12 -ATTTCCAGTATCTTGCCCTGAAGGGCCAGTAAGTCCTGATCGAATAGTTTTCGAAGTCTC -TCGTCAGTGACTGGTTCCAACAGCTTGCAGAACCCAATGATGAAGCGCTCTGCTTGTGCG -GAGCGCGTCTGGAATATCCTGCCCTGTTCGGCGAGGAATTTGGTCGCGACGATTTGAGGC -GACGGAGTTTGTTGGTGCGGTGAGCTTCGATGACTCGCCTCGTAGATTGGCTCTACAAAT -TGTTGTGTGGGTTGTTGTGATGGCGGTTGTGGCCCGTTAAGGACCATTTCGACGTCTTGA -CGCGTCGAACATTGAGTTGGGAGGGGGGGCCAAGAGCCAGCCTCTGCGGAGGACTGGGGC -GGCATGAGTGAGTGAGGTTTGTGGCAGTGTGAGATCGTAGATGGTATACGGCGCGCTTGA -AGGG - |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/CompleteAProfilesDBFromAFileWithProfilesNamesOrAccNumber.py --- a/commons/pyRepetUnit/profilesDB/CompleteAProfilesDBFromAFileWithProfilesNamesOrAccNumber.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,79 +0,0 @@ -from commons.pyRepetUnit.profilesDB.ProfilesDatabankUtils import ProfilesDatabankUtils -import re -import sys - - -class CompleteAProfilesDBFromAFileWithProfilesNamesOrAccNumber(object): - ''' - Check if profiles from a profiles list are present in profiles DB, if not you can generate the getz command to add them. - By default the profiles list is a list of profiles names - ''' - - def __init__(self): - ''' - Constructor - ''' - self.profilesDBUtils = ProfilesDatabankUtils() - self.profilesToAddNotInDB = [] - self._pfamAccNumber = False - - def setProfilesDBFile ( self, profilesDBFile ): - self._profilesDBFile = profilesDBFile - - def setProfilesToAdd ( self, profilesFile ): - self._profilesToAdd = profilesFile - - def setPfamAccNumberKeys ( self ): - self._pfamAccNumber = True - - def _IsProfilInDB(self, pfamDBList, profil): - IsProfilInDB = False - for profilInstance in pfamDBList.getList(): - if (self._pfamAccNumber == False and profilInstance.name == profil) or (self._pfamAccNumber == True and re.match(profil + "\.\d+", profilInstance.accNumber)): - IsProfilInDB = True - break - return IsProfilInDB - - def _generateProfilesList(self): - f = open(self._profilesToAdd) - profilesToAddList = f.readlines() - return profilesToAddList - - def generateNotExistingProfilesList ( self ): - ''' - generate the profiles list of profiles not in profiles DB among profiles in a list of name or accession number - ''' - self.profilesToAddNotInDB = [] - profilesToAddList = self._generateProfilesList() - pfamDBList = self.profilesDBUtils.read( self._profilesDBFile ) - if pfamDBList.getList( ) != []: - for profil in profilesToAddList: - if profil != "\n": - sys.stdout.flush() - profil = profil.rstrip( ) - IsProfilInDB = self._IsProfilInDB(pfamDBList, profil) - if ( IsProfilInDB == False): - self.profilesToAddNotInDB.append( profil ) - return ( self.profilesToAddNotInDB ) - - def generateGetzCmdProfilesList ( self, profilesList ): - ''' - generate the getz command to retrieve profiles list of name or accession number - ''' - getzCmd = "getz -e \'" - if (self._pfamAccNumber == False): - for profileName in profilesList: - getzCmd += "[pfamhmm-Id:\"" + profileName + "*\"] | " - else: - for profileAccNumber in profilesList: - getzCmd += "[pfamhmm-AccNumber:\"" + profileAccNumber + "\"] | " - getzCmd = getzCmd[ 0:len( getzCmd )-3 ] - getzCmd += "\'" - return getzCmd - - def CmdToCompleteProfileDB (self): - ''' - generate the getz command to retrieve profiles list of name or accession number if the profile is not yet in profiles DB - ''' - profilesList2Add = self.generateNotExistingProfilesList() - return self.generateGetzCmdProfilesList ( profilesList2Add ) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/InsertProfilesMapFileInDB.py --- a/commons/pyRepetUnit/profilesDB/InsertProfilesMapFileInDB.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,35 +0,0 @@ -from commons.core.coord.Map import Map -from pyRepet.sql.TableAdaptator import TableMapAdaptator - -class InsertProfilesMapFileInDB(object): - ''' - Insert a map File in a database - You have to specified the input file name, the table name and the repetDB object when you create the object - ''' - - def __init__(self, inputFileName, tableName, db): - ''' - Constructor - ''' - self.inputFileName = inputFileName - self.tableName = tableName - self.db = db - - def createAndLoadTable(self): - ''' - Create the table and load the map data from input table - ''' - self.db.createTable(self.tableName, "map", overwrite = True) - f = open (self.inputFileName, "r") - iMap = Map() - lMap = [] - while iMap.read( f ): - lMap.append(iMap) - iMap = Map() - f.close() - self._tMapA = TableMapAdaptator( self.db, self.tableName ) - self._tMapA.insMapList( lMap ) - - -if __name__ == "__main__": - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/Profiles.py --- a/commons/pyRepetUnit/profilesDB/Profiles.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,91 +0,0 @@ -import re - -#------------------------------------------------------------------------------ - -class Profiles: - ''' - Hmm profile Class - Attributes are name, desc, length, accNumber, GA_cut_off and retrieve - ''' - - #-------------------------------------------------------------------------- - - def __init__( self, name="", desc="", length=0, accNumber = "", GA_cut_off = 0, retrieve = False ): - self.name = name - self.desc = desc - self.length = length - self.accNumber = accNumber - self.GA_cut_off = GA_cut_off - self.retrieve = retrieve - self.tab_profile = [] - - #-------------------------------------------------------------------------- - - def _noProfileInFile(self): - self.name = None - self.desc = None - self.length = None - self.accNumber = None - self.GA_cut_off = None - - #-------------------------------------------------------------------------- - - def _initialisation(self): - self.name = "" - self.desc = "" - self.length = 0 - self.accNumber = "" - GA_cut_off = 0 - self.tab_profile = [] - - #-------------------------------------------------------------------------- - - def read( self, hmmFile ): - ''' - Read a profile and characterize the object profile - attributes name, length, desc, accNumber and GA_cut_off are specified - ''' - line = hmmFile.readline() - if line == "": - self._noProfileInFile() - return - self._initialisation() - if self.retrieve: - self.tab_profile.append(line) - while not re.match("\/\/.*", line): - line = hmmFile.readline() - if self.retrieve: - self.tab_profile.append(line) - name = re.match("NAME\s*(.*)", line) - if name: - self.name = name.group(1) - desc = re.match("DESC\s*(.*)", line) - if desc: - self.desc = desc.group(1) - length = re.match("LENG\s*(.*)", line) - if length: - self.length = int(length.group(1)) - accNumber = re.match("ACC\s*(.*)", line) - if accNumber: - self.accNumber = accNumber.group(1) - GA_cut_off = re.match("GA\s*\d*\.\d*\s*(.*);", line) - if GA_cut_off: - self.GA_cut_off = float(GA_cut_off.group(1)) - else : - if (self.GA_cut_off == 0): - self.GA_cut_off = "NA" - if self.retrieve: - return self.tab_profile - else: - return 1 - - #-------------------------------------------------------------------------- - - def readAndRetrieve( self, hmmFile ): - ''' - Read a profile and characterize the object profile - attributes name, length, desc, accNumber and GA_cut_off are specified - And a list of each line of profile is returned - ''' - self.retrieve = True - return self.read(hmmFile) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/ProfilesDB2Map.py --- a/commons/pyRepetUnit/profilesDB/ProfilesDB2Map.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,40 +0,0 @@ -from commons.pyRepetUnit.profilesDB.ProfilesDatabankUtils import ProfilesDatabankUtils - - -class ProfilesDB2Map ( object ): - """ - write a file in map format from a ProfilDatabank object - You have to set an input File and an Output File names - """ - - def __init__(self): - self.profilesDBUtils = ProfilesDatabankUtils() - self._inputFile = "" - self._outputFile = "" - - def setInputFile(self, input): - self._inputFile = input - - def setOutputFile(self, output): - self._outputFile = output - - def _readProfilesDB( self ): - pfamDB = self.profilesDBUtils.read( self._inputFile ) - return pfamDB - - def _writeMapFile( self, pfamDBList ): - """ - write a file in map format from a ProfilDatabank object - """ - if pfamDBList.getList() != []: - f = open( self._outputFile , "w") - for ProfilInstance in pfamDBList.getList(): - f.write(ProfilInstance.name + "\t" + ProfilInstance.desc + "\t1\t" + str(ProfilInstance.length) + "\n") - f.close() - - def run( self ): - """ - read a profiles DB file, parse it and, write the corresponding .map file - """ - pfamDBList = self._readProfilesDB() - self._writeMapFile(pfamDBList) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/ProfilesDB4Repet.py --- a/commons/pyRepetUnit/profilesDB/ProfilesDB4Repet.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,226 +0,0 @@\n-#!/usr/bin/env python\n-\n-import re\n-import getopt\n-import sys\n-from commons.pyRepetUnit.profilesDB.Profiles import Profiles\n-from commons.core.LoggerFactory import LoggerFactory\n-\n-LOG_DEPTH = "commons.pyRepetUnit.profiles"\n-\n-## Format a profiles DB for pipelines in REPET\n-# \n-class ProfilesDB4Repet( object ):\n- \n- def __init__(self):\n- self.profile = Profiles()\n- self._inputFile = "" \n- self._outputFile = ""\n- self._verbosity = 2\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- \n- def _help( self ):\n- print\n- print "usage: %s.py [ options ]" % ( type(self).__name__ )\n- print "options:"\n- print " -h: this help"\n- print " -i: name of the profiles DB to format for Repet"\n- print " -o: name of the output profiles DB for Repet"\n- print\n- \n- \n- def _setAttributesFromCmdLine( self ):\n- try:\n- opts, args = getopt.getopt(sys.argv[1:],"hi:o:")\n- except getopt.GetoptError, err:\n- print str(err); self._help(); sys.exit(1)\n- for o,a in opts:\n- if o == "-h":\n- self._help(); sys.exit(0)\n- elif o == "-i":\n- self.setInputFile( a )\n- elif o == "-o":\n- self.setOutputFile( a )\n- \n- #TDOD: add nb of each domain in log file, verbose...\n- def _searchCurrentDomain(self, profile):\n- currentDomain = ""\n- #TODO: pattern GAGA and GAGE should be excluded !\n- #TODO: add new tag like "ORF1_LTR" for ATHILA as key word in Pfam\n- #TODO: add new tags from GypsyDB (MOV etc...)\n- if (re.search("[gG][aA][Gg]", profile[1]) or re.search("[gG][aA][Gg]", profile[3])):\n- currentDomain = "GAG"\n- elif (re.search("Zinc knuckle", profile[1]) or re.search("Zinc knuckle", profile[3])):\n- currentDomain = "GAG"\n- elif (re.search("PF02813", profile[2]) or re.search("PF01021", profile[2])):\n- currentDomain = "GAG"\n- elif (re.search("GAG_", profile[1])):\n- currentDomain = "GAG"\n- elif (re.search("GAGCOAT_", profile[1])):\n- currentDomain = "GAG"\n- \n- elif ((re.search("[aA]spartic", profile[1]) or re.search("[aA]aspartic", profile[3])) and (re.search("[pP]roteinase", profile[1]) or re.search("[pP]roteinase", profile[3]))):\n- currentDomain = "AP"\n- elif ((re.search("[aA]spartic", profile[1]) or re.search("[aA]spartic", profile[3])) and (re.search("[pP]rotease", profile[1]) or re.search("[pP]rotease", profile[3]))):\n- currentDomain = "AP"\n- elif ((re.search("[rR]etrotransposon", profile[1]) or re.search("[rR]etrotransposon", profile[3])) and (re.search("[pP]eptidase", profile[1]) or re.search("[pP]eptidase", profile[3]))):\n- currentDomain = "AP"\n- elif ((re.search("[aA]spartic", profile[1]) or re.search("[aA]spartic", profile[3])) and (re.search("[pP]eptidase", profile[1]) or re.search("[pP]eptidase", profile[3]))):\n- currentDomain = "AP"\n- elif ((re.search("[aA]spartic", profile[1]) or re.search("[aA]spartic", profile[3])) and (re.search("[eE]ndopeptidase", profile[1]) or re.search("[eE]ndopeptidase", profile[3]))):\n- currentDomain = "AP"\n- elif ((re.search("[aA]spartyl", profile[1]) or re.search("[aA]spartyl", profile[3])) and (re.search("[pP]roteinase", profile[1]) or re.search("[pP]roteinase", profile[3]))):\n- currentDomain = "AP"\n- elif ((re.search("[aA]spartyl", profile[1]) or re.search("[aA]spartyl", profile[3])) and (re.search("[pP]rotease", profile[1]) or re.search("[pP]rotease", profile[3]))):\n- currentDomain = "AP"\n- elif ((re.search("[aA]spartyl", profile[1]) or re.search("[aA]spartyl", profile[3])) and (re.search("[pP]eptidase", profile[1]) or re.search("'..b'P]rotein", profile[1]) or re.search("[pP]rotein", profile[3])) and (re.search("A ", profile[1]) or re.search("A ", profile[3]))):\n- currentDomain = "RPA"\n- elif (re.search("[rR]epA ", profile[1]) or re.search("[rR]epA ", profile[3])):\n- currentDomain = "RPA"\n- elif (re.search("RPA", profile[1]) or re.search("RPA", profile[3])):\n- currentDomain = "RPA"\n- \n- elif (re.search("[cC]-integrase", profile[1]) or re.search("[cC]-integrase", profile[3])):\n- currentDomain = "C-INT"\n- \n- elif ((re.search("[pP]ackaging", profile[1]) or re.search("[pP]ackaging", profile[3])) and (re.search("ATPase", profile[1]) or re.search("ATPase", profile[3]))):\n- currentDomain = "ATP"\n- \n- elif ((re.search("[cC]ysteine", profile[1]) or re.search("[cC]ysteine", profile[3])) and (re.search("[pP]rotease", profile[1]) or re.search("[pP]rotease", profile[3]))):\n- currentDomain = "CYP"\n- elif ((re.search("[cC]ysteine", profile[1]) or re.search("[cC]ysteine", profile[3])) and (re.search("[pP]eptidase", profile[1]) or re.search("[pP]eptidase", profile[3]))):\n- currentDomain = "CYP"\n- elif (re.search("[pP]eptidase_C", profile[1]) or re.search("[pP]eptidase_C", profile[3])):\n- currentDomain = "CYP"\n- elif (re.search("PF00559", profile[2])):\n- currentDomain = "CYP"\n- \n- elif (re.search("[pP]ol\\S*_*B", profile[1]) or re.search("[pP]ol\\S*_*B", profile[3])):\n- currentDomain = "POLB"\n- elif ((re.search("[pP]olymerase", profile[1]) or re.search("[pP]olymerase", profile[3])) and (re.search("B ", profile[1]) or re.search("B ", profile[3]))):\n- currentDomain = "POLB"\n- \n- elif (re.search("[hH]elicase", profile[1]) or re.search("[hH]elicase", profile[3])):\n- currentDomain = "HEL"\n- \n- else :\n- currentDomain = "OTHER"\n- return currentDomain\n- \n- \n- ## Replace the old profile name by accession number, name, domain and gather cut off\n- # \n- # @param fout file handle\n- # @param profile Profiles instance\n- # @param currentDomain string\n- #\n- def _writeModifiedProfile(self, fout, profile, currentDomain):\n- for i in xrange(0, len(profile), 1):\n- if i != 1:\n- fout.write(profile[i])\n- else:\n- fout.write("NAME " + self.profile.accNumber + "_"\\\n- + self.profile.name + "_"\\\n- + currentDomain + "_"\\\n- + str(self.profile.GA_cut_off) + "\\n")\n- \n- \n- ## Set input file name\n- # \n- # @param inputFileName string\n- #\n- def setInputFile(self, inputFileName):\n- self._inputFile = inputFileName\n- \n- \n- ## Set output file name\n- #\n- # @param outputFileName string\n- #\n- def setOutputFile(self, outputFileName):\n- self._outputFile = outputFileName \n- \n- \n- ## Read a profiles DB file, parse it and, write a new profiles DB with TE domain information and GA score cut_off placed side by side of the name\n- # \n- def run( self ):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- fileIn = open( self._inputFile )\n- fout = open( self._outputFile, "w" )\n- profile = self.profile.readAndRetrieve( fileIn )\n- while profile != None:\n- currentDomain = self._searchCurrentDomain(profile)\n- if currentDomain == "OTHER":\n- self._log.warning(self.profile.accNumber + " " + self.profile.name + " has no associated domain")\n- self._writeModifiedProfile(fout, profile, currentDomain)\n- profile = self.profile.read( fileIn )\n- \n- \n-if __name__ == "__main__":\n- i = ProfilesDB4Repet()\n- i._setAttributesFromCmdLine()\n- i.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/ProfilesDatabank.py --- a/commons/pyRepetUnit/profilesDB/ProfilesDatabank.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,22 +0,0 @@ -class ProfilesDatabank: - - """ - List of profiles objects. - """ - - list; - - def __init__( self ): - self._profilesDatabank = [] - - def append( self, list ): - self._profilesDatabank.append(list) - - def len (self): - return len(self._profilesDatabank) - - def get(self, index): - return self._profilesDatabank[index] - - def getList(self): - return self._profilesDatabank \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/ProfilesDatabankUtils.py --- a/commons/pyRepetUnit/profilesDB/ProfilesDatabankUtils.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,38 +0,0 @@ -""" -Utility to handle a databank of HMM profiles. -""" - -import sys -from commons.pyRepetUnit.profilesDB.Profiles import Profiles -from commons.pyRepetUnit.profilesDB.ProfilesDatabank import ProfilesDatabank -from commons.core.utils.FileUtils import FileUtils - -class ProfilesDatabankUtils: - """ - Utility to handle a databank of HMM profiles. - """ - - def read( inFileName, verbose=0 ): - """ - Read a file in Pfam format and return a L[ProfilesDatabank<commons.core.ProfilesDatabank>} instance. - @param inFileName: name of the input file - @type inFileName: string - @param verbose: verbosity level - @type verbose: integer - """ - if verbose > 0: print "reading file '%s'..." % ( inFileName ); sys.stdout.flush() - - - if FileUtils.isEmpty(inFileName): - return (None) - profilesInstance = Profiles() - profilesDBInstance = ProfilesDatabank() - f = open( inFileName , "r") - while profilesInstance.read( f ): - profilesDBInstance.append( profilesInstance ) - profilesInstance = Profiles() - f.close() - if verbose > 0: print "file '%s' is loaded" % ( inFileName ); sys.stdout.flush() - return (profilesDBInstance) - - read = staticmethod( read ) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/InsertProfilesMapFileInDBTestRessources.py --- a/commons/pyRepetUnit/profilesDB/tests/InsertProfilesMapFileInDBTestRessources.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,14 +0,0 @@ -''' -Created on 24 juin 2009 - -@author: choede -''' - -class InsertProfilesMapFileInDBTestRessources(object): - ''' - Put here ressources not present in config file - ''' - REPET_DB_USER = "ochoede" - REPET_DB_HOST = "pisano" - REPET_DB_PW = "ochoede" - REPET_DB_NAME = "repet_ochoede" \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/TestCompleteProfilesDBFromProfilesNameListOrAccNumber.py --- a/commons/pyRepetUnit/profilesDB/tests/TestCompleteProfilesDBFromProfilesNameListOrAccNumber.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,67 +0,0 @@ -''' -Created on 18 mai 2009 - -@author: choede -''' -import unittest -import commons.pyRepetUnit.profilesDB.CompleteAProfilesDBFromAFileWithProfilesNamesOrAccNumber - - -class TestCompleteProfilesDBFromProfilesNameListOrAccNumber(unittest.TestCase): - - - def setUp(self): - self._fileProfilesList = "./datas/ListPfamProfilsInRepbase.txt" - self._filePfamList = "./datas/ListpfamAccNumber.txt" - self._profilesDB = "./datas/profilesDBTest.hmm" - self.CompleteProfilesDB = commons.pyRepetUnit.profilesDB.CompleteAProfilesDBFromAFileWithProfilesNamesOrAccNumber.CompleteAProfilesDBFromAFileWithProfilesNamesOrAccNumber() - self.CompleteProfilesDB.setProfilesDBFile ( self._profilesDB ) - self._expectedList = ["zf-CCHC", "InvE", "Chromo", "TLV_coat"] - self._expectedList2 = ["PF00075", "PF00424", "PF00469"] - self._expectedGetzCmd = "getz -e \'[pfamhmm-Id:\"zf-CCHC*\"] | [pfamhmm-Id:\"InvE*\"] | [pfamhmm-Id:\"Chromo*\"] | [pfamhmm-Id:\"TLV_coat*\"]\'" - self._expectedGetzCmd2 = "getz -e \'[pfamhmm-AccNumber:\"PF00075\"] | [pfamhmm-AccNumber:\"PF00424\"] | [pfamhmm-AccNumber:\"PF00469\"]\'" - - - def tearDown(self): - pass - - - def testListNotExistingProfiles(self): - #with name - self.CompleteProfilesDB.setProfilesToAdd ( self._fileProfilesList ) - profilesNotInDBList = self.CompleteProfilesDB.generateNotExistingProfilesList( ) - i = 0 - if profilesNotInDBList != []: - for profil in profilesNotInDBList: - self.assertEquals(profil, self._expectedList[i]) - i = i + 1 - #with pfam accession number - self.CompleteProfilesDB.setProfilesToAdd ( self._filePfamList ) - self.CompleteProfilesDB.setPfamAccNumberKeys () - profilesNotInDBList = self.CompleteProfilesDB.generateNotExistingProfilesList( ) - i = 0 - if profilesNotInDBList != []: - for profil in profilesNotInDBList: - self.assertEquals(profil, self._expectedList2[i]) - i = i + 1 - - def testCreateGetzCommand(self): - getzCmd = self.CompleteProfilesDB.generateGetzCmdProfilesList( self._expectedList ) - # pour le moment je cherche dans les fs ou les ls si je ne veux que les fs specifier type = fs ce sera surement le cas a terme - self.assertEqual (getzCmd, self._expectedGetzCmd) - - def testCmdToCompleteProfileDBFromList(self): - #names list - self.CompleteProfilesDB.setProfilesToAdd ( self._fileProfilesList ) - getzCmd = self.CompleteProfilesDB.CmdToCompleteProfileDB() - self.assertEqual (getzCmd, self._expectedGetzCmd) - #pfam accession Number list - self.CompleteProfilesDB.setPfamAccNumberKeys () - self.CompleteProfilesDB.setProfilesToAdd ( self._filePfamList ) - getzCmd = self.CompleteProfilesDB.CmdToCompleteProfileDB() - self.assertEqual (getzCmd, self._expectedGetzCmd2) - - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/TestInsertProfilesMapFileInDB.py --- a/commons/pyRepetUnit/profilesDB/tests/TestInsertProfilesMapFileInDB.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,65 +0,0 @@ -import unittest -import time -import os -from commons.core.sql.TableMapAdaptator import TableMapAdaptator -from commons.core.coord.Map import Map -#from commons.pyRepetUnit.profilesDB.tests.InsertProfilesMapFileInDBTestRessources import InsertProfilesMapFileInDBTestRessources -from commons.pyRepetUnit.profilesDB.InsertProfilesMapFileInDB import InsertProfilesMapFileInDB -from commons.core.sql.DbMySql import DbMySql - - -class TestInsertProfilesMapFileInDB(unittest.TestCase): - - def setUp(self): - self._inputFileName = "./datas/profiles.map" - self._createProfilesMapFile() -# self._host = InsertProfilesMapFileInDBTestRessources.REPET_DB_HOST -# self._user = InsertProfilesMapFileInDBTestRessources.REPET_DB_USER -# self._passwd = InsertProfilesMapFileInDBTestRessources.REPET_DB_PW -# self._dbname = InsertProfilesMapFileInDBTestRessources.REPET_DB_NAME -# self._db = DbMySql( self._user, self._host, self._passwd, self._dbname ) - self._db = DbMySql( os.environ["REPET_USER"], - os.environ["REPET_HOST"], - os.environ["REPET_PW"], - os.environ["REPET_DB"] ) - self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S") , os.getpid() ) - self._table = "dummyMapTable_%s" % ( self._uniqId ) - - def tearDown(self): - os.remove(self._inputFileName) - self._deleteDBtables() - self._db.close() - - def testInsertProfilesMapFileInDB(self): - resultFromFileMapUtils = self._readMapResultsFromFileAndFillList() - InsertProfilesMapFileInDBinstance = InsertProfilesMapFileInDB(self._inputFileName, self._table, self._db) - InsertProfilesMapFileInDBinstance.createAndLoadTable() - resultFromTableMapUtils = self._readMapResultsFromTableAndFillList() - self.assertEquals(resultFromFileMapUtils, resultFromTableMapUtils) - - def _createProfilesMapFile(self): - f = open(self._inputFileName, "w") - f.write("rrm\t\t1\t77\n") - f.write("fn3\tFibronectin type III domain\t1\t84\n") - f.write("pkinase\tProtein kinase domain\t1\t294\n") - f.close() - - def _readMapResultsFromTableAndFillList(self): - tableMapAdaptatorInstance = TableMapAdaptator (self._db, self._table) - return tableMapAdaptatorInstance.getListOfAllMaps() - - def _readMapResultsFromFileAndFillList(self): - mapInstance = Map() - lMap = [] - f = open( self._inputFileName , "r") - while mapInstance.read( f ): - lMap.append (mapInstance) - mapInstance = Map() - f.close() - return lMap - - def _deleteDBtables(self): - self._db.dropTable(self._table) - -if __name__ == "__main__": - unittest.main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/TestProfiles.py --- a/commons/pyRepetUnit/profilesDB/tests/TestProfiles.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,151 +0,0 @@ -import os -import unittest -from commons.pyRepetUnit.profilesDB.Profiles import Profiles -from commons.core.utils.FileUtils import FileUtils - - -class TestProfiles(unittest.TestCase): - - def createInputDBFile(self): - f = open(self._inputDBFile, "w") - f.write("HMMER2.0 [2.3.2]\n") - f.write("NAME fn3\n") - f.write("ACC PF00041\n") - f.write("DESC Fibronectin type III domain\n") - f.write("LENG 84\n") - f.write("ALPH Amino\n") - f.write("RF no\n") - f.write("CS yes\n") - f.write("MAP yes\n") - f.write("COM hmmbuild -A myhmms fn3.sto\n") - f.write("COM hmmcalibrate myhmms\n") - f.write("NSEQ 108\n") - f.write("DATE Thu Jan 8 17:50:26 2009\n") - f.write("CKSUM 6130\n") - f.write("GA 7.8 2.0;\n") - f.write("TC 7.9 2.1;\n") - f.write("NC 7.0 1.1;\n") - f.write("XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \n") - f.write("NULT -4 -8455\n") - f.write("NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \n") - f.write("EVD -45.973442 0.237545\n") - f.write("HMM A C D E F G H I K L M N P Q R S T V W Y \n") - f.write(" m->m m->i m->d i->m i->i d->m d->d b->m m->e\n") - f.write("COM hmmcalibrate myhmms\n") - f.write(" -13 * -6756\n") - f.write(" 1 -1698 -4236 -5399 -847 -4220 -2885 -1259 -930 -2438 406 -3428 -4768 3631 -1835 -4773 -1187 -1331 -120 -4666 -1510 1\n") - f.write(" - -150 -501 232 46 -382 399 104 -628 211 -461 -722 274 395 44 95 358 118 -368 -296 -251 \n") - f.write(" C -144 -3400 -12951 -19 -6286 -701 -1378 -13 * \n") - f.write("//\n") - f.write("HMMER2.0 [2.3.2]\n") - f.write("NAME truc\n") - f.write("ACC PF00042.012\n") - f.write("LENG 123\n") - f.write("ALPH Amino\n") - f.write("RF no\n") - f.write("CS yes\n") - f.write("MAP yes\n") - f.write("COM hmmbuild -A myhmms fn3.sto\n") - f.write("COM hmmcalibrate myhmms\n") - f.write("NSEQ 108\n") - f.write("DATE Thu Jan 8 17:50:26 2009\n") - f.write("CKSUM 6130\n") - f.write("GA 7.8 -1.0;\n") - f.write("TC 7.9 0.1;\n") - f.write("NC 7.8 0.1;\n") - f.write("XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \n") - f.write("NULT -4 -8455\n") - f.write("NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \n") - f.write("EVD -45.973442 0.237545\n") - f.write("HMM A C D E F G H I K L M N P Q R S T V W Y \n") - f.write(" m->m m->i m->d i->m i->i d->m d->d b->m m->e\n") - f.write("COM hmmcalibrate myhmms\n") - f.write(" -13 * -6756\n") - f.write(" 1 -1698 -4236 -5399 -847 -4220 -2885 -1259 -930 -2438 406 -3428 -4768 3631 -1835 -4773 -1187 -1331 -120 -4666 -1510 1\n") - f.write(" - -150 -501 232 46 -382 399 104 -628 211 -461 -722 274 395 44 95 358 118 -368 -296 -251 \n") - f.write(" C -144 -3400 -12951 -19 -6286 -701 -1378 -13 * \n") - f.write("//\n") - f.close() - - - def setUp(self): - self.profiles = Profiles() - self._inputDBFile = "dummy.hmm" - - - def testRead(self): - # atomic profiles file - self.createInputDBFile() - file = open( self._inputDBFile ) - profile = self.profiles - profile.read(file) - self.assertEqual("fn3",profile.name) - self.assertEqual("Fibronectin type III domain", profile.desc) - self.assertEqual(84, profile.length) - self.assertEqual("PF00041", profile.accNumber) - self.assertEqual(2.0, profile.GA_cut_off) - profile.read(file) - self.assertEqual("truc",profile.name) - self.assertEqual("", profile.desc) - self.assertEqual(123, profile.length) - self.assertEqual("PF00042.012", profile.accNumber) - self.assertEqual(-1.0, profile.GA_cut_off) - os.system("rm " + self._inputDBFile) - # empty file - f = open(self._inputDBFile, "w") - f.close() - file = open( self._inputDBFile ) - profile = self.profiles - profile.read(file) - self.assertEqual(None, profile.name) - self.assertEqual(None, profile.desc) - self.assertEqual(None, profile.length) - self.assertEqual(None, profile.accNumber) - self.assertEqual(None, profile.GA_cut_off) - os.system("rm " + self._inputDBFile) - - - def testReadAndRetrieve(self): - # atomic profiles file - self.createInputDBFile() - file = open( self._inputDBFile ) - profile = self.profiles - myProfile = profile.readAndRetrieve(file) - self.assertEqual("fn3",profile.name) - self.assertEqual("Fibronectin type III domain", profile.desc) - self.assertEqual(84, profile.length) - self.assertEqual("PF00041", profile.accNumber) - self.assertEqual(2.0, profile.GA_cut_off) - myProfile2 = profile.readAndRetrieve(file) - self.assertEqual("truc",profile.name) - self.assertEqual("", profile.desc) - self.assertEqual(123, profile.length) - self.assertEqual("PF00042.012", profile.accNumber) - self.assertEqual(-1.0, profile.GA_cut_off) - #I check if retrieve work like I want - f = open("retrieveResult", "w") - for item in myProfile: - f.write(item) - for item in myProfile2: - f.write(item) - f.close() - self.assertTrue(FileUtils.are2FilesIdentical("retrieveResult", self._inputDBFile)) - os.system("rm " + self._inputDBFile) - os.system("rm retrieveResult") - # empty file - f = open(self._inputDBFile, "w") - f.close() - file = open( self._inputDBFile ) - profile = self.profiles - myProfile3 = profile.readAndRetrieve(file) - self.assertEqual(None, profile.name) - self.assertEqual(None, profile.desc) - self.assertEqual(None, profile.length) - self.assertEqual(None, profile.accNumber) - self.assertEqual(None, profile.GA_cut_off) - self.assertEqual(None, myProfile3) - os.system("rm " + self._inputDBFile) - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/TestProfilesDB2Map.py --- a/commons/pyRepetUnit/profilesDB/tests/TestProfilesDB2Map.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,199 +0,0 @@\n-import os\n-import unittest\n-from commons.pyRepetUnit.profilesDB.Profiles import Profiles\n-from commons.pyRepetUnit.profilesDB.ProfilesDatabank import ProfilesDatabank\n-import commons.pyRepetUnit.profilesDB.ProfilesDB2Map\n-from commons.core.utils.FileUtils import FileUtils\n-\n-\n-class TestProfilesDB2Map(unittest.TestCase):\n- \n- def setUp(self):\n- self.profilesDB2Map = commons.pyRepetUnit.profilesDB.ProfilesDB2Map.ProfilesDB2Map() \n- \n- \n- def testWriteProfilesDB(self):\n- # atomic hmmerpfam file\n- profilesDB = ProfilesDatabank()\n- profiles1 = Profiles()\n- profiles1.name = "fn3"\n- profiles1.desc = "Fibronectin type III domain"\n- profiles1.length = 84\n- profilesDB.append( profiles1 )\n- profiles2 = Profiles()\n- profiles2.name = "truc"\n- profiles2.desc = ""\n- profiles2.length = 123\n- profilesDB.append( profiles2 )\n- file = open( "expectedFile", "w" )\n- file.write( "fn3\\tFibronectin type III domain\\t1\\t84\\n" )\n- file.write( "truc\\t\\t1\\t123\\n" )\n- file.close()\n- self.profilesDB2Map.setOutputFile("testOutput.map")\n- self.profilesDB2Map._writeMapFile(profilesDB)\n- self.assertTrue(FileUtils.are2FilesIdentical("expectedFile", "testOutput.map"))\n- os.remove("expectedFile")\n- os.remove("testOutput.map")\n- #empty profileDB object\n- profilesDB = ProfilesDatabank()\n- self.profilesDB2Map._writeMapFile(profilesDB)\n- self.assertFalse(FileUtils.isRessourceExists("testOutput.map"))\n- \n- def testReadProfilesDB(self):\n- # atomic hmmerpfam file\n- f = open("dummy.hmm", "w")\n- f.write("HMMER2.0 [2.3.2]\\n")\n- f.write("NAME fn3\\n")\n- f.write("ACC PF00041\\n")\n- f.write("DESC Fibronectin type III domain\\n")\n- f.write("LENG 84\\n")\n- f.write("ALPH Amino\\n")\n- f.write("RF no\\n")\n- f.write("CS yes\\n")\n- f.write("MAP yes\\n")\n- f.write("COM hmmbuild -A myhmms fn3.sto\\n")\n- f.write("COM hmmcalibrate myhmms\\n")\n- f.write("NSEQ 108\\n")\n- f.write("DATE Thu Jan 8 17:50:26 2009\\n")\n- f.write("CKSUM 6130\\n")\n- f.write("GA 7.8 -1.0\\n")\n- f.write("TC 7.9 0.1\\n")\n- f.write("XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \\n")\n- f.write("NULT -4 -8455\\n")\n- f.write("NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \\n")\n- f.write("EVD -45.973442 0.237545\\n")\n- f.write("HMM A C D E F G H I K L M N P Q R S T V W Y \\n")\n- f.write(" m->m m->i m->d i->m i->i d->m d->d b->m m->e\\n")\n- f.write("COM hmmcalibrate myhmms\\n")\n- f.write(" -13 * -6756\\n")\n- f.write(" 1 -1698 -4236 -5399 -847 -4220 -2885 -1259 -930 -2438 406 -3428 -4768 3631 -1835 -4773 -1187 -1331 -120 -4666 -1510 1\\n")\n- f.write(" - -150 -501 232 46 -382 399 104 -628 211 -461 -722 274 395 44 95 358 118 -368 -296 -251 \\n")\n- f.write(" C -144 -3400 -12951 -19 -6286 -701 -1378 -13 * \\n")\n- f.write("//\\n")\n- f.write("HMMER2.0 [2.3.2]\\n")\n- f.write("NAME truc\\n")\n- f.write("ACC PF00041\\n")\n- f.write("LENG 123\\n")\n- f.write("ALPH Amino\\n")\n- f.write("RF no\\n")\n- f.write("CS yes\\n")\n- f.write("MAP yes\\n")\n- f.write("COM hmmbuild -A myhmms fn3.sto\\n")\n- f.write("COM hmmcalibrate myhmms\\n")\n- f.write("NSEQ 108\\n")\n- f.write("DATE Thu Jan 8 17:50:26 2009\\n")\n- f.write("CKSUM '..b'write("ALPH Amino\\n")\n- f.write("RF no\\n")\n- f.write("CS yes\\n")\n- f.write("MAP yes\\n")\n- f.write("COM hmmbuild -A myhmms fn3.sto\\n")\n- f.write("COM hmmcalibrate myhmms\\n")\n- f.write("NSEQ 108\\n")\n- f.write("DATE Thu Jan 8 17:50:26 2009\\n")\n- f.write("CKSUM 6130\\n")\n- f.write("GA 7.8 -1.0\\n")\n- f.write("TC 7.9 0.1\\n")\n- f.write("XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \\n")\n- f.write("NULT -4 -8455\\n")\n- f.write("NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \\n")\n- f.write("EVD -45.973442 0.237545\\n")\n- f.write("HMM A C D E F G H I K L M N P Q R S T V W Y \\n")\n- f.write(" m->m m->i m->d i->m i->i d->m d->d b->m m->e\\n")\n- f.write("COM hmmcalibrate myhmms\\n")\n- f.write(" -13 * -6756\\n")\n- f.write(" 1 -1698 -4236 -5399 -847 -4220 -2885 -1259 -930 -2438 406 -3428 -4768 3631 -1835 -4773 -1187 -1331 -120 -4666 -1510 1\\n")\n- f.write(" - -150 -501 232 46 -382 399 104 -628 211 -461 -722 274 395 44 95 358 118 -368 -296 -251 \\n")\n- f.write(" C -144 -3400 -12951 -19 -6286 -701 -1378 -13 * \\n")\n- f.write("//\\n")\n- f.write("HMMER2.0 [2.3.2]\\n")\n- f.write("NAME truc\\n")\n- f.write("ACC PF00041\\n")\n- f.write("LENG 123\\n")\n- f.write("ALPH Amino\\n")\n- f.write("RF no\\n")\n- f.write("CS yes\\n")\n- f.write("MAP yes\\n")\n- f.write("COM hmmbuild -A myhmms fn3.sto\\n")\n- f.write("COM hmmcalibrate myhmms\\n")\n- f.write("NSEQ 108\\n")\n- f.write("DATE Thu Jan 8 17:50:26 2009\\n")\n- f.write("CKSUM 6130\\n")\n- f.write("GA 7.8 -1.0\\n")\n- f.write("TC 7.9 0.1\\n")\n- f.write("XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \\n")\n- f.write("NULT -4 -8455\\n")\n- f.write("NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \\n")\n- f.write("EVD -45.973442 0.237545\\n")\n- f.write("HMM A C D E F G H I K L M N P Q R S T V W Y \\n")\n- f.write(" m->m m->i m->d i->m i->i d->m d->d b->m m->e\\n")\n- f.write("COM hmmcalibrate myhmms\\n")\n- f.write(" -13 * -6756\\n")\n- f.write(" 1 -1698 -4236 -5399 -847 -4220 -2885 -1259 -930 -2438 406 -3428 -4768 3631 -1835 -4773 -1187 -1331 -120 -4666 -1510 1\\n")\n- f.write(" - -150 -501 232 46 -382 399 104 -628 211 -461 -722 274 395 44 95 358 118 -368 -296 -251 \\n")\n- f.write(" C -144 -3400 -12951 -19 -6286 -701 -1378 -13 * \\n")\n- f.write("//\\n") \n- f.close()\n- self.profilesDB2Map.setInputFile("dummy.hmm")\n- self.profilesDB2Map.setOutputFile("testOutput.map")\n- self.profilesDB2Map.run()\n- file = open( "expectedFile", "w" )\n- file.write( "fn3\\tFibronectin type III domain\\t1\\t84\\n" )\n- file.write( "truc\\t\\t1\\t123\\n" )\n- file.close()\n- self.assertTrue(FileUtils.are2FilesIdentical("expectedFile", "testOutput.map"))\n- os.remove("expectedFile")\n- os.remove("testOutput.map")\n- os.remove("dummy.hmm")\n- \n- \n-if __name__ == "__main__": \n- unittest.main() \n- \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/TestProfilesDatabankUtils.py --- a/commons/pyRepetUnit/profilesDB/tests/TestProfilesDatabankUtils.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,101 +0,0 @@ -import unittest -import os -from commons.pyRepetUnit.profilesDB.Profiles import Profiles -from commons.pyRepetUnit.profilesDB.ProfilesDatabankUtils import ProfilesDatabankUtils - - -class TestProfilesDatabankUtils( unittest.TestCase ): - - def setUp( self ): - self.profilesDBUtils = ProfilesDatabankUtils() - - - def test_read_emptyFile( self ): - file = open( "pfamDBEmpty", "w" ) - file.close() - pfamDB2 = self.profilesDBUtils.read( "pfamDBEmpty" ) - self.assertEquals( None, pfamDB2 ) - os.remove( "pfamDBEmpty" ) - - - def test_read( self ): - f = open("dummy.hmm", "w") - f.write("HMMER2.0 [2.3.2]\n") - f.write("NAME fn3\n") - f.write("ACC PF00041\n") - f.write("DESC Fibronectin type III domain\n") - f.write("LENG 84\n") - f.write("ALPH Amino\n") - f.write("RF no\n") - f.write("CS yes\n") - f.write("MAP yes\n") - f.write("COM hmmbuild -A myhmms fn3.sto\n") - f.write("COM hmmcalibrate myhmms\n") - f.write("NSEQ 108\n") - f.write("DATE Thu Jan 8 17:50:26 2009\n") - f.write("CKSUM 6130\n") - f.write("GA 7.8 -1.0\n") - f.write("TC 7.9 0.1\n") - f.write("XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \n") - f.write("NULT -4 -8455\n") - f.write("NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \n") - f.write("EVD -45.973442 0.237545\n") - f.write("HMM A C D E F G H I K L M N P Q R S T V W Y \n") - f.write(" m->m m->i m->d i->m i->i d->m d->d b->m m->e\n") - f.write("COM hmmcalibrate myhmms\n") - f.write(" -13 * -6756\n") - f.write(" 1 -1698 -4236 -5399 -847 -4220 -2885 -1259 -930 -2438 406 -3428 -4768 3631 -1835 -4773 -1187 -1331 -120 -4666 -1510 1\n") - f.write(" - -150 -501 232 46 -382 399 104 -628 211 -461 -722 274 395 44 95 358 118 -368 -296 -251 \n") - f.write(" C -144 -3400 -12951 -19 -6286 -701 -1378 -13 * \n") - f.write("//\n") - f.write("HMMER2.0 [2.3.2]\n") - f.write("NAME truc\n") - f.write("ACC PF00041\n") - f.write("LENG 123\n") - f.write("ALPH Amino\n") - f.write("RF no\n") - f.write("CS yes\n") - f.write("MAP yes\n") - f.write("COM hmmbuild -A myhmms fn3.sto\n") - f.write("COM hmmcalibrate myhmms\n") - f.write("NSEQ 108\n") - f.write("DATE Thu Jan 8 17:50:26 2009\n") - f.write("CKSUM 6130\n") - f.write("GA 7.8 -1.0\n") - f.write("TC 7.9 0.1\n") - f.write("XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \n") - f.write("NULT -4 -8455\n") - f.write("NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \n") - f.write("EVD -45.973442 0.237545\n") - f.write("HMM A C D E F G H I K L M N P Q R S T V W Y \n") - f.write(" m->m m->i m->d i->m i->i d->m d->d b->m m->e\n") - f.write("COM hmmcalibrate myhmms\n") - f.write(" -13 * -6756\n") - f.write(" 1 -1698 -4236 -5399 -847 -4220 -2885 -1259 -930 -2438 406 -3428 -4768 3631 -1835 -4773 -1187 -1331 -120 -4666 -1510 1\n") - f.write(" - -150 -501 232 46 -382 399 104 -628 211 -461 -722 274 395 44 95 358 118 -368 -296 -251 \n") - f.write(" C -144 -3400 -12951 -19 -6286 -701 -1378 -13 * \n") - f.write("//\n") - f.close() - pfamDB = self.profilesDBUtils.read("dummy.hmm") - expectedProfiles1 = Profiles() - expectedProfiles1.name = "fn3" - expectedProfiles1.desc = "Fibronectin type III domain" - expectedProfiles1.length = 84 - expectedProfiles2 = Profiles() - expectedProfiles2.name = "truc" - expectedProfiles2.desc = "" - expectedProfiles2.length = 123 - - self.assertEqual( expectedProfiles1.name, pfamDB.get(0).name ) - self.assertEqual( expectedProfiles1.desc, pfamDB.get(0).desc ) - self.assertEqual( expectedProfiles1.length, pfamDB.get(0).length ) - self.assertEqual( expectedProfiles2.name, pfamDB.get(1).name ) - self.assertEqual( expectedProfiles2.desc, pfamDB.get(1).desc ) - self.assertEqual( expectedProfiles2.length, pfamDB.get(1).length ) - - os.remove("dummy.hmm") - - -if __name__ == "__main__": - unittest.main() - \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/Test_F_CompleteProfilDB.py --- a/commons/pyRepetUnit/profilesDB/tests/Test_F_CompleteProfilDB.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,40 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils - -class Test_F_CompleteProfilDB(unittest.TestCase): - - def setUp(self): - self._fileProfilesList = "./datas/ListPfamProfilsInRepbase.txt" - self._filePfamList = "./datas/ListpfamAccNumber.txt" - self._profilesDB = "./datas/profilesDBTest.hmm" - self._expectedGetzCmd = "getz -e \'[pfamhmm-Id:\"zf-CCHC*\"] | [pfamhmm-Id:\"InvE*\"] | [pfamhmm-Id:\"Chromo*\"] | [pfamhmm-Id:\"TLV_coat*\"]\'" - self._expectedFile(self._expectedGetzCmd) - self._outputFileName = "./datas/outputFile" - self._expectedGetzCmd2 = "getz -e \'[pfamhmm-AccNumber:\"PF00075\"] | [pfamhmm-AccNumber:\"PF00424\"] | [pfamhmm-AccNumber:\"PF00469\"]\'" - - def tearDown(self): - os.remove(self._outputFileName) - os.remove(self._expectedGetzCmdFile) - - def testCompleteProfilesDBScriptByName(self): - Cmd = "completeProfilesDBFromAFileWithProfilesList_script.py -d " + self._profilesDB + " -l " + self._fileProfilesList + " -o " + self._outputFileName + "\n" - os.system (Cmd) - self.assertTrue (FileUtils.are2FilesIdentical(self._outputFileName, self._expectedGetzCmdFile)) - - def testCompleteProfilesDBScriptByAccession(self): - self._expectedFile(self._expectedGetzCmd2) - Cmd = "completeProfilesDBFromAFileWithProfilesList_script.py -d " + self._profilesDB + " -l " + self._filePfamList + " -o " + self._outputFileName + " -n\n" - os.system(Cmd) - self.assertTrue(FileUtils.are2FilesIdentical(self._outputFileName, self._expectedGetzCmdFile)) - - def _expectedFile(self, expectedGetzCmd): - self._expectedGetzCmdFile = "./datas/expectedCmdFile" - f = open(self._expectedGetzCmdFile, 'w') - f.write(expectedGetzCmd) - f.close - - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/Test_F_ProfilesDB2Map.py --- a/commons/pyRepetUnit/profilesDB/tests/Test_F_ProfilesDB2Map.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,34 +0,0 @@ -import os -import unittest -from commons.core.utils.FileUtils import FileUtils -from commons.pyRepetUnit.profilesDB.ProfilesDB2Map import ProfilesDB2Map - -class Test_F_ProfilesDB2Map(unittest.TestCase): - - def setUp(self): - self.profilesDB2Map = ProfilesDB2Map() - self._inputFile = "./datas/myhmms" - self._outputFile = "./datas/outputFile.map" - self._expectedFile = "./datas/profiles.map" - self._createProfilesMapFile() - - def tearDown(self): - os.remove(self._outputFile) - os.remove(self._expectedFile) - - def testRun(self): - self.profilesDB2Map.setInputFile(self._inputFile) - self.profilesDB2Map.setOutputFile(self._outputFile) - pfamDB = self.profilesDB2Map.run() - self.assertTrue(FileUtils.are2FilesIdentical(self._expectedFile, self._outputFile)) - - def _createProfilesMapFile(self): - f = open(self._expectedFile, "w") - f.write("rrm\t\t1\t77\n") - f.write("fn3\tFibronectin type III domain\t1\t84\n") - f.write("pkinase\tProtein kinase domain\t1\t294\n") - f.close() - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/Test_F_ProfilesDB4Repet.py --- a/commons/pyRepetUnit/profilesDB/tests/Test_F_ProfilesDB4Repet.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,20 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils - -class Test_F_ProfilesDB4Repet(unittest.TestCase): - - def setUp(self): - self._inputDBFile = "%s/Tools/ProfilesDB4Repet_v2.hmm" % os.environ["REPET_DATA"] - self._outputDBFile = "output.hmm" - - def tearDown(self): - os.remove(self._outputDBFile) - - def test_run_as_script(self): - cmd = "python ../ProfilesDB4Repet.py -i " + self._inputDBFile + " -o " + self._outputDBFile - os.system(cmd) - self.assertEqual(FileUtils.getNbLinesInSingleFile(self._outputDBFile), 375854) - -if __name__ == "__main__": - unittest.main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/Test_ProfilesDB4Repet.py --- a/commons/pyRepetUnit/profilesDB/tests/Test_ProfilesDB4Repet.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,442 +0,0 @@\n-import unittest\n-import os\n-from commons.pyRepetUnit.profilesDB.ProfilesDB4Repet import ProfilesDB4Repet\n-from commons.core.utils.FileUtils import FileUtils\n-\n-\n-class Test_ProfilesDB4Repet(unittest.TestCase):\n-\n- def setUp(self):\n- self._inputDBFile = "./datas/dummy.hmm"\n- self._expectedDBFile = "./datas/expected.hmm"\n- self._outputDBFile = "./datas/output.hmm"\n- self._profilesDB4Repet = ProfilesDB4Repet()\n-\n- def tearDown(self):\n- os.remove(self._expectedDBFile)\n- os.remove(self._outputDBFile)\n- os.remove(self._inputDBFile)\n-\n- def testFormateProfilesDB4Repet(self):\n- self._createHmmFile()\n- self._createExpectedHmmFile()\n- self._profilesDB4Repet.setInputFile(self._inputDBFile)\n- self._profilesDB4Repet.setOutputFile(self._outputDBFile)\n- self._profilesDB4Repet.run()\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expectedDBFile, self._outputDBFile))\n-\n- def test_formateProfilesDB4Repet_GypsyDB(self):\n- self._createHmmFile_GypsyDB()\n- self._createExpectedHmmFile_GypsyDB()\n- self._profilesDB4Repet.setInputFile(self._inputDBFile)\n- self._profilesDB4Repet.setOutputFile(self._outputDBFile)\n- self._profilesDB4Repet.run()\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expectedDBFile, self._outputDBFile))\n- \n- def _createExpectedHmmFile(self):\n- f = open(self._expectedDBFile, "w")\n- f.write("HMMER2.0 [2.3.2]\\n")\n- f.write("NAME PF07582.4_AP_endonuc_2_N_APE_20.9\\n")\n- f.write("ACC PF07582.4\\n")\n- f.write("DESC AP endonuclease family 2 C terminus\\n")\n- f.write("LENG 84\\n")\n- f.write("ALPH Amino\\n")\n- f.write("RF no\\n")\n- f.write("CS yes\\n")\n- f.write("MAP yes\\n")\n- f.write("COM hmmbuild -A myhmms fn3.sto\\n")\n- f.write("COM hmmcalibrate myhmms\\n")\n- f.write("NSEQ 108\\n")\n- f.write("DATE Thu Jan 8 17:50:26 2009\\n")\n- f.write("CKSUM 6130\\n")\n- f.write("GA 20.9000 20.9000;\\n")\n- f.write("TC 21.2000 21.2000;\\n")\n- f.write("NC 20.8000 20.8000;\\n")\n- f.write("XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \\n")\n- f.write("NULT -4 -8455\\n")\n- f.write("NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \\n")\n- f.write("EVD -45.973442 0.237545\\n")\n- f.write("HMM A C D E F G H I K L M N P Q R S T V W Y \\n")\n- f.write(" m->m m->i m->d i->m i->i d->m d->d b->m m->e\\n")\n- f.write("COM hmmcalibrate myhmms\\n")\n- f.write(" -13 * -6756\\n")\n- f.write(" 1 -1698 -4236 -5399 -847 -4220 -2885 -1259 -930 -2438 406 -3428 -4768 3631 -1835 -4773 -1187 -1331 -120 -4666 -1510 1\\n")\n- f.write(" - -150 -501 232 46 -382 399 104 -628 211 -461 -722 274 395 44 95 358 118 -368 -296 -251 \\n")\n- f.write(" C -144 -3400 -12951 -19 -6286 -701 -1378 -13 * \\n")\n- f.write("//\\n")\n- f.write("HMMER2.0 [2.3.2]\\n")\n- f.write("NAME PF01606.8_Arteri_env_ENV_25.0\\n")\n- f.write("ACC PF01606.8\\n")\n- f.write("DESC DESC Arterivirus envelope protein\\n")\n- f.write("LENG 123\\n")\n- f.write("ALPH Amino\\n")\n- f.write("RF no\\n")\n- f.write("CS yes\\n")\n- f.write("MAP yes\\n")\n- f.write("COM hmmbuild -A myhmms fn3.sto\\n")\n- f.write("COM hmmcalibrate myhmms\\n")\n- f.write("NSEQ 108\\n")\n- f.write("DATE Thu Jan 8 17:50:26 2009\\n")\n- f.write("CKSUM 6130\\n")\n- f.write("GA 21.0000 25.0000;\\n")'..b' -4 -8455\\n")\n- f.write("NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644\\n") \n- f.write("EVD -12.496953 0.641902\\n")\n- f.write("HMM A C D E F G H I K L M N P Q R S T V W Y\\n") \n- f.write(" m->m m->i m->d i->m i->i d->m d->d b->m m->e\\n")\n- f.write(" -576 * -1603\\n")\n- f.write("1 -995 -1009 -2161 -1884 -298 -2046 -1336 348 -1429 591 4179 -1738 -2255 -1394 -1460 -1476 -1060 98 -1303 -906 1\\n")\n- f.write("- -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249\\n") \n- f.write("- -33 -6075 -7117 -894 -1115 -701 -1378 -1576 -10335\\n") \n- f.write("2 95 -518 -873 -904 -1785 -691 -984 -1664 -955 -1934 -1254 -652 -1327 -861 -1134 2815 -243 -1070 -2024 -1564 2\\n")\n- f.write("- -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249\\n") \n- f.write("- -33 -6075 -7117 -894 -1115 -701 -1378 -10911 -10334\\n") \n- f.write("//\\n")\n- f.write("HMMER2.0 [2.3.2]\\n")\n- f.write("NAME MOV_cavemovirus\\n")\n- f.write("LENG 302\\n")\n- f.write("ALPH Amino\\n")\n- f.write("RF no\\n")\n- f.write("CS no\\n")\n- f.write("MAP yes\\n")\n- f.write("COM hmmbuild output/MOV_cavemovirus.hmm input/MOV_cavemovirus.sto\\n")\n- f.write("COM hmmcalibrate output/MOV_cavemovirus.hmm\\n")\n- f.write("NSEQ 2\\n")\n- f.write("DATE Tue Nov 3 11:25:12 2009\\n")\n- f.write("CKSUM 1918\\n")\n- f.write("XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4\\n") \n- f.write("NULT -4 -8455\\n")\n- f.write("NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644\\n") \n- f.write("EVD -135.876633 0.154850\\n")\n- f.write("HMM A C D E F G H I K L M N P Q R S T V W Y\\n") \n- f.write(" m->m m->i m->d i->m i->i d->m d->d b->m m->e\\n")\n- f.write(" -585 * -1585\\n")\n- f.write("1 -1028 -1686 -800 -442 -2171 -1521 -263 -1873 3103 -1859 -1251 -547 -1750 74 599 -1004 -972 -1620 -1812 -1528 5\\n")\n- f.write("- -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249\\n") \n- f.write("- -33 -6045 -7087 -894 -1115 -701 -1378 -585 *\\n") \n- f.write("2 -1016 -805 -2637 -2367 -591 -2470 -1853 3039 -2040 329 346 -2180 -2589 -1943 -2070 -1879 -1051 1184 -1698 -1261 6\\n")\n- f.write("- -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249\\n") \n- f.write("- -33 -6045 -7087 -894 -1115 -701 -1378 * *\\n") \n- f.write("3 -1016 -805 -2637 -2367 -591 -2470 -1853 3039 -2040 329 346 -2180 -2589 -1943 -2070 -1879 -1051 1184 -1698 -1261 7\\n")\n- f.write("- -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249\\n") \n- f.write("- -33 -6045 -7087 -894 -1115 -701 -1378 * *\\n") \n- f.write("//\\n")\n- f.close() \n-\n-\n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/completeProfilesDBFromAFileWithProfilesList_script.py --- a/commons/pyRepetUnit/profilesDB/tests/completeProfilesDBFromAFileWithProfilesList_script.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,102 +0,0 @@ -#!/usr/bin/env python -''' -Created on 19 mai 2009 - -@author: choede -''' - -import commons.pyRepetUnit.profilesDB.CompleteAProfilesDBFromAFileWithProfilesNamesOrAccNumber -import user, os, sys, getopt, exceptions -from pyRepet.util.file.FileUtils import * - -#------------------------------------------------------------------------------ - -def help(): - - """ - Give the command-line parameters. - """ - - print "" - print "usage: ",sys.argv[0],"[ options ]" - print "options:" - print " -h: this help" - print " -d: name of profiles databank (format='pfam')" - print " -l: name of the profiles list file (name or accession number, default=profiles name)" - print " -o: name of the output file (default=profiles list file+'.getz')" - print " -v: verbose (default=0/1/2)" - print " -n: pfam accession number (default=Not set)" - print "" - -#------------------------------------------------------------------------------ - -def main(): - - DBFileName = "" - outFileName = "" - verbose = 0 - listFileName = "" - accNumber = False - - try: - opts,args=getopt.getopt(sys.argv[1:],"hd:l:o:v:n") - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-d": - DBFileName = a - elif o == "-l": - listFileName = a - elif o == "-o": - outFileName = a - elif o == "-v": - verbose = int(a) - elif o == "-n": - accNumber = True - - - if DBFileName == "" or listFileName == "": - print "*** Error: missing compulsory options" - help() - sys.exit(1) - - if verbose > 0: - print "beginning of %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - if outFileName == "": - outFileName = "%s.getz" % ( listFileName ) - - CompleteProfilesDB = commons.pyRepetUnit.profilesDB.CompleteAProfilesDBFromAFileWithProfilesNamesOrAccNumber.CompleteAProfilesDBFromAFileWithProfilesNamesOrAccNumber() - CompleteProfilesDB.setProfilesDBFile ( DBFileName ) - CompleteProfilesDB.setProfilesToAdd ( listFileName ) - if accNumber == True: - CompleteProfilesDB.setPfamAccNumberKeys () - if verbose > 0: - print "The profiles list is in Accession number" - sys.stdout.flush() - getzCmd = CompleteProfilesDB.CmdToCompleteProfileDB() - f = open( outFileName , 'w') - f.write ( getzCmd ) - f.close() - - if verbose > 0: - fileUtils = FileUtils( ) - if fileUtils.isRessourceExists( outFileName ) and not(fileUtils.isFileEmpty( outFileName )): - print "%s finished successfully" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - else: - print "warning %s execution failed" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - -#------------------------------------------------------------------------------ - -if __name__ == '__main__': - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/datas/ListPfamProfilsInRepbase.txt --- a/commons/pyRepetUnit/profilesDB/tests/datas/ListPfamProfilsInRepbase.txt Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,17 +0,0 @@ -RVT_1 -RVT_2 -rve -zf-CCHC -DDE -hATC -Hermes_DBD -MULE -Exo_endo_phos -Peptidase_C27 -Transposase_mut -InvE -Retrotrans_gag -Chromo -TLV_coat - - |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/datas/ListpfamAccNumber.txt --- a/commons/pyRepetUnit/profilesDB/tests/datas/ListpfamAccNumber.txt Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,6 +0,0 @@ -PF00075 -PF00077 -PF00078 -PF00424 -PF05407 -PF00469 |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/datas/myhmms --- a/commons/pyRepetUnit/profilesDB/tests/datas/myhmms Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1433 +0,0 @@\n-HMMER2.0 [2.3.2]\n-NAME rrm\n-LENG 77\n-ALPH Amino\n-RF no\n-CS no\n-MAP yes\n-COM hmmbuild -A myhmms rrm.sto\n-COM hmmcalibrate myhmms\n-NSEQ 90\n-DATE Thu Jan 8 17:50:18 2009\n-CKSUM 8325\n-XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \n-NULT -4 -8455\n-NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \n-EVD -45.953121 0.233439\n-HMM A C D E F G H I K L M N P Q R S T V W Y \n- m->m m->i m->d i->m i->i d->m d->d b->m m->e\n- -16 * -6492\n- 1 -1084 390 -8597 -8255 -5793 -8424 -8268 2395 -8202 2081 -1197 -8080 -8115 -8020 -8297 -7789 -5911 1827 -7525 -7140 1\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 -16 * \n- 2 -2140 -3785 -6293 -2251 3226 -2495 -727 -638 -2421 -545 -675 -5146 -5554 -4879 -1183 -2536 -1928 267 76 3171 2\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 3 -2542 458 -8584 -8273 -6055 -8452 -8531 2304 -8255 -324 101 -8104 -8170 -8221 -8440 -7840 -5878 3145 -7857 -7333 3\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 4 -1505 -5144 -1922 -558 -1842 2472 -3303 -2213 1099 -5160 -4233 372 -4738 -530 1147 168 498 -4766 -5327 -1476 4\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 5 -3724 -5184 300 -3013 -1655 1803 -3353 -5245 -1569 -2686 -4276 3495 -1963 -1331 -1054 -1472 -3664 -4803 -5369 -2 5\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 6 -1569 -6106 -8967 -8363 555 -8531 -7279 654 -8092 2953 -94 -8220 -7908 -1643 -7682 -7771 -6460 -59 -6191 -6284 6\n- - -151 -504 230 45 -380 399 101 -621 211 -470 -713 278 399 48 91 360 113 -364 -299 -254 \n- - -178 -3113 -12684 -1600 -578 -701 -1378 * * \n- 7 -409 -5130 -215 -2987 -1709 -956 690 -5188 -395 -5144 -4224 729 3054 -2862 -3409 354 1293 -1381 -5321 -4644 13\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 8 -3674 -5118 -1004 639 420 -4652 176 -2050 404 -1039 -935 16 1755 168 147 -275 198 -1472 1889 1977 14\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11642 -12684 -894 -1115 -701 -1378 * * \n- 9 -408 -5134 2415 1299 -950 -66 -767 -1296 -2889 -1843 -4224 1084 -968 -1439 -1854 540 -314 -2304 -5320 -60 15\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 '..b'246 -4848 -4187 461\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11183 -12226 -894 -1115 -186 -3045 * * \n- 285 2163 763 -1619 -5296 2250 -2060 -4007 1241 -4891 -489 484 -4781 -226 -4515 -4692 -678 -1688 -813 264 -3530 462\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11253 -12295 -894 -1115 -701 -1378 * * \n- 286 -268 -329 -158 917 -541 -1990 350 -4851 1273 -1075 388 -1130 233 840 993 -602 801 -595 -4964 -857 463\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11253 -12295 -894 -1115 -701 -1378 * * \n- 287 109 -243 672 2304 -5103 -4283 488 -4854 -1317 -2269 -656 -492 -1519 2679 -655 -618 -3248 -4404 -4965 -1114 464\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11253 -12295 -894 -1115 -701 -1378 * * \n- 288 1312 1294 -6215 -5593 -206 -1244 -4339 2188 -5201 1409 395 -5091 -5478 -4828 -5009 -4538 -3794 1162 -4188 -3846 465\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -23 -11253 -6022 -894 -1115 -701 -1378 * * \n- 289 -3562 799 -5767 -2054 -1235 -2075 318 138 237 2164 1713 -1454 -5145 -1272 -730 -4172 -1640 1071 -3865 -34 466\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11231 -12273 -894 -1115 -1470 -646 * * \n- 290 73 1351 -674 1236 -1549 -2008 1350 -4834 1049 -2498 -3851 1801 -4356 1813 -115 -223 -1582 -1052 -4945 -4262 467\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11231 -12273 -894 -1115 -369 -2147 * * \n- 291 -1739 -320 777 -2654 -1419 -2051 4360 -4707 -1358 -2412 -689 -1300 -4399 -224 537 531 -289 -2010 -4905 -1057 468\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -11253 -12295 -894 -1115 -701 -1378 * * \n- 292 -3345 -4494 -233 -332 -563 -1986 -3051 333 99 1063 -3616 -3072 2953 -1026 -1490 -943 -1528 -1070 -4753 -4151 469\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -10815 -11857 -894 -1115 -701 -1378 * * \n- 293 -6409 -5751 -7614 -7636 2593 -7311 -4003 -5084 -7219 -150 -151 -6210 -7172 -849 -6723 -6510 -6299 -1387 4881 2807 470\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -1 -10749 -11791 -894 -1115 -701 -1378 * * \n- 294 -4057 -3817 -6415 -5791 3203 -1638 -4541 1679 -5412 765 1434 -5333 -5617 -4930 -5182 -4791 -3987 1226 750 -3959 471\n- - * * * * * * * * * * * * * * * * * * * * \n- - * * * * * * * * 0 \n-//\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/datas/profilesDBTest.hmm --- a/commons/pyRepetUnit/profilesDB/tests/datas/profilesDBTest.hmm Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,7162 +0,0 @@\n-HMMER2.0 [2.3.2]\n-NAME RVT_1\n-ACC PF00078.19\n-DESC Reverse transcriptase (RNA-dependent DNA polymerase)\n-LENG 242\n-ALPH Amino\n-RF no\n-CS no\n-MAP yes\n-COM hmmbuild -f -F --prior PRIOR HMM_fs.ann SEED.ann\n-COM hmmcalibrate --seed 0 HMM_fs.ann\n-NSEQ 156\n-DATE Mon Jun 2 18:30:00 2008\n-CKSUM 7481\n-GA 35.2000 35.2000;\n-TC 35.2000 35.2000;\n-NC 35.1000 35.1000;\n-XT -8455 -4 -1000 -1000 -8455 -4 -8455 -4 \n-NULT -4 -8455\n-NULE 595 -1558 85 338 -294 453 -1158 197 249 902 -1085 -142 -21 -313 45 531 201 384 -1998 -644 \n-EVD -10.513688 0.618327\n-HMM A C D E F G H I K L M N P Q R S T V W Y \n- m->m m->i m->d i->m i->i d->m d->d b->m m->e\n- -13 * -6834\n- 1 254 -362 -1116 20 -891 -782 -593 -1348 663 -2265 -4560 682 522 340 223 2070 -1876 -2798 -263 -4972 1\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -3 -26756 -26756 0 -19932 0 -19932 -1013 -8913 \n- 2 -419 -233 -396 -1108 1220 -2792 -3751 -250 -584 -1669 -4321 -1660 2448 -323 -379 -1635 -527 -1337 3626 168 2\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -12 -26767 -7314 0 -19932 0 -19932 -8926 -8910 \n- 3 -3036 1124 -1949 -2086 -484 -1024 1155 -973 1367 -1738 -250 1015 -902 -89 1143 -814 -125 -1397 2962 1591 3\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -3 -26758 -26758 0 -19932 -781 -1259 -8926 -8907 \n- 4 516 -987 -771 -323 -5789 -1603 1192 -740 80 -1399 452 1966 1252 -961 178 229 252 -1273 -632 -4972 4\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -3 -26758 -26758 0 -19932 -781 -1259 -8926 -8904 \n- 5 1343 -1132 -6596 -5963 -4077 -340 -4703 201 -5567 -2165 -675 -770 -2432 -5197 -287 1192 2065 481 -4580 975 5\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -3 -26758 -26758 0 -19932 0 -20712 -8926 -8901 \n- 6 -1152 -5367 -3923 -1459 -2119 -869 -642 -1019 908 -1501 -4470 334 2500 -1749 1764 -1025 141 -13 -594 -1817 6\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -3 -26767 -26767 0 -19932 0 -19932 -8926 -8898 \n- 7 414 -4522 -2360 -2529 -4542 -1623 -4197 1934 -816 267 417 -4460 -2354 -1999 1302 -1950 186 1758 -4919 -4490 7\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -10 -26767 -7603 0 -19932 0 -19932 -8926 -8895 \n- 8 -1232 249 -2517 -1894 2481 -2907 -1402 1076 -826 -485 -144 -5476 -2696 -5208 -3149 -1959 -20 2026 1351 503 8\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -3 -26760 -26760 0 -19932 0 -20598 -8926 -8892 \n- 9 -326 -780 -6569 -1098 1014 -1723 -4705 257 -1888 1172 '..b'179 -3382 -3017 122\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -15 -10636 -11678 -894 -1115 -701 -1378 -7662 -6768 \n- 91 -1419 -2874 -4996 -166 -2834 -4498 -3350 2192 -4047 893 2115 -1277 -4552 898 -425 -1951 -2931 1569 -3326 -2975 123\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -15 -10636 -11678 -894 -1115 -701 -1378 -7662 -6755 \n- 92 -76 -4209 -341 1004 -950 -235 1846 -4278 -1226 -1838 -551 -151 -3808 -565 1304 1164 477 53 -4394 -721 124\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -35 -10636 -6161 -894 -1115 -701 -1378 -7662 -6741 \n- 93 1500 -3036 -4100 -3522 -848 -4290 -3083 -269 1297 -1148 1015 344 -4355 -811 1917 -3310 743 248 -3462 -3074 125\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -82 -10616 -4462 -894 -1115 -1200 -824 -7662 -6728 \n- 94 -232 623 -5382 -4748 3758 -4590 -3444 -657 -4344 426 -2 -4233 -4630 -3956 -1660 -3676 -2979 -2255 -3285 1780 126\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -15 -10549 -11591 -894 -1115 -2164 -364 -7662 -6714 \n- 95 -2923 -2753 -5240 -4606 -782 -2061 -3337 1062 -1449 1644 2573 -4104 -4517 -862 878 -1538 150 -96 -3210 1568 127\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -15 -10549 -11592 -894 -1115 -2164 -364 -7662 -6700 \n- 96 978 -4137 -106 675 -4458 8 289 -4209 991 -4153 -379 1210 -3731 767 1934 -484 -1280 -3759 -4320 -3637 128\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -16 -10551 -11593 -894 -1115 -2164 -364 -7662 -6688 \n- 97 -1890 -5006 -7160 -7517 -7033 3792 -6646 -7516 -7403 -7615 -6806 -6070 -6009 -6947 -7027 -4766 -4978 -6286 719 -6963 129\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -37 -10550 -6074 -894 -1115 -576 -1603 -7662 -6672 \n- 98 -1954 -5230 -8287 -7756 -3698 -8091 -6961 -272 -7594 3060 1462 -7802 -7231 -6491 -7169 -7468 -5696 303 -5529 -5708 130\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -16 -10591 -11633 -894 -1115 -320 -2331 -7662 -6658 \n- 99 -977 -4213 252 -2039 -4534 -1329 -71 -4284 999 -787 -3302 2027 -922 385 2239 -660 -231 -3835 1268 -871 131\n- - -149 -500 233 43 -381 399 106 -626 210 -466 -720 275 394 45 96 359 117 -369 -294 -249 \n- - -16 -10637 -11679 -894 -1115 -701 -1378 -7662 -6644 \n- 100 -1418 -4205 1277 1300 -1156 -249 666 -936 -491 -2013 -3295 -979 1463 75 844 -2623 643 -1003 406 42 132\n- - * * * * * * * * * * * * * * * * * * * * \n- - * * * * * * * -7662 0 \n-//\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/pyRepetUnit/profilesDB/tests/profilesDBTestSuite.py --- a/commons/pyRepetUnit/profilesDB/tests/profilesDBTestSuite.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,27 +0,0 @@ -import unittest -import sys -import TestProfilesDB2Map -import TestAcceptanceProfilesDB2Map -import TestCompleteProfilesDBFromProfilesNameListOrAccNumber -import TestAcceptanceCompleteProfilDB_script -import TestProfilesDB4Repet -import TestAcceptanceProfilesDB4Repet -import TestInsertProfilesMapFileInDB - -def main(): - - profilesDBTestSuite = unittest.TestSuite() - profilesDBTestSuite.addTest(unittest.makeSuite(TestProfilesDB2Map.TestProfilesDB2Map,'test')) - profilesDBTestSuite.addTest(unittest.makeSuite(TestAcceptanceProfilesDB2Map.TestAcceptanceProfilesDB2Map,'test')) - profilesDBTestSuite.addTest(unittest.makeSuite(TestCompleteProfilesDBFromProfilesNameListOrAccNumber.TestCompleteProfilesDBFromProfilesNameListOrAccNumber, 'test')) - profilesDBTestSuite.addTest(unittest.makeSuite(TestAcceptanceCompleteProfilDB_script.TestAcceptanceCompleteProfilDB_script, 'test')) - profilesDBTestSuite.addTest(unittest.makeSuite(TestProfilesDB4Repet.TestProfilesDB4Repet, 'test')) - profilesDBTestSuite.addTest(unittest.makeSuite(TestAcceptanceProfilesDB4Repet.TestAcceptanceProfilesDB4Repet, 'test')) - profilesDBTestSuite.addTest(unittest.makeSuite(TestInsertProfilesMapFileInDB.TestInsertProfilesMapFileInDB, 'test')) - - runner = unittest.TextTestRunner(sys.stderr, 2, 2) - runner.run(profilesDBTestSuite) - - -if __name__ == '__main__': - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/AlignTEOnGenomeAccordingToAnnotation.py --- a/commons/tools/AlignTEOnGenomeAccordingToAnnotation.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,282 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-import re\n-import os\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.checker.ConfigChecker import ConfigRules, ConfigChecker\n-import subprocess\n-from commons.core.seq.AlignedBioseqDB import AlignedBioseqDB\n-from commons.core.sql.TableSeqAdaptator import TableSeqAdaptator\n-from commons.core.coord.PathUtils import PathUtils\n-from commons.core.coord.SetUtils import SetUtils\n-from commons.core.sql.TablePathAdaptator import TablePathAdaptator\n-from commons.core.coord.Set import Set\n-from commons.core.sql.DbFactory import DbFactory\n-\n-## Align a TE on genome according to annotation\n-\n-LOG_DEPTH = "repet.tools"\n-\n-class AlignTEOnGenomeAccordingToAnnotation(object):\n- \n- def __init__(self, pathTableName = "", queryTableName = "", subjectTableName = "", mergeSamePathId = False, outTableName = "", matchPenality=10, mism=8, gapo=16, gape=4, gapl=20, configFileName = "", doClean = False, verbosity = 0):\n- self._pathTableName = pathTableName\n- self._queryTableName = queryTableName\n- self._subjectTableName = subjectTableName\n- self._mergeSamePathId = mergeSamePathId\n- self.setOutTableName(outTableName)\n- self._matchPenality = matchPenality\n- self._mismatch = mism\n- self._gapOpening = gapo\n- self._gapExtend = gape\n- self._gapLength = gapl\n- self._configFileName = configFileName\n- self._doClean = doClean\n- self._verbosity = verbosity\n- self._iDb = None\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def setAttributesFromCmdLine(self):\n- description = "Align a TE on genome according to annotation."\n- epilog = "\\nExample 1: launch without verbosity and keep temporary files.\\n"\n- epilog += "\\t$ python AlignTEOnGenomeAccordingToAnnotation.py -p DmelChr4_chr_allTEs_nr_noSSR_join_path -q DmelChr4_chr_seq -s DmelChr4_refTEs_seq -v 0"\n- epilog += "\\n"\n- parser = RepetOptionParser(description = description, epilog = epilog)\n- parser.add_option("-p", "--path", dest = "pathTableName", action = "store", type = "string", help = "path table name [compulsory] [format: path]", default = "")\n- parser.ad'..b's : is it correct ? matcher allow overlap on query and not on subject ?\n- iSubjectBioseq = iSubjectTSA.getBioseqFromSetList(lSubjectSets)\n- iAlignedBioseqDB = self.alignBioseqWithNWalign(iQueryBioseq, iSubjectBioseq)\n- self._insertAlignedBioseqDBWithScoreAndIdentityInTable(pathNum, iAlignedBioseqDB)\n- else:\n- lPathId = iTPA.getIdList()\n- pathNb = len(lPathId)\n- count = 0\n- for pathNum in lPathId:\n- self._log.debug(count,"/",pathNb,"=>path",pathNum,"...")\n- lPaths = iTPA.getPathListFromId(pathNum)\n- queryName = lPaths[0].getQueryName()\n- subjectName = lPaths[0].getSubjectName()\n- lQueryStart = []\n- lQueryEnd = []\n- lSubjectStart = []\n- lSubjectEnd = []\n- isReversed = not lPaths[0].isSubjectOnDirectStrand()\n- for iPath in lPaths:\n- lQueryStart.append(iPath.getQueryStart())\n- lQueryEnd.append(iPath.getQueryEnd())\n- lSubjectStart.append(iPath.getSubjectStart())\n- lSubjectEnd.append(iPath.getSubjectEnd())\n- queryStart = min(lQueryStart)\n- queryEnd = max(lQueryEnd)\n- if isReversed:\n- subjectStart = max(lSubjectStart)\n- subjectEnd = min(lSubjectEnd)\n- else:\n- subjectStart = min(lSubjectStart)\n- subjectEnd = max(lSubjectEnd)\n- lQuerySets = [Set(pathNum,subjectName, queryName,queryStart,queryEnd)]\n- lSubjectSets = [Set(pathNum,queryName, subjectName,subjectStart,subjectEnd)]\n- \n- iQueryBioseq = iQueryTSA.getBioseqFromSetList(lQuerySets)\n- iSubjectBioseq = iSubjectTSA.getBioseqFromSetList(lSubjectSets)\n- iAlignedBioseqDB = self.alignBioseqWithNWalign(iQueryBioseq, iSubjectBioseq)\n- self._insertAlignedBioseqDBWithScoreAndIdentityInTable(pathNum, iAlignedBioseqDB)\n- \n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- if self._configFileName:\n- self._checkConfig()\n- self._iDb = DbFactory.createInstance()\n- self._checkOptions()\n- self._log.info("START AlignTEOnGenomeAccordingToAnnotation")\n- self._log.debug("path table name: %s" % self._pathTableName)\n- self._log.debug("query table name: %s" % self._queryTableName)\n- self._log.debug("subject table name: %s" % self._subjectTableName)\n- self.alignSeqAccordingToPathAndBuildAlignedSeqTable()\n- self._iDb.close()\n- self._log.info("END AlignTEOnGenomeAccordingToAnnotation")\n-\n- def _insertAlignedBioseqDBWithScoreAndIdentityInTable(self, pathNum, iAlignedBioseqDB):\n- scoreWithEndLine = re.split("Score=", iAlignedBioseqDB.db[0].header)[1]\n- score = int(scoreWithEndLine.split()[0])\n- \n- identity = re.split("Identity=", scoreWithEndLine)[1]\n- if identity == "nan":\n- identity = "0.0"\n- identity = float(identity)*100.0\n- \n- #TODO: create TableAlignedSeqAdaptator (to use insert...)\n- sqlCmd = \'INSERT INTO %s VALUES (%d,"%s","%s", %d,%f);\' % (self._outTableName, pathNum, iAlignedBioseqDB.db[0].sequence, iAlignedBioseqDB.db[1].sequence, score, identity)\n- self._iDb.execute(sqlCmd)\n- \n- self._log.debug("header:", iAlignedBioseqDB.db[0].header)\n- self._log.debug("path", pathNum, "Score=", score, "Identity=", identity, "ok")\n- self._log.debug(iAlignedBioseqDB.db[0].sequence[:80])\n- self._log.debug(iAlignedBioseqDB.db[1].sequence[:80])\n-\n-if __name__ == "__main__":\n- iLaunch = AlignTEOnGenomeAccordingToAnnotation()\n- iLaunch.setAttributesFromCmdLine()\n- iLaunch.run() \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/AnnotationStats.py --- a/commons/tools/AnnotationStats.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,374 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-##@file\n-# Give summary information on a TE annotation table.\n-# options:\n-# -h: this help\n-# -t: analysis type (default = 1, 1: per transposable element (TE), 2: per cluster, 3: per classification, 4: with map input file)\n-# -p: name of the table (_path) or file (.path) with the annotated TE copies\n-# -s: name of the table (_seq) or file (.fasta or .fa) with the TE reference sequences\n-# -g: length of the genome (in bp)\n-# -m: name of the file with the group and the corresponding TE names (format = \'map\')\n-# -o: name of the output file (default = pathTableName + \'_stats.txt\')\n-# -C: name of the configuration file to access MySQL (e.g. \'TEannot.cfg\')\n-# -c: remove map files and blastclust file (if analysis type is 2 or 3)\n-# -I: identity coverage threshold (default = 0)\n-# -L: length coverage threshold (default=0.8)\n-# -v: verbosity level (default = 0)\n-\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.stat.Stat import Stat\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.core.sql.TablePathAdaptator import TablePathAdaptator\n-from commons.core.sql.TableSeqAdaptator import TableSeqAdaptator\n-from commons.tools.getCumulLengthFromTEannot import getCumulLengthFromTEannot\n-\n-LOG_DEPTH = "repet.tools"\n-\n-#TODO: use templating engine instead of raw strings for AnnotationStatsWriter\n-class AnnotationStats( object ):\n-\n- def __init__(self, analysisName="TE", clusterFileName="",seqTableName="", pathTableName="", genomeLength=0, statsFileName="", globalStatsFileName="", verbosity=3):\n- self._analysisName = analysisName\n- self._clusterFileName = clusterFileName\n- self._seqTableName = seqTableName\n- self._pathTableName = pathTableName\n- self._genomeLength = genomeLength\n- self._statsFileName = statsFileName\n- self._globalStatsFileName = globalStatsFileName\n- self._iDb = None\n- self._iTablePathAdaptator = None\n- self._iTableSeqAdaptator = None\n- self._save = False\n- self._clean = False\n- self._verbosity = verbosity\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def _logAndRaise(self, errorMsg):\n- self._log.error(errorMsg)\n- raise Exception(errorMsg)'..b'tsAllCopiesMedIdentity" ].add( dOneTErefseq[ "statsIdentityPerChain" ].median() )\n- \n- if dOneTErefseq[ "statsLengthPerChainPerc" ].getValuesNumber() != 0:\n- self._dAllTErefseqs[ "statsAllCopiesMedLengthPerc" ].add( dOneTErefseq[ "statsLengthPerChainPerc" ].median() )\n-\n- def printStatsForAllTEs(self, TEnb):\n-# statString += "(sum of cumulative coverages: %i bp)" % ( self._dAllTErefseqs[ "sumCumulCoverage" ] )\n- statString = "total nb of TE fragments: %i\\n" % ( self._dAllTErefseqs[ "totalNbFragments" ] )\n- \n- if self._dAllTErefseqs[ "totalNbFragments" ] != 0:\n- \n- statString += "total nb full-length fragments: %i (%.2f%%)\\n" % \\\n- ( self._dAllTErefseqs[ "totalNbFullLengthFragments" ], \\\n- 100*self._dAllTErefseqs[ "totalNbFullLengthFragments" ] / float(self._dAllTErefseqs[ "totalNbFragments" ]) )\n- \n- statString += "total nb of TE copies: %i\\n" % ( self._dAllTErefseqs[ "totalNbCopies" ] )\n- \n- statString += "total nb full-length copies: %i (%.2f%%)\\n" % \\\n- ( self._dAllTErefseqs[ "totalNbFullLengthCopies" ], \\\n- 100*self._dAllTErefseqs[ "totalNbFullLengthCopies" ] / float(self._dAllTErefseqs[ "totalNbCopies" ]) )\n- \n- statString += "families with full-length fragments: %i (%.2f%%)\\n" % \\\n- ( self._dAllTErefseqs[ "nbFamWithFullLengthFragments" ], \\\n- 100*self._dAllTErefseqs[ "nbFamWithFullLengthFragments" ] / float(TEnb) )\n- statString += " with only one full-length fragment: %i\\n" % ( self._dAllTErefseqs[ "nbFamWithOneFullLengthFragment" ] )\n- statString += " with only two full-length fragments: %i\\n" % ( self._dAllTErefseqs[ "nbFamWithTwoFullLengthFragments" ] )\n- statString += " with only three full-length fragments: %i\\n" % ( self._dAllTErefseqs[ "nbFamWithThreeFullLengthFragments" ] )\n- statString += " with more than three full-length fragments: %i\\n" % ( self._dAllTErefseqs[ "nbFamWithMoreThanThreeFullLengthFragments" ] )\n- \n- statString += "families with full-length copies: %i (%.2f%%)\\n" % \\\n- ( self._dAllTErefseqs[ "nbFamWithFullLengthCopies" ], \\\n- 100*self._dAllTErefseqs[ "nbFamWithFullLengthCopies" ] / float(TEnb) )\n- statString += " with only one full-length copy: %i\\n" % ( self._dAllTErefseqs[ "nbFamWithOneFullLengthCopy" ] )\n- statString += " with only two full-length copies: %i\\n" % ( self._dAllTErefseqs[ "nbFamWithTwoFullLengthCopies" ] )\n- statString += " with only three full-length copies: %i\\n" % ( self._dAllTErefseqs[ "nbFamWithThreeFullLengthCopies" ] )\n- statString += " with more than three full-length copies: %i\\n" % ( self._dAllTErefseqs[ "nbFamWithMoreThanThreeFullLengthCopies" ] )\n- \n- statString += "mean of median identity of all families: %.2f +- %.2f\\n" % \\\n- ( self._dAllTErefseqs[ "statsAllCopiesMedIdentity" ].mean(), \\\n- self._dAllTErefseqs[ "statsAllCopiesMedIdentity" ].sd() )\n- \n- statString += "mean of median length percentage of all families: %.2f +- %.2f\\n" % \\\n- ( self._dAllTErefseqs[ "statsAllCopiesMedLengthPerc" ].mean(), \\\n- self._dAllTErefseqs[ "statsAllCopiesMedLengthPerc" ].sd() )\n- return statString\n- \n- def printResume(self, lNamesTErefseq, lDistinctSubjects, totalCumulCoverage, genomeLength):\n- statString = "nb of sequences: %i\\n" % len(lNamesTErefseq)\n- statString += "nb of matched sequences: %i\\n" % len(lDistinctSubjects)\n- statString += "cumulative coverage: %i bp\\n" % totalCumulCoverage\n- statString += "coverage percentage: %.2f%%\\n" % ( 100 * totalCumulCoverage / float(genomeLength) )\n-# statString += "processing the %i TE families..." % len(lNamesTErefseq)\n- return statString\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/BenchmarkTEconsensus.py --- a/commons/tools/BenchmarkTEconsensus.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,567 +0,0 @@\n-#!/usr/bin/env python\n-\n-##@file\n-# Compare two fasta files of TEs to assess how reference sequences are recovered by de novo consensus.\n-\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-\n-import os\n-import sys\n-import getopt\n-import shutil\n-import glob\n-\n-\n-import pyRepet.launcher.programLauncher\n-from commons.core.coord.AlignUtils import AlignUtils\n-from commons.core.coord.MatchUtils import MatchUtils\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.seq.AlignedBioseqDB import AlignedBioseqDB\n-from commons.core.seq.FastaUtils import FastaUtils\n-from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders\n-\n-\n-class BenchmarkTEconsensus( object ):\n- \n- def __init__( self ):\n- self._qryFile = ""\n- self._sbjFile = ""\n- self._method = 1\n- self._keepConflictSbj = False\n- self._thresholdCoverage = 95\n- self._thresholdIdentity = 80\n- self._thresholdEvalue = 1e-10\n- self._thresholdCoverageMatch = 90\n- self._useCluster = False\n- self._queue = ""\n- self._configFileName = ""\n- self._clean = False\n- self._verbose = 0\n- self._pL = pyRepet.launcher.programLauncher.programLauncher()\n- \n- \n- def help( self ):\n- print\n- print "usage: BenchmarkTEconsensus.py [ options ]"\n- print "options:"\n- print " -h: this help"\n- print " -q: name of the query file (de novo consensus, format=\'fasta\')"\n- print " -s: name of the subject file (reference sequences, format=\'fasta\')"\n- print " -m: method"\n- print " 1: Blaster + Matcher (default)"\n- print " 2: Blaster + merge + Matcher (not with \'-Q\')"\n- print " 3: Orienter + Mafft + Matcher"\n- print " 4: Yass + Matcher"\n- print " -a: keep all conflicting subjects in Matcher"\n- print " -t: coverage threshold over which the match is \'complete\' (in %% of the seq length, default=%i)" % self._thresholdCoverage\n- print " -I: identity threshold for \'CC\' matches (default=%i)" % self._thresholdIdentity\n- print " -E: E-value threshold for \'CC\' matches (default=1e-10)"\n- print " -T: coverage threshold for match length on query compare to subject length (default=%i)" % self._thresholdCoverageMatch\n- print " -Q: queue name to run in paral'..b'\n- self._sbjFile,\n- self._method ),\n- tmpFile )\n- else:\n- tmpFile = "%s_vs_%s.m%i.align" % ( self._qryFile,\n- self._sbjFile,\n- self._method )\n- \n- prg = os.environ["REPET_PATH"] + "/bin/matcher"\n- cmd = prg\n- cmd += " -m %s" % ( tmpFile )\n- cmd += " -q %s" % ( self._qryFile )\n- cmd += " -s %s" % ( self._sbjFile )\n- cmd += " -j"\n- if self._keepConflictSbj:\n- cmd += " -a"\n- cmd += " -v %i" % ( self._verbose )\n- self._pL.launch( prg, cmd )\n- \n- csh = ChangeSequenceHeaders()\n- csh.setInputFile( matchFile )\n- csh.setFormat( "tab" )\n- csh.setStep( 2 )\n- csh.setLinkFile( "%slink" % ( self._qryFile ) )\n- csh.setOutputFile( matchFile.replace(".newH","") )\n- csh.run()\n- \n- csh.setInputFile( pathFile )\n- csh.setFormat( "path" )\n- csh.setStep( 2 )\n- csh.setOutputFile( pathFile.replace(".newH","") )\n- csh.run()\n- \n- return matchFile.replace(".newH",""), pathFile.replace(".newH","")\n- \n- \n- def analyzeMatchFile( self, matchFile, pathFile ):\n- if matchFile != "":\n- if self._verbose > 0:\n- print "analyze the \'tab\' file..."\n- sys.stdout.flush()\n- prg = os.environ["REPET_PATH"] + "/bin/tabFileReader.py"\n- cmd = prg\n- cmd += " -m %s" % ( matchFile )\n- cmd += " -q %s" % ( self._qryFile.replace(".newH","") )\n- cmd += " -s %s" % ( self._sbjFile.replace(".newH","") )\n- cmd += " -t %i" % ( self._thresholdCoverage )\n- cmd += " -I %i" % ( self._thresholdIdentity )\n- cmd += " -E %g" % ( self._thresholdEvalue )\n- cmd += " -T %i" % ( self._thresholdCoverageMatch )\n- cmd += " -v %i" % ( self._verbose - 1 )\n- self._pL.launch( prg, cmd )\n- for f in [ matchFile, pathFile,\n- "%s_tabFileReader.txt" % matchFile,\n- "%s_qryCategories.txt" % matchFile,\n- "%s_sbjCategories.txt" % matchFile ]:\n- shutil.copy( f, ".." )\n- os.chdir( ".." )\n- \n- \n- def start( self ):\n- self.checkAttributes()\n- if self._verbose > 0:\n- print "START BenchmarkTEconsensus.py"\n- sys.stdout.flush()\n- \n- \n- def end( self ):\n- if self._clean:\n- tmpDir = "tmp%s_t%i_m%i_I%i" % ( os.getpid(),\n- self._thresholdCoverage,\n- self._method,\n- self._thresholdIdentity )\n- shutil.rmtree( tmpDir )\n- if self._verbose > 0:\n- print "END BenchmarkTEconsensus.py"\n- sys.stdout.flush()\n- \n- \n- def run( self ):\n- self.start()\n- \n- self.preprocess()\n- \n- if self._method == 1:\n- matchFile, pathFile = self.compareFastaViaBlasterMatcher()\n- elif self._method == 2:\n- matchFile, pathFile = self.compareFastaViaBlasterMatcher( merged=True )\n- elif self._method == 3:\n- matchFile, pathFile = self.compareFastaViaMafft()\n- elif self._method == 4:\n- matchFile, pathFile = self.compareFastaViaYassMatcher()\n- \n- self.analyzeMatchFile( matchFile, pathFile )\n- \n- self.end()\n- \n- \n-if __name__ == "__main__":\n- i = BenchmarkTEconsensus()\n- i.setAttributesFromCmdLine()\n- i.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/CalcCoordCumulLength.py --- a/commons/tools/CalcCoordCumulLength.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,186 +0,0 @@ -#!/usr/bin/env python - -""" -Calculate the cumulative length of coordinates data in the L{Map<commons.coreMap>} format. -""" - -import os -import sys -import getopt -from pyRepet.launcher.programLauncher import programLauncher -from pyRepet.util.Stat import Stat -from commons.core.checker.CheckerUtils import CheckerUtils - - -class CalcCoordCumulLength( object ): - """ - Compute the coverage of coordinates data in the L{Map<commons.core.ccommons.core """ - - - def __init__( self ): - """ - Constructor. - """ - self._inFileName = "" - self._outFileName = "" - self._verbose = 0 - - - def help( self ): - """ - Display the help on stdout. - """ - print "usage:",sys.argv[0]," [ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (format='map')" - print " -o: name of the output file (default=inFileName+'.coverage')" - - - def setAttributesFromCmdLine( self ): - """ - Set the attributes from the command-line. - """ - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:o:v:") - except getopt.GetoptError, err: - print str(err); self.help(); sys.exit(1) - for o,a in opts: - if o == "-h": - self.help(); sys.exit(0) - elif o == "-i": - self.setInputFileName( a ) - elif o == "-o": - self._outFileName = a - elif o == "-v": - self._verbose = int(a) - - - def setInputFileName( self, inFileName ): - self._inFileName = inFileName - - def setVerbose( self, verbose ): - self._verbose = int(verbose) - - def checkAttributes( self ): - """ - Check the attributes are valid before running the algorithm. - """ - if self._inFileName == "": - print "ERROR: missing input file" - self.help(); sys.exit(1) - if not os.path.exists( self._inFileName ): - print "ERROR: can't find file '%s'" % ( self._inFileName ) - self.help(); sys.exit(1) - if self._outFileName == "": - self._outFileName = "%s.coverage" % ( self._inFileName ) - - - def mergeCoordinates( self ): - """ - Merge the coordinates with 'mapOp'. - """ - if self._verbose > 0: - print "merge the coordinates with mapOp..."; sys.stdout.flush() - if not CheckerUtils.isExecutableInUserPath( "mapOp" ): - msg = "ERROR: 'mapOp' is not in your PATH" - sys.stderr.write( "%s\n" % msg ) - sys.exit(1) - pL = programLauncher() - prg = os.environ["REPET_PATH"] + "/bin/mapOp" - cmd = prg - cmd += " -q %s" % ( self._inFileName ) - cmd += " -m" - cmd += " > /dev/null" - pL.launch( prg, cmd, self._verbose - 1 ) - if self._verbose > 0: - print "coordinates merged !"; sys.stdout.flush() - mergeFileName = "%s.merge" % ( self._inFileName ) - inPath, inName = os.path.split( self._inFileName ) - if inPath != "": - os.system( "mv %s.merge %s" % ( inName, inPath ) ) - return mergeFileName - - - def getStatsPerChr( self, mergeFileName ): - """ - Return summary statistics on the coordinates, per chromosome. - @param mergeFileName: L{Map<commons.core.coord.Macommons.coreype mergeFileName: string - @return: dictionary whose keys are the chromosomes of the 'map file and values are L{Stat<pyRepet.util.Stat>} instances - """ - dChr2Stats = {} - if self._verbose > 0: - print "compute the coverage of the coordinates..."; sys.stdout.flush() - mergeF = open( mergeFileName, "r" ) - line = mergeF.readline() - while True: - if line == "": break - tokens = line[:-1].split("\t") - if int(tokens[2]) < int(tokens[3]): - matchLength = int(tokens[3]) - int(tokens[2]) + 1 - elif int(tokens[2]) > int(tokens[3]): - matchLength = int(tokens[2]) - int(tokens[3]) + 1 - if not dChr2Stats.has_key( tokens[1] ): - dChr2Stats[ tokens[1] ] = Stat() - dChr2Stats[ tokens[1] ].add( matchLength ) - line = mergeF.readline() - mergeF.close() - os.remove( mergeFileName ) - return dChr2Stats - - - def saveCumulLength( self, dChr2Stats ): - """ - Write the stats in the output file. - """ - outF = open( self._outFileName, "w" ) - totalLength = 0 - for i in dChr2Stats.keys(): - totalLength += dChr2Stats[i].sum - string = "cumulative length (in bp) on '%s': %i" % ( i, dChr2Stats[i].sum ) - outF.write( "%s\n" % ( string ) ) - if self._verbose > 0: print string - string = "total cumulative length (in bp): %i" % ( totalLength ) - outF.write( "%s\n" % ( string ) ) - if self._verbose > 0: print string - outF.close() - sys.stdout.flush() - - - def start( self ): - """ - Useful commands before running the program. - """ - if self._verbose > 0: - print "beginning of %s" % (sys.argv[0].split("/")[-1]); sys.stdout.flush() - self.checkAttributes() - if self._verbose > 0: - print "input file : '%s'" % ( self._inFileName ) - sys.stdout.flush() - - - def end( self ): - """ - Useful commands before ending the program. - """ - if self._verbose > 0: - print "%s finished successfully" % (sys.argv[0].split("/")[-1]); sys.stdout.flush() - - - def run( self ): - """ - Run the program. - """ - self.start() - mergeFileName = self.mergeCoordinates() - dChr2Stats = self.getStatsPerChr( mergeFileName ) - self.saveCumulLength( dChr2Stats ) - self.end() - - -if __name__ == '__main__': - i = CalcCoordCumulLength() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/ChangeSequenceHeaders.py --- a/commons/tools/ChangeSequenceHeaders.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,524 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-\n-import os\n-import sys\n-import getopt\n-from commons.core.coord.Align import Align\n-from commons.core.coord.Path import Path\n-from commons.core.coord.Match import Match\n-\n-\n-\n-class ChangeSequenceHeaders( object ):\n- \n- def __init__( self, name="ChangeSequenceHeaders", inFile="", format="", step=0, prefix="seq", outFile="",linkFile="", whichCluster = "", replace_query=True, replace_subject=True, verbosity=0):\n- self._name = name\n- self._inFile = inFile\n- self._format = format\n- self._step = step\n- self._prefix = prefix\n- self._linkFile = linkFile\n- self._whichCluster = whichCluster\n- self._outFile = outFile\n- self.replace_query = replace_query\n- self.replace_subject = replace_subject\n- self._verbose = verbosity\n- \n- \n- def help( self ):\n- print\n- print "usage: %s.py [ options ]" % ( self._name )\n- print "options:"\n- print " -h: this help"\n- print " -i: name of the input file"\n- print " -f: format of the input file (fasta/newick/align/path/tab)"\n- print " -s: step (1: shorten headers / 2: retrieve initial headers)"\n- print " -p: prefix of new headers (with \'-s 1\', default=\'seq\')"\n- print " -l: name of the \'link\' file (with \'-s 2\', format=map)"\n- print " -w: header formatting type (A: after LTRharvest, B: for ClusterConsensus, not specified: no change)"\n- print " -o: name of the output file (default=inFile+\'.newH\'/\'.initH\')"\n- print\n- \n- \n- def setAttributesFromCmdLine( self ):\n- try:\n- opts, args = getopt.getopt(sys.argv[1:],"hi:f:s:p:l:w:o:v:")\n- except getopt.GetoptError, err:\n- sys.stderr.write( "%s\\n" % ( str(err) ) )\n- self.help(); sys.exit(1)\n- for o,a in opts:\n- if o == "-h":\n- self.help(); sys.exit(0)\n- elif o == "-i":\n- self.setInputFile( a )\n- elif o == "-f":\n- self.setFormat( a )\n- elif o == "-s":\n- self.setStep( a )\n- elif o == "-p":\n- self.setPrefix( a )\n- elif o == "-l":\n- self.setLinkFile( a )\n- elif o == "-w":\n- self.setWhichcluste'..b'elems[2], elems[3], elems[4], elems[5], query_seqname, elems[7], elems[8],elems[9],elems[10], elems[11], elems[12],elems[13],elems[14].strip(\'\\n\').strip(\'\\r\')]\n- newLine = "\\t".join(modedelems)\n- outFileHandler.write("%s\\n" % newLine)\n- if self._verbose >0 :\n- print("query", query_seqname, "subject", subject_seqname)\n- print("Output lastz_line : line %s " % newLine)\n- except: pass\n- inFileHandler.close()\n- outFileHandler.close()\n- \n- def retrieveInitialSequenceHeadersForChainFile( self, dNew2Init):\n- #format: chain score tName tSize tStrand tStart tEnd qName qSize qStrand qStart qEnd id \n- inFileHandler = open( self._inFile, "r" )\n- outFileHandler = open( self._outFile, "w" )\n- while True:\n- try:\n- line = inFileHandler.next()\n- except StopIteration:\n- break\n- if line == "" or not "seq" in line:\n- outFileHandler.write(line)\n- else :\n- elems = line.split(" ")\n- try:\n- subject_seqname = elems[2]\n- if self.replace_subject :\n- nameToBeReplaced = elems[2]\n- if dNew2Init.has_key( nameToBeReplaced ):\n- subject_seqname = dNew2Init[nameToBeReplaced]\n- subject_seqname = subject_seqname.strip(\'\\n\').strip(\'\\r\')\n- \n- query_seqname = elems[7]\n- if self.replace_query:\n- nameToBeReplaced = elems[7]\n- if dNew2Init.has_key( nameToBeReplaced ):\n- query_seqname = dNew2Init[nameToBeReplaced]\n- query_seqname = query_seqname.strip(\'\\n\').strip(\'\\r\')\n- \n- modedelems = elems[:]\n- modedelems[2] = subject_seqname\n- modedelems[7] = query_seqname\n- newLine = " ".join(modedelems)\n- outFileHandler.write("%s\\n" % newLine)\n- except: pass\n- \n- inFileHandler.close()\n- outFileHandler.close() \n- \n- \n- def run( self ):\n- self.checkAttributes()\n- if self._step == 1:\n- if self._linkFile == "":\n- self._linkFile = "%s.newHlink" % ( self._inFile )\n- if self._format == "fasta":\n- self.shortenSequenceHeadersForFastaFile()\n- if self._step == 2:\n- dNew2Init = self.getLinksNewToInitialHeaders()\n- if self._format == "fasta":\n- self.retrieveInitialSequenceHeadersForFastaFile( dNew2Init )\n- elif self._format == "newick":\n- self.retrieveInitialSequenceHeadersForNewickFile( dNew2Init )\n- elif self._format == "align":\n- self.retrieveInitialSequenceHeadersForAlignFile( dNew2Init )\n- elif self._format == "path":\n- self.retrieveInitialSequenceHeadersForPathFile( dNew2Init )\n- elif self._format == "axt":\n- self.retrieveInitialSequenceHeadersForAxtFile( dNew2Init)\n- elif self._format == "psl":\n- self.retrieveInitialSequenceHeadersForPslFile( dNew2Init)\n- elif self._format == "lastz":\n- self.retrieveInitialSequenceHeadersForLastZFile(dNew2Init)\n- elif self._format == "chain":\n- self.retrieveInitialSequenceHeadersForChainFile(dNew2Init)\n- elif self._format in [ "tab", "match" ]:\n- self.retrieveInitialSequenceHeadersForMatchFile( dNew2Init )\n- \n- \n-if __name__ == "__main__":\n- i = ChangeSequenceHeaders()\n- i.setAttributesFromCmdLine()\n- i.run()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/CheckMysqlConnect.py --- a/commons/tools/CheckMysqlConnect.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,86 +0,0 @@ -#!/usr/bin/env python - -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import sys -import os -from commons.core.utils.RepetOptionParser import RepetOptionParser -from commons.core.checker.RepetException import RepetException -from commons.tools.CleanClusterNodesAfterRepet import CleanClusterNodesAfterRepet - -REPET_PATH = os.environ.get("REPET_PATH") - -def main(): - - description = "Check MySQL connection on each node" - usage = "CheckMysqlConnect.py [options]" - examples = "\nExample 1: check MySQL connection from every node of a SGE cluster using environment variables:\n" - examples += "\t$ python CheckMysqlConnect.py" - examples += "\n\t" - examples += "\nExample 2: check MySQL connection from every node of a SGE cluster using configuration file:\n" - examples += "\t$ python CheckMysqlConnect.py -C configFileName" - examples += "\n\t" - examples += "\nExample 3: check MySQL connection from every node of a SGE cluster using environment variables and using a different python executable than the one in the PATH:\n" - examples += "\t$ python CheckMysqlConnect.py -p /path/to/python" - examples += "\n\n" - - parser = RepetOptionParser(description = description, usage = usage, version = "v1.0", epilog = examples) - parser.add_option( "-p", "--path", dest = "pythonPath", type = "string", help = "path to python executable ('python' included, without finishing '/')", default = "python") - parser.add_option( "-C", "--config", dest = "config", type = "string", help = "path to config file", default = "") - - options, args = parser.parse_args() - pythonPath = options.pythonPath - configFile = options.config - - iCleanClusterNodesAfterRepet = CleanClusterNodesAfterRepet() - nodesList = iCleanClusterNodesAfterRepet.getAllNodesList() - - nbNodes = len(nodesList) - nodeCount = 0 - configOption = "" - for node in nodesList: - try: - nodeCount += 1 - print "Connect to node '%s' (%i/%i)..." % (node, nodeCount, nbNodes) - sys.stdout.flush() - cmd = "ssh" - cmd += " -q %s " % ( node ) - if configFile != "": - configOption = " -C %s" % configFile - cmd += "'%s %s/bin/MysqlConnect.py -n %s %s'" % (pythonPath, REPET_PATH, node, configOption) - os.system(cmd) - except RepetException, e: - print e.getMessage() - - iCleanClusterNodesAfterRepet.clean() - -if __name__ == '__main__': - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/CleanClusterNodesAfterRepet.py --- a/commons/tools/CleanClusterNodesAfterRepet.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,177 +0,0 @@ -#!/usr/bin/env python - -## @file -# Clean the cluster nodes after REPET was used. -# -# usage: CleanClusterNodesAfterRepet.py [ options ] -# options: -# -h: this help -# -n: node to clean (otherwise all nodes will be cleaned) -# -t: temporary directory (e.g. '/tmp') -# -p: pattern (e.g. 'DmelChr4*') -# -v: verbosity level (default=0/1/2) - -import os -import sys -import getopt - -class CleanClusterNodesAfterRepet( object ): - """ - Clean the cluster nodes after REPET was used. - """ - - def __init__( self ): - """ - Constructor. - """ - self._lNodes = [] - self._tmpDir = "" - self._pattern = "" - self._verbose = 0 - self._lNodesToExcept = ["compute-2-46", "compute-2-47"] - - def help( self ): - """ - Display the help on stdout. - """ - print "usage: %s.py [ options ]" % ( type(self).__name__ ) - print "options:" - print " -h: this help" - print " -n: node to clean (otherwise all nodes will be cleaned)" - print " -t: temporary directory (e.g. '/tmp')" - print " -p: pattern (e.g. 'DmelChr4*')" - print " -v: verbosity level (default=0/1/2)" - - def setAttributesFromCmdLine( self ): - """ - Set the attributes from the command-line. - """ - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:n:t:p:v:") - except getopt.GetoptError, err: - print str(err); self.help(); sys.exit(1) - for o,a in opts: - if o == "-h": - self.help(); sys.exit(0) - elif o == "-n": - self.setLNodes( a.split(" ") ) - elif o == "-t": - self.setTempDirectory( a ) - elif o == "-p": - self.setPattern( a ) - elif o == "-v": - self.setVerbosityLevel( a ) - - def setLNodes( self, a ): - self._lNodes = a - - def setTempDirectory( self, a ): - if a[-1] == "/": - self._tmpDir = a[:-1] - else: - self._tmpDir = a - - def setPattern( self, a ): - self._pattern = a - - def setVerbosityLevel( self, verbose ): - self._verbose = int(verbose) - - def checkAttributes( self ): - """ - Before running, check the required attributes are properly filled. - """ - if self._tmpDir == "": - print "ERROR: need a valid temporary directory" - self.help(); sys.exit(1) - - def getAllNodesList( self ): - """ - Return the list of the names of each node. - """ - lNodes = [] - log = os.system( "qhost > qhost.txt" ) - if log != 0: print "ERROR with qhost"; sys.exit(1) - inF = open( "qhost.txt", "r" ) - line = inF.readline() - line = inF.readline() - line = inF.readline() - while True: - if line == "": - break - tokens = line.split() - if tokens[3] == "-": - line = inF.readline() - continue - lNodes.append( tokens[0] ) - line = inF.readline() - inF.close() - #Remove nodes to avoid from the nodes list - for node in self._lNodesToExcept: - if node in lNodes: - lNodes.remove(node) - return lNodes - - def showNodeList( self, lNodes ): - print "nb of nodes: %i" % ( len(lNodes) ) - for i in range(0,len(lNodes)): - print " %i: %s" % ( i+1, lNodes[i] ) - - def cleanNodes( self): - """ - Connect to each job and clean the temporary directory. - """ - nbNodes = len(self._lNodes) - nodeCount = 0 - for node in self._lNodes: - nodeCount += 1 - if self._verbose > 0: - print "connect to node '%s' (%i/%i)..." % ( node, nodeCount, nbNodes ) - sys.stdout.flush() - cmd = "ssh" - cmd += " -q %s " % ( node ) - cmd += "'find %s" % ( self._tmpDir ) - cmd += " -user %s" % ( os.environ["USER"] ) - if self._pattern != "": - cmd += " -name '%s'" % ( self._pattern ) - cmd += " 2> /dev/null -exec rm -rf {} \; ; exit'" - if self._verbose > 0: print cmd; sys.stdout.flush() - os.system( cmd ) # warning, even if everything goes right, ssh returns an error code, i.e. different than 0 - - def clean( self ): - if os.path.exists( "qhost.txt" ): - os.remove( "qhost.txt" ) - - def start( self ): - """ - Useful commands before running the program. - """ - if self._verbose > 0: - print "START %s" % ( type(self).__name__ ); sys.stdout.flush() - self.checkAttributes() - - def end( self ): - """ - Useful commands before ending the program. - """ - self.clean() - if self._verbose > 0: - print "END %s" % ( type(self).__name__ ); sys.stdout.flush() - - def run( self ): - """ - Run the program. - """ - self.start() - if self._lNodes == []: - self._lNodes = self.getAllNodesList() - if self._verbose > 0: self.showNodeList( self._lNodes ) - self.cleanNodes() - self.end() - -if __name__ == "__main__": - i = CleanClusterNodesAfterRepet() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/CorrelateTEageWithGCcontent.py --- a/commons/tools/CorrelateTEageWithGCcontent.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,204 +0,0 @@\n-#!/usr/bin/env python\n-\n-import sys\n-import os\n-import getopt\n-import math\n-from commons.core.sql.DbMySql import DbMySql\n-from commons.core.sql.TablePathAdaptator import TablePathAdaptator\n-from commons.core.sql.TableSeqAdaptator import TableSeqAdaptator\n-from commons.core.coord.PathUtils import PathUtils\n-from commons.core.coord.SetUtils import SetUtils\n-from commons.core.seq.BioseqUtils import BioseqUtils\n-\n-\n-class CorrelateTEageWithGCcontent( object ):\n- \n- def __init__( self ):\n- self._inputCoord = ""\n- self._inputGenome = ""\n- self._inputTErefseq = ""\n- self._configFile = ""\n- self._outFile = ""\n- self._verbose = 0\n- self._db = None\n- self._tableCoord = ""\n- self._pathA = TablePathAdaptator()\n- self._tableGenome = ""\n- self._seqA = TableSeqAdaptator()\n- \n- \n- def help( self ):\n- print\n- print "usage: CorrelateTEageWithGCcontent.py [ options ]"\n- print "options:"\n- print " -h: this help"\n- print " -i: input TE coordinates (can be file or table)"\n- print " TEs as subjects in \'path\' format"\n- print " -g: input genome sequences (can be fasta file or table)"\n- print " -r: input TE reference sequences (can be fasta file or table)"\n- print " -C: configuration file (if table as input)"\n- print " -o: output fasta file (default=inputCoord+\'.gc\')"\n- print " -v: verbosity level (default=0/1)"\n- print\n- \n- \n- def setAttributesFromCmdLine( self ):\n- try:\n- opts, args = getopt.getopt(sys.argv[1:],"hi:g:r:C:o:v:")\n- except getopt.GetoptError, err:\n- msg = "%s" % str(err)\n- sys.stderr.write( "%s\\n" % msg )\n- self.help(); sys.exit(1)\n- for o,a in opts:\n- if o == "-h":\n- self.help(); sys.exit(0)\n- elif o == "-i":\n- self._inputCoord = a\n- elif o == "-g":\n- self._inputGenome = a\n- elif o == "-r":\n- self._inputTErefseq = a\n- elif o == "-C":\n- self._configFile = a\n- elif o =="-o":\n- self._outFile = a\n- elif o == "-v":\n- self._verbose = int(a)\n- \n- \n- def checkAttributes( self ):\n- if self._inputCoord == "":\n- msg = "ERROR: missing input TE coordinates (-i)"\n- sys.stderr.write( "%s\\n" % msg )\n- self.help()\n- sys.exit(1)\n- if not os.path.exists( self._inputCoord ):\n- if not os.path.exists( self._configFile ):\n- msg = "ERROR: neither input file \'%s\' nor configuration file \'%s\'" % ( self._inputCoord, self._configFile )\n- sys.stderr.write( "%s\\n" % msg )\n- self.help()\n- sys.exit(1)\n- if not os.path.exists( self._configFile ):\n- msg = "ERROR: can\'t find configuration file \'%s\'" % ( self._configFile )\n- sys.stderr.write( "%s\\n" % msg )\n- sys.exit(1)\n- self._db = DbMySql( cfgFileName=self._configFile )\n- if not self._db.exist( self._inputCoord ):\n- msg = "ERROR: can\'t find table \'%s\'" % ( self._inputCoord )\n- sys.stderr.write( "%s\\n" % msg )\n- self.help()\n- sys.exit(1)\n- self._tableCoord = self._inputCoord\n- else:\n- self._tableCoord = self._inputCoord.replace(".","_")\n- if self._inputGenome == "":\n- msg = "ERROR: missing input genome sequences (-g)"\n- sys.stderr.write( "%s\\n" % msg )\n- self.help()\n- sys.exit(1)\n- if not os.path.exists( self._inputGenome ):\n- if not self._db.doesTableExist( self._inputGenome ):\n- msg = "ERROR: can\'t find table \'%s\'" % ('..b'rr.write( "%s\\n" % msg )\n- self.help()\n- sys.exit(1)\n- if not os.path.exists( self._inputTErefseq ):\n- if not self._db.doesTableExist( self._inputTErefseq ):\n- msg = "ERROR: can\'t find table \'%s\'" % ( self._inputTErefseq )\n- sys.stderr.write( "%s\\n" % msg )\n- self.help()\n- sys.exit(1)\n- if self._outFile == "":\n- self._outFile = "%s.gc" % ( self._inputCoord )\n- \n- \n- def getLengthOfTErefseqs( self ):\n- if os.path.exists( self._inputTErefseq ):\n- return BioseqUtils.getLengthPerSeqFromFile( self._inputTErefseq )\n- else:\n- dTErefseq2Length = {}\n- refseqA = TableSeqAdaptator( self._db, self._inputTErefseq )\n- lAccessions = refseqA.getAccessionsList()\n- for acc in lAccessions:\n- dTErefseq2Length[ acc ] = refseqA.getSeqLengthFromAccession( acc )\n- return dTErefseq2Length\n- \n- \n- def start( self ):\n- self.checkAttributes()\n- if self._verbose > 0:\n- print "START CorrelateTEageWithGCcontent.py"\n- sys.stdout.flush()\n- if os.path.exists( self._inputCoord ):\n- self._db = DbMySql( cfgFileName=self._configFile )\n- self._db.createTable( self._tableCoord, "path", self._inputCoord, True )\n- self._pathA = TablePathAdaptator( self._db, self._tableCoord )\n- if os.path.exists( self._inputGenome ):\n- self._db.createTable( self._tableGenome, "seq", self._inputGenome, True )\n- self._seqA = TableSeqAdaptator( self._db, self._tableGenome )\n- if self._verbose > 0:\n- print "output fasta file: %s" % self._outFile\n- \n- \n- def end( self ):\n- if os.path.exists( self._inputCoord ):\n- self._db.dropTable( self._tableCoord )\n- if os.path.exists( self._inputGenome ):\n- self._db.dropTable( self._tableGenome )\n- self._db.close()\n- if self._verbose > 0:\n- print "END CorrelateTEageWithGCcontent.py"\n- sys.stdout.flush()\n- \n- \n- def run( self ):\n- self.start()\n- \n- dTErefseq2Length = self.getLengthOfTErefseqs()\n- \n- outFileHandler = open( self._outFile, "w" )\n- outFileHandler.write( "copy\\tTE\\tchr\\tlength\\tid\\tGC\\tlengthPerc\\n" )\n- \n- lIdentifiers = self._pathA.getIdList()\n- nbTEcopies = len(lIdentifiers)\n- if self._verbose > 0:\n- print "nb of TE copies: %i" % ( nbTEcopies )\n- sys.stdout.flush()\n- count = 0\n- power10 = int( math.floor( math.log10( nbTEcopies ) ) ) - 1\n- for id in lIdentifiers:\n- count += 1\n- if self._verbose > 0 and power10 > 0 and count % math.pow(10,power10) == 0:\n- print "%s / %s" % ( str(count).zfill(power10+2), str(nbTEcopies).zfill(power10+2) )\n- sys.stdout.flush()\n- lPaths = self._pathA.getPathListFromId( id )\n- lSets = PathUtils.getSetListFromQueries( lPaths )\n- lMergedSets = SetUtils.mergeSetsInList( lSets )\n- bs = self._seqA.getBioseqFromSetList( lMergedSets )\n- data = "%i" % id\n- data += "\\t%s" % ( bs.header.split("::")[0] )\n- data += "\\t%s" % ( lPaths[0].getQueryName() )\n- data += "\\t%i" % ( bs.getLength() )\n- data += "\\t%.2f" % ( PathUtils.getIdentityFromPathList( lPaths ) )\n- data += "\\t%.2f" % ( bs.getGCpercentage() )\n- data += "\\t%.2f" % ( 100 * bs.getLength() / float( dTErefseq2Length[ bs.header.split("::")[0] ] ) )\n- outFileHandler.write( "%s\\n" % data )\n- \n- outFileHandler.close()\n- \n- self.end()\n- \n- \n-if __name__ == "__main__":\n- i = CorrelateTEageWithGCcontent()\n- i.setAttributesFromCmdLine()\n- i.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/FilterAlign.py --- a/commons/tools/FilterAlign.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,149 +0,0 @@ -#!/usr/bin/env python - -import sys -import getopt -import os - - -def help(): - print "usage: ",sys.argv[0].split("/")[-1],"[ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (format='align')" - print " -E: maximum E-value (default=100)" - print " -S: minimum score (default=0)" - print " -I: minimum identity (default=0)" - print " -l: minimum length (default=0)" - print " -L: maximum length (default=1000000000)" - print " -o: name of the output file (default=inFileName+'.filtered')" - print " -v: verbose (default=0/1)" - - -def main(): - """ - This program filters the output from BLASTER ('align' file recording HSPs). - """ - - inFileName = "" - outFileName = "" - maxEValue = 100 - minIdentity = 0 - minLength = 0 - maxLength = 1000000000 - minScore = 0 - verbose = 0 - - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:E:S:I:l:L:o:v:") - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit() - elif o == "-i": - inFileName = a - elif o == "-E": - maxEValue = float(a) - elif o == "-S": - minScore = int(float(a)) - elif o == "-I": - minIdentity = int(float(a)) - elif o == "-l": - minLength = int(a) - elif o == "-L": - maxLength = int(a) - elif o == "-o": - outFileName = a - elif o == "-v": - verbose = int(a) - - if inFileName == "": - print "ERROR: missing input file name" - help() - sys.exit(1) - - if outFileName == "": - outFileName = "%s.filtered" % ( inFileName ) - - if os.path.exists( os.environ["REPET_PATH"] + "/bin/filterAlign" ): - prg = os.environ["REPET_PATH"] + "/bin/filterAlign" - cmd = prg - cmd += " -i %s" % ( inFileName ) - cmd += " -E %g" % ( maxEValue ) - cmd += " -S %i" % ( minScore ) - cmd += " -I %f" % ( minIdentity ) - cmd += " -l %i" % ( minLength ) - cmd += " -L %i" % ( maxLength ) - cmd += " -o %s" % ( outFileName ) - cmd += " -v %i" % ( verbose ) - return os.system( cmd ) - - if verbose > 0: - print "START %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - inFile = open( inFileName, "r" ) - outFile = open( outFileName, "w" ) - - nbMatches = 0 - nbFiltered = 0 - - line = inFile.readline() - while True: - if line == "": - break - nbMatches += 1 - data = line.split("\t") - qryName = data[0] - qryStart = data[1] - qryEnd = data[2] - sbjName = data[3] - sbjStart = data[4] - sbjEnd = data[5] - Evalue = data[6] - score = data[7] - identity = data[8] - - if int(qryStart) < int(qryEnd): - matchLength = int(qryEnd) - int(qryStart) + 1 - elif int(qryStart) > int(qryEnd): - matchLength = int(qryStart) - int(qryEnd) + 1 - - if float(Evalue) <= maxEValue and matchLength >= minLength and \ - float(identity) >= minIdentity and matchLength <= maxLength and \ - int(score) >= minScore: - string = qryName + "\t" + qryStart + "\t" + qryEnd + "\t" +\ - sbjName + "\t" + sbjStart + "\t" + sbjEnd + "\t" +\ - Evalue + "\t" + score + "\t" + identity - outFile.write( string ) - else: - nbFiltered += 1 - string = "qry %s (%s-%s) vs subj %s (%s-%s): Eval=%s identity=%s matchLength=%s score=%s" %\ - ( qryName, qryStart, qryEnd, sbjName, sbjStart, sbjEnd, Evalue, identity.split("\n")[0], matchLength, score ) - if verbose > 1: - print string; sys.stdout.flush() - - line = inFile.readline() - - inFile.close() - outFile.close() - - if verbose > 0: - msg = "total number of matches: %i" % ( nbMatches ) - msg += "\nnumber of filtered matches: %i" % ( nbFiltered ) - print msg; sys.stdout.flush() - - if verbose > 0: - print "END %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/GFF3Maker.py --- a/commons/tools/GFF3Maker.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,498 +0,0 @@\n-#!/usr/bin/env python\n-\n-##@file GFF3Maker.py\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.core.sql.TableSeqAdaptator import TableSeqAdaptator\n-from commons.core.sql.TablePathAdaptator import TablePathAdaptator\n-import sys\n-import os\n-\n-## GFF3Maker exports annotations from a \'path\' table into a GFF3 file.\n-#\n-class GFF3Maker(object):\n-\n- def __init__(self, inFastaName = "", tablesFileName = "", classifTableName = "", isChado = False, isGFF3WithoutAnnotation = False, isWithSequence = False, areMatchPartsCompulsory = False, configFileName = "", verbose = 0, doMergeIdenticalMatches = False, doSplit = False):\n- self._inFastaName = inFastaName\n- self._tablesFileName = tablesFileName\n- self._classifTableName = classifTableName\n- self._isChado = isChado\n- self._isGFF3WithoutAnnotation = isGFF3WithoutAnnotation\n- self._isWithSequence = isWithSequence\n- self._areMatchPartsCompulsory = areMatchPartsCompulsory\n- self._configFileName = configFileName\n- self._doMergeIdenticalMatches = doMergeIdenticalMatches\n- self._doSplit = doSplit\n- self._iDB = None\n- self._verbose = verbose\n- \n- def setAttributesFromCmdLine(self):\n- description = "GFF3Maker exports annotations from \'path\', \'set\' and/or \'classif\' tables into a GFF3 file\\n"\n- parser = RepetOptionParser(description = description)\n- parser.add_option("-f", "--inseq", dest = "inFastaName", action = "store", type = "string", help = "\'seq\' table recording the input sequences", default = "")\n- parser.add_option("-t", "--tablesfile", dest = "tablesFileName", action = "store", type = "string", help = "tabulated file of table name to use to create the gff3 files (fields: tier name, format, table name)", default = "")\n- parser.add_option("-w", "--withSequence", dest = "isWithSequence", action = "store_true", help = "write the sequence at the end of GFF3 file", default = False)\n- parser.add_option("-a", "--withoutAnnotation", dest = "isGFF3WithoutAnnotation", action = "store_true", help = "write GFF3 files even if no a'..b'_iDB, self._inFastaName)\n- lTuples = iTSA.getAccessionAndLengthList()\n- for seqName, length in lTuples :\n- if not self._doSplit:\n- fileName = "%s.gff3" % seqName\n- outFile = open(fileName, "w")\n- outFile.write("##gff-version 3\\n")\n- outFile.write("##sequence-region %s 1 %s\\n" % (seqName, length))\n- for line in linesFromAnnotationTablesFile:\n- if line[0] == "#":\n- continue\n- tok = line.split()\n- if len(tok) == 0:\n- break\n- source = tok[0]\n- format = tok[1]\n- table = tok[2]\n- tableseq = ""\n- if len(tok) == 4:\n- tableseq = tok[3]\n- if format == \'path\' :\n- annotations = self._getPathFeatures(table, tableseq, seqName, source, feature, frame)\n- elif format == \'set\' :\n- annotations = self._getSetFeatures(table, seqName, source, feature, frame)\n- else:\n- raise Exception("Wrong format : %s" % format)\n- outFile.write(annotations)\n- outFile.close()\n- #TODO: check getNbLinesInSingleFile() to handle big files\n- if not self._isGFF3WithoutAnnotation and FileUtils.getNbLinesInSingleFile(fileName) == 2:\n- os.remove(fileName)\n- elif self._isWithSequence:\n- outFile = open(fileName, "a")\n- outFile.write("##FASTA\\n")\n- iBioseq = iTSA.getBioseqFromHeader(seqName)\n- iBioseq.write(outFile)\n- outFile.close()\n- else:\n- count = 1\n- for line in linesFromAnnotationTablesFile:\n- if line[0] == "#":\n- continue\n- tok = line.split()\n- if len(tok) == 0:\n- break\n- source = tok[0]\n- format = tok[1]\n- table = tok[2]\n- tableseq = ""\n- if len(tok) == 4:\n- tableseq = tok[3]\n- fileName = "%s_Annot%i.gff3" % (seqName, count)\n- outFile = open(fileName, "w")\n- outFile.write("##gff-version 3\\n")\n- outFile.write("##sequence-region %s 1 %s\\n" % (seqName, length))\n- if format == \'path\' :\n- annotations = self._getPathFeatures(table, tableseq, seqName, source, feature, frame)\n- elif format == \'set\' :\n- annotations = self._getSetFeatures(table, seqName, source, feature, frame)\n- else:\n- raise Exception("Wrong format : %s" % format)\n- outFile.write(annotations)\n- outFile.close()\n- #TODO: check getNbLinesInSingleFile() to handle big files\n- if not self._isGFF3WithoutAnnotation and FileUtils.getNbLinesInSingleFile(fileName) == 2:\n- os.remove(fileName)\n- elif self._isWithSequence:\n- outFile = open(fileName, "a")\n- outFile.write("##FASTA\\n")\n- iBioseq = iTSA.getBioseqFromHeader(seqName)\n- iBioseq.write(outFile)\n- outFile.close()\n- count += 1\n- \n- self._iDB.close()\n- \n- if self._verbose > 0:\n- print "END GFF3Maker"\n- sys.stdout.flush()\n- \n-if __name__ == "__main__":\n- iGFF3Maker = GFF3Maker()\n- iGFF3Maker.setAttributesFromCmdLine()\n- iGFF3Maker.run()\n- \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/GameXmlMaker.py --- a/commons/tools/GameXmlMaker.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,384 +0,0 @@\n-#!/usr/bin/env python\n-\n-##@file GameXmlMaker.py\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-import os\n-import glob\n-import sys\n-import xml.dom.minidom\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.seq.BioseqDB import BioseqDB\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.core.sql.TablePathAdaptator import TablePathAdaptator\n-from commons.core.sql.TableSetAdaptator import TableSetAdaptator\n-from commons.core.sql.TableMapAdaptator import TableMapAdaptator\n-\n-## GameXmlMaker exports .\n-#\n-class GameXmlMaker(object):\n-\n- def __init__(self, inFastaName = "", tablesFileName = "", configFileName = "", verbose = 0):\n- self._inFastaName = inFastaName\n- self._tablesFileName = tablesFileName\n- self._configFileName = configFileName\n- self._verbose = verbose\n- self._gameXMLFileName = ""\n- \n- def setAttributesFromCmdLine(self):\n- description = "GameXmlMaker with -f option <=> step 1 : create gff files (write only the sequence and not the annotation. Only one sequence in each file)\\n"\n- description += "GameXmlMaker with -t option <=> step 2 : add annotations in each file\\n"\n- parser = RepetOptionParser(description = description)\n- parser.add_option("-f", "--inseq", dest = "inFastaName", action = "store", type = "string", help = "\'fasta\' file or \'seq\' table recording the input sequences (required to generate new \'.gamexml\' files)", default = "")\n- parser.add_option("-t", "--tablesfile", dest = "tablesFileName", action = "store", type = "string", help = "tabulated file of table name to use to update the GameXML files (fields: tier name, format, table name)", default = "")\n- parser.add_option("-g", "--gameXML", dest = "gameXML", action = "store", type = "string", help = "gameXML file to update (if not specified, update all gameXML files in directory", default = "")\n- parser.add_option("-C", "--config", dest = "configFileName", action = "store", type = "string", help = "configuration file for database connection", default = "")\n- parser.add_option("-v", "--verbose", dest = "verbose", action = "store", type = "int", help = "verbosity level (default=0, else 1 or 2)", default = 0)\n- (options, args) '..b' resultSetName.appendChild(docXML.createTextNode("%s::%s" %(iSet.getName(),str(iSet.getId()))))\n- resultSet.appendChild(resultSetName)\n- return resultSet\n- \n- def _addResultSetFromMap(self, docXML, iMap, parent):\n- computationalAnalysis = parent\n- resultSet = docXML.createElement(\'result_set\')\n- resultSet.setAttribute(\'id\', "-1") \n- computationalAnalysis.appendChild(resultSet)\n- resultSetName = docXML.createElement(\'name\')\n- resultSetName.appendChild(docXML.createTextNode("%s::%s" %(iMap.getName(), "-1")))\n- resultSet.appendChild(resultSetName)\n- return resultSet\n-\n- def _updateGameXMLFileFromlTablesFile(self, gameXMLFile):\n- docXML = xml.dom.minidom.parse(gameXMLFile) \n- \n- f = open(self._tablesFileName, "r")\n- line = f.readline()\n- \n- while line: \n- if not line.startswith("#"):\n- list = line.split()\n- programName = list[0]\n- format = list[1]\n- table = list[2]\n-\n- gameXMLFileName = os.path.splitext(gameXMLFile)[0]\n- computationalAnalysis = self._addComputationalAnalysisTags(docXML,programName)\n- if format == "path": \n- iDB = DbFactory.createInstance(self._configFileName)\n- iTpa = TablePathAdaptator(iDB, table)\n- \n- lPaths = iTpa.getPathListFromQuery(gameXMLFileName)\n- dResultSets = {}\n-\n- for iPath in lPaths:\n- if dResultSets.get(iPath.getIdentifier()) is None:\n- resultSet = self._addResultSetFromPath(docXML, iPath,computationalAnalysis)\n- dResultSets[iPath.getIdentifier()] = resultSet\n- else:\n- resultSet = dResultSets[iPath.getIdentifier()]\n- spanInfo = self._parseResultSpanInfo(iPath, "path")\n- self._addPathSpan(docXML, spanInfo, resultSet)\n- \n- if format == "set":\n- iDB = DbFactory.createInstance(self._configFileName)\n- iTsa = TableSetAdaptator(iDB, table)\n- lSet = iTsa.getSetListFromSeqName(gameXMLFileName)\n- \n- dResultSets = {}\n-\n- for iSet in lSet:\n- if dResultSets.get(iSet.getId()) is None:\n- resultSet = self._addResultSetFromSet(docXML, iSet,computationalAnalysis)\n- dResultSets[iSet.getId()] = resultSet\n- else:\n- resultSet = dResultSets[iSet.getId()]\n- \n- spanInfo = self._parseResultSpanInfo(iSet, "set")\n- self._addPathSpan(docXML, spanInfo, resultSet)\n- \n- if format == "map":\n- iDB = DbFactory.createInstance(self._configFileName)\n- iTma = TableMapAdaptator(iDB, table)\n- lMap = iTma.getMapListFromChr(gameXMLFileName)\n- dResultSets = {}\n- for iMap in lMap:\n- resultSet = self._addResultSetFromMap(docXML, iMap,computationalAnalysis)\n- spanInfo = self._parseResultSpanInfo(iMap, "map")\n- self._addPathSpan(docXML, spanInfo, resultSet)\n- \n- line = f.readline()\n- \n- outputGameXMLFile = open(gameXMLFile, "w") \n- xmlstr = docXML.toxml()\n- outputGameXMLFile.write(xmlstr)\n- outputGameXMLFile.close()\n- \n-if __name__ == "__main__":\n- iGameXmlMaker = GameXmlMaker()\n- iGameXmlMaker.setAttributesFromCmdLine()\n- iGameXmlMaker.run()\n- \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/GetMultAlignAndPhylogenyPerTErefSeq.py --- a/commons/tools/GetMultAlignAndPhylogenyPerTErefSeq.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,547 +0,0 @@\n-#!/usr/bin/env python\n-\n-##@file\n-# For each TE reference sequence, it computes a multiple alignment and a phylogeny of all its copies.\n-# usage: GetMultAlignAndPhylogenyPerTErefSeq.py [ options ]\n-# options:\n-# -h: this help\n-# -S: step (0: all steps [default], 1:file generation, 2:multiple alignements, 3:phylogenies)\n-# -p: table with the annotations (format=path)\n-# -s: table with the TE reference sequences (format=seq)\n-# -g: table with the genome sequence (format=seq)\n-# -r: name or file with TE reference sequence(s) (all by default)\n-# -m: MSA method (default=Refalign/Map)\n-# -l: minimum length of copies (default=100)\n-# -n: number of longest copies to use (default=20)\n-# -y: minimum copy proportion compare to references (default=0.5)\n-# -R: keep the reference sequence (only with Refalign)\n-# -C: configuration file\n-# -q: queue name\n-# -c: clean\n-# -d: temporary directory\n-# -v: verbosity level (default=0/1)\n-\n-import os\n-import sys\n-import glob\n-import ConfigParser\n-\n-import pyRepet.launcher.programLauncher\n-\n-from commons.core.coord.PathUtils import PathUtils\n-from commons.core.seq.FastaUtils import FastaUtils\n-from commons.core.coord.SetUtils import SetUtils\n-from commons.core.sql.TablePathAdaptator import TablePathAdaptator\n-from commons.core.sql.TableSeqAdaptator import TableSeqAdaptator\n-from commons.tools.OrientSequences import OrientSequences\n-from ConfigParser import MissingSectionHeaderError\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.seq.AlignedBioseqDB import AlignedBioseqDB\n-from commons.launcher import LaunchMap\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.core.sql.TableJobAdaptatorFactory import TableJobAdaptatorFactory\n-from commons.core.launcher.Launcher import Launcher\n-from commons.core.utils.FileUtils import FileUtils\n-\n-\n-LOG_DEPTH = "repet.tools"\n-\n-## For each TE reference sequence, it computes a multiple alignment and a phylogeny of all its copies.\n-#\n-class GetMultAlignAndPhylogenyPerTErefSeq(object):\n- \n- def __init__(self, pathTableName="",refSeqTableName="", genomeSeqTableName="", step=0, mSAmethod="RefAlign",keepRefseq=False, configFileName= "", clean = True, verbosity=3):\n- """\n- Constructor.\n- """\n- self.step = step\n- self._pathTable = pathTableName\n- self._refSeqTable = refSeqTableName\n- self._genomeSeqTable = genomeSeqTableName\n- self._TErefseq = ""\n- self._MSAmethod = mSAmethod\n- self._minCopyLength = 100\n- self._nbLongestCopies = 20\n- self._minPropCopy = 0.5\n- self._keepRefseq = keepRefseq\n- self.setConfigFileName(configFileName)\n- self._queue = ""\n- self._tmpDir = ""\n- self._clean = clean\n- self._verbosity = verbosity\n- self._db = None\n- self._tpaAnnot = None\n- self._tsaRef = None\n- self._pL = pyRepet.launcher.programLauncher.programLauncher()\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def _logAndRaise(self, errorMsg):\n- self._log.error(errorMsg)\n- raise Exception(errorMsg)\n- \n- def setAttributesFromCmdLine(self):\n- desc = "For each TE reference sequence, it computes a multiple alignment and a phylogeny of all its copies.\\n"\n- #Commented: it\'s not true, Config File is mandatory!\n-# desc += "Connection to the database parameters are retrieved from the environment"\n- \n- #TODO: format options as other scripts (have a look at LaunchTemplate)\n- parser = RepetOptionParser(description = desc, epilog = "")\n- parser.add_option("-S", "--step", dest = "step" , action = "store", type = "int", help = "step (0: all steps [default], 1:file generation, 2:mu'..b' \n- def filter4phylogenies( self, verbosity=0 ):\n- """\n- Filter TE copy alignment for better phylogenies.\n- """\n- self._log.info("Filtering MSA")\n- lInFiles = glob.glob( "*_all.fa.oriented_%s.fa_aln" % ( self._MSAmethod.lower() ) )\n- count = 0\n- for inFileName in lInFiles:\n- count += 1 \n- self._log.debug("clean MSA %d --> %s" % (count,inFileName)) \n- alignDB = AlignedBioseqDB()\n- alignDB.load(inFileName)\n- alignDB.cleanMSA()\n- if alignDB.getSize() > 2: \n- alignDB.save( inFileName + ".clean" )\n- self._log.debug("clean!")\n- else:\n- self._log.debug("skip!")\n- self._log.info("MSA cleaned: %d" % count)\n- \n-\n- def _createLaunchPhyMLCommands(self, iLauncher, query):\n-# prg = os.environ["REPET_PATH"] + "/bin/srptPhyML.py"\n-# cmd = prg\n-# cmd += " -g %s_PHY_%s" % ( self._refSeqTable, os.getpid() )\n-# cmd += " -q %s" % ( os.getcwd() )\n-# cmd += " -S \'*_all.fa.oriented_%s.fa_aln.clean\'" % ( self._MSAmethod.lower() )\n-# cmd += " -Q %s" % ( self._queue )\n-# cmd += " -C %s" % ( self._configFileName )\n-\n- prg = "LaunchPhyML.py"\n- lArgs = []\n- lArgs.append("-i %s" % query)\n- lArgs.append("-o %s.fa_phylo" % query) \n- lArgs.append("-v %d" % (self._verbosity-1))\n- \n- self._log.debug("Prepared Phyml commands : %s %s" % (prg, " ".join(lArgs)))\n- return iLauncher.getSystemCommand("%s" % prg, lArgs)\n- \n- def makePhylogenies( self ):\n- """\n- Launch PhyML on each TE family.\n- """\n- self.phyloFileSuffix = "*_all.fa.oriented_%s.fa_aln.clean" % ( self._MSAmethod.lower() )\n- \n- queue = self._queue\n- cDir = os.getcwd()\n- tmpDir = self._tmpDir \n- groupid = "%s_PHY_%s" % ( self._refSeqTable, os.getpid() )\n- acronym = "Phylo"\n- iDb = DbFactory.createInstance(configFileName=self._configFileName)\n- iTJA = TableJobAdaptatorFactory.createInstance(iDb, "jobs")\n- iLauncher = Launcher(iTJA, os.getcwd(), "", "", cDir, tmpDir, "jobs", queue, groupid)\n- lCmdsTuples = self._preparePhyMljobs(iLauncher, cDir)\n- iLauncher.runLauncherForMultipleJobs(acronym, lCmdsTuples, self._clean) \n-\n- \n- def start( self ):\n- """\n- Useful commands before running the program.\n- """\n- self.checkAttributes()\n- self._log.info("START GetMultAlignAndPhylogenyPerTErefSeq.py STEP %d" % self.step)\n- self.connectSql()\n- \n- def end( self ):\n- """\n- Useful commands before ending the program.\n- """\n- self._db.close()\n- self._log.info("END GetMultAlignAndPhylogenyPerTErefSeq.py STEP %d" % self.step)\n- \n- def run( self ):\n- """\n- Run the program.\n- """\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- self.start()\n- lNamesTErefSeq = self.getNamesOfTErefSeq()\n- self._log.debug("lNamesTErefSeq: %s" % " ".join(lNamesTErefSeq))\n- \n- if self.step in [0, 1]:\n- self.getTErefSeqInFastaFiles( lNamesTErefSeq )\n- self.getCopiesInFastaFilesPerTErefSeq( lNamesTErefSeq )\n- \n- if self.step in [0, 2]:\n- self.filter4Alignments(lNamesTErefSeq)\n- self.buildInFiles4Launcher(lNamesTErefSeq)\n- self.launchMultAlignments(lNamesTErefSeq)\n- \n- if self.step in [0, 3]:\n- self.filter4phylogenies(verbosity=self._verbosity)\n- self.makePhylogenies()\n- self.end()\n- \n-if __name__ == "__main__":\n- iGetMultAlignAndPhylogenyPerTErefSeq = GetMultAlignAndPhylogenyPerTErefSeq()\n- iGetMultAlignAndPhylogenyPerTErefSeq.setAttributesFromCmdLine()\n- iGetMultAlignAndPhylogenyPerTErefSeq.run()\n- \n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/GetSpecificTELibAccordingToAnnotation.py --- a/commons/tools/GetSpecificTELibAccordingToAnnotation.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,178 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-\n-import os\n-import sys\n-from commons.core.sql.DbMySql import DbMySql\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.sql.TableSeqAdaptator import TableSeqAdaptator\n-from commons.core.LoggerFactory import LoggerFactory\n-\n-LOG_DEPTH = "repet.tools" \n-LOG_FORMAT = "%(message)s"\n-#TODO: use configuration file\n-\n-## Get 3 annotation files, using output from TEannot:\n-#- consensus with one or more full length copy, \n-#- consensus with one or more full length fragment,\n-#- consensus without copy\n-\n-class GetSpecificTELibAccordingToAnnotation(object):\n- \n- def __init__(self, inInfoFileName = "", tableName = "", verbose = 0):\n- self._inInfoFileName = inInfoFileName\n- self._tableName = tableName\n- self._verbose = verbose\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbose, LOG_FORMAT)\n- \n- def setAttributesFromCmdLine(self):\n- desc = "Splits a GiveInfoTEannot \\"statsPerTE.txt\\" file in 3 subfiles containing consensus which have at least one copy, one full length fragment or one full length copy. "\n- desc += "A TEs library is built according to each category. Connection to the database parameters are retrieved from the environment"\n- \n- examples = "\\nExample : with a project called \\"MyTEannotAnalysis\\":\\n"\n- examples += "\\t$ python GetSpecificTELibAccordingToAnnotation.py -i MyTEannotAnalysis_chr_allTEs_nr_noSSR_join_path_statsPerTE.txt -t MyTEannotAnalysis_refTEs_seq"\n- examples += "\\n\\t"\n- examples += "\\n\\n"\n- \n- parser = RepetOptionParser(description = desc, epilog = examples)\n- parser.add_option("-i", "--file", dest = "inInfoFileName", action = "store", type = "string", help = "input file (mandatory) = output file from GiveInfoTEannot.py (e.g. <project_name>_chr_allTEs_nr_noSSR_join_path_statsPerTE.txt)", default = "")\n- parser.add_option("-t", "--table", dest = "tableName", action = "store", type = "string", help = "table name of TEs sequences (mandatory, seq format, e.g. <project_name>_refTEs_seq)", default = "")\n- parser.add_option("-v", "--verbose", dest = "verbose", action = "store", type = "int", help = "verbosity le'..b' self._tableName = tableName\n- \n- def setInInfoFileName(self, inInfoFileName):\n- self._inInfoFileName = inInfoFileName\n- \n- def setVerbose(self, verbose):\n- self._verbose = verbose\n- \n- def checkOptions(self):\n- if self._inInfoFileName != "":\n- if not FileUtils.isRessourceExists(self._inClassifFileName):\n- self._logAndRaise("ERROR: Input GiveInfoTEannot.txt output file does not exist!")\n- else:\n- self._logAndRaise("ERROR: No specified -i option!")\n- \n- if self._tableName != "":\n- iDb = DbMySql()\n- if not iDb.doesTableExist(self._tableName):\n- self._logAndRaise("ERROR: table does not exist!")\n- iDb.close()\n- else:\n- self._logAndRaise("ERROR: No specified -t option!")\n-\n- def _logAndRaise(self, errorMsg):\n- self._log.error(errorMsg)\n- raise Exception(errorMsg)\n-\n- def writeFastaFileFromGiveInfoTEAnnot(self, fileName):\n- fFileHandler = open(fileName,"r")\n- lineHeader = fFileHandler.readline()\n- line = fFileHandler.readline()\n- lConsensusName = []\n- while line: \n- lConsensusName.append(line.split()[0])\n- line = fFileHandler.readline()\n-\n- fFileHandler.close()\n- iDb = DbMySql()\n- iTSA = TableSeqAdaptator(iDb, self._tableName)\n- outPutFileName = "%s.fa" % os.path.splitext(fileName)[0]\n- iTSA.saveAccessionsListInFastaFile(lConsensusName, outPutFileName)\n- iDb.close()\n- \n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbose)\n-\n- outInfoFileNameFullCopy = "%s_FullLengthCopy.txt" % os.path.splitext(os.path.basename(self._inInfoFileName))[0]\n- outInfoFileNameCopy = "%s_OneCopyAndMore.txt" % os.path.splitext(os.path.basename(self._inInfoFileName))[0]\n- outInfoFileNameFullFrag = "%s_FullLengthFrag.txt" % os.path.splitext(os.path.basename(self._inInfoFileName))[0]\n- \n- outInfoFileFullCopy = open(outInfoFileNameFullCopy, "w")\n- outInfoFileCopy = open(outInfoFileNameCopy, "w")\n- outInfoFileFullFrag = open(outInfoFileNameFullFrag, "w")\n- \n- self._log.info("START GetSpecificTELibAccordingToAnnotation\\n input info file: %s" % self._inInfoFileName)\n- \n- inFileFh = open(self._inInfoFileName, "r")\n- line = inFileFh.readline()\n- lHeaders = line.split()\n- if "fullLgthCopies" not in lHeaders:\n- self._logAndRaise("ERROR: No headers in %s!" % self._inInfoFileName )\n- \n- outInfoFileFullCopy.write(line)\n- outInfoFileCopy.write(line)\n- outInfoFileFullFrag.write(line)\n- \n- line = inFileFh.readline()\n- while line:\n- dTokens = {}\n- for index, token in enumerate(line.split()):\n- dTokens[lHeaders[index]] = token\n- \n- if int(dTokens["fullLgthCopies"]) > 0:\n- outInfoFileFullCopy.write(line)\n- if int(dTokens["copies"]) > 0:\n- outInfoFileCopy.write(line)\n- if int(dTokens["fullLgthFrags"]) > 0:\n- outInfoFileFullFrag.write(line)\n- line = inFileFh.readline()\n- \n- inFileFh.close()\n- outInfoFileFullCopy.close()\n- outInfoFileCopy.close()\n- outInfoFileFullFrag.close()\n- \n- self.writeFastaFileFromGiveInfoTEAnnot(outInfoFileNameFullCopy)\n- self.writeFastaFileFromGiveInfoTEAnnot(outInfoFileNameCopy)\n- self.writeFastaFileFromGiveInfoTEAnnot(outInfoFileNameFullFrag)\n- \n- self._log.info("END GetSpecificTELibAccordingToAnnotation\\n" )\n- \n- return 0\n-\n-if __name__ == \'__main__\':\n- iGetTELib = GetSpecificTELibAccordingToAnnotation()\n- iGetTELib.setAttributesFromCmdLine()\n- iGetTELib.run() \n- \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py --- a/commons/tools/HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,123 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import getopt -from commons.pyRepetUnit.align.hmmOutputParsing.HmmpfamOutput2align import HmmpfamOutput2align -from commons.pyRepetUnit.align.hmmOutputParsing.HmmscanOutput2align import HmmscanOutput2align -from commons.pyRepetUnit.align.transformAACoordIntoNtCoord.TransformAACoordIntoNtCoordInAlignFormat import TransformAACoordIntoNtCoordInAlignFormat -from commons.core.utils.FileUtils import FileUtils - -#------------------------------------------------------------------------------ - -def help(): - - """ - Give the command-line parameters. - """ - - print "" - print "usage: ",sys.argv[0],"[ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (format='hmmpfam Output' or 'hmmscan Output)" - print " -o: name of the output file (default=inFileName+'.align')" - print " -T: name of the consensus File (To launch the transformation of aa positions in nt positions and Filter positive score, default=no transformation)" - print " -v: verbose (default=0/1/2)" - print " -p: name of program (default=hmmpfam, but you can specify hmmscan too)" - print " -c: clean" - print "" - -#------------------------------------------------------------------------------ - -def main(): - - inFileName = "" - outFileName = "" - verbose = 0 - clean = False - consensusFileName = "" - program = "hmmpfam" - - try: - opts,args=getopt.getopt(sys.argv[1:],"hi:o:T:v:p:c") - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-o": - outFileName = a - elif o == "-T": - consensusFileName = a - elif o == "-v": - verbose = int(a) - elif o == "-p": - program = a - elif o == "-c": - clean = True - - if inFileName == "": - print "*** Error: missing compulsory options" - help() - sys.exit(1) - - if verbose > 0: - print "beginning of %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - if outFileName == "": - outFileName = "%s.align" % ( inFileName ) - - if program == "hmmpfam": - hmmpfamOutput2align = HmmpfamOutput2align( ) - hmmpfamOutput2align.setInputFile( inFileName ) - if consensusFileName == "": - hmmpfamOutput2align.setOutputFile( outFileName ) - else: - hmmpfamOutput2align.setOutputFile( outFileName + ".tmp" ) - hmmpfamOutput2align.run( ) - else: - if program == "hmmscan": - hmmscanOutput2align = HmmscanOutput2align( ) - hmmscanOutput2align.setInputFile( inFileName ) - if consensusFileName == "": - hmmscanOutput2align.setOutputFile( outFileName ) - else: - hmmscanOutput2align.setOutputFile( outFileName + ".tmp" ) - hmmscanOutput2align.run( ) - else: - print "\nWarning: You must specify a valid program (-p option). Only hmmpfam or hmmscan are supported !\n" - - if consensusFileName != "": - alignTransformation = TransformAACoordIntoNtCoordInAlignFormat() - alignTransformation.setInFileName( outFileName + ".tmp" ) - alignTransformation.setOutFileName( outFileName ) - alignTransformation.setConsensusFileName( consensusFileName ) - alignTransformation.setIsFiltered(True) - alignTransformation.run() - os.remove( outFileName + ".tmp" ) - - - if clean == True: - os.remove( inFileName ) - - if verbose > 0: - if FileUtils.isRessourceExists( outFileName ) and not(FileUtils.isEmpty( outFileName )): - print "%s finished successfully" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - else: - print "warning %s execution failed" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - -#------------------------------------------------------------------------------ - -if __name__ == '__main__': - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/LaunchBlaster.py --- a/commons/tools/LaunchBlaster.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,204 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-import subprocess\n-\n-LOG_DEPTH = "repet.tools"\n-\n-##Launch BLASTER\n-#\n-class LaunchBlaster(object):\n- \n- def __init__(self, queryFileName = "", subjectFileName = "", evalue = 1e-300, identity = 90, length = 100, doAllByall = False, type = "ncbi", nbCPU = 1, program="blastn",extraParams="", doClean = False, verbosity = 0):\n- self._queryFileName = queryFileName\n- self.setSubjectFileName(subjectFileName)\n- self._eValue = evalue\n- self._identity = identity\n- self._length = length\n- self._doAllByall = doAllByall\n- self._blastType = type\n- self._program = program\n- self._extraParams = extraParams\n- self._nbCPU = nbCPU\n- self._doClean = doClean\n- self._verbosity = verbosity\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def setAttributesFromCmdLine(self):\n- description = "Launch Blaster."\n- epilog = "\\nExample 1: launch without verbosity and keep temporary files.\\n"\n- epilog += "\\t$ python LaunchBlaster.py -q query.fa -v 0"\n- epilog += "\\n\\t"\n- epilog += "\\nExample 2: launch with verbosity to have errors (level 1) and basic information (level 2), and delete temporary files.\\n"\n- epilog += "\\t$ python LaunchBlaster.py -q query.fa -s nr.fa -c -v 2"\n- parser = RepetOptionParser(description = description, epilog = epilog)\n- parser.add_option("-q", "--query", dest = "query", action = "store", type = "string", help = "query fasta file name [compulsory] [format: fasta]", default = "")\n- parser.add_option("-s", "--subject", dest = "subject", action = "store", type = "string", help = "subject fasta file name [default: query] [format: fasta]", default = "")\n- parser.add_option("-e", "--evalue", dest = "evalue", action = "store", type = "string", help = "Blast e-value [default: 1e-300]", default = "1e-300")\n- parser.add_option("-d", "--id", dest = "identity", action = "store", type = "int", help = "Blast identity [default: 90]", d'..b':\n- if subjectFileName == "":\n- self._subjectFileName = self._queryFileName\n- else:\n- self._subjectFileName = subjectFileName\n- \n- def setEvalue(self, evalue):\n- self._eValue = evalue\n- \n- def setIdentity(self, identity):\n- self._identity = identity\n- \n- def setLength(self, length):\n- self._length = length\n- \n- def setDoAllByall(self, doAllByall):\n- self._doAllByall = doAllByall\n- \n- def setType(self, blastType):\n- self._blastType = blastType\n- \n- def setProgram(self, program):\n- self._program = program\n- \n- def setExtraParams(self, extraParams):\n- self._extraParams = extraParams\n- \n- def setCPU(self, cpu):\n- self._nbCPU = cpu\n- \n- def setDoClean(self, doClean):\n- self._doClean = doClean\n- \n- def setVerbosity(self, verbosity):\n- self._verbosity = verbosity\n- \n- def _checkOptions(self):\n- if self._queryFileName == "":\n- self._logAndRaise("ERROR: Missing input fasta file name")\n- \n- lBlastType = ["ncbi", "wu", "blastplus"] \n- if self._blastType.lower() not in lBlastType:\n- self._logAndRaise("ERROR: unknown Blast type \'%s\' - correct values are %s" % (self._blastType, lBlastType))\n- \n- def _logAndRaise(self, errorMsg):\n- self._log.error(errorMsg)\n- raise Exception(errorMsg)\n-\n- def _getBlasterCmd(self):\n- lArgs = []\n- lArgs.append("-n %s" % self._program)\n- lArgs.append("-q %s" % self._queryFileName)\n- lArgs.append("-s %s" % self._subjectFileName)\n- lArgs.append("-B %s" % self._queryFileName)\n- if self._doAllByall:\n- lArgs.append("-a")\n- lArgs.append("-E %s" % self._eValue)\n- lArgs.append("-L %s" % self._length)\n- lArgs.append("-I %s" % self._identity)\n- if self._blastType == "ncbi": \n- lArgs.append("-N")\n- lArgs.append("-p \'-a %s %s\'" % (self._nbCPU, self._extraParams))\n- elif self._blastType == "wu":\n- lArgs.append("-W")\n- lArgs.append("-p \'-cpus=%s %s\'" % (self._nbCPU, self._extraParams))\n- elif self._blastType == "blastplus":\n- lArgs.append("-X")\n- lArgs.append("-p \'-num_threads %s %s\'" % (self._nbCPU, self._extraParams))\n-# TODO: check the check option at the beginning of step 2 to allow to launch megablast for blast and blast+\n-# elif config.get(sectionName, "blast") == "mega":\n-# lArgs.append("-N")\n-# lArgs.append("-n megablast")\n-# elif config.get(sectionName, "blast") == "megablastplus":\n-# lArgs.append("-X")\n-# lArgs.append("-n megablast")\n- if self._doClean:\n- lArgs.append("-c")\n- lArgs.append("-v %i" % (self._verbosity - 1))\n- return self._getSystemCommand("blaster", lArgs)\n- \n- def _getSystemCommand(self, prg, lArgs):\n- systemCmd = prg \n- for arg in lArgs:\n- systemCmd += " " + arg\n- return systemCmd\n- \n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- self._checkOptions()\n- self._log.info("START LaunchBlaster")\n- self._log.debug("Query file name: %s" % self._queryFileName)\n- self._log.debug("Subject file name: %s" % self._subjectFileName)\n- if self._doClean:\n- self._log.warning("Files will be cleaned")\n- cmd = self._getBlasterCmd()\n- process = subprocess.Popen(cmd, shell = True)\n- self._log.debug("Running : %s" % cmd)\n- process.communicate()\n- if process.returncode != 0:\n- self._logAndRaise("ERROR when launching \'%s\'" % cmd)\n- self._log.info("END LaunchBlaster")\n-\n-if __name__ == "__main__":\n- iLaunch = LaunchBlaster()\n- iLaunch.setAttributesFromCmdLine()\n- iLaunch.run() \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/LaunchBlasterInParallel.py --- a/commons/tools/LaunchBlasterInParallel.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,301 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-import os\n-import shutil\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.core.sql.TableJobAdaptatorFactory import TableJobAdaptatorFactory\n-from commons.core.launcher.Launcher import Launcher\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.checker.ConfigChecker import ConfigRules, ConfigChecker\n-from commons.tools.MergeMatchsFiles import MergeMatchsFiles\n-\n-LOG_DEPTH = "repet.tools"\n-\n-##Launch BLASTER in parallel\n-#\n-class LaunchBlasterInParallel(object):\n- \n- def __init__(self, queryDirectory = "", subjectFilePath = "", outFileName = "", configFileName = "", groupId = "", queryPattern = ".*\\.fa", \\\n- doAllByall = False, nbCPU = 1, eValue="1e-300", type = "ncbi", program="blastn", extraParams="", verbosity = 0):\n- self._queryDirectory = queryDirectory\n- self._queryPattern = queryPattern\n- self.setSubjectFilePath(subjectFilePath)\n- self._outFileName = outFileName\n- self._configFileName = configFileName\n- self.setGroupId(groupId)\n- self._doAllByall = doAllByall\n- self._blastType = type\n- self._program = program\n- self._extraParams = extraParams\n- self._nbCPU = nbCPU\n- self._jobSectionName = "jobs"\n- self._blasterSectionName = "alignment"\n- self._prepareDataSectionName = "prepare_data"\n- self._eValue = eValue\n- \n- self._doClean = None\n- self._verbosity = verbosity\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def setAttributesFromCmdLine(self):\n- description = "Launch Blaster in parallel."\n- epilog = "\\nExample 1: launch without verbosity and keep temporary files.\\n"\n- epilog += "\\t$ python LaunchBlasterInParallel.py -q query -o query.align -v 0"\n- epilog += "\\n\\t"\n- epilog += "\\nExample 2: launch with verbosity to have errors (level 1) and basic information (level 2), and delete temporary files.\\n"\n- epilog += "\\t$ python LaunchBlasterInParallel.py -q query -o query.align -s nr.fa -c -v 2"\n- parser = RepetOptionParser(description = description, epilog = epilog)\n- parse'..b' lArgs)\n-\n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- self._checkConfig()\n- self._checkOptions()\n- self._log.info("START LaunchBlasterInParallel")\n- self._log.debug("Query file name: %s" % self._queryPattern)\n- self._log.debug("Subject file name: %s" % self._subjectFileName)\n- \n- cDir = os.getcwd()\n- if not self._tmpDir:\n- self._tmpDir = cDir\n- \n- acronym = "Blaster"\n- iDb = DbFactory.createInstance()\n- jobdb = TableJobAdaptatorFactory.createInstance(iDb, "jobs")\n- iLauncher = Launcher(jobdb, os.getcwd(), "", "", cDir, self._tmpDir, "jobs", self._resources, self._groupId, acronym, chooseTemplateWithCopy = self._isCopyOnNode)\n-\n- lCmdsTuples = []\n- fileSize = float(os.path.getsize(self._subjectFilePath) + 5000000) / 1000000000\n- \n- lCmdSize = []\n- lCmdCopy = []\n- if self._isCopyOnNode:\n- lCmdSize.append("fileSize = %f" % fileSize) \n- lCmdCopy.append("shutil.copy(\\"%s\\", \\".\\")" % self._subjectFilePath)\n- \n- lFiles = FileUtils.getFileNamesList(self._queryDirectory, self._queryPattern)\n- for file in lFiles:\n- lCmds = []\n- lCmds.append(self._getLaunchBlasterCmd(iLauncher, file))\n- lCmdStart = []\n- if self._isCopyOnNode:\n- lCmdStart.append("os.symlink(\\"../%s\\", \\"%s\\")" % (self._subjectFileName, self._subjectFileName))\n- lCmdStart.append("shutil.copy(\\"%s/%s\\", \\".\\")" % (self._queryDirectory, file))\n- else:\n- lCmdStart.append("os.symlink(\\"%s\\", \\"%s\\")" % (self._subjectFilePath, self._subjectFileName))\n- lCmdStart.append("os.symlink(\\"%s/%s\\", \\"%s\\")" % (self._queryDirectory, file, file))\n- lCmdFinish = []\n- lCmdFinish.append("if os.path.exists(\\"%s.align\\"):" % file)\n- lCmdFinish.append("\\tshutil.move(\\"%s.align\\", \\"%s/.\\" )" % (file, cDir))\n- lCmdFinish.append("shutil.move(\\"%s.param\\", \\"%s/.\\" )" % (file, cDir))\n- lCmdsTuples.append(iLauncher.prepareCommands_withoutIndentation(lCmds, lCmdStart, lCmdFinish, lCmdSize, lCmdCopy))\n- \n- iLauncher.runLauncherForMultipleJobs("Blaster", lCmdsTuples, self._doClean, self._isCopyOnNode)\n-\n- tmpFileName = "tmp_%s.align" % os.getpid()\n- iMMF = MergeMatchsFiles("align", "tmp_%s" % os.getpid(), allByAll = self._doAllByall, clean = self._doClean)\n- iMMF.run()\n-\n- if self._doAllByall:\n- iDb = DbFactory.createInstance()\n- jobdb = TableJobAdaptatorFactory.createInstance(iDb, "jobs")\n- iLauncher = Launcher(jobdb, os.getcwd(), "", "", cDir, self._tmpDir, "jobs", self._resources, "%s_RmvPairAlignInChunkOverlaps" % self._groupId)\n- \n- lCmdsTuples = []\n- lCmds = []\n- lCmds.append(self._getRmvPairAlignInChunkOverlapsCmd(iLauncher, tmpFileName, self._outFileName))\n- lCmdStart = [] \n- lCmdStart.append("os.symlink(\\"%s/%s\\", \\"%s\\")" % (cDir, tmpFileName, tmpFileName))\n- lCmdFinish = []\n- lCmdFinish.append("shutil.move(\\"%s\\", \\"%s/.\\")" % (self._outFileName, cDir))\n- lCmdsTuples.append(iLauncher.prepareCommands_withoutIndentation(lCmds, lCmdStart, lCmdFinish))\n- \n- iLauncher.runLauncherForMultipleJobs("RmvPairAlignInChunkOverlaps", lCmdsTuples, self._doClean)\n- if self._doClean:\n- os.remove(tmpFileName)\n- else:\n- shutil.move(tmpFileName, self._outFileName)\n- \n- if self._doClean:\n- FileUtils.removeFilesByPattern("*.param")\n- \n- self._log.info("END LaunchBlasterInParallel")\n-\n-if __name__ == "__main__":\n- iLaunch = LaunchBlasterInParallel()\n- iLaunch.setAttributesFromCmdLine()\n- iLaunch.run() \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/LaunchMatcherInParallel.py --- a/commons/tools/LaunchMatcherInParallel.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,285 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.core.sql.TableJobAdaptatorFactory import TableJobAdaptatorFactory\n-from commons.core.launcher.Launcher import Launcher\n-from commons.core.launcher.LauncherUtils import LauncherUtils\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.checker.ConfigChecker import ConfigRules, ConfigChecker\n-from commons.core.coord.AlignUtils import AlignUtils\n-import shutil\n-import os\n-\n-LOG_DEPTH = "repet.tools"\n-\n-\n-class LaunchMatcherInParallel(object):\n- def __init__(self, align="", queryFileName="", subjectFileName="", evalue="1e-10", doJoin=False, keepConflict=False, prefix="", alignPattern = ".*\\.align", \\\n- config = "", groupId = "", maxFileSize = 1000000, mergeResults=True, workingDir="tmpMatcher", doClean = False, verbosity = 0):\n- self._alignFileName = align\n- self._queryFileName = queryFileName\n- self.setSubjectFileName(subjectFileName)\n- self.setOutPrefix(prefix)\n- self._alignPattern = alignPattern\n- self._doJoin = doJoin\n- self._eValue = evalue\n- self._keepConflict = keepConflict\n- self._configFileName = config\n- self.setGroupId(groupId)\n- self._maxFileSize = maxFileSize\n- self._mergeResults = mergeResults\n- self._doClean = doClean\n- self._workingDir = workingDir\n- self._verbosity = verbosity\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- self._jobSectionName = "jobs"\n- \n- def setAttributesFromCmdLine(self):\n- description = "Launch Matcher in parallel."\n- epilog = "\\nExample 1: launch without verbosity and keep temporary files.\\n"\n- epilog += "\\t$ python LaunchMatcherInParallel.py -a in.align -v 0"\n- epilog += "\\n\\t"\n- epilog += "\\nExample 2: launch with verbosity to have errors (level 1) and basic information (level 2), and delete temporary files.\\n"\n- epilog += "\\t$ python LaunchMatcherInParallel.py -a in.align -q query.fa -s subject.fa -o query -c -v 2"\n- parser = RepetOptionParser(description = description, epilog = epilog)\n- parser.add_option("-'..b'eName, \'w\') as f:\n- f.write("query.name\\tquery.start\\tquery.end\\tquery.length\\tquery.length.%\\tmatch.length.%\\tsubject.name\\tsubject.start\\tsubject.end\\tsubject.length\\tsubject.length.%\\tE.value\\tScore\\tIdentity\\tpath\\n")\n-\n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- self._checkConfig()\n- self._checkOptions()\n- \n- self._log.info("START LaunchMatcherInParallel")\n- self._log.debug("Align file name: %s" % self._alignFileName)\n- self._log.debug("Query file name: %s" % self._queryFileName)\n- self._log.debug("Subject file name: %s" % self._subjectFileName)\n- if not os.path.exists(self._workingDir):\n- os.makedirs(self._workingDir)\n- else:\n- self._doClean = False\n- self._splitAlignFilePerSeq()\n- os.chdir(self._workingDir)\n- os.symlink("../%s" % self._queryFileName, self._queryFileName)\n- if self._queryFileName != self._subjectFileName:\n- os.symlink("../%s" % self._subjectFileName, self._subjectFileName)\n- \n- cDir = os.getcwd()\n- if not self._tmpDir:\n- self._tmpDir = cDir\n- \n- acronym = "Matcher"\n- iDb = DbFactory.createInstance()\n- jobdb = TableJobAdaptatorFactory.createInstance(iDb, "jobs")\n- iLauncher = Launcher(jobdb, os.getcwd(), "", "", cDir, self._tmpDir, "jobs", self._resources, self._groupId, acronym, chooseTemplateWithCopy = self._isCopyOnNode)\n-\n- lCmdsTuples = []\n- lCmdSize = []\n- lCmdCopy = []\n-\n- lFiles = FileUtils.getFileNamesList(".", self._alignPattern)\n- lFileSizeTuples = []\n- for fileName in lFiles:\n- fileSize = os.path.getsize(fileName)\n- lFileSizeTuples.append((fileName, fileSize))\n- lFileSizeList = LauncherUtils.createHomogeneousSizeList(lFileSizeTuples, self._maxFileSize)\n- \n- for lFiles in lFileSizeList:\n- lCmds = []\n- lCmdStart = []\n- lCmdFinish = []\n- if self._queryFileName:\n- lCmdStart.append("os.symlink(\\"%s/%s\\", \\"%s\\")" % (cDir, self._queryFileName, self._queryFileName))\n- if self._subjectFileName and self._subjectFileName != self._queryFileName:\n- lCmdStart.append("os.symlink(\\"%s/%s\\", \\"%s\\")" % (cDir, self._subjectFileName, self._subjectFileName))\n- for file in lFiles:\n- lCmds.append(self._getLaunchMatcherCmd(iLauncher, file))\n- lCmdStart.append("os.symlink(\\"%s/%s\\", \\"%s\\")" % (cDir, file, file))\n- lCmdFinish.append("if os.path.exists(\\"%s.match.path\\"):" % file)\n- lCmdFinish.append("\\tshutil.move(\\"%s.match.path\\", \\"%s/.\\" )" % (file, cDir))\n- lCmdFinish.append("if os.path.exists(\\"%s.match.tab\\"):" % file)\n- lCmdFinish.append("\\tshutil.move(\\"%s.match.tab\\", \\"%s/.\\" )" % (file, cDir))\n- lCmdsTuples.append(iLauncher.prepareCommands_withoutIndentation(lCmds, lCmdStart, lCmdFinish, lCmdSize, lCmdCopy))\n- \n- iLauncher.runLauncherForMultipleJobs("Matcher", lCmdsTuples, self._doClean, self._isCopyOnNode)\n-\n- if self._mergeResults:\n- FileUtils.catFilesByPattern("*.match.path", "../%s.match.path" % self._outPrefix)\n- if self._queryFileName or self._subjectFileName:\n- outTabFileName = "../%s.match.tab" % self._outPrefix\n- self._writeTabHeader(outTabFileName)\n- FileUtils.catFilesByPattern("*.match.tab", outTabFileName, skipHeaders = True)\n- os.chdir("..")\n- if self._doClean and self._mergeResults:\n- self._log.warning("Working directory will be cleaned")\n- shutil.rmtree(self._workingDir)\n- self._log.info("END LaunchMatchInParallel")\n-\n-if __name__ == "__main__":\n- iLaunch = LaunchMatcherInParallel()\n- iLaunch.setAttributesFromCmdLine()\n- iLaunch.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/ListAndDropTables.py --- a/commons/tools/ListAndDropTables.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,157 +0,0 @@ -#!/usr/bin/env python - -##@file -# List and drop MySQL tables. -# -# usage: ListAndDropTables.py [ options ] -# options: -# -h: this help -# -l: tables to list (can be a pattern, '*' for all) -# -d: tables to drop (can be a pattern, '*' for all) -# -C: configuration file -# -v: verbose (default=0/1) -# it doesn't drop 'info_tables' - - -import sys -import getopt -from commons.core.sql.DbMySql import DbMySql - - -class ListAndDropTables( object ): - - def __init__( self ): - self._action = "list" - self._tableNames = "" - self._configFileName = "" - self._verbose = 0 - self._db = None - - - def help( self ): - print "usage: %s [ options ]" % ( sys.argv[0].split("/")[-1] ) - print "options:" - print " -h: this help" - print " -l: tables to list (can be a pattern, '*' for all)" - print " -d: tables to drop (can be a pattern, '*' for all)" - print " -C: configuration file (otherwise, use env variables)" - print " -v: verbose (default=0/1)" - print "Note: it doesn't drop 'info_tables'." - - - def setAttributesFromCmdLine( self ): - try: - opts, args = getopt.getopt(sys.argv[1:],"hl:d:C:v:") - except getopt.GetoptError, err: - print str(err); self.help(); sys.exit(1) - for o,a in opts: - if o == "-h": - self.help(); sys.exit(0) - elif o == "-l": - self._action = "list" - self._tableNames = a - elif o == "-d": - self._action = "drop" - self._tableNames = a - elif o == "-C": - self._configFileName = a - elif o == "-v": - self._verbose = int(a) - - - def checkAttributes( self ): - """ - Before running, check the required attributes are properly filled. - """ - if self._tableNames == "": - print "ERROR: missing input table" - self.help() - sys.exit(1) -# if self._configFileName == "": -# print "ERROR: missing configuration file" -# self.help() -# sys.exit(1) - - - def getlistTables( self ): - """ - Return a list with the table names corresponding to the given pattern. - """ - lTables = [] - if self._tableNames != "*": - sql_cmd = "SHOW TABLES like '%%%s%%'" % ( self._tableNames ) - else: - sql_cmd = "SHOW TABLES" - self._db.execute( sql_cmd ) - res = self._db.fetchall() - for i in res: - lTables.append( i[0] ) - return lTables - - - def list( self ): - """ - List the tables corresponding to the pattern. - """ - lTables = i.getlistTables() - if len(lTables) == 0: - print "no table corresponding to '%s'" % ( self._tableNames ) - else: - print "list of tables:" - for t in lTables: - print t - print "%i tables corresponding to '%s'" % ( len(lTables), self._tableNames ) - sys.stdout.flush() - - - def drop( self ): - """ - Drop the tables corresponding to the pattern. - """ - lTables = i.getlistTables() - if len(lTables) == 0: - print "no table corresponding to '%s'" % ( self._tableNames ) - else: - print "deleting %i tables corresponding to '%s'" % ( len(lTables), self._tableNames ) - for t in lTables: - if t != "info_tables": - self._db.dropTable( t ) - sys.stdout.flush() - - - def start( self ): - self.checkAttributes() - if self._verbose > 0: - print "START %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - if self._configFileName != "": - self._db = DbMySql( cfgFileName = self._configFileName ) - else: - if self._verbose > 0: - print "WARNING: use environment variables to connect to MySQL" - sys.stdout.flush() - self._db = DbMySql() - - - def end( self ): - self._db.close() - if self._verbose > 0: - print "END %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - - def run( self ): - self.start() - if i._action == "list": - i.list() - if i._action == "drop": - i.drop() - self.end() - - -if __name__ == "__main__": - i = ListAndDropTables() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/MergeMatchsFiles.py --- a/commons/tools/MergeMatchsFiles.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,84 +0,0 @@ -from commons.core.utils.FileUtils import FileUtils -from commons.core.coord.Align import Align -import shutil -import os -import sys - -class MergeMatchsFiles(object): - - def __init__(self, fileType, outFileBaseName, allByAll = False, clean = True, verbose = 0): - self._fileType = fileType - self._outFileBaseName = outFileBaseName - self._allByAll = allByAll - self._verbose = verbose - self._clean = clean - - def _filterRedundantMatches( self, inFile, outFile ): - """ - When a pairwise alignment is launched ~ all-by-all (ie one batch against all chunks), - one filters the redundant matches. For instance we keep 'chunk3-1-100-chunk7-11-110-...' - and we discards 'chunk7-11-110-chunk3-1-100-...'. - Also we keep 'chunk5-1-100-chunk5-11-110-...' and we discards - 'chunk5-11-110-chunk5-1-100-...'. - For this of course the results need to be sorted by query, on plus strand, - and in ascending coordinates (always the case with Blaster). - """ - inFileHandler = open( inFile, "r" ) - outFileHandler = open( outFile, "w" ) - iAlign = Align() - countMatches = 0 - tick = 100000 - while True: - line = inFileHandler.readline() - if line == "": - break - countMatches += 1 - iAlign.setFromString( line ) - if "chunk" not in iAlign.range_query.seqname \ - or "chunk" not in iAlign.range_subject.seqname: - print "ERROR: 'chunk' not in seqname" - sys.exit(1) - if int(iAlign.range_query.seqname.split("chunk")[1]) < int(iAlign.range_subject.seqname.split("chunk")[1]): - iAlign.write( outFileHandler ) - elif int(iAlign.range_query.seqname.split("chunk")[1]) == int(iAlign.range_subject.seqname.split("chunk")[1]): - if iAlign.range_query.getMin() < iAlign.range_subject.getMin(): - iAlign.write( outFileHandler ) - if countMatches % tick == 0: # need to free buffer frequently as file can be big - outFileHandler.flush() - os.fsync( outFileHandler.fileno() ) - inFileHandler.close() - outFileHandler.close() - - def run(self): - if self._verbose > 1: - print "concatenate the results of each job" - sys.stdout.flush() - - tmpFileName = "%s.%s_tmp" % (self._outFileBaseName, self._fileType) - outFileName = "%s.%s" % (self._outFileBaseName, self._fileType) - pattern = "*.%s" % self._fileType - - if os.path.exists(tmpFileName): - os.remove(tmpFileName) - - FileUtils.catFilesByPattern(pattern, tmpFileName) - if self._clean: - FileUtils.removeFilesByPattern(pattern) - - if self._fileType == "align": - if self._allByAll: - self._filterRedundantMatches(tmpFileName, outFileName) - else: - shutil.move(tmpFileName, outFileName) - else: - prg = "%s/bin/%snum2id" % (os.environ["REPET_PATH"], self._fileType) - cmd = prg - cmd += " -i %s" % tmpFileName - cmd += " -o %s" % outFileName - cmd += " -v %i" % (self._verbose - 1) - log = os.system(cmd) - if log != 0: - print "*** Error: %s returned %i" % (prg, log) - sys.exit(1) - if self._clean and FileUtils.isRessourceExists(tmpFileName): - os.remove(tmpFileName) \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/MysqlConnect.py --- a/commons/tools/MysqlConnect.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,56 +0,0 @@ -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -from commons.core.sql.DbMySql import DbMySql -from commons.core.utils.RepetOptionParser import RepetOptionParser - -def main(): - description = "Check MySQL connection on a node" - usage = "MysqlConnect.py -n hostname" - - parser = RepetOptionParser(description = description, usage = usage, version = "v1.0") - parser.add_option( "-n", "--node", dest = "node", type = "string", help = "node name", default = "") - parser.add_option( "-C", "--config", dest = "config", type = "string", help = "path to config file", default = "") - - options, args = parser.parse_args() - - node = options.node - - try: - if options.config != "": - idbMySQL = DbMySql(cfgFileName = options.config) - else: - idbMySQL = DbMySql() - print "SUCCESS to connect to MySQL database from '%s'" % node - except SystemExit: - print "FAILED to connect to MySQL database from '%s'" % node - -if __name__ == '__main__': - main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/OrientSequences.py --- a/commons/tools/OrientSequences.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,375 +0,0 @@\n-#!/usr/bin/env python\n-\n-"""\n-Interface to orient sequences before making a multiple alignment.\n-Use hashing or suffix tree to get an idea of the appropriate strand.\n-Use \'orienter\' by default, otherwise use \'mummer\'.\n-"""\n-\n-import sys\n-import os\n-import glob\n-import getopt\n-\n-from commons.core.seq.BioseqDB import BioseqDB\n-import pyRepet.seq.fastaDB\n-from commons.core.checker.CheckerUtils import CheckerUtils\n-\n-class OrientSequences( object ):\n- """\n- Interface to orient sequences before making a multiple alignment.\n- Use hashing or suffix tree to get an idea of the appropriate strand.\n- Use \'orienter\' by default, otherwise use \'mummer\'.\n- """\n- \n- def __init__(self, inFileName="", minMatchLength=10, prgToOrient = "orienter", outFileName="", clean=False, verbosity=1):\n- """\n- Constructor.\n- """\n- self._inFileName = inFileName\n- self._minMatchLength = minMatchLength\n- self._prgToOrient = prgToOrient\n- self._outFileName = outFileName\n- self._clean = clean\n- self._verbose = verbosity\n- \n- def help( self ):\n- """\n- Display the help on stdout.\n- """\n- print\n- print "usage:",sys.argv[0].split("/")[-1],"[options]"\n- print "options:"\n- print " -h: this help"\n- print " -i: name of the input file (format=\'fasta\')"\n- print " -m: minimum match length (default=10)"\n- print " -p: program to use first (default=orienter/mummer)"\n- print " -o: name of the output file (default=inFileName+\'.oriented\')"\n- print " -c: clean"\n- print " -v: verbosity level (0/default=1/2)"\n- print\n- \n- def setAttributesFromCmdLine( self ):\n- """\n- Set the attributes from the command-line.\n- """\n- try:\n- opts, args = getopt.getopt(sys.argv[1:],"hi:m:p:o:cv:")\n- except getopt.GetoptError, err:\n- print str(err); self.help(); sys.exit(1)\n- for o,a in opts:\n- if o == "-h":\n- self.help(); sys.exit(0)\n- elif o == "-i":\n- self.setInputFileName( a )\n- elif o == "-m":\n- self.setMinMatchLength( a )\n- elif o == "-p":\n- self.setPrgToOrient( a )\n- elif o == "-o":\n- self.setOutputFileName( a )\n- elif o == "-c":\n- self.setClean()\n- elif o == "-v":\n- self.setVerbosityLevel( a )\n- \n- def setInputFileName( self, inFileName ):\n- self._inFileName = inFileName\n- \n- def setMinMatchLength( self, minMatchLength ):\n- self._minMatchLength = int(minMatchLength)\n- \n- def setPrgToOrient( self, prgToOrient ):\n- self._prgToOrient = prgToOrient\n- \n- def setOutputFileName( self, outFileName ):\n- self._outFileName = outFileName\n- \n- def setClean( self ):\n- self._clean = True\n- \n- def setVerbosityLevel( self, verbose ):\n- self._verbose = int(verbose)\n- \n- def checkAttributes( self ):\n- """\n- Check the attributes are valid before running the algorithm.\n- """\n- if self._inFileName == "":\n- print "ERROR: missing input file name"\n- self.help(); sys.exit(1)\n- if not os.path.exists( self._inFileName ):\n- print "ERROR: input file \'%s\' doesn\'t exist" % ( self._inFileName )\n- self.help(); sys.exit(1)\n- if self._prgToOrient not in [ "orienter", "mummer" ]:\n- print "ERROR: unknown program \'%s\'" % ( self._prgToOrient )\n- self.help(); sys.exit(1)\n- if self._outFileName == "":\n- self._outFileName = "%s.oriented" % ( self._inFileName )\n- \n- def useOrienter( self ):\n- """\n- Use \'orienter\'.\n- @return: exit value of \'orienter\'\n- """\n- prg = '..b'tStatus = self.useOrienter()\n- if exitStatus == 0:\n- self.end()\n- sys.exit(0)\n- if exitStatus != 0:\n- print "\\nWARNING: \'orienter\' had a problem, switching to \'mummer\'"\n- sys.stdout.flush()\n- \n- lInHeaders = pyRepet.seq.fastaDB.dbHeaders( self._inFileName )\n- nbInSeq = len( lInHeaders )\n- if self._verbose > 0:\n- print "nb of input sequences: %i" % ( nbInSeq )\n- sys.stdout.flush()\n- \n- pyRepet.seq.fastaDB.shortenSeqHeaders( self._inFileName, 1 )\n- tmpFileName = "%s.shortH" % ( self._inFileName )\n- lNewHeaders = pyRepet.seq.fastaDB.dbHeaders( tmpFileName )\n- dNew2Init = pyRepet.seq.fastaDB.retrieveLinksNewInitialHeaders( "%slink" % ( tmpFileName ) )\n- \n- pyRepet.seq.fastaDB.dbSplit( tmpFileName, nbSeqPerBatch=1, newDir=True )\n- os.chdir( "batches" )\n- self.compareInputSequencesWithMummer( nbInSeq )\n- dMatrix = self.getCumulativeMatchLengthsOnBothStrandForEachPairwiseComparison( lNewHeaders, nbInSeq )\n- os.chdir( ".." )\n- \n- lNewHeadersToReverse = self.getSequencesToReverseFromMatrix( dMatrix, lNewHeaders )\n- for newH in lNewHeadersToReverse:\n- lSequenceHeadersToReverse.append( dNew2Init[ newH ] )\n- if self._verbose > 0:\n- print "nb of sequences to reverse: %i" % ( len(lNewHeadersToReverse) )\n- for initH in lSequenceHeadersToReverse: print " %s" % ( initH )\n- sys.stdout.flush()\n- \n- if self._clean:\n- os.remove( tmpFileName )\n- os.remove( "%slink" % ( tmpFileName ) )\n- \n- return lSequenceHeadersToReverse\n- \n- def orientInputSequences( self, lSequenceHeadersToReverse, tmpFileName="" ):\n- """\n- Save input sequences while re-orienting those needing it.\n- @param lSequenceHeadersToReverse: list of headers corresponding to sequences than need to be re-oriented\n- @type lSequenceHeadersToReverse: list of strings\n- @param tmpFileName: name of a fasta file (inFileName by default)\n- @type tmpFileName: string\n- """\n- if self._verbose > 0:\n- print "saving oriented sequences..."\n- sys.stdout.flush()\n- if tmpFileName == "":\n- tmpFileName = self._inFileName\n- inDB = BioseqDB( tmpFileName )\n- outDB = BioseqDB()\n- for bs in inDB.db:\n- if bs.header in lSequenceHeadersToReverse:\n- bs.reverseComplement()\n- bs.header += " re-oriented"\n- outDB.add( bs )\n- outDB.save( self._outFileName )\n- \n- def clean( self ):\n- if os.path.exists( "batches" ):\n- os.system( "rm -rf batches" )\n- if os.path.exists( "orienter_error.log" ):\n- os.remove( "orienter_error.log" )\n- for f in glob.glob( "core.*" ):\n- os.remove( f )\n- \n- def start( self ):\n- """\n- Useful commands before running the program.\n- """\n- self.checkAttributes()\n- if self._verbose > 0:\n- print "START %s" % ( type(self).__name__ )\n- print "input file: %s" % ( self._inFileName )\n- sys.stdout.flush()\n- \n- def end( self ):\n- """\n- Useful commands before ending the program.\n- """\n- if self._clean:\n- self.clean()\n- if self._verbose > 0:\n- print "END %s" % ( type(self).__name__ )\n- sys.stdout.flush()\n- \n- def run( self ):\n- """\n- Run the program.\n- """\n- self.start()\n- lSequenceHeadersToReverse = self.getSequencesToReverse()\n- self.orientInputSequences( lSequenceHeadersToReverse )\n- self.end()\n- \n-if __name__ == "__main__":\n- i = OrientSequences()\n- i.setAttributesFromCmdLine()\n- i.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/PostAnalyzeTELib.py --- a/commons/tools/PostAnalyzeTELib.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,301 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.stat.Stat import Stat\n-from commons.core.seq.BioseqDB import BioseqDB\n-from commons.launcher.LaunchBlastclust import LaunchBlastclust\n-from commons.tools.AnnotationStats import AnnotationStats\n-import os\n-\n-CONSENSUS = "TE"\n-CLUSTER = "Cluster"\n-LOG_DEPTH = "repet.tools"\n-LOG_FORMAT = "%(message)s"\n-\n-class PostAnalyzeTELib(object):\n- \n- def __init__(self, analysis = 1, fastaFileName = "", clusterFileName = "", pathTableName="", seqTableName="", genomeSize=0, configFileName = "", doClean = False, verbosity = 3):\n- self._analysis = analysis\n- self._fastaFileName = fastaFileName\n- self._pathTableName = pathTableName\n- self._seqTableName = seqTableName\n- self._genomeSize = genomeSize\n- if self._analysis == 1:\n- self.setBioseqDB()\n- self._identity = 0\n- self._coverage = 80\n- self._applyCovThresholdOnBothSeq = False\n- self.setClusterFileName(clusterFileName)\n- self.setStatPerClusterFileName()\n- self.setClassifStatPerClusterFileName()\n- self.setAnnotationStatsPerTEFileName()\n- self.setAnnotationStatsPerClusterFileName()\n- self._doClean = doClean\n- self._verbosity = verbosity\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity, LOG_FORMAT)\n- \n- def setAttributesFromCmdLine(self):\n- description = "Tool to post-analyze a TE library : clusterize, give stats on cluster, on annotation,...\\n"\n- epilog = "\\nExample 1: clustering (e.g. to detect redundancy)\\n"\n- epilog += "\\t$ python PostAnalyzeTELib.py -a 1 -i TElib.fa -L 98 -S 95 -b\\n"\n- epilog += "Example 2: classification stats per cluster\\n"\n- epilog += "\\t$ python PostAnalyzeTELib.py -a 2 -t TElib.tab\\n"\n- epilog += "Example 3: annotation stats per consensus\\n"\n- epilog += "\\t$ python PostAnalyzeTELib.py -a 3 -p project_chr_allTEs_nr_noSSR_join_path -s project_refTEs_seq -g 129919500\\n"\n- epilog += "Example 4: annotation stats per cluster\\n"\n- epilog += "\\t$ python PostAnalyzeTELib.py -a 4 -t TElib.tab -p project_chr_al'..b'ce("-comp","")\n- if "-chim" in classifInfos:\n- nbChim += 1\n- classifInfos = classifInfos.replace("-chim","")\n- if "noCat" in classifInfos:\n- nbNoCat += 1\n- classifInfos = classifInfos.replace("noCat","")\n- \n- classif = classifInfos.split("-")[-1]\n- if classif != "":\n- if dClassifNb.get(classif, None) is None:\n- dClassifNb[classif] = 0\n- dClassifNb[classif] +=1\n- \n- occurences= []\n- for classif, occs in dClassifNb.items():\n- occurences.append("%s (%d)" % (classif, occs))\n- \n- f.write("%d\\t%d\\t%d\\t%d\\t%d\\t%s\\n" % (clusterId+1, nbNoCat, nbChim\\\n- , nbComp, nbIncomp,"\\t".join(occurences)))\n- \n- def _giveStatsOnTEClusters(self):\n- with open(self._clusterFileName) as fCluster:\n- with open(self._statPerClusterFileName, \'w\') as fStatPerCluster:\n- fStatPerCluster.write("cluster\\tsequencesNb\\tsizeOfSmallestSeq\\tsizeOfLargestSeq\\taverageSize\\tmedSize\\n")\n- line = fCluster.readline()\n- clusterNb = 0\n- clusterSeqList= line.split() \n- minClusterSize = len(clusterSeqList)\n- maxClusterSize = 0\n- totalSeqNb = 0\n- seqNbInBigClusters = 0\n- dClusterSize2ClusterNb = {1:0, 2:0, 3:0}\n- while line:\n- clusterSeqList= line.split() \n- seqNb = len(clusterSeqList)\n- totalSeqNb += seqNb\n- if seqNb > 2:\n- seqNbInBigClusters += seqNb\n- dClusterSize2ClusterNb[3] += 1\n- else:\n- dClusterSize2ClusterNb[seqNb] += 1\n- if seqNb > maxClusterSize:\n- maxClusterSize = seqNb\n- if seqNb < minClusterSize:\n- minClusterSize = seqNb\n- line = fCluster.readline()\n- clusterNb += 1\n- clusterSeqLengths = self._iBioseqDB.getSeqLengthByListOfName(clusterSeqList)\n- iStatSeqLengths = Stat(clusterSeqLengths)\n- fStatPerCluster.write("%d\\t%d\\t%d\\t%d\\t%d\\t%d\\n" %(clusterNb, seqNb, min(clusterSeqLengths), max(clusterSeqLengths), iStatSeqLengths.mean(), iStatSeqLengths.median()))\n- \n- with open(self._globalStatPerClusterFileName, \'w\') as fG:\n- fG.write("nb of clusters: %d\\n" % clusterNb)\n- fG.write("nb of clusters with 1 sequence: %d\\n" % dClusterSize2ClusterNb[1])\n- fG.write("nb of clusters with 2 sequences: %d\\n" % dClusterSize2ClusterNb[2])\n- fG.write("nb of clusters with >2 sequences: %d (%d sequences)\\n" % (dClusterSize2ClusterNb[3], seqNbInBigClusters))\n- fG.write("nb of sequences: %d\\n" % totalSeqNb)\n- fG.write("nb of sequences in the largest cluster: %d\\n" % maxClusterSize)\n- fG.write("nb of sequences in the smallest cluster: %d\\n" % minClusterSize)\n- lSeqSizes = self._iBioseqDB.getListOfSequencesLength()\n- iStat = Stat(lSeqSizes)\n- fG.write("size of the smallest sequence: %d\\n" % min(lSeqSizes))\n- fG.write("size of the largest sequence: %d\\n" % max(lSeqSizes))\n- fG.write("average sequences size: %d\\n" % iStat.mean())\n- fG.write("median sequences size: %d\\n" % iStat.median())\n-\n-if __name__ == "__main__":\n- iLaunch = PostAnalyzeTELib()\n- iLaunch.setAttributesFromCmdLine()\n- iLaunch.run()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/PrepareBatches.py --- a/commons/tools/PrepareBatches.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,126 +0,0 @@ -#!/usr/bin/env python - -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import os -import sys -from ConfigParser import NoSectionError, NoOptionError -from commons.core.checker.CheckerUtils import CheckerUtils -from commons.core.checker.CheckerException import CheckerException -from commons.core.utils.FileUtils import FileUtils -from commons.core.seq.FastaUtils import FastaUtils - -class PrepareBatches(object): - - def __init__(self, pipelineName, projectDir, projectName, iConfig, verbose): - self._pipelineName = pipelineName - self._projectDir = projectDir - self._projectName = projectName - self._iConfig = iConfig - self._verbose = verbose - - def run(self): - if self._verbose > 0: - print "beginning of step 1" - sys.stdout.flush() - if FileUtils.isRessourceExists("%s_db" % self._projectName): - print "ERROR: directory '%s_db' already exists" % self._projectName - sys.exit(1) - - os.mkdir("%s_db" % self._projectName) - os.chdir("%s_db" % self._projectName) - genomeFastaFileName = "%s.fa" % self._projectName - os.symlink("../%s" % genomeFastaFileName, genomeFastaFileName) - sectionName = "prepare_batches" - self._checkConfig(sectionName) - - separator = "\n" - inGenomeFileHandler = open(genomeFastaFileName, "r") - try: - CheckerUtils.checkHeaders(inGenomeFileHandler) - except CheckerException, e: - print "Error in file %s. Wrong headers are :" % genomeFastaFileName - print separator.join(e.messages) - print "Authorized characters are : a-z A-Z 0-9 - . : _\n" - inGenomeFileHandler.close() - sys.exit(1) - inGenomeFileHandler.close() - - doClean = False - if self._iConfig.get(sectionName, "clean") == "yes": - doClean = True - chunkFilePrefix = "%s_chunks" % self._projectName - chunkLength = int(self._iConfig.get(sectionName, "chunk_length")) - chunkOverlap = int(self._iConfig.get(sectionName, "chunk_overlap")) - FastaUtils.dbChunks(genomeFastaFileName, chunkLength, chunkOverlap, 0, chunkFilePrefix, doClean, self._verbose) - - nbSeq = int(self._iConfig.get(sectionName, "nb_seq_per_batch")) - FastaUtils.splitFastaFileInBatches("%s.fa" % chunkFilePrefix, nbSeq * chunkLength) - - if self._iConfig.get(sectionName, "clean") == "yes": - FileUtils.removeFilesByPattern("%s.fa*" % self._projectName) - - os.chdir( ".." ) - if self._verbose > 0: - print "step 1 finished successfully" - sys.stdout.flush() - - def _checkConfig(self, sectionName): - try: - CheckerUtils.checkSectionInConfigFile(self._iConfig, sectionName) - except NoSectionError: - print "ERROR: the section %s must be in your configuration file" % sectionName - sys.exit(1) - try: - CheckerUtils.checkOptionInSectionInConfigFile(self._iConfig, sectionName, "chunk_length") - except NoOptionError: - print "ERROR: the option 'chunk_length' must be defined in %s in your configuration file" % sectionName - sys.exit(1) - try: - CheckerUtils.checkOptionInSectionInConfigFile(self._iConfig, sectionName, "chunk_overlap") - except NoOptionError: - print "ERROR: the option 'chunk_overlap' must be defined in %s in your configuration file" % sectionName - sys.exit(1) - try: - CheckerUtils.checkOptionInSectionInConfigFile(self._iConfig, sectionName, "nb_seq_per_batch") - except NoOptionError: - print "ERROR: the option 'nb_seq_per_batch' must be defined in %s in your configuration file" % sectionName - sys.exit(1) - try: - CheckerUtils.checkOptionInSectionInConfigFile(self._iConfig, sectionName, "resources") - except NoOptionError: - print "ERROR: the option 'resources' must be defined in %s in your configuration file" % sectionName - sys.exit(1) - try: - CheckerUtils.checkOptionInSectionInConfigFile(self._iConfig, sectionName, "tmpDir") - except NoOptionError: - print "ERROR: the option 'tmpDir' must be defined in %s in your configuration file" % sectionName - sys.exit(1) |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/RetrieveInitHeaders.py --- a/commons/tools/RetrieveInitHeaders.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,150 +0,0 @@ -#! /usr/bin/env python - -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -from optparse import OptionParser -from commons.core.sql.DbMySql import DbMySql - -class RetrieveInitHeaders(object): - - def __init__(self, inTableName = "", linkFileName = "", outTableName = "", isQueryHeaders = True, clean = False, verbose = 0): - self._inTableName = inTableName - self._linkFileName = linkFileName - if outTableName == "": - self._outTableName = self._inTableName - else: - self._outTableName = outTableName - self._isQueryHeaders = isQueryHeaders - self._clean = clean - self._verbose = verbose - self._iDb = None - self._tmpTableName = "%s_tmp" % self._inTableName - - #TODO: can handle config file - #TODO: description, help... - def setAttributesFromCmdLine(self): - description = "" - parser = OptionParser(description = description) - parser.add_option("-i", "--input", dest = "inTableName", type = "string", help = "", default = "") - parser.add_option("-l", "--link", dest = "linkFileName", type = "string", help = "", default = "") - parser.add_option("-o", "--output", dest = "outTableName", type = "string", help = "(default = input table name)", default = "") - parser.add_option("-s", "--subject", dest = "isQueryHeaders", action = "store_false", help = "change subject name and not query name", default = True) - parser.add_option("-c", "--clean", dest = "clean", action = "store_true", help = "drop input table", default = False) - parser.add_option("-v", "--verbose", dest = "verbose", type = "int", help = "0 or 1", default = 0) - options, args = parser.parse_args() - self.setAttributesFromOptions(options) - - def setAttributesFromOptions(self, options): - self.setInTableName(options.inTableName) - self.setLinkFileName(options.linkFileName) - self.setOutTableName(options.outTableName) - self.setIsQueryHeaders(options.isQueryHeaders) - self.setClean(options.clean) - self.setVerbose(options.verbose) - - def setInTableName(self, inTableName): - self._inTableName = inTableName - self._tmpTableName = "%s_tmp" % self._inTableName - - def setLinkFileName(self, linkFileName): - self._linkFileName = linkFileName - - def setOutTableName(self, outTableName): - if outTableName == "": - self._outTableName = self._inTableName - else: - self._outTableName = outTableName - - def setIsQueryHeaders(self, isQueryHeaders): - self._isQueryHeaders = isQueryHeaders - - def setClean(self, clean): - self._clean = clean - - def setVerbose(self, verbose): - self._verbose = verbose - - #TODO: checkOptions - def checkOptions(self): - pass - - def run(self): - if self._verbose > 0: - print "START RetrieveInitHeaders.py" - self.checkOptions() - - if self._verbose > 0: - print "copy '%s' table to '%s' table" % (self._inTableName, self._tmpTableName) - self._iDb = DbMySql() - self._iDb.copyTable(self._inTableName, self._tmpTableName) - - if self._verbose > 0: - print "read '%s' file" % self._linkFileName - f = open(self._linkFileName) - line = f.readline() - count = 0 - while line: - oldHeader = line.split()[0] - newHeader = line.split()[1] - if self._isQueryHeaders: - self._updateQueryName(oldHeader, newHeader) - else: - self._updateSubjectName(oldHeader, newHeader) - count += 1 - line = f.readline() - f.close() - - if self._verbose > 0: - print "nb of relationships: %i" % count - if self._clean: - self._iDb.dropTable(self._inTableName) - if self._verbose > 0: - print "drop '%s' table" % self._inTableName - if self._verbose > 0: - print "rename '%s' table to '%s' table" % (self._tmpTableName, self._outTableName) - self._iDb.renameTable(self._tmpTableName, self._outTableName) - self._iDb.close() - if self._verbose > 0: - print "END RetrieveInitHeaders.py" - - #TODO: methods must be in TablePathAdaptator ? - def _updateQueryName(self, oldH, newH): - sqlCmd = "UPDATE %s SET query_name = '%s' WHERE query_name = '%s'" % (self._tmpTableName, newH, oldH) - self._iDb.execute(sqlCmd) - - def _updateSubjectName(self, oldH, newH): - sqlCmd = "UPDATE %s SET subject_name = '%s' WHERE subject_name = '%s'" % (self._tmpTableName, newH, oldH) - self._iDb.execute(sqlCmd) - -if __name__ == "__main__": - iRIH = RetrieveInitHeaders() - iRIH.setAttributesFromCmdLine() - iRIH.run() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/RmvPairAlignInChunkOverlaps.py --- a/commons/tools/RmvPairAlignInChunkOverlaps.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,286 +0,0 @@\n-#!/usr/bin/env python\n-\n-"""\n-Remove hits due to chunk overlaps.\n-"""\n-\n-import os\n-import sys\n-import getopt\n-import exceptions\n-import copy\n-from commons.core.coord.Align import *\n-\n-\n-class RmvPairAlignInChunkOverlaps( object ):\n- """\n- Remove hits due to chunk overlaps.\n- """\n- \n- \n- def __init__( self, inFileName="", chunkLength=200000, chunkOverlap=10000, margin=10, outFileName="", verbose=0 ):\n- """\n- Constructor.\n- """\n- self._inFileName = inFileName\n- self._chunkLength = chunkLength\n- self._chunkOverlap = chunkOverlap\n- self._margin = margin\n- self._outFileName = outFileName\n- self._verbose = verbose\n-\n- def help( self ):\n- """\n- Display the help.\n- """\n- print\n- print "usage: %s [ options ]" % ( sys.argv[0] )\n- print "options:"\n- print " -h: this help"\n- print " -i: name of the input file (format=\'align\')"\n- print " -l: chunk length (in bp)"\n- print " -o: chunk overlap (in bp)"\n- print " -m: margin to remove match included into a chunk overlap (default=10)"\n- print " -O: name of the output file (default=inFileName+\'.not_over\')"\n- print " -v: verbose (default=0/1)"\n- print\n-\n- def setAttributesFromCmdLine( self ):\n- """\n- Set attributes from the command-line arguments.\n- """\n- try:\n- opts, args = getopt.getopt(sys.argv[1:],"h:i:l:o:m:O:v:")\n- except getopt.GetoptError, err:\n- print str(err); self.help(); sys.exit(1)\n- for o,a in opts:\n- if o == "-h":\n- self.help(); sys.exit(0)\n- elif o == "-i":\n- self.setInputFileName( a )\n- elif o == "-l":\n- self.setChunkLength( a )\n- elif o == "-o":\n- self.setChunkOverlap( a )\n- elif o == "-m":\n- self.setMargin( a )\n- elif o == "-O":\n- self.setOutputFileName( a )\n- elif o == "-v":\n- self.setVerbosityLevel( a )\n- \n- def setInputFileName( self, inFileName ):\n- self._inFileName = inFileName\n- \n- def setChunkLength( self, chunkLength ):\n- self._chunkLength = int(chunkLength)\n- \n- def setChunkOverlap( self, chunkOverlap ):\n- self._chunkOverlap = int(chunkOverlap)\n- \n- def setMargin( self, margin ):\n- self._margin = int(margin)\n- \n- def setOutputFileName( self, outFileName ):\n- self._outFileName = outFileName\n- \n- def setVerbosityLevel( self, verbose ):\n- self._verbose = int(verbose)\n- \n- def checkAttributes( self ):\n- """\n- Before running, check the required attributes are properly filled.\n- """\n- if self._inFileName == "":\n- print "ERROR: missing input file"; self.help(); sys.exit(1)\n- if not os.path.exists(self._inFileName ):\n- print "ERROR: input file \'%s\' doesn\'t exist" %( self._inFileName )\n- if self._outFileName == "":\n- self._outFileName = "%s.not_over" % ( self._inFileName )\n- \n- \n- def isPairAlignAChunkOverlap( self, a, chunkQuery, chunkSubject ):\n- """\n- Return True if the pairwise alignment exactly corresponds to a 2-chunk overlap, False otherwise.\n- Take into account cases specific to BLASTER or PALS.\n- """\n- \n- if a.range_query.isOnDirectStrand() != a.range_subject.isOnDirectStrand():\n- if self._verbose > 1: print "on different strand"\n- return False\n- \n- if chunkQuery == chunkSubject + 1:\n- if self._verbose > 1: print "query > subject"\n- if a.range_query.start == 1 and a.range_subject.end == self._chunkLength \\\n- and ( a.range_query.getLength() == self._chunkOverlap \\\n- '..b' \n- if self._verbose > 1: print "not included"\n- return False\n- \n- \n- def removeChunkOverlaps( self ):\n- """\n- Remove pairwise alignments exactly corresponding to chunk overlaps or those included within such overlaps.\n- """\n- totalNbPairAlign = 0\n- nbChunkOverlaps = 0\n- d = {}\n- nbPairAlignWithinChunkOverlaps = 0\n- \n- inF = open( self._inFileName, "r" )\n- outF = open( self._outFileName, "w" )\n- alignInstance = Align()\n- \n- while True:\n- if not alignInstance.read( inF ): break\n- totalNbPairAlign += 1\n- if self._verbose > 1: alignInstance.show()\n- \n- if "chunk" not in alignInstance.range_query.seqname or "chunk" not in alignInstance.range_subject.seqname:\n- print "WARNING: no \'chunk\' in query or subject name"; return False\n- \n- chunkQuery = int(alignInstance.range_query.seqname.replace("chunk",""))\n- chunkSubject = int(alignInstance.range_subject.seqname.replace("chunk",""))\n- \n- if abs( chunkSubject - chunkQuery ) > 1:\n- if self._verbose > 1: print "non contiguous chunks -> keep"\n- alignInstance.write( outF )\n- continue\n- \n- if alignInstance.range_query.isOnDirectStrand() != alignInstance.range_subject.isOnDirectStrand():\n- if self._verbose > 1: print "on different strand"\n- alignInstance.write( outF )\n- continue\n- \n- if abs( chunkSubject - chunkQuery ) == 0:\n- if alignInstance.range_query.start == 1 \\\n- and alignInstance.range_query.end == self._chunkLength \\\n- and alignInstance.range_subject.start == 1 \\\n- and alignInstance.range_subject.end == self._chunkLength:\n- if self._verbose > 1: print "self-alignment on whole chunk -> remove"\n- continue\n- \n- if self.isPairAlignAChunkOverlap( alignInstance, chunkQuery, chunkSubject ):\n- if self._verbose > 1: print "chunk overlap -> remove"\n- nbChunkOverlaps += 1\n- \n- elif self.isPairAlignWithinAndDueToAChunkOverlap( alignInstance, chunkQuery, chunkSubject ):\n- if self._verbose > 1: print "within chunk overlap -> remove"\n- nbPairAlignWithinChunkOverlaps += 1\n- \n- else:\n- if self._verbose > 1: print "keep"\n- alignInstance.write( outF )\n- \n- inF.close()\n- if self._verbose > 0: print "nb of pairwise alignments in input file: %i" % ( totalNbPairAlign )\n- if self._verbose > 0: print "nb of chunk overlaps: %i" % ( nbChunkOverlaps )\n- if self._verbose > 0: print "nb of pairwise alignments within chunk overlaps: %i" % ( nbPairAlignWithinChunkOverlaps )\n- \n- for names,lAligns in d.items():\n- for alignInstance in lAligns:\n- alignInstance.write( outF )\n- outF.close()\n- \n- \n- def start( self ):\n- """\n- Useful commands before running the program.\n- """\n- if self._verbose > 0:\n- print "START %s" % ( type(self).__name__ ); sys.stdout.flush()\n- self.checkAttributes()\n- \n- \n- def end( self ):\n- """\n- Useful commands before ending the program.\n- """\n- if self._verbose > 0:\n- print "END %s" % ( type(self).__name__ ); sys.stdout.flush()\n- \n- \n- def run( self ):\n- """\n- Run the program.\n- """\n- self.start()\n- self.removeChunkOverlaps()\n- self.end()\n- \n- \n-if __name__ == \'__main__\':\n- i = RmvPairAlignInChunkOverlaps()\n- i.setAttributesFromCmdLine()\n- i.run()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/SpliceTEsFromGenome.py --- a/commons/tools/SpliceTEsFromGenome.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,193 +0,0 @@ -#!/usr/bin/env python - -import sys -import os -import getopt - -from commons.core.sql.DbMySql import DbMySql -from commons.core.seq.FastaUtils import FastaUtils -from commons.core.coord.MapUtils import MapUtils -from commons.core.coord.AlignUtils import AlignUtils -from commons.core.coord.PathUtils import PathUtils - - -class SpliceTEsFromGenome( object ): - - def __init__( self ): - self._inputData = "" - self._formatData = "" - self._genomeFile = "" - self._configFile = "" - self._outFile = "" - self._verbose = 0 - self._db = None - - - def help( self ): - print "usage: SpliceTEsFromGenome.py [ options ]" - print "options:" - print " -h: this help" - print " -i: input TE coordinates (can be file or table)" - print " TEs as subjects if align or path format" - print " -f: format of the data (map/align/path)" - print " -g: genome file (format=fasta)" - print " -C: configuration file (if table as input)" - print " -o: output fasta file (default=genomeFile+'.splice')" - print " -v: verbosity level (default=0/1)" - - - def setAttributesFromCmdLine( self ): - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:f:g:C:o:v:") - except getopt.GetoptError, err: - msg = "%s" % str(err) - sys.stderr.write( "%s\n" % msg ) - self.help(); sys.exit(1) - for o,a in opts: - if o == "-h": - self.help(); sys.exit(0) - elif o == "-i": - self._inputData = a - elif o == "-f": - self._formatData = a - elif o == "-g": - self._genomeFile = a - elif o == "-C": - self._configFile = a - elif o =="-o": - self._outFile = a - elif o == "-v": - self._verbose = int(a) - - - def checkAttributes( self ): - if self._inputData == "": - msg = "ERROR: missing input data (-i)" - sys.stderr.write( "%s\n" % msg ) - self.help() - sys.exit(1) - if not os.path.exists( self._inputData ): - if not os.path.exists( self._configFile ): - msg = "ERROR: neither input file '%s' nor configuration file '%s'" % ( self._inputData, self._configFile ) - sys.stderr.write( "%s\n" % msg ) - self.help() - sys.exit(1) - if not os.path.exists( self._configFile ): - msg = "ERROR: can't find config file '%s'" % ( self._configFile ) - sys.stderr.write( "%s\n" % msg ) - sys.exit(1) - self._db = DbMySql( cfgFileName=self._configFile ) - if not self._db.doesTableExist( self._inputData ): - msg = "ERROR: can't find table '%s'" % ( self._inputData ) - sys.stderr.write( "%s\n" % msg ) - self.help() - sys.exit(1) - if self._formatData == "": - msg = "ERROR: need to precise format (-f)" - sys.stderr.write( "%s\n" % msg ) - self.help() - sys.exit(1) - if self._formatData not in [ "map", "align", "path" ]: - msg = "ERROR: format '%s' not yet supported" % ( self._formatData ) - sys.stderr.write( "%s\n" % msg ) - self.help() - sys.exit(1) - if self._genomeFile == "": - msg = "ERROR: missing genome file (-g)" - sys.stderr.write( "%s\n" % msg ) - self.help() - sys.exit(1) - if not os.path.exists( self._genomeFile ): - msg = "ERROR: can't find genome file '%s'" % ( self._genomeFile ) - sys.stderr.write( "%s\n" % msg ) - self.help() - sys.exit(1) - if self._outFile == "": - self._outFile = "%s.splice" % ( self._genomeFile ) - if self._verbose > 0: - print "output fasta file: %s" % self._outFile - - - def getCoordsAsMapFile( self ): - if self._verbose > 0: - print "get TE coordinates as 'Map' file" - sys.stdout.flush() - if self._db != None: - cmd = "srptExportTable.py" - cmd += " -i %s" % ( self._inputData ) - cmd += " -C %s" % ( self._configFile ) - cmd += " -o %s.%s" % ( self._inputData, self._formatData ) - returnStatus = os.system( cmd ) - if returnStatus != 0: - msg = "ERROR while exporting data from table" - sys.stderr.write( "%s\n" % msg ) - sys.exit(1) - self._inputData += ".%s" % ( self._formatData ) - - if self._formatData == "map": - return self._inputData - elif self._formatData == "align": - mapFile = "%s.map" % ( self._inputData ) - AlignUtils.convertAlignFileIntoMapFileWithSubjectsOnQueries( self._inputData, mapFile ) - return mapFile - elif self._formatData == "path": - mapFile = "%s.map" % ( self._inputData ) - PathUtils.convertPathFileIntoMapFileWithSubjectsOnQueries( self._inputData, mapFile ) - return mapFile - - - def mergeCoordsInMapFile( self, mapFile ): - if self._verbose > 0: - print "merge TE coordinates" - sys.stdout.flush() - mergeFile = "%s.merge" % ( mapFile ) - MapUtils.mergeCoordsInFile( mapFile, mergeFile ) - if self._formatData != "map" or self._db != None: - os.remove( mapFile ) - return mergeFile - - - def spliceFastaFromCoords( self, mergeFile ): - if self._verbose > 0: - print "splice TE copies from the genome" - sys.stdout.flush() - FastaUtils.spliceFromCoords( self._genomeFile, - mergeFile, - self._outFile ) - - os.remove( mergeFile ) - - - def start( self ): - self.checkAttributes() - if self._verbose > 0: - print "START SpliceTEsFromGenome.py" - sys.stdout.flush() - - - def end( self ): - if self._db != None: - self._db.close() - if self._verbose > 0: - print "END SpliceTEsFromGenome.py" - sys.stdout.flush() - - - def run( self ): - self.start() - - mapFile = self.getCoordsAsMapFile() - - mergeFile = self.mergeCoordsInMapFile( mapFile ) - - self.spliceFastaFromCoords( mergeFile ) - - self.end() - - -if __name__ == "__main__": - i = SpliceTEsFromGenome() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/SplicerFromAnnotation.py --- a/commons/tools/SplicerFromAnnotation.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,218 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-\n-import os\n-import sys\n-import ConfigParser\n-\n-from commons.core.sql.DbMySql import DbMySql\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.parsing.FastaParser import FastaParser\n-from ConfigParser import MissingSectionHeaderError\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.core.sql.TablePathAdaptator import TablePathAdaptator\n-from commons.core.LoggerFactory import LoggerFactory\n-\n-#TODO: use configuration file\n-\n-LOG_DEPTH = "repet.tools"\n-\n-## Get 3 annotation files, using output from TEannot:\n-#- consensus with one or more full length copy, \n-#- consensus with one or more full length fragment,\n-#- consensus without copy\n-\n-class SplicerFromAnnotation(object):\n- \n- def __init__(self, inInfoFileName = "", tableName = "", verbose = 0):\n- self._inInfoFileName = inInfoFileName\n- self._tableName = tableName\n- self._verbosity = verbose\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def _logAndRaise(self, errorMsg):\n- self._log.error(errorMsg)\n- raise Exception(errorMsg)\n- \n- def setAttributesFromCmdLine(self):\n- desc = "Splice annotations from genome. These annotations are Full Length Copy or Full Length Fragment according to consensus."\n- desc += "A TEs library and annotation are necessary. Connection to the database parameters are retrieved from the environment"\n- \n- examples = "\\nExample : with a project called \\"MyTEannotAnalysis\\":\\n"\n- examples += "\\t$ python SplicerFromAnnotation.py -i inputFastaFileName -C configFileName -t MyTEannotAnalysis_refTEs_seq "\n- examples += "\\n\\t"\n- examples += "\\n\\n"\n- \n- parser = RepetOptionParser(description = desc, epilog = examples)\n- parser.add_option("-i", "--file", dest = "inputFastaFileName", action = "store", type = "string", help = "input file (mandatory) = output file with .splice)")\n- parser.add_option("-C", "--config", dest = "configFileName", action = "store", type = "string", help = "config file name to set database connection", default = "")\n- parser.add_option("-t", "--copyType", dest = "copyType" , action = "store"'..b' self._logAndRaise("Input fasta file does not exist!")\n- else:\n- self._logAndRaise("No specified -i option! It is mandatory")\n- \n- if self._outputFileName =="":\n- self._outputFileName = os.path.basename(self._inputFastaFileName)+\'.splice\'\n- \n- if self._copyType!=1 or self._copyType!=2:\n- self._logAndRaise("Copy type must be only 1 or 2!")\n- if self._configFileName != "":\n- iDb = DbMySql(cfgFileName = self._configFileName)\n- iDb.close()\n- else:\n- self._logAndRaise("No specified config file name!")\n-\n- \n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- self.checkOptions()\n- \n- msg = "START SplicerFromAnnotation"\n- msg += "\\n input info file: %s" % self._inputFastaFileName\n- msg += "\\n Copy type is: %s" % self._copyType\n- msg += "\\n identity is: %s" % self._identity\n- msg += "\\n host is: %s" % os.environ["REPET_HOST"]\n- msg += "\\n user is: %s" % os.environ["REPET_USER"]\n- msg += "\\n DB is: %s" % os.environ["REPET_DB"] \n- msg += "\\n port is: %s" % os.environ["REPET_PORT"]\n- self._log.debug("%s\\n" % msg)\n- \n- cmd="PostAnalyzeTELib.py -a 3 -p %s_chr_allTEs_nr_noSSR_join_path -s %s_refTEs_seq -g %s" % (self._projectName,self._projectName,self.genomeSize) \n- os.system(cmd)\n- \n- cmd="GetSpecificTELibAccordingToAnnotation.py -i %s_chr_allTEs_nr_noSSR_join_path.annotStatsPerTE.tab -t %s_refTEs_seq -v 2" % (self._projectName,self._projectName)\n- os.system(cmd) \n-\n- if self._copyType == 1 :\n- f = open("Splicer_inputFile_chr_allTEs_nr_noSSR_join_path.annotStatsPerTE_FullLengthCopy.txt", "r")\n- else :\n- f = open("Splicer_inputFile_chr_allTEs_nr_noSSR_join_path.annotStatsPerTE_FullLengthFrag.txt", "r")\n- \n- lines=f.readlines()[1:]\n- if len(lines)>0:\n- lConsensusHeader_copyType=[i.split(\'\\t\',1)[0] for i in lines] \n- db = DbFactory.createInstance()\n- \n- sql_cmd = "CREATE TABLE %s_annotationIdentitySup%d_path SELECT * FROM %s_chr_allTEs_nr_noSSR_join_path where identity >=%f" % ( self._projectName,int(self._identity),self._projectName,self._identity)\n- db.execute( sql_cmd )\n- \n- iTPA = TablePathAdaptator(db, "%s_annotationIdentitySup%d_path" % (self._projectName, int(self._identity)))\n- lAllDistinctPath=[]\n- for consensusName in lConsensusHeader_copyType:\n- lDistinctPath = iTPA.getIdListFromSubject(consensusName)\n- lAllDistinctPath=lAllDistinctPath+lDistinctPath\n- \n- iTPA = TablePathAdaptator(db,"%s_chr_allTEs_nr_noSSR_join_path" % self._projectName)\n- sql_cmd = "CREATE TABLE %s_annotationToSplice_path LIKE %s_chr_allTEs_nr_noSSR_join_path" % ( self._projectName, self._projectName )\n- db.execute( sql_cmd )\n-\n- for pathId in lAllDistinctPath:\n- sql_cmd = "INSERT INTO %s_annotationToSplice_path SELECT * FROM %s_chr_allTEs_nr_noSSR_join_path where path =%d" % ( self._projectName, self._projectName, pathId )\n- db.execute( sql_cmd ) \n- db.close()\n- \n- cmd="SpliceTEsFromGenome.py -i %s_annotationToSplice_path -f path -g %s -o %s -C %s -v 2" % (self._projectName, self._inputFastaFileName, self._outputFileName, self._configFileName) \n- os.system(cmd)\n- \n- else : \n- msg = "There is no consensus in this copy type.\\n"\n- self._log.info(msg)\n- f.close() \n- \n- self._log.info("END SplicerFromAnnotation")\n- return 0\n-\n-if __name__ == \'__main__\':\n- iGetTELib = SplicerFromAnnotation()\n- iGetTELib.setAttributesFromCmdLine()\n- iGetTELib.run() \n- \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/TEclassifierPE.py --- a/commons/tools/TEclassifierPE.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,193 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-import os\n-import sys\n-\n-if not "REPET_PATH" in os.environ.keys():\n- print "ERROR: no environment variable REPET_PATH"\n- sys.exit(1)\n-sys.path.append(os.environ["REPET_PATH"])\n-if not "PYTHONPATH" in os.environ.keys():\n- os.environ["PYTHONPATH"] = os.environ["REPET_PATH"]\n-else:\n- os.environ["PYTHONPATH"] = "%s:%s" % (os.environ["REPET_PATH"], os.environ["PYTHONPATH"])\n- \n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.checker.ConfigChecker import ConfigRules\n-from commons.core.checker.ConfigChecker import ConfigChecker\n-from commons.core.seq.FastaUtils import FastaUtils\n-from denovo_pipe.ReverseComplementAccordingToClassif import ReverseComplementAccordingToClassif\n-from denovo_pipe.RenameHeaderClassif import RenameHeaderClassif\n-from denovo_pipe.DetectTEFeatures import DetectTEFeatures\n-from denovo_pipe.LaunchPASTEC import LaunchPASTEC\n-from PASTEC.StatPastec import StatPastec\n-\n-LOG_DEPTH = "repet.tools"\n-#LOG_FORMAT = "%(message)s"\n-\n-####TEclassifier PASTEC Edition\n-#\n-class TEclassifierPE(object):\n- \n- def __init__(self, fastaFileName = "", configFileName = "", addWickerCode = False, reverseComp = False, doClean = False, verbosity = 0):\n- self._fastaFileName = fastaFileName\n- self._addWickerCode = addWickerCode\n- self._reverseComp = reverseComp\n- self._configFileName = configFileName\n- self._doClean = doClean\n- self._verbosity = verbosity\n- self._projectName = ""\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def setAttributesFromCmdLine(self):\n- description = "TE classifier PASTEC Edition.\\n"\n- description += "Detect TE features on consensus and classify them. Give some classification statistics.\\n"\n- description += "Can rename headers with classification info and Wicker\'s code at the beginning.\\n"\n- description += "Can reverse-complement consensus if they are detected in reverse strand.\\n"\n- description += "Warning : it\'s highly advised to use sequences in upper case.\\n"\n- epilog = "\\n"\n- epilog += "Example 1: launch and clean temporary files\\n"\n- epilog += "\\t$ python TEclassifierPE.py -i consensus.fa -'..b'ions.reverseComp)\n- self.setConfigFileName(options.configFileName)\n- self.setDoClean(options.doClean)\n- self.setVerbosity(options.verbosity)\n-\n- def _checkConfig(self): \n- iConfigRules = ConfigRules()\n- iConfigRules.addRuleOption(section="project", option ="project_name", mandatory=True, type="string")\n- sectionName = "classif_consensus"\n- iConfigRules.addRuleOption(section=sectionName, option ="clean", mandatory=True, type="bool")\n- iConfigChecker = ConfigChecker(self._configFileName, iConfigRules)\n- iConfig = iConfigChecker.getConfig()\n- self._setAttributesFromConfig(iConfig)\n- \n- def _setAttributesFromConfig(self, iConfig):\n- self.setProjectName(iConfig.get("project", "project_name"))\n- sectionName = "classif_consensus"\n- self.setDoClean(iConfig.get(sectionName, "clean"))\n- \n- def setFastaFileName(self, fastaFileName):\n- self._fastaFileName = fastaFileName\n- \n- def setConfigFileName(self, configFileName):\n- self._configFileName = configFileName\n- \n- def setAddWickerCode(self, addWickerCode):\n- self._addWickerCode = addWickerCode\n- \n- def setReverseComp(self, reverseComp):\n- self._reverseComp = reverseComp\n- \n- def setDoClean(self, doClean):\n- self._doClean = doClean\n- \n- def setVerbosity(self, verbosity):\n- self._verbosity = verbosity\n- \n- def setProjectName(self, projectName):\n- self._projectName = projectName\n- \n- def _checkOptions(self):\n- if self._fastaFileName == "":\n- self._logAndRaise("ERROR: Missing input fasta file name")\n- \n- def _logAndRaise(self, errorMsg):\n- self._log.error(errorMsg)\n- raise Exception(errorMsg)\n- \n- def run(self):\n- LoggerFactory.setLevel(self._log, self._verbosity)\n- if self._configFileName:\n- self._checkConfig()\n- self._checkOptions()\n- self._log.info("START TEclassifier PASTEC Edition")\n- self._log.debug("Fasta file name: %s" % self._fastaFileName)\n- nbSeq = FastaUtils.dbSize(self._fastaFileName)\n- self._log.debug("Total number of sequences: %i)" % nbSeq)\n-\n- #TODO: add step => avoid to re-launch DetectTEFeatures, if error with PASTEC (e.g. wrong bank format)\n- #step 1\n- iDF = DetectTEFeatures(self._fastaFileName, self._projectName, self._configFileName, self._doClean, self._verbosity)\n- iDF.run()\n- \n- #step 2\n- iLP = LaunchPASTEC(configFileName = self._configFileName, inputFileName = self._fastaFileName, projectName = self._projectName, verbose = self._verbosity)\n- iLP.run()\n- \n- classifFileName = "%s.classif" % self._projectName\n-\n- iSP = StatPastec(classifFileName)\n- iSP.run()\n- \n- if self._reverseComp:\n- self._log.info("Reverse complement...")\n- iRevComplAccording2Classif = ReverseComplementAccordingToClassif()\n- iRevComplAccording2Classif.setFastaFile(self._fastaFileName)\n- iRevComplAccording2Classif.setClassifFile(classifFileName)\n- iRevComplAccording2Classif.run()\n- tmpFastaFileName = "%s_negStrandReversed.fa" % os.path.splitext(self._fastaFileName)[0]\n- else:\n- tmpFastaFileName = self._fastaFileName\n-\n- if self._addWickerCode:\n- self._log.info("Rename headers according to Wicker\'s code...")\n- iRHC = RenameHeaderClassif(classifFileName, tmpFastaFileName, self._projectName)\n- iRHC.setOutputFileName("")\n- iRHC.run()\n- if self._doClean:\n- os.remove(tmpFastaFileName)\n- \n- self._log.info("END TEclassifier PASTEC Edition")\n-\n-if __name__ == "__main__":\n- iLaunch = TEclassifierPE()\n- iLaunch.setAttributesFromCmdLine()\n- iLaunch.run() \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/TEclassifierPE_parallelized.py --- a/commons/tools/TEclassifierPE_parallelized.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,261 +0,0 @@\n-#!/usr/bin/env python\n-\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-import os\n-import sys\n-import shutil\n-\n-if not "REPET_PATH" in os.environ.keys():\n- print "ERROR: no environment variable REPET_PATH"\n- sys.exit(1)\n-sys.path.append(os.environ["REPET_PATH"])\n-if not "PYTHONPATH" in os.environ.keys():\n- os.environ["PYTHONPATH"] = os.environ["REPET_PATH"]\n-else:\n- os.environ["PYTHONPATH"] = "%s:%s" % (os.environ["REPET_PATH"], os.environ["PYTHONPATH"])\n- \n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.checker.ConfigChecker import ConfigRules\n-from commons.core.checker.ConfigChecker import ConfigChecker\n-from commons.core.seq.FastaUtils import FastaUtils\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.core.sql.TableJobAdaptatorFactory import TableJobAdaptatorFactory\n-from commons.core.launcher.Launcher import Launcher\n-from denovo_pipe.ReverseComplementAccordingToClassif import ReverseComplementAccordingToClassif\n-from denovo_pipe.DetectTEFeatures_parallelized import DetectTEFeatures_parallelized\n-from denovo_pipe.RenameHeaderClassif import RenameHeaderClassif\n-from denovo_pipe.LaunchPASTEC import LaunchPASTEC\n-from PASTEC.StatPastec import StatPastec\n-\n-LOG_DEPTH = "repet.tools"\n-#LOG_FORMAT = "%(message)s"\n-\n-####TEclassifier PASTEC Edition - parallelized\n-#\n-class TEclassifierPE_parallelized(object):\n- \n- def __init__(self, fastaFileName = "", configFileName = "", addWickerCode = False, reverseComp = False, doClean = False, verbosity = 0):\n- self._fastaFileName = fastaFileName\n- self._addWickerCode = addWickerCode\n- self._reverseComp = reverseComp\n- self._configFileName = configFileName\n- self._doClean = doClean\n- self._verbosity = verbosity\n- self._projectName = ""\n- self._log = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self._verbosity)\n- \n- def setAttributesFromCmdLine(self):\n- description = "TE classifier PASTEC Edition.\\n"\n- description += "Detect TE features on consensus and classify them. Give some classification statistics.\\n"\n- description += "Can rename headers with classification info and Wicker\'s code at the beginning.\\n"\n- description += "Can reverse-comple'..b'f._configFileName:\n- self._checkConfig()\n- self._checkOptions()\n- self._log.info("START TEclassifier PASTEC Edition")\n- self._log.debug("Fasta file name: %s" % self._fastaFileName)\n- nbSeq = FastaUtils.dbSize(self._fastaFileName)\n- self._log.debug("Total number of sequences: %i)" % nbSeq)\n-\n- self._log.debug("Launch DetectTEFeatures on each batch")\n- iDF = DetectTEFeatures_parallelized(self._fastaFileName, self._projectName, self._configFileName, self._doClean, self._verbosity)\n- iDF.run()\n- \n- self._log.debug("Insert banks in database")\n- iLP = LaunchPASTEC(self._configFileName, "1", projectName = self._projectName, verbose = self._verbosity)\n- iLP.run()\n- \n- self._log.info("Split fasta file")\n- if self._maxJobNb == 0 or nbSeq / self._maxJobNb <= 1.0:\n- nbSeqPerBatch = nbSeq\n- else:\n- nbSeqPerBatch = nbSeq / self._maxJobNb + 1\n- FastaUtils.dbSplit(self._fastaFileName, nbSeqPerBatch, True, verbose = self._verbosity - 2)\n- \n- self._log.info("Launch PASTEC on each batch")\n- queue = self._resources\n- cDir = os.getcwd()\n- if self._tmpDir != "":\n- tmpDir = self._tmpDir\n- else:\n- tmpDir = cDir\n- \n- #TODO: allow not to parallelize\n- groupid = "%s_PASTEC" % self._projectName\n- acronym = "PASTEC"\n- iDb = DbFactory.createInstance()\n- iTJA = TableJobAdaptatorFactory.createInstance(iDb, "jobs")\n- iLauncher = Launcher(iTJA, os.getcwd(), "", "", cDir, tmpDir, "jobs", queue, groupid)\n- lCmdsTuples = []\n- lFiles = FileUtils.getFileNamesList("%s/batches" % cDir, "batch_")\n- if len(lFiles) == 0:\n- self._logAndRaise("ERROR: directory \'batches\' is empty")\n- classifFileName = "%s.classif" % self._projectName\n- count = 0\n- for file in lFiles:\n- count += 1\n- lCmds = [self.getPASTECcommand(iLauncher, file)] \n- lCmdStart = []\n- lCmdStart.append("shutil.copy(\\"%s/batches/%s\\", \\".\\")" % (cDir, file))\n- lCmdStart.append("shutil.copy(\\"%s/%s\\", \\".\\")" % (cDir, self._configFileName))\n- lCmdFinish = []\n- lCmdFinish.append("shutil.move(\\"%s\\", \\"%s/%s_%i\\")" % (classifFileName, cDir, classifFileName, count))\n- lCmdsTuples.append(iLauncher.prepareCommands_withoutIndentation(lCmds, lCmdStart, lCmdFinish))\n- iLauncher.runLauncherForMultipleJobs(acronym, lCmdsTuples, self._doClean) \n- \n- FileUtils.catFilesByPattern("%s_*" % classifFileName, classifFileName)\n- if self._doClean:\n- FileUtils.removeFilesByPattern("%s_*" % classifFileName)\n- shutil.rmtree("batches")\n-\n- self._log.debug("Compute stats about classification")\n- iSP = StatPastec(classifFileName)\n- iSP.run()\n- \n- if self._reverseComp:\n- self._log.debug("Reverse complement")\n- iRevComplAccording2Classif = ReverseComplementAccordingToClassif()\n- iRevComplAccording2Classif.setFastaFile(self._fastaFileName)\n- iRevComplAccording2Classif.setClassifFile(classifFileName)\n- iRevComplAccording2Classif.run()\n- newFastaFileName = "%s_negStrandReversed.fa" % os.path.splitext(self._fastaFileName)[0]\n- else:\n- newFastaFileName = self._fastaFileName\n-\n- if self._addWickerCode:\n- self._log.debug("Rename headers according to Wicker\'s code")\n- iRHC = RenameHeaderClassif(classifFileName, newFastaFileName, self._projectName)\n- iRHC.setOutputFileName("")\n- iRHC.run()\n- \n- self._log.info("END TEclassifier PASTEC Edition")\n-\n-if __name__ == "__main__":\n- iLaunch = TEclassifierPE_parallelized()\n- iLaunch.setAttributesFromCmdLine()\n- iLaunch.run() \n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/blast2align.py --- a/commons/tools/blast2align.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,75 +0,0 @@ -#!/usr/bin/env python - -import sys -import getopt - - -def help(): - print "usage: blast2align.py [ options ]" - print "options:" - print " -h: this help" - print " -i: input file name (format=tabulated BLAST)" - print " -o: output file name (format=align, default=inFileName+'.align')" - - -def blast2align( inFile, outFile ): - inFileHandler = open( inFile, "r" ) - outFileHandler = open( outFile, "w" ) - while True: - line = inFileHandler.readline() - if line == "": - break - if line[0] != "#": - data = line.split("\t") - qryName = data[0] - sbjName = data[1] - percId = data[2] - qryStart = data[6] - qryEnd = data[7] - sbjStart = data[8] - sbjEnd = data[9] - Eval = data[10] - bitScore = data[11][:-1] - string = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % ( qryName, qryStart, qryEnd, sbjName, sbjStart, sbjEnd, Eval, bitScore, percId ) - outFileHandler.write( string ) - inFileHandler.close() - outFileHandler.close() - - -def main(): - inFileName = "" - outFileName = "" - - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:o:") - except getopt.GetoptError, err: - sys.stderr.write( "%s\n" % str(err) ) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-o": - outFileName = a - - if inFileName == "": - msg = "ERROR: missing input file name (-i)" - sys.stderr.write( "%s\n" % msg ) - help() - sys.exit(1) - - if outFileName == "": - outFileName = inFileName + ".align" - - blast2align( inFileName, outFileName ) - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/dbBestLength.py --- a/commons/tools/dbBestLength.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,94 +0,0 @@ -#!/usr/bin/env python - -## @file -# This program extracts the n longest sequences from the input fasta file. -# usage: dbBestLength.py [ options ] -# options: -# -h: this help -# -i: name of the input fasta file -# -n: maximum number of sequences in the output file (default=20) -# -o: name of the output fasta file (default=inFileName+'.best20') -# -v: verbose (default=0/1/2) - -import os -import sys -import getopt - -if not os.environ.has_key( "REPET_PATH" ): - print "*** Error: no environment variable REPET_PATH" - sys.exit(1) -sys.path.append( os.environ["REPET_PATH"] ) - -from pyRepet.seq.fastaDB import * - - -def help(): - """ - Give the list of the command-line options. - """ - print "usage: dbBestLength.py [ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input fasta file" - print " -n: maximum number of sequences in the output file (default=20)" - print " -o: name of the output fasta file (default=inFileName+'.best20')" - print " -v: verbose (default=0/1/2)" - - -def main(): - """ - This program extracts the n longest sequences from the input fasta file. - """ - - inFileName = "" - nbSeq = 20 - outFileName = "" - verbose = 0 - - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:n:o:v:") - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-n": - nbSeq = a - elif o == "-o": - outFileName = a - elif o == "-v": - verbose = int(a) - - if inFileName == "": - print "ERROR: missing input file (-i)" - help() - sys.exit(1) - - if verbose > 0: - print "START dbBestLength.py" - sys.stdout.flush() - - if outFileName == "": - outFileName = "%s.best%s" % ( inFileName, nbSeq ) - - log = dbBestLength( nbSeq, inFileName, outFileName, verbose ) - if log != 0: - print "ERROR: dbBestLength() returned %i" % ( log ) - sys.exit(1) - - if verbose > 0: - print "END dbBestLength.py" - sys.stdout.flush() - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/dbConsensus.py --- a/commons/tools/dbConsensus.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,133 +0,0 @@ -#!/usr/bin/env python - -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import os -import sys -import getopt - -##@file -# usage: dbConsensus.py [ options ] -# options: -# -h: this help -# -i: name of the input file (format=aligned fasta) -# -n: minimum number of nucleotides in a column to edit a consensus (default=1) -# -p: minimum proportion for the major nucleotide to be used, otherwise add 'N' (default=0.0) -# -o: name of the output file (default=inFileName+'.cons') -# -v: verbose (default=0/1/2) - -if not os.environ.has_key( "REPET_PATH" ): - print "ERROR: no environment variable REPET_PATH" - sys.exit(1) -sys.path.append( os.environ["REPET_PATH"] ) - -import commons.core.seq.AlignedBioseqDB - - -def help(): - """ - Give the list of the command-line options. - """ - print "usage:",sys.argv[0]," [ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (format=aligned fasta)" - print " -n: minimum number of nucleotides in a column to edit a consensus (default=1)" - print " -p: minimum proportion for the major nucleotide to be used, otherwise add 'N' (default=0.0)" - print " -o: name of the output file (default=inFileName+'.cons')" - print " -H: format the header with pyramid and piles informations (SATannot)" - print " -v: verbose (default=0/1/2)" - - -def main(): - - inFileName = "" - minNbNt = 1 - minPropNt = 0.0 - outFileName = "" - header_SATannot = False - verbose = 0 - - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:n:p:o:v:H") - except getopt.GetoptError, err: - print str(err); help(); sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-n": - minNbNt = int(a) - elif o == "-p": - minPropNt = float(a) - elif o == "-o": - outFileName = a - elif o == "-H": - header_SATannot = True - elif o == "-v": - verbose = int(a) - - if inFileName == "": - print "ERROR: missing input file name" - help() - sys.exit(1) - - if verbose > 0: - print "START %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - alnDB = commons.core.seq.AlignedBioseqDB.AlignedBioseqDB( inFileName ) - - if alnDB.getSize() < minNbNt: - print "WARNING: not enough sequences (<%i)" % ( minNbNt ) - - else: - consensus = alnDB.getConsensus( minNbNt, minPropNt, verbose, header_SATannot) - if consensus != None: - consensus.upCase() - if outFileName == "": - outFileName = "%s.cons" % ( inFileName ) - outFile = open( outFileName, "w" ) - consensus.write( outFile ) - outFile.close() - - if verbose > 0: - print "END %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - -if __name__ == "__main__": - main () |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/dbShuffle.py --- a/commons/tools/dbShuffle.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,108 +0,0 @@ -#!/usr/bin/env python - -# Copyright INRA (Institut National de la Recherche Agronomique) -# http://www.inra.fr -# http://urgi.versailles.inra.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - - -import os -import sys -import getopt - -from commons.core.seq.FastaUtils import FastaUtils - - -def help(): - print "usage: %s [ options ]" % ( sys.argv[0].split("/")[-1] ) - print "options:" - print " -h: this help" - print " INPUT: use '-i' or '-I'" - print " -i: name of the input file (fasta format)" - print " -I: name of the input directory (containing fasta files)" - print " OUTPUT: use '-o' or '-O'" - print " -o: name of the output file (use only with '-i')" - print " -O: name of the output directory (use only with '-I')" - print " output file are: prefix of input fasta file + '_shuffle.fa')" - print " -v: verbose (default=0/1/2)" - - -def main(): - inData = "" - outData = "" - verbose = 0 - try: - opts, args = getopt.getopt( sys.argv[1:], "hi:I:o:O:v:" ) - except getopt.GetoptError, err: - sys.stderr.write( "%s\n" % str(err) ) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inData = a - elif o == "-I": - inData = a - elif o == "-o": - outData = a - elif o == "-O": - outData = a - elif o == "-v": - verbose = int(a) - - if inData == "" or ( not os.path.isfile( inData ) \ - and not os.path.isdir( inData ) ): - msg = "ERROR: missing input file or directory (-i or -I)" - sys.stderr.write( "%s\n" % msg ) - help() - sys.exit(1) - - if outData == "": - print "ERROR: missing name of output file or directory (-o or -O)" - help() - sys.exit(1) - - if verbose > 0: - print "START %s" % ( sys.argv[0].split("/")[-1] ) - sys.stdout.flush() - - FastaUtils.dbShuffle( inData, outData, verbose ) - - if verbose > 0: - print "END %s" % ( sys.argv[0].split("/")[-1] ) - sys.stdout.flush() - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/dbSplit.py --- a/commons/tools/dbSplit.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,92 +0,0 @@ -#!/usr/bin/env python - - -##@file -# Split the input fasta file in several output files -# usage: dbSplit.py [ options ] -# options: -# -h: this help -# -i: name of the input file (format='fasta') -# -n: number of sequences per output file (default=1) -# -d: record the output fasta files in a directory called 'batches' -# -s: use the sequence header if '-n 1' (otherwise 'batch_00X')" -# -p: use a prefix for the output files (default='batch')" -# -v: verbose (default=0/1) - - -import sys -import getopt - -from commons.core.seq.FastaUtils import FastaUtils - - -## Give the list of the command-line options -# -def help(): - print "usage: dbSplit.py [ options ]" - print "options:" - print " -h: this help" - print " -i: name of the input file (format='fasta')" - print " -n: number of sequences per batch file (default=1)" - print " -d: record the output fasta files in a directory called 'batches'" - print " -s: use the sequence header if '-n 1' (otherwise 'batch_00X')" - print " -p: use a prefix for the output files (default='batch')" - print " -v: verbosity level (default=0/1/2)" - - -## Split the input fasta file in several output files -# -def main(): - inFile = "" - nbSeqPerBatch = 1 - newDir = False - useSeqHeader = False - prefix = "batch" - verbose = 0 - - try: - opts, args = getopt.getopt( sys.argv[1:], "hi:n:dsp:v:" ) - except getopt.GetoptError, err: - sys.stderr.write( "%s\n" % ( str(err) ) ) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFile = a - elif o == "-n": - nbSeqPerBatch = int(a) - elif o == "-d": - newDir = True - elif o == "-s": - useSeqHeader = True - elif o == "-p": - prefix = a - elif o == "-v": - verbose = int(a) - - if inFile == "": - msg = "ERROR: missing input file (-i)" - sys.stderr.write( "%s\n" % ( msg ) ) - help() - sys.exit(1) - - if verbose > 0: - print "START %s" % ( sys.argv[0].split("/")[-1] ) - sys.stdout.flush() - - FastaUtils.dbSplit( inFile, nbSeqPerBatch, newDir, useSeqHeader, prefix, verbose ) - - if verbose > 0: - print "END %s" % ( sys.argv[0].split("/")[-1] ) - sys.stdout.flush() - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/filterOutMatcher.py --- a/commons/tools/filterOutMatcher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,155 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import getopt -import logging - -if not os.environ.has_key( "REPET_PATH" ): - print "ERROR: no environment variable REPET_PATH" - sys.exit(1) -sys.path.append( os.environ["REPET_PATH"] ) -import pyRepet.coord.MatchDB -import pyRepet.seq.BioseqDB - - -def help(): - """ - Give the list of the command-line options. - """ - print "usage: %s [ options ]" % ( sys.argv[0] ) - print "options:" - print " -h: this help" - print " -q: fasta filename of the queries" - print " -s: fasta filename of the subjects (same as queries if left blank)" - print " -m: output file from Matcher (format='tab')" - print " -o: name of the output query file (format=fasta, default=qryFileName+'.filtered')" - print " -i: identity threshold (default=0.95)" - print " -l: length threshold (default=0.98)" - print " -L: name of a 'log' file (usually from 'rmvRedundancy.py')" - print " -v: verbose (default=0/1)" - - -def writeOutQuery( qryDB, outFileName, lQryToKeep ): - """ - Write in a fasta file the queries than haven't been filtered (i.e. they are not included in any subject). - """ - outFile = open( outFileName, "w" ) - nbRmvSeq = 0 - for bs in qryDB.db: - if bs.header in lQryToKeep: - bs.write( outFile ) - else: - nbRmvSeq += 1 - outFile.close() - if verbose > 0: - print "%i removed queries out of %i" % ( nbRmvSeq, qryDB.getSize() ); sys.stdout.flush() - - -def main(): - """ - This program filters the ouput from Matcher by removing queries 'included' in subjects. - """ - qryFileName = "" - sbjFileName = "" - tabFileName = "" - outFileName = "" - thresIdentity = 0.95 # remove the seq if it is identical to 95% of another seq - thresLength = 0.98 # and if its length is 98% of that seq - logFileName = "" - global verbose - verbose = 0 - try: - opts, args = getopt.getopt(sys.argv[1:],"h:q:s:m:o:i:l:L:v:") - except getopt.GetoptError: - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-q": - qryFileName = a - elif o == "-s": - sbjFileName = a - elif o == "-m": - tabFileName = a - elif o == "-o": - outFileName = a - elif o == "-i": - thresIdentity = float(a) - elif o == "-l": - thresLength = float(a) - elif o == "-L": - logFileName = a - elif o == "-v": - verbose = int(a) - if qryFileName == "" or tabFileName == "": - print "ERROR: missing compulsory options" - help() - sys.exit(1) - if verbose > 0: - print "START %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - # prepare the 'log' file - handler = logging.FileHandler( logFileName ) - formatter = logging.Formatter( "%(asctime)s %(levelname)s: %(message)s" ) - handler.setFormatter( formatter ) - logging.getLogger('').addHandler( handler ) - logging.getLogger('').setLevel( logging.DEBUG ) - logging.info( "use '%s' on '%s'" % ( sys.argv[0].split("/")[-1], tabFileName ) ) - - if sbjFileName == "": - sbjFileName = qryFileName - if outFileName == "": - outFileName = "%s.filtered" % ( qryFileName ) - - # load the input fasta file corresponding to the queries - qryDB = pyRepet.seq.BioseqDB.BioseqDB( qryFileName ) - if sbjFileName != qryFileName: - string = "nb of input sequences (as query only): %i" % ( qryDB.getSize() ); sys.stdout.flush() - logging.info( string ) - if verbose > 0: print string - else: - string = "nb of input sequences (as query and subject): %i" % ( qryDB.getSize() ); sys.stdout.flush() - logging.info( string ) - if verbose > 0: print string - - # load the input 'tab' file - matchDB = pyRepet.coord.MatchDB.MatchDB() - tabFile = open( tabFileName, "r" ) - matchDB.read( tabFile, thresIdentity, thresLength, verbose ) - tabFile.close() - longString = "" - string = "nb of matches (id>=%.2f,qlgth>=%.2f): %i" % ( thresIdentity, thresLength, matchDB.getNbMatchesWithThres( thresIdentity, thresLength ) ) - longString += "\n%s" % ( string ) - if verbose > 0: print string - string = "nb of distinct queries having matches (id>=%.2f,qlgth>=%.2f): %i" % ( thresIdentity, thresLength, matchDB.getNbDistinctQryWithThres( thresIdentity, thresLength ) ) - longString += "\n%s" % ( string ) - if verbose > 0: print string - logging.info( longString ) - sys.stdout.flush() - - lQryToKeep = matchDB.filterDiffQrySbj( qryDB, thresIdentity, thresLength, verbose - 1 ) - - # here, possibility to save the information about by which match a specific query has been removed - - string = "%i queries to be kept" % ( len(lQryToKeep) ); sys.stdout.flush() - logging.info( string ) - if verbose > 0: print string - - # write the output fasta file without the included queries - writeOutQuery( qryDB, outFileName, lQryToKeep ) - - if verbose > 0: - print "END %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - - -if __name__ == "__main__": - main () |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/getCumulLengthFromTEannot.py --- a/commons/tools/getCumulLengthFromTEannot.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,201 +0,0 @@ -#!/usr/bin/env python - -##@file -# usage: getCumulLengthFromTEannot.py [ options ] -# options: -# -h: this help -# -i: table with the annotations (format=path) -# -r: name of a TE reference sequence (if empty, all subjects are considered) -# -g: length of the genome (in bp) -# -C: configuration file -# -c: clean -# -v: verbosity level (default=0/1) - - -import sys -import os -import getopt -from commons.core.sql.DbMySql import DbMySql -from commons.core.sql.TablePathAdaptator import TablePathAdaptator - - -class getCumulLengthFromTEannot( object ): - """ - Give the cumulative length of TE annotations (subjects mapped on queries). - """ - - def __init__( self ): - """ - Constructor. - """ - self._tableName = "" - self._TErefseq = "" - self._genomeLength = 0 - self._configFileName = "" - self._clean = False - self._verbose = 0 - self._db = None - self._tpA = None - - - def help( self ): - """ - Display the help on stdout. - """ - print "usage: getCumulLengthFromTEannot.py [ options ]" - print "options:" - print " -h: this help" - print " -i: table with the annotations (format=path)" - print " -r: name of a TE reference sequence (if empty, all subjects are considered)" - print " -g: length of the genome (in bp)" - print " -C: configuration file" - print " -c: clean" - print " -v: verbosity level (default=0/1)" - - - def setAttributesFromCmdLine( self ): - """ - Set the attributes from the command-line. - """ - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:r:g:C:cv:") - except getopt.GetoptError, err: - print str(err); self.help(); sys.exit(1) - for o,a in opts: - if o == "-h": - self.help(); sys.exit(0) - elif o == "-i": - self.setInputTable( a ) - elif o == "-r": - self.setTErefseq( a ) - elif o == "-g": - self.setGenomeLength( a ) - elif o == "-C": - self.setConfigFileName( a ) - elif o == "-c": - self.setClean() - elif o == "-v": - self.setVerbosityLevel( a ) - - - def setInputTable( self, inTable ): - self._tableName = inTable - - def setTErefseq( self, a ): - self._TErefseq = a - - def setGenomeLength( self, genomeLength ): - self._genomeLength = int(genomeLength) - - def setConfigFileName( self, configFileName ): - self._configFileName = configFileName - - def setClean( self ): - self._clean = True - - def setVerbosityLevel( self, verbose ): - self._verbose = int(verbose) - - def checkAttributes( self ): - """ - Check the attributes are valid before running the algorithm. - """ - if self._tableName == "": - print "ERROR: missing input table"; self.help(); sys.exit(1) - - - def setAdaptatorToTable( self ): - self._db = DbMySql( cfgFileName=self._configFileName ) - self._tpA = TablePathAdaptator( self._db, self._tableName ) - - - def getAllSubjectsAsMapOfQueries( self ): - mapFileName = "%s.map" % self._tableName - mapFile = open( mapFileName, "w" ) - if self._TErefseq != "": - lPathnums = self._tpA.getIdListFromSubject( self._TErefseq ) - else: - lPathnums = self._tpA.getIdList() - if self._verbose > 0: - print "nb of paths: %i" % ( len(lPathnums) ) - for pathnum in lPathnums: - lPaths = self._tpA.getPathListFromId( pathnum ) - for path in lPaths: - map = path.getSubjectAsMapOfQuery() - map.write( mapFile ) - mapFile.close() - return mapFileName - - - def mergeRanges( self, mapFileName ): - mergeFileName = "%s.merge" % mapFileName - prg = os.environ["REPET_PATH"] + "/bin/mapOp" - cmd = prg - cmd += " -q %s" % ( mapFileName ) - cmd += " -m" - cmd += " 2>&1 > /dev/null" - log = os.system( cmd ) - if log != 0: - print "*** Error: %s returned %i" % ( prg, log ) - sys.exit(1) - if self._clean: - os.remove( mapFileName ) - return mergeFileName - - - def getCumulLength( self, mergeFileName ): - mergeFile = open( mergeFileName, "r" ) - total = 0 - while True: - line = mergeFile.readline() - if line == "": - break - tok = line.split("\t") - total += abs( int(tok[3]) - int(tok[2]) ) + 1 - mergeFile.close() - if self._clean: - os.remove( mergeFileName ) - return total - - - def start( self ): - """ - Useful commands before running the program. - """ - self.checkAttributes() - if self._verbose > 0: - print "START %s" % ( type(self).__name__ ); sys.stdout.flush() - self.setAdaptatorToTable() - - - def end( self, mapFileName, mergeFileName ): - """ - Useful commands before ending the program. - """ - self._db.close() - if self._verbose > 0: - print "END %s" % ( type(self).__name__ ); sys.stdout.flush() - - - def run( self ): - """ - Run the program. - """ - self.start() - - mapFileName = self.getAllSubjectsAsMapOfQueries() - mergeFileName = self.mergeRanges( mapFileName ) - total = self.getCumulLength( mergeFileName ) - print "cumulative length: %i bp" % total - if self._genomeLength > 0: - print "TE content: %.2f%%" % ( 100 * total / float(self._genomeLength) ) - - self.end( mapFileName, mergeFileName ) - - -if __name__ == "__main__": - i = getCumulLengthFromTEannot() - i.setAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/pathnum2id.py --- a/commons/tools/pathnum2id.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,68 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import getopt - -def setup_env(): - if "REPET_PATH" in os.environ.keys(): - sys.path.append( os.environ["REPET_PATH"] ) - else: - print "*** Error: no environment variable REPET_PATH ***" - sys.exit(1) -setup_env() - -from commons.core.parsing.PathNum2Id import PathNum2Id - -#----------------------------------------------------------------------------- - -def help(): - - print "" - print "usage:",sys.argv[0]," [ options ]" - print "option:" - print " -h: this help" - print " -i: input file name (path format)" - print " -o: output file name (path format, default=inFileName+'.path')" - print "" - -#----------------------------------------------------------------------------- - -def main(): - - inFileName = "" - outFileName = "" - - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:o:") - except getopt.GetoptError: - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inFileName = a - elif o == "-o": - outFileName = a - - if inFileName == "": - print "*** Error: missing input file name" - help() - sys.exit(1) - - if outFileName == "": - outFileName = inFileName + ".path" - - pathNum2Id = PathNum2Id() - pathNum2Id.setInFileName( inFileName ) - pathNum2Id.setOutFileName( outFileName ) - pathNum2Id.run() - - return 0 - -#----------------------------------------------------------------------------- - -if __name__ == '__main__': - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/refalign2fasta.py --- a/commons/tools/refalign2fasta.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,408 +0,0 @@\n-#!/usr/bin/env python\n-\n-##@file\n-# Convert the output from Refalign (MSA program) into the \'fasta\' format.\n-# Usually used before subsequent analysis such as the estimation of deletion rate.\n-#\n-# usage: refalign2fasta.py [ options ]\n-# options:\n-# -h: this help\n-# -i: name of the input file (output from refalign)\n-# -r: name of the reference sequence (discard if not provided)\n-# -g: for the gaps, keep only deletions (\'d\'), only insertions (\'i\') or both (default=\'id\')\n-# -o: name of the output file (default=inFileName\'.fa_aln\',format=\'fasta\')\n-\n-import os\n-import sys\n-import getopt\n-import exceptions\n-\n-if not os.environ.has_key( "REPET_PATH" ):\n- print "ERROR: no environment variable REPET_PATH"\n- sys.exit(1)\n-sys.path.append( os.environ["REPET_PATH"] )\n-\n-import pyRepet.seq.Bioseq\n-\n-\n-def help():\n- """\n- Give the list of the command-line options.\n- """\n- print\n- print "usage:",sys.argv[0]," [ options ]"\n- print "options:"\n- print " -h: this help"\n- print " -i: name of the input file (output from refalign)"\n- print " -r: name of the reference sequence (discard if not provided)"\n- print " -g: for the gaps, keep only deletions (\'d\'), only insertions (\'i\') or both (default=\'id\')"\n- print " -o: name of the output file (default=inFileName\'.fa_aln\',format=\'fasta\')"\n- print\n-\n-\n-def getAlignments( inFileName ):\n- """\n- Retrieve the alignments from the input file.\n-\n- @param inFileName: name of the input file\n- @type: string\n-\n- @return: list of alignments ( refseq, seq, header of seq )\n- @rtype: list of 3d-tuples\n- """\n-\n- lAlign = []\n-\n- inFile = open( inFileName, "r" )\n- line = inFile.readline()\n- while True:\n- if line == "":\n- break\n- refseq, seq, label = line[:-1].split("\\t")[:3]\n- lAlign.append( ( refseq, seq, label ) )\n- line = inFile.readline()\n- inFile.close()\n-\n- return lAlign\n-\n-\n-def getGaps( seq ):\n- """\n- Get the gaps on a sequence, start coordinate and length. The start\n- coordinate of a gap is the # of the nucleotide after which it starts.\n-\n- @param seq: sequence to analyse\n- @type seq: string\n-\n- @return: list of gaps ( start coordinate, length )\n- @rtype: list of 2d-tuples\n- """\n-\n- prev = "N"\n- lGapsOnSeq = []\n- i = 0\n- lengthGap = 0\n- for c in seq:\n- if c == "-" and prev != "-":\n- startGap = i\n- if c != "-" and prev == "-":\n- lGapsOnSeq.append( ( startGap, lengthGap ) )\n- lengthGap = 0\n- if c != "-":\n- i += 1\n- else:\n- lengthGap += 1\n- prev = c\n-\n- # case with a gap at the end of the sequence\n- if seq[ len(seq) - 1 ] == "-":\n- lGapsOnSeq.append( ( startGap, lengthGap ) )\n-\n- return lGapsOnSeq\n-\n-\n-def getGapsOnRefSeq( lAlign ):\n- """\n- Retrieve the gaps on the ref seq in all the alignments.\n-\n- @param lAlign: list of alignments ( refseq, seq, header of seq )\n- @type lAlign: list of 3d-tuples\n-\n- @return: list of gaps per alignment\n- @rtype: list of lists of 2d-tuples\n- """\n-\n- lGapsOnRef = []\n-\n- for align in lAlign:\n- refseq = align[0]\n- lGapsOnRef.append( getGaps( refseq ) )\n-\n- return lGapsOnRef\n-\n-\n-def insertGap( seq, startGap, lengthGap ):\n- """\n- Get a new seq by inserting a gap in the give seq.\n-\n- @param seq: sequence\n- @type seq: string\n-\n- @param startGap:\n- @type: startGap: integer\n-\n- @param lengthGap: length of the gap\n- @type lengthGap: integer\n-\n- @return: new seq made from the give seq by inserting the gap\n- @rtype: string\n- """\n-\n- new_seq = seq[:startGap] + (lengthGap*\'-\') + seq[startGap:] \n- return new_seq\n-\n-\n-def insertListGaps( inSeq, lGaps ):\n- """\n- Insert all the gaps from the list into the sequence.\n-\n- @param inSeq: sequence\n- @type inSeq: string\n-\n- @param lGaps'..b'ign[j][1]), newlist )\n- header = lAlign[j][2]\n- Align_seq.append( ( header, newSeq ) )\n-\n- return Align_seq\n-\n-\n-def getSeqWithDeletions( lAlign ):\n- """\n- Get the sequences by putting gaps only when they correspond to a deletion compare to ref seq.\n- Used for instance when we want to estimate the deletion rate.\n-\n- @param lAlign: list of alignments ( refseq, seq, header of seq )\n- @type lAlign: list of 3d-tuples\n-\n- @return: list of lists ( header, sequence with gaps )\n- @rtype: list of 2d-tuples\n- """\n-\n- Align_seq = []\n-\n- for align in lAlign:\n- refseq = align[0]\n- seq = align[1]\n- header = align[2]\n- newSeq = ""\n- for i in xrange(0,len(refseq)):\n- if refseq[i] != "-":\n- newSeq += seq[i]\n- Align_seq.append( ( header, newSeq ) )\n-\n- return Align_seq\n-\n-\n-def saveMSA( outFileName, Align_seq, Align_seqref=None ):\n- """\n- Save the results as a multiple sequence alignment (MSA) in the \'fasta\' format.\n-\n- @param outFileName: name of the output file\n- @type outFileName: string\n-\n- @param Align_seqref: sequence of ref seq\n- @type Align_seqref: string\n- """\n-\n- outFile = open( outFileName, "w" )\n- bs = pyRepet.seq.Bioseq.Bioseq()\n-\n- # if provided, save the ref seq\n- if Align_seqref != None:\n- bs.header = Align_seqref[0]\n- bs.sequence = Align_seqref[1]\n- bs.write( outFile )\n-\n- # save the other sequences\n- for i in Align_seq:\n- bs.header = i[0]\n- bs.sequence = i[1]\n- bs.write( outFile )\n-\n- outFile.close()\n- \n- \n-def saveOnlyWithDeletions( lAlign, refseqName, outFileName ):\n- Align_seq = getSeqWithDeletions( lAlign )\n- if refseqName != "":\n- Align_seqref = ( refseqName, lAlign[0][0].replace("-","") )\n- saveMSA( outFileName, Align_seq, Align_seqref )\n- else:\n- saveMSA( outFileName, Align_seq )\n- \n- \n-def main():\n- \n- inFileName = ""\n- refseqName = ""\n- keepGap = "id"\n- outFileName = ""\n- global verbose\n- verbose = 0\n- \n- try:\n- opts, args = getopt.getopt(sys.argv[1:],"hi:r:g:o:v:")\n- except getopt.GetoptError, err:\n- print str(err)\n- help()\n- sys.exit(1)\n- for o,a in opts:\n- if o == "-h":\n- help()\n- sys.exit(0)\n- elif o == "-i":\n- inFileName = a\n- elif o == "-r":\n- refseqName = a\n- elif o == "-g":\n- keepGap = a\n- elif o == "-o":\n- outFileName = a\n- elif o == "-v":\n- verbose = int(a)\n-\n- if inFileName == "":\n- print "ERROR: missing input file name"\n- help()\n- sys.exit(1)\n- \n- if verbose > 0:\n- print "START %s" % (sys.argv[0].split("/")[-1])\n- sys.stdout.flush()\n- \n- lAlign = getAlignments( inFileName )\n- if verbose > 0:\n- print "nb of alignments: %i" % ( len(lAlign) )\n- sys.stdout.flush()\n- \n- if outFileName == "":\n- outFileName = "%s.fa_aln" % ( inFileName )\n- if verbose > 0:\n- print "output file: \'%s\'" % ( outFileName )\n- \n- if keepGap == "id":\n- lGapsOnRefSeqPerAlign = getGapsOnRefSeq( lAlign )\n- Align_seq = insertgap_seq( lAlign, lGapsOnRefSeqPerAlign )\n- if refseqName != "":\n- Align_seqref = insertGapsInRefSeq( lAlign, lGapsOnRefSeqPerAlign, refseqName )\n- saveMSA( outFileName, Align_seq, Align_seqref )\n- else:\n- saveMSA( outFileName, Align_seq )\n- \n- elif keepGap == "d":\n- saveOnlyWithDeletions( lAlign, refseqName, outFileName )\n- \n- elif keepGap == "i":\n- print "ERROR: \'-g i\' not yet available"\n- sys.exit(1)\n- \n- if verbose > 0:\n- print "END %s" % (sys.argv[0].split("/")[-1])\n- sys.stdout.flush()\n- \n- return 0\n-\n-\n-if __name__ == "__main__" :\n- main ()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/removeDescriptionInFastaHeaderProgramLauncher.py --- a/commons/tools/removeDescriptionInFastaHeaderProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,37 +0,0 @@ -#!/usr/bin/env python - -import re -from commons.pyRepetUnit.components.AbstractProgramLauncher import AbstractProgramLauncher - -class removeDescriptionInFastaHeaderProgramLauncher(AbstractProgramLauncher): - - def __init__( self ): - AbstractProgramLauncher.__init__( self ) - self._formatInFile = "fasta" - - def run( self ): - self.checkInput() - fastaHandler = open(self.getInputFile(), "r") - lines = fastaHandler.readlines() - fastaHandler.close() - newFastaName = ".".join([self.getInputFile().split(".")[0], "preprocessed", "fasta"]) - - self._writePreprocessedFastaFile(lines, newFastaName) - - def _writePreprocessedFastaFile(self, lines, newFastaName): - newFastaHandler = open(newFastaName, "w") - for line in lines: - if re.match(">", line): - newLine = line.split(" ",1)[0] + "\n" - newFastaHandler.write(newLine) - else: - newFastaHandler.write(line) - newFastaHandler.close() - - - - -if __name__ == "__main__": - i = removeDescriptionInFastaHeaderProgramLauncher() - i.checkAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/replaceGreaterThanSymbolInFastaHeaderProgramLauncher.py --- a/commons/tools/replaceGreaterThanSymbolInFastaHeaderProgramLauncher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,37 +0,0 @@ -#!/usr/bin/env python - -import re -from commons.pyRepetUnit.components.AbstractProgramLauncher import AbstractProgramLauncher - -class replaceGreaterThanSymbolInFastaHeaderProgramLauncher(AbstractProgramLauncher): - - def __init__( self ): - AbstractProgramLauncher.__init__( self ) - self._formatInFile = "fasta" - - def run( self ): - self.checkInput() - fastaHandler = open(self.getInputFile(), "r") - lines = fastaHandler.readlines() - fastaHandler.close() - newFastaName = ".".join([self.getInputFile().split(".")[0], "preprocessed", "fasta"]) - - self._writePreprocessedFastaFile(lines, newFastaName) - - def _writePreprocessedFastaFile(self, lines, newFastaName): - newFastaHandler = open(newFastaName, "w") - for line in lines: - if re.match(">", line): - newLine = re.sub("-->|->", " to ", line) - newFastaHandler.write(newLine) - else: - newFastaHandler.write(line) - newFastaHandler.close() - - - - -if __name__ == "__main__": - i = replaceGreaterThanSymbolInFastaHeaderProgramLauncher() - i.checkAttributesFromCmdLine() - i.run() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/setnum2id.py --- a/commons/tools/setnum2id.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,83 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import getopt -import exceptions - -#----------------------------------------------------------------------------- - -def help(): - - print "\nusage:",sys.argv[0]," [ options ]" - print "option:" - print " -h: this help" - print " -i: input set file" - print "output on stdout\n" - -#----------------------------------------------------------------------------- - -def main(): - - inFileName = "" - - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:") - except getopt.GetoptError: - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - if o == "-i": - inFileName = a - - if inFileName == "": - print "*** Error: missing input file name" - help() - sys.exit(1) - - inFile = open( inFileName, "r" ) - line = inFile.readline() - - dID2count = {} - count = 1 - - while 1: - - if line == "": - break - - line = line.split() - - path = line[0] - sbjName = line[1] - qryName = line[2] - qryStart = line[3] - qryEnd = line[4] - - key_id = path + "-" + qryName + "-" + sbjName - if key_id not in dID2count.keys(): - newPath = count - count += 1 - dID2count[ key_id ] = newPath - else: - newPath = dID2count[ key_id ] - - data = str(newPath) + "\t" + sbjName + "\t" + qryName + "\t" - data += qryStart + "\t" + qryEnd - - print data - sys.stdout.flush() - - line = inFile.readline() - - inFile.close() - - return 0 - -#----------------------------------------------------------------------------- - -if __name__ == '__main__': - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/srptBlasterMatcher.py --- a/commons/tools/srptBlasterMatcher.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,448 +0,0 @@\n-#!/usr/bin/env python\n-\n-"""\n-This program takes a query directory as input,\n-then launches Blaster and/or Matcher on each file in it,\n-finally results are optionally gathered in a single file.\n-"""\n-\n-import os\n-import sys\n-import getopt\n-import logging\n-import glob\n-import ConfigParser\n-\n-from pyRepet.launcher.programLauncher import programLauncher\n-from pyRepet.launcher import Launcher\n-from pyRepet.sql.RepetJobMySQL import RepetJob\n-from commons.core.coord.Align import Align\n-\n-\n-def help():\n- print\n- print "usage: %s [ options ]" % ( sys.argv[0].split("/")[-1] )\n- print "options:"\n- print " -h: this help"\n- print " -g: name of the group identifier (same for all the jobs)"\n- print " -q: name of the query directory"\n- print " -S: suffix in the query directory (default=\'*.fa\' for Blaster, \'*.align\' for Matcher)"\n- print " -s: absolute path to the subject databank"\n- print " -Q: resources needed on the cluster)"\n- print " -d: absolute path to the temporary directory"\n- print " -m: mix of Blaster and/or Matcher"\n- print " 1: launch Blaster only"\n- print " 2: launch Matcher only (on \'*.align\' query files)"\n- print " 3: launch Blaster+Matcher in the same job"\n- print " -B: parameters for Blaster (e.g. \\"-a -n tblastx\\")"\n- print " -M: parameters for Matcher (e.g. \\"-j\\")"\n- print " -Z: collect all the results into a single file"\n- print " align (after Blaster)"\n- print " path/tab (after Matcher)"\n- print " -C: configuration file from TEdenovo or TEannot pipeline"\n- print " -t: name of the table recording the jobs (default=jobs)"\n- print " -p: absolute path to project directory (if jobs management via files)"\n- print " -c: clean (remove job launch files and job stdout)"\n- print " -v: verbose (default=0/1/2)"\n- print\n-\n-\n-def filterRedundantMatches( inFile, outFile ):\n- """\n- When a pairwise alignment is launched ~ all-by-all (ie one batch against all chunks),\n- one filters the redundant matches. For instance we keep \'chunk3-1-100-chunk7-11-110-...\'\n- and we discards \'chunk7-11-110-chunk3-1-100-...\'.\n- Also we keep \'chunk5-1-100-chunk5-11-110-...\' and we discards\n- \'chunk5-11-110-chunk5-1-100-...\'.\n- For this of course the results need to be sorted by query, on plus strand,\n- and in ascending coordinates (always the case with Blaster).\n- """\n- inFileHandler = open( inFile, "r" )\n- outFileHandler = open( outFile, "w" )\n- iAlign = Align()\n- countMatches = 0\n- tick = 100000\n- while True:\n- line = inFileHandler.readline()\n- if line == "":\n- break\n- countMatches += 1\n- iAlign.setFromString( line )\n- if "chunk" not in iAlign.range_query.seqname \\\n- or "chunk" not in iAlign.range_subject.seqname:\n- print "ERROR: \'chunk\' not in seqname"\n- sys.exit(1)\n- if int(iAlign.range_query.seqname.split("chunk")[1]) < int(iAlign.range_subject.seqname.split("chunk")[1]):\n- iAlign.write( outFileHandler )\n- elif int(iAlign.range_query.seqname.split("chunk")[1]) == int(iAlign.range_subject.seqname.split("chunk")[1]):\n- if iAlign.range_query.getMin() < iAlign.range_subject.getMin():\n- iAlign.write( outFileHandler )\n- if countMatches % tick == 0: # need to free buffer frequently as file can be big\n- outFileHandler.flush()\n- os.fsync( outFileHandler.fileno() )\n- inFileHandler.close()\n- outFileHandler.close()\n-\n-\n-def runCollect( groupid, collect, allByAll ):\n- """\n- Gather the results of each job in a single job and adapt path ID if necessary.\n- """\n- if verbose > 0:\n- print "concatenate the results of each job"; sys.stdout.flush()\n-\n- # retrieve the list of the files\n- lFiles = glob.glob( "*.%s" % ( collect ) )\n- lFiles.so'..b' cleanB += "if os.path.exists( \\"" + prefix + ".raw\\" ):\\n"\n- cleanB += "\\tos.remove( \\"" + prefix + ".raw\\" )\\n"\n- cleanB += "if os.path.exists( \\"" + prefix + ".seq_treated\\" ):\\n"\n- cleanB += "\\tos.remove( \\"" + prefix + ".seq_treated\\" )\\n"\n- launchM = ""\n- launchM += os.environ["REPET_PATH"] + "/bin/matcher"\n- launchM += " -m %s.align" % ( prefix )\n- launchM += " -q %s" % ( prefix )\n- launchM += " -s %s" % ( subjectBank )\n- if paramMatcher != "":\n- launchM += " %s" % ( paramMatcher )\n- cleanM = ""\n- s = ""\n- if "-a" in paramMatcher:\n- s = "match"\n- else:\n- s = "clean_match"\n- if collect == "path":\n- cleanM += "if not os.path.exists( \\"%s/%s.align.%s.path\\" ):\\n" % ( currentDir, prefix, s )\n- cleanM += "\\tos.system( \\"mv %s.align.%s.path %s\\" )\\n" % ( prefix, s, currentDir )\n- cleanM += "if os.path.exists( \\"" + prefix + ".align."+s+".tab\\" ):\\n"\n- cleanM += "\\tos.remove( \\"" + prefix + ".align."+s+".tab\\" )\\n"\n- elif collect == "tab":\n- cleanM += "if not os.path.exists( \\"%s/%s.align.%s.tab\\" ):\\n" % ( currentDir, prefix, s )\n- cleanM += "\\tos.system( \\"mv %s.align.%s.tab %s\\" )\\n" % ( prefix, s, currentDir )\n- cleanM += "if os.path.exists( \\"" + prefix + ".align."+s+".path\\" ):\\n"\n- cleanM += "\\tos.remove( \\"" + prefix + ".align."+s+".path\\" )\\n"\n- cleanM += "if not os.path.exists( \\"%s/%s.align.%s.param\\" ):\\n" % ( currentDir, prefix, s )\n- cleanM += "\\tos.system( \\"mv %s.align.%s.param %s\\" )\\n" % ( prefix, s, currentDir )\n- if tmpDir != currentDir:\n- cleanM += "if os.path.exists( \\"%s\\" ):\\n" % ( prefix )\n- cleanM += "\\tos.remove( \\"%s\\" )\\n" % ( prefix )\n- if clean == True:\n- cleanM += "if os.path.exists( \\"" + prefix + ".align\\" ):\\n"\n- cleanM += "\\tos.remove( \\"" + prefix + ".align\\" )\\n"\n- else:\n- cleanM += "if not os.path.exists( \\"%s/%s.align\\" ):\\n" % ( currentDir, prefix )\n- cleanM += "\\tos.system( \\"mv %s.align %s\\" )\\n" % ( prefix, currentDir )\n- cleanM += "if os.path.exists( \\"" + prefix + ".align."+s+".fa\\" ):\\n"\n- cleanM += "\\tos.remove( \\"" + prefix + ".align."+s+".fa\\" )\\n"\n- cleanM += "if os.path.exists( \\"" + prefix + ".align."+s+".map\\" ):\\n"\n- cleanM += "\\tos.remove( \\"" + prefix + ".align."+s+".map\\" )\\n"\n- cmd_start += "print \\"" + launchB + "\\"; sys.stdout.flush()\\n"\n- cmd_start += "log = os.system( \\"" + launchB + "\\" )\\n"\n- cmd_start += "if log != 0:\\n"\n- cmd_start += launcher.cmd_test( launcher.job, "error", loop=1 )\n- cmd_start += "\\tsys.exit(1)\\n"\n- cmd_start += cleanB\n- cmd_start += "print \\"" + launchM + "\\"; sys.stdout.flush()\\n"\n- cmd_start += "log = os.system( \\"" + launchM + "\\" )\\n"\n- cmd_start += cleanM\n- launcher.runSingleJob( cmd_start )\n- launcher.acronyme = "BlasterMatcher"\n- launcher._nbJobs = count\n- launcher.endRun()\n- if clean == True:\n- launcher.clean( "BlasterMatcher_*" )\n-\n- else:\n- print "ERROR: option \'-m %s\' not recognized" % ( mix )\n- sys.exit(1)\n-\n-\n- if collect != "":\n- if collect in [ "align", "path", "tab" ]:\n- runCollect( groupid, collect, allByAll )\n- else:\n- print "ERROR: collect \'%s\' not implemented" % ( collect )\n- sys.exit(1)\n-\n-\n- logging.info( "finished" )\n-\n- if verbose > 0:\n- print "END %s" % ( sys.argv[0].split("/")[-1] )\n- sys.stdout.flush()\n-\n- return 0\n-\n-\n-if __name__ == "__main__":\n- main()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/srptCreateTable.py --- a/commons/tools/srptCreateTable.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,134 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import getopt -import ConfigParser - -from commons.core.sql.DbMySql import DbMySql - - -def help(): - print "usage: %s [ options ]" % ( sys.argv[0].split("/")[-1] ) - print "options:" - print " -h: this help" - print " -f: name of the input file" - print " -n: name of the MySQL table" - print " -t: table type (fasta|align|path|set|match|map|TEclassif|cluster)" - print " -o: overwrite (default=False)" - print " -c: configuration file from TEdenovo or TEannot pipeline" - print " -H: MySQL host (if no configuration file)" - print " -U: MySQL user (if no configuration file)" - print " -P: MySQL password (if no configuration file)" - print " -D: MySQL database (if no configuration file)" - print " -T: MySQL port (if no configuration file, default=3306)" - print " -v: verbose (default=0/1)" - - -def main(): - """ - This program loads data from a file into a MySQL table. - """ - filename = "" - tablename = "" - filetype = "" - overwrite = False - configFileName = "" - host = "" - user = "" - passwd = "" - dbname = "" - port = 0 - verbose = 0 - - try: - opts, args = getopt.getopt( sys.argv[1:], "hf:t:n:oc:H:U:P:D:T:v:" ) - except getopt.GetoptError, err: - sys.stderr.write( "%s\n" % str(err) ) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-f": - filename = a - elif o == "-n": - tablename = a - elif o == "-t": - filetype = a - elif o == "-o": - overwrite = True - elif o == "-c": - configFileName = a - elif o == "-H": - host = a - elif o == "-U": - user = a - elif o == "-P": - passwd = a - elif o == "-D": - dbname = a - elif o == "-T": - port = int(a) - elif o == "-v": - verbose = int(a) - - if filename == "" or tablename == "" or filetype == "": - print "ERROR: missing compulsory options" - help() - sys.exit(1) - - if configFileName != "": - config = ConfigParser.ConfigParser() - config.readfp( open(configFileName) ) - host = config.get("repet_env","repet_host") - user = config.get("repet_env","repet_user") - passwd = config.get("repet_env","repet_pw") - dbname = config.get("repet_env","repet_db") - port = config.get("repet_env","repet_port") - - if host == "" and os.environ.get( "REPET_HOST" ) != "": - host = os.environ.get( "REPET_HOST" ) - if user == "" and os.environ.get( "REPET_USER" ) != "": - user = os.environ.get( "REPET_USER" ) - if passwd == "" and os.environ.get( "REPET_PW" ) != "": - passwd = os.environ.get( "REPET_PW" ) - if dbname == "" and os.environ.get( "REPET_DB" ) != "": - dbname = os.environ.get( "REPET_DB" ) - if port == 0 and os.environ.get( "REPET_PORT" ) != "": - port = int( os.environ.get( "REPET_PORT" ) ) - - if host == "": - print "ERROR: missing host" - sys.exit(1) - if user == "": - print "ERROR: missing user" - sys.exit(1) - if passwd == "": - print "ERROR: missing password" - sys.exit(1) - if dbname == "": - print "ERROR: missing db name" - sys.exit(1) - if port == 0: - print "ERROR: missing port" - sys.exit(1) - - db = DbMySql(user, host, passwd, dbname, port ) - - if not os.path.exists( filename ): - print "ERROR: input file '%s' doesn't exist" % ( filename ) - sys.exit(1) - - db.createTable( tablename, filetype, filename, overwrite) - - db.close() - - return 0 - - -if __name__ == "__main__": - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/srptExportTable.py --- a/commons/tools/srptExportTable.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,146 +0,0 @@ -#!/usr/bin/env python - -import user, os, sys, getopt, exceptions, ConfigParser - -#----------------------------------------------------------------------------- - -def help(): - - """ - Give the list of the command-line options. - """ - - print "usage:",sys.argv[0]," [ options ]" - print "options:" - print " -h: this help" - print " -i: name of the table to export" - print " -o: name of the output file (default=inTable)" - print " -p: extra parameters to add to the SQL query (e.g. 'ORDER BY path')" - print " -k: keep the first line" - print " -C: configuration file from TEdenovo or TEannot pipeline" - print " -H: MySQL host (if no configuration file)" - print " -U: MySQL user (if no configuration file)" - print " -P: MySQL password (if no configuration file)" - print " -D: MySQL database (if no configuration file)" - print " -v: verbose (default=0/1)" - -#----------------------------------------------------------------------------- - -def main(): - - """ - This program exports all the data contained in a MySQL table into a flat file in the current directory. - """ - - inTable = "" - outFileName = "" - param = "" - keepFirstLine = False - configFileName = "" - host = "" - user = "" - passwd = "" - dbname = "" - verbose = 0 - - try: - opts, args = getopt.getopt(sys.argv[1:],"hi:o:p:kC:H:U:P:D:v:") - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-i": - inTable = a - elif o == "-o": - outFileName = a - elif o == "-p": - param = a - elif o == "-k": - keepFirstLine = True - elif o == "-C": - configFileName = a - elif o == "-H": - host = a - elif o == "-U": - user = a - elif o == "-P": - passwd = a - elif o == "-D": - dbname = a - elif o == "-v": - verbose = int(a) - - if inTable == "": - print "*** Error: missing input table name" - help() - sys.exit(1) - - if configFileName != "": - config = ConfigParser.ConfigParser() - config.readfp( open(configFileName) ) - host = config.get("repet_env","repet_host") - user = config.get("repet_env","repet_user") - passwd = config.get("repet_env","repet_pw") - dbname = config.get("repet_env","repet_db") - if host == "" or user == "" or passwd == "" or dbname == "": - if os.environ.get( "REPET_HOST" ) not in [ "", None ]: - host = os.environ.get( "REPET_HOST" ) - if os.environ.get( "REPET_USER" ) not in [ "", None ]: - user = os.environ.get( "REPET_USER" ) - if os.environ.get( "REPET_PW" ) not in [ "", None ]: - passwd = os.environ.get( "REPET_PW" ) - if os.environ.get( "REPET_DB" ) not in [ "", None ]: - dbname = os.environ.get( "REPET_DB" ) - if host == "" or user == "" or passwd == "" or dbname == "": - print "*** Error: missing information about MySQL connection" - sys.exit(1) - - if outFileName == "": - outFileName = inTable - - prg = "mysql" - cmd = prg - cmd += " -h %s" % ( host ) - cmd += " -u %s" % ( user ) - cmd += " -p\"%s\"" % ( passwd ) - cmd += " --database=%s" % ( dbname ) - cmd += " -e\"SELECT * FROM %s" % ( inTable ) - if param != "": - cmd += " %s" % ( param ) - cmd += ";\"" - cmd += " > " - if keepFirstLine == False: - cmd += "%s.tmp" % ( outFileName ) - else: - cmd += "%s" % ( outFileName ) - if verbose > 0: print cmd; sys.stdout.flush() - log = os.system( cmd ) - if log != 0: - print "*** Error: %s returned %i" % ( prg, log ) - sys.exit(1) - - if keepFirstLine == False: - tmpFileName = "%s.tmp" % ( outFileName ) - tmpFile = open( tmpFileName, "r" ) - outFile = open( outFileName, "w" ) - i = 0 - for line in tmpFile: - if i > 0: - outFile.write( line ) - i += 1 - tmpFile.close() - outFile.close() - os.remove( tmpFileName ) - - return 0 - -#---------------------------------------------------------------------------- - -if __name__ == '__main__': - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/srptGameXmlMaker.py --- a/commons/tools/srptGameXmlMaker.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,283 +0,0 @@\n-#!/usr/bin/env python\n-\n-import user, os, sys, getopt, ConfigParser\n-from os import listdir\n-\n-def setup_env():\n- if "REPET_PATH" in os.environ.keys():\n- sys.path.append( os.environ["REPET_PATH"] )\n- else:\n- print "*** Error: no environment variable REPET_PATH ***"\n- sys.exit(1)\n-setup_env()\n-\n-from pyRepet.sql.RepetDBMySQL import *\n-from pyRepet.gamexml.Xml_writer import *\n-from pyRepet.gamexml.computational import *\n-\n-#------------------------------------------------------------------------------\n-\n-def help():\n-\n- print ""\n- print "usage:",sys.argv[0],"[options]"\n- print "options:"\n- print " -h: this help"\n- print " -f: fasta file (required to generate new \'.gamexml\' files)"\n- print " -n: annotation tier_name"\n- print " -g: gamexml file (for Apollo). If it\'s not mentionned, all \'.gamexml\' files will be updated with the result file"\n- print " -l: light gameXML file (without sequence)"\n- print " -r: result files (require -n)"\n- print " -R: reverse the query and subject of Blaster results"\n- print " -s: tier_name of an annotation to remove from a gameXML file"\n- print " -t: file of table name to use to create the gamexml files (tier name \'tab\' format \'tab\' table name)"\n- print " -c: configuration file from TEdenovo or TEannot pipeline"\n- print " -H: MySQL host (if no configuration file)"\n- print " -U: MySQL user (if no configuration file)"\n- print " -P: MySQL password (if no configuration file)"\n- print " -D: MySQL database (if no configuration file)"\n- print " -v: verbose (default=0/1/2)"\n- print ""\n-\n-#------------------------------------------------------------------------------\n-\n-def automatisation( result_file, tier_name, reverse, comput ):\n-\n- if verbose > 1:\n- print "Auto update"; sys.stdout.flush()\n- writer = Xml_writer()\n- file_liste = []\n- liste_comp = []\n- liste_comp = listdir(\'./\')\n-\n- if result_file != "":\n- for j in liste_comp:\n- if writer.file_in_keys( j, comput ):\n- file_liste = file_liste + [j]\n-\n- for i in file_liste:\n- writer.update_gamexml( i, result_file, tier_name, comput )\n-\n- else:\n- for j in liste_comp:\n- if j.find( "gamexml" ) != -1:\n- writer.parse_gamexml( j )\n- writer.verif_name_prog( tier_name )\n- writer.write( j )\n- if verbose > 1:\n- print tier_name + " program from " +j +" removed"\n-\n-#------------------------------------------------------------------------------\n-\n-def main():\n-\n- f_result = ""\n- f_gamexml = ""\n- f_fasta = ""\n- f_table = ""\n- tier_name = ""\n- substract_name = ""\n- no_seq = 0\n- configFileName = ""\n- host = ""\n- user = ""\n- passwd = ""\n- dbname = ""\n- verbose = 0\n-\n- try:\n- options,arguments=getopt.getopt(sys.argv[1:],"hn:f:g:r:s:lRt:c:H:U:P:D:v:",["help","tier_name=","fasta","gamexml","result","substract_program","light","reverse_result","table"])\n- except getopt.GetoptError:\n- help()\n- sys.exit(1)\n- if options == []:\n- help()\n- sys.exit(1)\n- for o,a in options:\n- if o == "-h" or o == "--help":\n- help()\n- sys.exit(0)\n- elif o == "-f" or o == "--fasta":\n- f_fasta = a\n- elif o == "-g" or o == "--gamexml":\n- f_gamexml = a \n- elif o == "-n" or o == "--tier_name":\n- tier_name = a\n- elif o == "-r" or o == "--result":\n- f_result = a\n- elif o == "-s" or o == "--subtract_program":\n- substract_name = a\n- elif o == "-l" or o == "--light":\n- no_seq = 1\n- elif o == "-R" or o == "--reverse_result":\n- writer.set_reverse()\n- elif o == "-t" or o == "--table":\n- f_table = a\n- elif o == "-c":\n- '..b'tdout.flush()\n-\t writer.parse_gamexml( f_gamexml )\n-\n-\t if f_gamexml != "":\n-## key=".".join(f_gamexml.split(".")[:-1])\n- key = f_gamexml.split(".")[0]\n-\t else:\n- key = ""\n-\n-\t tfile = open( f_table )\n-\t lines = tfile.readlines()\n-\t for l in lines:\n- if l[0] == "#":\n- continue\n- tok = l.split()\n- #print tok\n- if len(tok) == 0:\n- break\n- tier_name = tok[0]\n- format = tok[1]\n- table = tok[2]\n- alias = ""\n- if verbose > 1:\n- print "table: " + table + " (format=" + format + ")"\n- if len(tok) > 3:\n- alias = tok[3]\n- if verbose > 1:\n- print " alias=" + alias\n-\n- if host == "" or user == "" or passwd == "" or dbname == "":\n- print "*** Error: missing information about MySQL connection"\n- sys.exit(1)\n- db = RepetDB( user, host, passwd, dbname )\n-\n- if format == "path":\n- comput.load_dico_path_from_table( db, key, table, alias )\n- writer.update_gamexml_comput( tier_name, comput )\n- elif format == "rpath":\n- comput.load_dico_rpath_from_table( db, key, table, alias )\n- elif format == "ipath":\n- comput.load_dico_ipath_from_table( db, key, table, alias )\n- writer.update_gamexml_comput( tier_name, comput )\n- elif format == "align":\n- comput.load_dico_align_from_table( db, key, table, alias )\n- writer.update_gamexml_comput( tier_name, comput )\n- elif format == "map":\n- comput.load_dico_map_from_table( db, key, table, alias )\n- writer.update_gamexml_comput( tier_name, comput )\n- elif format == "rmap":\n- comput.load_dico_rmap_from_table( db, key, table, alias )\n- writer.update_gamexml_comput( tier_name, comput )\n- elif format == "set":\n- comput.load_dico_set_from_table( db, key, table, alias )\n- writer.update_gamexml_comput( tier_name, comput )\n- elif format == "annot":\n- comput.load_dico_annot_from_table( db, key, table, alias )\n- writer.update_gamexml_annot( table, comput )\n- elif format == "annot_set":\n- comput.load_dico_annotset_from_table( db, key, table, alias )\n- writer.update_gamexml_annot( table, comput )\n- else:\n- print "*** Error: unknown format \'%s\'" % ( format )\n- sys.exit(1)\n- writer.write(f_gamexml)\n-\n- db.close()\n-\n- # \n- if f_gamexml == "" and f_result != "" and f_fasta == "":\n- automatisation( f_result, tier_name, writer.get_reverse(), comput )\n-\n- # update a ".gamexml" file (options \'-g\' and \'-t\')\n- if f_gamexml != "" and f_result != "":\n- writer.update_gamexml( f_gamexml, f_result, tier_name, comput )\n-\n- # remove a comput\n- if substract_name != "" and tier_name == "":\n- if f_gamexml != "":\n- writer.parse_gamexml( f_gamexml )\n- writer.verif_name_prog( substract_name )\n- writer.write( f_gamexml )\n- if verbose > 1:\n- print substract_name + " program from " + f_gamexml +" removed"\n- else:\n- automatisation( "", substract_name, 0, None )\n-\n- if verbose > 0:\n- print "%s finished successfully\\n" % (sys.argv[0].split("/")[-1])\n- sys.stdout.flush()\n-\n- return 0\n-\n-#------------------------------------------------------------------------------\n-\n-if __name__ == \'__main__\':\n- main()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/srptPhyML.py --- a/commons/tools/srptPhyML.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,165 +0,0 @@ -#!/usr/bin/env python - -import user, os, sys, getopt, exceptions, logging, ConfigParser - -if not os.environ.has_key( "REPET_PATH" ): - print "*** Error: no environment variable REPET_PATH" - sys.exit(1) -sys.path.append( os.environ["REPET_PATH"] ) - -import pyRepet.sql.RepetJobMySQL -import pyRepet.launcher.Launcher - -#----------------------------------------------------------------------------- - -def help(): - - """ - Give the list of the command-line options. - """ - - print "usage:",sys.argv[0]," [ options ]" - print "options:" - print " -h: this help" - print " -g: name of the group identifier (same for all the jobs)" - print " -q: name of the query directory" - print " -S: suffix in the query directory (default='*.fa')" - print " -Q: name of the queue (on the cluster)" - print " -d: absolute path to the temporary directory" - print " -C: configuration file from TEdenovo or TEannot pipeline" - print " -t: job table name (default=jobs)" - print " -p: absolute path to project directory (if jobs management via files)" - print " -c: clean (remove job launch files and job stdout)" - print " -v: verbose (default=0/1/2)" - -#----------------------------------------------------------------------------- - -def main(): - - """ - This program takes a directory as input and launches MAP on each file in it. - """ - - groupid = "" - queryDir = "" - patternSuffix = "*.fa" - queue = "" - tmpDir = "" - configFileName = "" - jobTable = "jobs" - projectDir = "" - clean = False - verbose = 0 - - try: - opts, args = getopt.getopt(sys.argv[1:],"hg:q:S:Q:d:C:t:p:cv:") - except getopt.GetoptError, err: - print str(err) - help() - sys.exit(1) - for o,a in opts: - if o == "-h": - help() - sys.exit(0) - elif o == "-g": - groupid = a - elif o == "-q": - queryDir = a - elif o == "-S": - patternSuffix = a - elif o == "-Q": - queue = a - elif o == "-d": - tmpDir = a - elif o == "-C": - configFileName = a - elif o == "-t": - jobTable = a - elif o == "-p": - projectDir = a - elif o == "-c": - clean = True - elif o == "-v": - verbose = int(a) - - if groupid == "" or queryDir == "": - print "*** Error: missing compulsory options" - help() - sys.exit(1) - - if os.environ["REPET_JOBS"] == "files" and projectDir == "": - print "*** Error: missing compulsory options for jobs management via files" - help() - sys.exit(1) - - if verbose > 0: - print "\nbeginning of %s" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - #-------------------------------------------------------------------------- - - # create the 'log' file - - logFileName = "%s_pid%s.log" % ( groupid, os.getpid() ) - handler = logging.FileHandler( logFileName ) - formatter = logging.Formatter( "%(asctime)s %(levelname)s: %(message)s" ) - handler.setFormatter( formatter ) - logging.getLogger('').addHandler( handler ) - logging.getLogger('').setLevel( logging.DEBUG ) - logging.info( "started" ) - - - # open a connection to the MySQL table - - if configFileName != "": - if not os.path.exists( configFileName ): - print "*** Error: configuration file '%s' doesn't exist" % ( configFileName ) - sys.exit(1) - config = ConfigParser.ConfigParser() - config.readfp( open(configFileName) ) - host = config.get("repet_env","repet_host") - user = config.get("repet_env","repet_user") - passwd = config.get("repet_env","repet_pw") - dbname = config.get("repet_env","repet_db") - else: - host = os.environ["REPET_HOST"] - user = os.environ["REPET_USER"] - passwd = os.environ["REPET_PW"] - dbname = os.environ["REPET_DB"] - - if os.environ["REPET_JOBS"] == "files": - jobdb = pyRepet.sql.RepetJobMySQL.RepetJob( dbname = projectDir + "/" + os.environ["REPET_DB"] ) - elif os.environ["REPET_JOBS"] == "MySQL": - jobdb = pyRepet.sql.RepetJobMySQL.RepetJob( user, host, passwd, dbname ) - else: - print "*** Error: REPET_JOBS is '%s'" % ( os.environ["REPET_JOBS"] ) - sys.exit(1) - - - currentDir = os.getcwd() - if tmpDir == "": - tmpDir = currentDir - - # launch PhyML on each fasta file in queryDir - cL = pyRepet.launcher.Launcher.PhyMlLauncher( jobdb=jobdb, query=queryDir, cdir=currentDir, tmpdir=tmpDir, job_table=jobTable, queue=queue, groupid=groupid, acro="PhyML" ) - cL.run( patternSuffix ) - - # clean - if clean == True: - cL.clean() - - - logging.info( "finished" ) - - if verbose > 0: - print "%s finished successfully\n" % (sys.argv[0].split("/")[-1]) - sys.stdout.flush() - - return 0 - -#---------------------------------------------------------------------------- - -if __name__ == '__main__': - main() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/srptTableOverlap.py --- a/commons/tools/srptTableOverlap.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,319 +0,0 @@\n-#!/usr/bin/env python\n-\n-import os\n-import sys\n-import getopt\n-import logging\n-import string\n-import ConfigParser\n-\n-from pyRepet.sql.TableAdaptator import *\n-import pyRepet.sql.RepetDBMySQL\n-import pyRepet.coord.Map\n-import pyRepet.coord.Path\n-import pyRepet.coord.Set\n-\n-\n-def help():\n- print\n- print "usage: %s [ options ]" % ( sys.argv[0].split("/")[-1] )\n- print "options:"\n- print " -h: this help"\n- print " -q: query table"\n- print " -s: subject table"\n- print " -p: by path"\n- print " -t: table type comparison: qtype/stype where qtype=[map,set,path] and stype=[path,set,map]"\n- print " -c: configuration file from TEdenovo or TEannot pipeline"\n- print " -H: MySQL host (if no configuration file)"\n- print " -U: MySQL user (if no configuration file)"\n- print " -P: MySQL password (if no configuration file)"\n- print " -D: MySQL database (if no configuration file)"\n- print\n- \n- \n-def pathOverlapByPath( qtable, qtype, stable, stype, db, fout, verbose=0 ):\n- \n- if qtype == "path":\n- db.create_path_index( qtable )\n- qtablePathAdaptator = TablePathAdaptator( db, qtable )\n- path_num_list = qtablePathAdaptator.getPath_num()\n- elif qtype == "set":\n- db.create_set_index( qtable )\n- qtableSetAdaptator = TableSetAdaptator( db, qtable )\n- path_num_list = qtableSetAdaptator.getSet_num()\n- else:\n- string = "unknown query table type: %s" % ( qtype )\n- if verbose > 0:\n- print string\n- logging.error( string )\n- sys.exit(1)\n- string = "nb of paths in query table: %i" % (len(path_num_list) )\n- if verbose > 0:\n- print string\n- logging.info( string )\n- \n- if stype == "path":\n- stablePathAdaptator = TableBinPathAdaptator( db, stable )\n-# stablePathAdaptator=TablePathAdaptator(db,stable)\n- elif stype == "set":\n- stableSetAdaptator = TableBinSetAdaptator( db, stable )\n-# stableSetAdaptator=TableSetAdaptator(db,stable)\n- else:\n- string = "unknown subject table type: %s" % ( stype )\n- if verbose > 0:\n- print string\n- logging.error( string )\n- sys.exit(1)\n- \n- count = 0\n- for path_num in path_num_list:\n- if qtype == "path":\n- qlist = qtablePathAdaptator.getPathList_from_num( path_num )\n- qlist = pyRepet.coord.Path.path_list_rangeQ2Set( qlist )\n- elif qtype == "set":\n- qlist = qtableSetAdaptator.getSetList_from_num( path_num )\n- \n- qlist.sort()\n- qmin, qmax = pyRepet.coord.Set.set_list_boundaries( qlist )\n- \n- qmin = qmin - 1\n- qmax = qmax + 1\n- if stype == "path":\n- slist = stablePathAdaptator.getPathList_from_qcoord(qlist[0].seqname.split()[0],qmin,qmax)\n- slist = pyRepet.coord.Path.path_list_rangeQ2Set( slist )\n- elif stype == "set":\n- slist = stableSetAdaptator.getSetList_from_qcoord(qlist[0].seqname.split()[0],qmin,qmax)\n- \n- if len(slist) > 0:\n- print "----------------------------------------"\n- print "query:"\n- pyRepet.coord.Set.set_list_show( qlist )\n- qlist=pyRepet.coord.Set.set_list_merge( qlist )\n- qsize=pyRepet.coord.Set.set_list_size( qlist )\n- print "query size=",qsize\n- \n- slist_dict = pyRepet.coord.Set.set_list_split( slist )\n- subj_names = ""\n- for i,l in slist_dict.items():\n- if subj_names != "":\n- subj_names += "|"\n- subj_names += "%d:%s" % (i,l[0].name)\n- subj_count = len(slist_dict.keys())\n- \n- print "subject:"\n- pyRepet.coord.Set.set_list_show( slist )\n- slist = pyRepet.coord.Set.set_list_merge( slist )\n- ssize = pyRepet.coord.Set.set_list_size( slist )\n- '..b'ion of query: %.3f" % ( float(sum_osize)/sum_qsize )\n- string += "\\nsize of non-overlaps with the subject table: %i nt" % ( sum_non_osize )\n- string += "\\n proportion of query: %.3f" % ( float(sum_non_osize)/sum_qsize )\n- if verbose > 0:\n- print string; sys.stdout.flush()\n- logging.info( string )\n- \n- return sum_osize, sum_non_osize, sum_qsize\n-\n-\n-def main ():\n- """\n- This program computes the overlaps between two tables recording spatial coordinates.\n- """\n- qtable = ""\n- stable = ""\n- type = ""\n- by_path = False\n- configFileName = ""\n- host = ""\n- user = ""\n- passwd = ""\n- db = ""\n- verbose = 0\n- try:\n- opts, args = getopt.getopt( sys.argv[1:], "hq:s:t:pc:H:U:P:D:v:" )\n- except getopt.GetoptError:\n- help()\n- sys.exit(1)\n- if len(args) != 0:\n- help()\n- sys.exit(1)\n- for o,a in opts:\n- if o == "-h":\n- help()\n- sys.exit(0)\n- elif o == "-q":\n- qtable = a\n- elif o == "-s":\n- stable = a\n- elif o == "-t":\n- type = a\n- elif o == "-p":\n- by_path = True\n- elif o == "-c":\n- configFileName = a\n- elif o == "-H":\n- host = a\n- elif o == "-U":\n- user = a \n- elif o == "-P":\n- passwd = a\n- elif o == "-D":\n- db = a\n- elif o == "-v":\n- verbose = int(a)\n- if qtable=="" or stable=="" or \\\n- (configFileName== "" and (host=="" or \\\n- user=="" or passwd=="" or db=="")):\n- print "ERROR: missing compulsory options"\n- help()\n- sys.exit(1)\n- if verbose > 0:\n- print "START %s" % (sys.argv[0].split("/")[-1])\n- sys.stdout.flush()\n- \n- if configFileName != "":\n- config = ConfigParser.ConfigParser()\n- config.readfp( open(configFileName) )\n- host = config.get("repet_env","repet_host")\n- user = config.get("repet_env","repet_user")\n- passwd = config.get("repet_env","repet_pw")\n- dbname = config.get("repet_env","repet_db")\n- \n- logfilename = qtable + "-" + stable + "-" + str(os.getpid()) + ".log"\n- handler = logging.FileHandler( logfilename )\n- formatter = logging.Formatter("%(asctime)s %(levelname)s: %(message)s")\n- handler.setFormatter( formatter )\n- logging.getLogger(\'\').addHandler(handler)\n- logging.getLogger(\'\').setLevel(logging.DEBUG)\n- logging.info("started")\n- \n- db = pyRepet.sql.RepetDBMySQL.RepetDB( user, host, passwd, dbname )\n- \n- qtype, stype = type.split("/")\n- \n- if not db.exist( qtable ):\n- if not os.path.exists( qtable ):\n- msg = "ERROR: neither table nor file \'%s\'" % ( qtable )\n- sys.stderr.write( "%s\\n" % msg )\n- sys.exit(1)\n- tmp = qtable.replace(".","_")\n- db.create_table( db, tmp, qtable, qtype )\n- qtable = tmp\n- if not db.exist( stable ):\n- if not os.path.exists( stable ):\n- msg = "ERROR: neither table nor file \'%s\'" % ( stable )\n- sys.stderr.write( "%s\\n" % msg )\n- sys.exit(1)\n- tmp = stable.replace(".","_")\n- db.create_table( db, tmp, stable, qtype )\n- stable = tmp\n- \n- string = "input tables:"\n- string += "\\nquery table: %s (\'%s\' format)" % ( qtable, qtype )\n- string += "\\nsubject table: %s (\'%s\' format)" % ( stable, stype )\n- logging.info( string )\n- \n- if by_path:\n- fout = open(qtable+"_vs_"+stable+".dat","w")\n- pathOverlapByPath( qtable, qtype, stable, stype, db, fout, verbose )\n- fout.close()\n- else:\n- getOverlapAllPaths( qtable, qtype, stable, stype, db, verbose )\n- \n- logging.info("finished")\n- \n- if verbose > 0:\n- print "END %s" % (sys.argv[0].split("/")[-1])\n- sys.stdout.flush()\n- \n- \n-if __name__ == "__main__":\n- main()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tabFileReader.py --- a/commons/tools/tabFileReader.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,600 +0,0 @@\n-#!/usr/bin/env python\n-\n-###@file\n-# Read a file recording matches in the \'tab\' format (output from Matcher) and return the number of matches between queries and subjects being CC, CI, IC and II.\n-# A match is said to be CC (for complete-complete) when both query and subject match over x% of their entire respective length. By default, x=95.\n-#\n-# usage: tabFileReader.py [ options ]\n-# options:\n-# -h: this help\n-# -m: name of the file recording the matches (format=\'tab\', output from Matcher)\n-# -q: name of the fasta file recording the queries\n-# -s: name of the fasta file recording the subjects\n-# -t: threshold over which the match is \'complete\', in % of the seq length (default=95)\n-# -i: identity below which matches are ignored (default=0)\n-# -l: length below which matches are ignored (default=0)\n-# -o: overlap on query and subject below which matches are ignored (default=0)\n-# -v: verbose (default=0/1)\n-\n-import sys\n-import getopt\n-from string import *\n-\n-import pyRepet.seq.BioseqDB\n-import pyRepet.util.Stat\n-\n-#TODO: remove case changes in headers (4 lower() method calls in this script) \n-\n-#----------------------------------------------------------------------------\n-\n-def help():\n- print\n- print "usage: %s [ options ]" % ( sys.argv[0].split("/")[-1] )\n- print "options:"\n- print " -h: this help"\n- print " -m: name of the file recording the matches (format=\'tab\', output from Matcher)"\n- print " -q: name of the fasta file recording the queries"\n- print " -s: name of the fasta file recording the subjects"\n- print " -t: coverage threshold over which the match is \'complete\' (in %% of the seq length, default=95)"\n- print " -i: identity below which matches are ignored (default=0)"\n- print " -l: length below which matches are ignored (default=0)"\n- print " -o: overlap on query and subject below which matches are ignored (default=0)"\n- print " -I: identity threshold for \'CC\' matches (default=90)"\n- print " -E: E-value threshold for \'CC\' matches (default=1e-10)"\n- print " -T: coverage threshold for match length on query compare to subject length (default=90)"\n- print " -v: verbose (default=0/1)"\n- print\n-\n-#----------------------------------------------------------------------------\n-\n-#here are the fields of a \'.tab\' file:\n-#[0]: query sequence name\n-#[1]: whole match start coordinate on the query sequence\n-#[2]: whole match end coordinate on the query sequence\n-#[3]: length on the query sequence\n-#[4]: length in percentage of the query sequence\n-#[5]: length on the query relative to the subject length in percentage\n-#[6]: subject sequence name\n-#[7]: whole match start coordinate on the subject sequence\n-#[8]: whole match end coordinate on the subject sequence\n-#[9]: length on the subject sequence\n-#[10]: length in percentage of the subject sequence\n-#[11]: BLAST E-value\n-#[12]: BLAST score\n-#[13]: identity percentage\n-#[14]: path\n-\n-class tabFileReader( object ):\n-\n- def __init__( self, line ):\n-\n- columns = line.split("\\t")\n-\n- self.name_sbj = (columns[6])\n- self.length_sbj = int(round(int(columns[9])/float(columns[10]),0)) #length of the subject\n- self.prct_sbj = float(columns[10]) * 100 #prct_sbj = length of the match on the subject divided by the length of the subject * 100\n- if int(columns[7]) < int(columns[8]):\n- self.start_sbj = int(columns[7]) #start of the match on the subject\n- self.end_sbj = int(columns[8]) #end of the match on the subject\n- else:\n- self.start_sbj = int(columns[8])\n- self.end_sbj = int(columns[7])\n- self.sbj_dist_ends = int(columns[9]) #length on the subject that matches with the query\n-\n- self.name_qry = columns[0]\n- self.length_qry = int(round(int(columns[3])/float(col'..b'\n-\n- outFile.write( "\\nNumber of matches with L < %i%% for subject & query: %i\\n" % ( thresholdCoverage, len(ListMatches_inf_sbjqry) ) )\n- outFile.write( " Number of different subjects in that case: %s\\n" % (len(Sbj2Qry_inf_sbjqry)))\n- outFile.write( " Among them, number of different subjects having exactly one match: %s\\n" % (len(UniqSbj_inf_sbjqry)))\n- outFile.write( " Among them, number of different subjects having more than one match: %s\\n" % (len(RedunSbj_inf_sbjqry)))\n- outFile.write( " Number of different queries in that case: %s\\n" % (len(Qry2Sbj_inf_sbjqry)))\n- outFile.write( " Among them, number of different queries having exactly one match: %s\\n" % (len(UniqQry_inf_sbjqry)))\n- outFile.write( " Among them, number of different queries having more than one match: %s\\n" % (len(RedunQry_inf_sbjqry)))\n- \n- \n- # For the elements already counted in the matches with L >= 95% for subject & query, remove them from the other dictionnaries\n- rmv_Sbj2Qry = remove( Sbj2Qry_all, Sbj2Qry_sup_sbjqry, Sbj2Qry_sup_sbj, Sbj2Qry_sup_qry, Sbj2Qry_inf_sbjqry )\n- rmv_Qry2Sbj = remove( Qry2Sbj_all, Qry2Sbj_sup_sbjqry, Qry2Sbj_sup_sbj, Qry2Sbj_sup_qry, Qry2Sbj_inf_sbjqry )\n- \n- outFile.write("\\n\\nAfter removal of the subjects/queries already counted in the matches with L >= %i%% for them:\\n" % ( thresholdCoverage ) )\n- \n- outFile.write( "\\nMatches with L >= %i%% for subject and L < %i%% for query:\\n" % ( thresholdCoverage, thresholdCoverage ) )\n- outFile.write( " # Number of different subjects in the \'CI\' case: %s (%.2f%%)\\n" % ( len(rmv_Sbj2Qry[0]), 100*len(rmv_Sbj2Qry[0])/float(nbSbj) ) )\n- outFile.write( " # Number of different queries in the \'CI\' case: %s (%.2f%%)\\n" % ( len(rmv_Qry2Sbj[0]), 100*len(rmv_Qry2Sbj[0])/float(nbQry) ) )\n- \n- outFile.write( "\\nMatches with L < %i%% for subject and L >= %i%% for query:\\n" % ( thresholdCoverage, thresholdCoverage ) )\n- outFile.write( " # Number of different subjects in the \'IC\' case: %s (%.2f%%)\\n" % (len(rmv_Sbj2Qry[1]), 100*len(rmv_Sbj2Qry[1])/float(nbSbj) ) )\n- outFile.write( " # Number of different queries in the \'IC\' case: %s (%.2f%%)\\n" % (len(rmv_Qry2Sbj[1]), 100*len(rmv_Qry2Sbj[1])/float(nbQry) ) )\n- \n- outFile.write( "\\nMatches with L < %i%% for subject & query:\\n" % ( thresholdCoverage ) )\n- outFile.write( " # Number of different subjects in the \'II\' case: %s (%.2f%%)\\n" % (len(rmv_Sbj2Qry[2]), 100*len(rmv_Sbj2Qry[2])/float(nbSbj) ) )\n- outFile.write( " # Number of different queries in the \'II\' case: %s (%.2f%%)\\n" % (len(rmv_Qry2Sbj[2]), 100*len(rmv_Qry2Sbj[2])/float(nbQry) ) )\n- \n- outFile.write("\\n==========================================================================\\n")\n- \n- write_output( outFile, \'CC\', Sbj2Qry_sup_sbjqry, dSbj2Cat, Qry2Sbj_sup_sbjqry, dQry2Cat )\n- \n- outFile.write("\\n==========================================================================\\n")\n- \n- write_output( outFile, \'CI\', rmv_Sbj2Qry[0], dSbj2Cat, rmv_Qry2Sbj[0], dQry2Cat )\n- \n- outFile.write("\\n==========================================================================\\n")\n- \n- write_output( outFile, \'IC\', rmv_Sbj2Qry[1], dSbj2Cat, rmv_Qry2Sbj[1], dQry2Cat )\n- \n- outFile.write("\\n==========================================================================\\n")\n- \n- write_output( outFile, \'II\', rmv_Sbj2Qry[2], dSbj2Cat, rmv_Qry2Sbj[2], dQry2Cat )\n- \n- outFile.write("\\n==========================================================================\\n")\n- \n- outFile.close()\n- \n- writeSubjectCategory( dSbj2Cat )\n- writeQueryCategory( dQry2Cat )\n- \n- if verbose > 0:\n- print "END %s" % (sys.argv[0].split("/")[-1])\n- sys.stdout.flush()\n- \n- return 0\n-\n-#-----------------------------------------------------------------------------------------------------\n-\n-if __name__ == "__main__":\n- main()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/MockFastaForReplaceGreaterThanSymbolInFastaHeader.py --- a/commons/tools/tests/MockFastaForReplaceGreaterThanSymbolInFastaHeader.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,59 +0,0 @@ -class MockFastaForReplaceGreaterThanSymbolInFastaHeader(object): - def write(self, inFileName): - f = open(inFileName, 'w') - f.write(">sp|P0A2V0|NDVA_AGRT5 Beta-(1-->2)glucan export ATP-binding/permease protein ndvA OS=Agrobacterium tumefaciens (strain C58 / ATCC 33970) GN=ndvA PE=3 SV=1\n") - f.write("MTLFQVYTRALRYLTVHKWRVAVVVIANVILAAITIAEPVLFGRIIDAISSGTNVTPILI\n") - f.write("LWAGFGVFNTVAYVAVAREADRLAHGRRATLLTEAFGRIISMPLSWHHLRGTSNALHTLL\n") - f.write("RASETLFGLWLEFMRTHLATFVALVLLIPTAMAMDLRLSFVLIGLGIVYWFIGKWVMGRT\n") - f.write("KDGQASVEEHYHSVFAHVSDSISNVSVLHSYNRIEAETKALKSFTEKLLSAQYPVLDWWA\n") - f.write("FASALNRTASTVSMMIILVIGTVLVKNGELRVGDVIAFIGFANLLIGRLDQMRQFVTQIF\n") - f.write("EARAKLEDFFVLEDAVKEREEPGDARELSNVSGTVEFRNINFGFANTKQGVHDVSFTAKA\n") - f.write("GETVAIVGPTGAGKTTLINLLQRVYDPDSGQILIDGTDISTVTKNSLRNSIATVFQDAGL\n") - f.write("LNRSIRENIRLGRETATDAEVVEAAAAAAATDFIDSRINGYLTQVGERGNRLSGGERQRI\n") - f.write("AIARAILKNAPILVLDEATSALDVETEARVKAAVDALRKNRTTFIIAHRLSTVRDADLVL\n") - f.write("FLDQGRIIEKGTFDELTQRGGRFTSLLRTSGLLTEDEGQQPRPKAIAS\n") - f.write(">sp|Q694C1|ABC3G_GORGO DNA dC->dU-editing enzyme APOBEC-3G OS=Gorilla gorilla gorilla GN=APOBEC3G PE=2 SV=1\n") - f.write("MTPQFRNTVERMYRDTFSYNFNNRPILSRRNTVWLCYEVKTKDPSRPPLDAKIFRGQVYS\n") - f.write("ELKYHPEMRFFHWFSKWRKLHRDQEYEVTWYISWSPCTKCTRNVATFLAEDPKVTLTIFV\n") - f.write("ARLYYFWDQDYQEALRSLCQKRDGPRATMKIMNYDEFQHCWSKFVYSQRELFEPWNNLPK\n") - f.write("YYMLLHIMLGEILRHSMDPPTFTSNFNNEHWVRGRHETYLCYEVERLHNDTWVLLNQRRG\n") - f.write("FLCNQAPHKHGFLEGRHAELCFLDVIPFWKLDLHQDYRVTCFTSWSPCFSCAQEMAKFIS\n") - f.write("NKKHVSLCIFAARIYDDQGRCQEGLRTLAEAGAKISIMTYSEFKHCWDTFVYHQGCPFQP\n") - f.write("WDGLEEHSQALSGRLQAILQNQGN\n") - f.write(">sp|P0A4M1|ZTOX_ENTFA Zeta-toxin OS=Enterococcus faecalis PE=3 SV=1\n") - f.write("MANITDFTEKQFEDRLEKNVERLTKNRLAVESPTAFLLGGQPGSGKTSLRSAISEETQGN\n") - f.write("VVIIDNDTFKQQHPNFDELVKLYEKDVVKYVTPYSNRMTEAIISRLRDKGYNLVIEGTGR\n") - f.write("TTDVPIQTATMLQAKDYETKMYVMAVPKINSYLGTIERYETMYADDPMTARATPKQAHDI\n") - f.write("VVKNLPTNLETLHKTGLFSDIRLYNREGVKLYSSLETPSISPKETLERELNRKVSGKEIQ\n") - f.write("PTLERIEQKMVQNQHQETPEFKAIQQKMESLQPPTPPIPKTPKLPGI\n") - f.close() - -class MockFastaForReplaceGreaterThanSymbolInFastaHeader_withoutGreaterThan(object): - def write(self, inFileName): - f = open(inFileName, 'w') - f.write(">sp|P0A2V0|NDVA_AGRT5 Beta-(1 to 2)glucan export ATP-binding/permease protein ndvA OS=Agrobacterium tumefaciens (strain C58 / ATCC 33970) GN=ndvA PE=3 SV=1\n") - f.write("MTLFQVYTRALRYLTVHKWRVAVVVIANVILAAITIAEPVLFGRIIDAISSGTNVTPILI\n") - f.write("LWAGFGVFNTVAYVAVAREADRLAHGRRATLLTEAFGRIISMPLSWHHLRGTSNALHTLL\n") - f.write("RASETLFGLWLEFMRTHLATFVALVLLIPTAMAMDLRLSFVLIGLGIVYWFIGKWVMGRT\n") - f.write("KDGQASVEEHYHSVFAHVSDSISNVSVLHSYNRIEAETKALKSFTEKLLSAQYPVLDWWA\n") - f.write("FASALNRTASTVSMMIILVIGTVLVKNGELRVGDVIAFIGFANLLIGRLDQMRQFVTQIF\n") - f.write("EARAKLEDFFVLEDAVKEREEPGDARELSNVSGTVEFRNINFGFANTKQGVHDVSFTAKA\n") - f.write("GETVAIVGPTGAGKTTLINLLQRVYDPDSGQILIDGTDISTVTKNSLRNSIATVFQDAGL\n") - f.write("LNRSIRENIRLGRETATDAEVVEAAAAAAATDFIDSRINGYLTQVGERGNRLSGGERQRI\n") - f.write("AIARAILKNAPILVLDEATSALDVETEARVKAAVDALRKNRTTFIIAHRLSTVRDADLVL\n") - f.write("FLDQGRIIEKGTFDELTQRGGRFTSLLRTSGLLTEDEGQQPRPKAIAS\n") - f.write(">sp|Q694C1|ABC3G_GORGO DNA dC to dU-editing enzyme APOBEC-3G OS=Gorilla gorilla gorilla GN=APOBEC3G PE=2 SV=1\n") - f.write("MTPQFRNTVERMYRDTFSYNFNNRPILSRRNTVWLCYEVKTKDPSRPPLDAKIFRGQVYS\n") - f.write("ELKYHPEMRFFHWFSKWRKLHRDQEYEVTWYISWSPCTKCTRNVATFLAEDPKVTLTIFV\n") - f.write("ARLYYFWDQDYQEALRSLCQKRDGPRATMKIMNYDEFQHCWSKFVYSQRELFEPWNNLPK\n") - f.write("YYMLLHIMLGEILRHSMDPPTFTSNFNNEHWVRGRHETYLCYEVERLHNDTWVLLNQRRG\n") - f.write("FLCNQAPHKHGFLEGRHAELCFLDVIPFWKLDLHQDYRVTCFTSWSPCFSCAQEMAKFIS\n") - f.write("NKKHVSLCIFAARIYDDQGRCQEGLRTLAEAGAKISIMTYSEFKHCWDTFVYHQGCPFQP\n") - f.write("WDGLEEHSQALSGRLQAILQNQGN\n") - f.write(">sp|P0A4M1|ZTOX_ENTFA Zeta-toxin OS=Enterococcus faecalis PE=3 SV=1\n") - f.write("MANITDFTEKQFEDRLEKNVERLTKNRLAVESPTAFLLGGQPGSGKTSLRSAISEETQGN\n") - f.write("VVIIDNDTFKQQHPNFDELVKLYEKDVVKYVTPYSNRMTEAIISRLRDKGYNLVIEGTGR\n") - f.write("TTDVPIQTATMLQAKDYETKMYVMAVPKINSYLGTIERYETMYADDPMTARATPKQAHDI\n") - f.write("VVKNLPTNLETLHKTGLFSDIRLYNREGVKLYSSLETPSISPKETLERELNRKVSGKEIQ\n") - f.write("PTLERIEQKMVQNQHQETPEFKAIQQKMESLQPPTPPIPKTPKLPGI\n") - f.close() |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_AlignTEOnGenomeAccordingToAnnotation.py --- a/commons/tools/tests/Test_AlignTEOnGenomeAccordingToAnnotation.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,304 +0,0 @@\n-from commons.core.seq.Bioseq import Bioseq\n-from commons.core.seq.AlignedBioseqDB import AlignedBioseqDB\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.core.sql.TableSeqAdaptator import TableSeqAdaptator\n-from commons.core.sql.TablePathAdaptator import TablePathAdaptator\n-from commons.core.coord.Path import Path\n-import os\n-import unittest\n-from commons.tools.AlignTEOnGenomeAccordingToAnnotation import AlignTEOnGenomeAccordingToAnnotation\n-\n-class Test_AlignTEOnGenomeAccordingToAnnotation(unittest.TestCase):\n-\n- def test_alignBioseqWithNWalign(self):\n- iBioseq1 = Bioseq("dmel_chr4", "TAATCGTAGAGGAAAAGGGTATGAGAGATTTGTTTAGAAGTACGTTACTAGTAGAAGAAA")\n- iBioseq2 = Bioseq("DmelChr4-B-R1-Map4_NoCat", "TTTCTTCTACCTATTACATACTTTTCAACAAATCTAGCATACCCTTTTACTCTACGAGTA")\n- iAlignedBioseq1 = Bioseq("dmel_chr4 Score=58 Identity=0.7", "TAATCGTAGAGGAAAAGGGTATGAGAGATTTGTT-TAGA-AGTACGTTACTAGTAGAAGAAA----------------------------")\n- iAlignedBioseq2 = Bioseq("DmelChr4-B-R1-Map4_NoCat Score=58 Identity=0.7", "----------------------------TTTCTTCTACCTATTACAT-ACTTTTC-AACAAATCTAGCATACCCTTTTACTCTACGAGTA")\n- expiAlignedBioseqDB = AlignedBioseqDB()\n- expiAlignedBioseqDB.add(iAlignedBioseq1)\n- expiAlignedBioseqDB.add(iAlignedBioseq2)\n- \n- iATEOGATA = AlignTEOnGenomeAccordingToAnnotation()\n- obsiAlignedBioseqDB = iATEOGATA.alignBioseqWithNWalign(iBioseq1, iBioseq2)\n- \n- self.assertEquals(expiAlignedBioseqDB, obsiAlignedBioseqDB)\n- \n- def test_alignSeqAccordingToPathAndBuildAlignedSeqTable_one_path(self):\n- iBioseq1 = Bioseq("dmel_chr4", "TTTCTTCTACTAGTAACGTACTTCTAAACAAATCTCTCATACCCTTTTCCTCTACGATTA")\n- iBioseq2 = Bioseq("DmelChr4-B-R1-Map4_NoCat", "TTATTTGTCTCCGAACTTCTTACTGACAATGGCACCAAAATATGATCAGTGTTTGTTGGTATTAATGGCCTTTCATCTAATGGGGGAGTAGCACATCCGAGTCCGTTTTCCAGAATTTCGGCATCAATGGGGGTGGAATTTCCAAAAACACATCGGTATTTTGCAAGAACAAGAAACTTATTATTAATTACAGCTATGTATCCAGTTACACCAATAAATTTCCGTCGCCGTACTTGTTAGTCTTAATAATACCCGTACTCGTAGAGTAAAAGGGTATGCTAGATTTGTTGAAAAGTATGTAATAGGTAGAAGAAAGCGTTTTCGACCATATCAAGTATATATATATTTTTGATAAGGATTAATAGCCGAGTCGAAGTGGCCATGCCATAGACGCATAGAAGCATAGACGCAGCGTAGAGATCCATGTTTCCCACTATAACGCCCACAAACCGCCCAAAATAAAATCGAAATGTTTCGATTTTTCTTTGTTTTATTGTTTGCCTTGTCAATTTCTATGTATTTTATACCCAAAACACTTTGGCCAAGGCCAAGATGTAAGGAAGCATCTACAACACGCTTTTGAACACATCTTTTAATATCGCAGATAAATGATGAAATTTCTCGTTCACATTTCCACTACCATTCCCCGGCTCAGGGGAAACTCAACCATAGCATTCTCTCTTGCTTTGACTTCAGCATAGTGACGATAAGCACCAAGAGTCTGAATTATAAGTAGACTACCGTATAGGACTCATAAAACTGAAAAGCTGCTTTTATATTGCGATCAAAAAAGAAATTAATATTACGAAAATTGCTGTTGCTGGGGCAGGTGGATCAACATATCCCAACATATATTTAACTGTATTGCATTTTACCCTAAAATACGCTTTAATTAATGGTTTAAAAAAAACAGACTGTTTCTATTTTCTATTTCTATTTATTTTATTCTTGGAAAGTTATTTTTTTAATTTTTTGACAAGAATCTTTGAATTTACTTGCTTGCAATCCCACTAGCTAAGTGACGGGTATATAGAGTTTTCCCTTATTTTAATAATCTAGGGTCGCCAGTTTGTCCGTCAGTTCTTCGCTAACGAAGTTCGCTGTTGGCTCGGTATCGACTGTGTAGTCTAGACTCCCTTCGTTGGTCCTCCTGCTGCGTTTCGTCCTTGCTAAGGGCTTTGCCCTCTGGCTTCGTAGTCTTCCTGGTGTGTAGGGTCTATTTTGTTTCCATCTCTGAGTAAGTATAAATAAATTTGGCTTGATTTTTATACTTTAGAGAGCCGTAACGGATAATGAAATAACGCCCCCATACTCTAGATACAGTTTTATCAACAAAGAATTAACCGTATATTGTAATTTGACAAAAATGTTGTATATTTTTCTTCGTAATAAGATCGATAGGGCATAGTTCTTATAATACAAAGCCGGCTTTTCTTACATACGTATAAGTCCATACATTTTTTAAACTAAAATTTATAATTTTTTTGACAATTGTAAATAAATTGTTATCTTGCTAAAAAATAAAAAAGTTACAAAAATTTTTTAAAAATCATATTGATGTCAGCAATTAGATGTGCAATCACCATCTAGTGTAGCAGCAACATTTCCTAATTTTCGTGAAAGATGCATCTTTCGGCAATTAATATCAGTTTCAAGTGATTCCATAATCTTTAAACAAAGGTAAATAAGTGGATTAGACGAAAAAAATTACGAAAATAGGTTAAATAGGTTACCTGATCCTTATATTTAGTTATATAAATGTATAACTCTTTTAATGCAGAAATAGTATCAAACTCTTCGTTTTGCCTTACTGATAGCTGTTGCATAGCTGTACTCATTTCCTGGTCGCTTATTTGTGGAAGCCTTGATACATCGCGGTAAAACTCTTTGACCATAATTCTATAGTTTGGAATATCCTGTCATATAAACCAGTTAATTAAATATTAATGATTTTATTAAAATATTTATACCATTACTTATAAATATTTAAATTTATTATTTGTGTATAAATTTGATAAAGGTAATAATCTAAGTAATATATACCAATATATATGCATATATGTATTCACATTTAAAAAAATGAAAGGGAAAAGAATTTGAAGTCTAATTGTATAAATTGTTTTTAATTTGTTTTATTCTCATTAGACCTCGATAATAGGTCTTTTGTGTGATTAATTAATTTGATAGACTCCTTACTTACAAGAAAAGAAGAAA'..b'")\n- f.write("AGTGACGGGTATATAGAGTTTTCCCTTATTTTAATAATCTAGGGTCGCCAGTTTGTCCGT\\n")\n- f.write("CAGTTCTTCGCTAACGAAGTTCGCTGTTGGCTCGGTATCGACTGTGTAGTCTAGACTCCC\\n")\n- f.write("TTCGTTGGTCCTCCTGCTGCGTTTCGTCCTTGCTAAGGGCTTTGCCCTCTGGCTTCGTAG\\n")\n- f.write("TCTTCCTGGTGTGTAGGGTCTATTTTGTTTCCATCTCTGAGTAAGTATAAATAAATTTGG\\n")\n- f.write("CTTGATTTTTATACTTTAGAGAGCCGTAACGGATAATGAAATAACGCCCCCATACTCTAG\\n")\n- f.write("ATATAGTTTTATCAACAAAGAATTAACCGTATATTGTAATTTGACAAAAATGTTGTATAT\\n")\n- f.write("TTTTCTTCGTAATAAGATCGATAGGGCATAGTTCTTATAATACAAAGCCGGCTTCTCTTA\\n")\n- f.write("CATACGTATAAGTCCATACATTTTTTAAACTAAAATTTATAATTTTTTTGACAATTGTAA\\n")\n- f.write("ATAAATTGTTATCTTGCTAAAAAATAAAAAAGTTACAAAAATTTTTAAAAAATCATATTG\\n")\n- f.write("ATGTCAGCAATTAGATGTGCAATCACCATCTAGTGTAGCAGCAACATTTCCTAATTTTCG\\n")\n- f.write("TGAAAGATGCATCTTTCGGCAATTAATATCAGTTTCAAGTGATTCCATAATCTTTAAACA\\n")\n- f.write("AAGGTAAATAAGTGGATTAGACGAAAAAAATTACGAAAATAGGTTAAATAGGTTACCTGA\\n")\n- f.write("TCCTTATATTTAGTTATATAAATGTATAACTCTTTTAATGCAGAAATAGTATCAAACTCT\\n")\n- f.write("TCGTTTTGCCTTACTGATAGCTGTTGCATAGCTGTACTCATTTCCTGGTCGCTTATTTGT\\n")\n- f.write("GGAAGCCTTGATACATCGCGGTAAAACTCTTTGACCATAATTCTATAGTTTGGAATATCC\\n")\n- f.write("TGTCATATAAACCAGTTAATTAAATATTAATGATTTTATTAAAATATTTATACCATTACT\\n")\n- f.write("TATAAATATTTAAATTTATTATTTGTGTATAAATTTGATAAAGGTAATAATCTAAGTAAT\\n")\n- f.write("ATATACCAATATATATGCATATATGTATTCACATTTAAAAAAATGAAAGGGAAAAGAATT\\n")\n- f.write("TGAAGTCTAATTGTATAAATTGTTTTTAATTTGTTTTATTCTCATTAGACCTCGATAATA\\n")\n- f.write("GGTCTTTTGTGTGATTAATTAATTTGATAGACTCCTTACTTACAAGAAAAGAAGAAAACA\\n")\n- f.write("GAAGGTTTACCAGGTGTTCCCTTTATCCGTTACTCCAGTAAAGCGAGGGCGAACTAAATT\\n")\n- f.write("TTTAAGCGTTGAAGAGGCCGTCTTGGTATTGGATCTTCCATGCTTAATGTCAACGTTCTA\\n")\n- f.write("TATTTTCATACGGACGGACATGGCCAGATCAAAGACACTAGAATAACAAGATGCGTAACG\\n")\n- f.write("CCATACGATTTTTTGGCACACAATTTTTTGGCCGTGGCTCTAGAGGTGGCTCCAGGCTCT\\n")\n- f.write("CTCGAATTTTTGTTAGAGAGCGAGAGAGCGAAGAGCGCTACAGCGAACCGCTCTTTTCTA\\n")\n- f.write("CGCATACAGTGATAGCAGACAACTTTATGTGCGCACACGTATGCTCATGCATTGTAAATT\\n")\n- f.write("TGACAAAATATGCCCTTCACCGTAGAAGTTCTTAGACTTTAAATCTATATTATTTTTGAT\\n")\n- f.write("CAATTGGCACCATGCGAAAAATTCTTGTTTTGCATTGCCTTAACGTTATTATTATTTGAA\\n")\n- f.write("AATAGATTAGAAATAGCCAAATCTATGTACATAATATCACAAAAATAAATTTCAAAAATG\\n")\n- f.write("ACTTTATATAAGAATATTTGTCATTAGAGTATTCATCTTGCGGGGTGTGAAAAATGAATA\\n")\n- f.write("AGGCAATGATTGTTGCTTGTGTCCGTCCGCACTTCGTGCCTCAAGATATGACCAAAACAA\\n")\n- f.write("AGACACTAGAATAATTCTAGTGTCTTTGATGTGACTTTTGCAATAAACAGTTTTCATATT\\n")\n- f.write("TTTATTTATTTTACAAATTTTTATTTTCTACTTCGTATTATTTTTATGAAATATTTATTT\\n")\n- f.write("CTCGATGTAATGTATTCCTTTTGTTATAAGTAGTTATAATAATTTATATTTTACTTCCTT\\n")\n- f.write("CAATATCACAAAATAAATTTCAAGTATGGCTTTATATTAGAATAATTGTCATTAAATTAT\\n")\n- f.write("TCAGCTTGGGACGTGGGAAAAATTAGAGTAGACATGTCTAGTAGACATCGATTCTTAGGT\\n")\n- f.write("GCTTCTGACCGCACGTCGTGCCTCAAGAAATCAATTTCGCATATTTATACCCATTATTTC\\n")\n- f.write("TAGAGTAAAAGGGTATACTACATTCGTTGAAAAGTATGTAACAGGCAGAAGAAAGCGTTT\\n")\n- f.write("CCGACTATATAATGTATAAAGATCAGGATCAACAGCCGAGTCGATCTGGCCATGTCCGTC\\n")\n- f.write("TGTCCGTATGAACGTCGAGGTCTCAGGAACTATAAAAGCAAGAAGGTAGAGATTATGCAT\\n")\n- f.write("ACATATTATGCATACATATTGCCCGTTGACCCATGTTGTCACGCCCACTCTAACGTCCAC\\n")\n- f.write("AAACCGCACAAAACTGCCACGCCCACAAATTCAAAAAATGTAAATGTAATTGACCAAATT\\n")\n- f.write("TAACAAAACTCTAAAAATGTAACTTTGTTTCTTAGATCAAAATTTAGACCAGAAAATCGT\\n")\n- f.write("CTTCATCTTCTAATGTTTTTACTCACACAAGAAAGCAAATTCTATTTTTAGATTTTAAAG\\n")\n- f.write("TACTCCATTTTACGCGAGCGGAGAGAGAGAGCAATTTTGGCCGTCACCAAAAAAGTGTCT\\n")\n-\n-\n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_CalcCoordCumulLength.py --- a/commons/tools/tests/Test_CalcCoordCumulLength.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,74 +0,0 @@ -import unittest -import os -import time -from commons.tools.CalcCoordCumulLength import CalcCoordCumulLength -from commons.core.utils.FileUtils import FileUtils -from pyRepet.util.Stat import Stat - - -class Test_CalcCoordCumulLength( unittest.TestCase ): - - def setUp( self ): - self._i = CalcCoordCumulLength() - self._uniqId = time.strftime("%Y%m%d%H%M%S") - - - def tearDown( self ): - self._i = None - self._uniqId = None - - - def test_mergeCoordinates( self ): - inFileName = "dummyInFile_%s" %( self._uniqId ) - inF = open( inFileName, "w" ) - inF.write( "TE1\tchr1\t101\t200\n" ) - inF.write( "TE2\tchr1\t401\t600\n" ) - inF.write( "TE2\tchr1\t451\t500\n" ) - inF.close() - expFileName = "dummyExpFile_%s" %( self._uniqId ) - expF = open( expFileName, "w" ) - expF.write( "TE1\tchr1\t101\t200\n" ) - expF.write( "TE2\tchr1\t401\t600\n" ) - expF.close() - self._i.setInputFileName( inFileName ) - obsFileName = self._i.mergeCoordinates() - self.assertTrue( FileUtils.are2FilesIdentical( obsFileName, expFileName ) ) - for f in [ inFileName, expFileName, obsFileName ]: os.remove( f ) - - - def test_getStatsPerChr( self ): - inFileName = "dummyInFile_%s" %( self._uniqId ) - inF = open( inFileName, "w" ) - inF.write( "TE1\tchr1\t101\t200\n" ) - inF.write( "TE2\tchr1\t401\t600\n" ) - inF.write( "TE1\tchr2\t1301\t1600\n" ) - inF.close() - dExp = { "chr1": Stat(), "chr2": Stat() } - dExp["chr1"].add( 200-101+1 ) - dExp["chr1"].add( 600-401+1 ) - dExp["chr2"].add( 1600-1301+1 ) - dObs = self._i.getStatsPerChr( inFileName ) - self.assertEqual( dObs, dExp ) - - - def test_zRunAsScript( self ): - cDir = os.getcwd() - inFileName = "dummyInFile_%s" %( self._uniqId ) - inF = open( inFileName, "w" ) - inF.write( "TE1\tchr1\t101\t200\n" ) - inF.write( "TE2\tchr1\t401\t600\n" ) - inF.write( "TE2\tchr1\t451\t500\n" ) - inF.close() - outFileName = "dummyOutFile_%s" %( self._uniqId ) - cmd = "CalcCoordCumulLength.py" - cmd += " -i %s" % ( inFileName ) - cmd += " -o %s" % ( outFileName ) - cmd += " -v 0" - log = os.system( cmd ) - self.assertTrue( log == 0 ) - - for f in [ inFileName, outFileName ]: os.remove( f ) - os.chdir( cDir ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_ChangeSequenceHeaders.py --- a/commons/tools/tests/Test_ChangeSequenceHeaders.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,428 +0,0 @@\n-# Copyright INRA (Institut National de la Recherche Agronomique)\n-# http://www.inra.fr\n-# http://urgi.versailles.inra.fr\n-#\n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use, \n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info". \n-#\n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability. \n-#\n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or \n-# data to be ensured and, more generally, to use and operate it in the \n-# same conditions as regards security. \n-#\n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-\n-\n-import unittest\n-import os\n-import time\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders\n-\n-\n-class Test_ChangeSequenceHeaders( unittest.TestCase ):\n- \n- def setUp( self ):\n- self._i = ChangeSequenceHeaders()\n- self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S") , os.getpid() )\n- \n- \n- def tearDown( self ):\n- self._i = None\n- self._uniqId = None\n- \n- \n- def test_script_no_input_file( self ):\n- cDir = os.getcwd()\n- \n- inFile = "dummyInFaFile_%s" % ( self._uniqId )\n- \n- obsFile = "dummyObsFile_%s" % ( self._uniqId )\n- \n- cmd = "python ../ChangeSequenceHeaders.py"\n- cmd += " -i %s" % ( inFile )\n- cmd += " -f fasta"\n- cmd += " -s 1"\n- cmd += " -p TE"\n- cmd += " -o %s" % ( obsFile )\n- exitStatus = os.system( cmd )\n- \n- self.assertFalse( exitStatus == 0 )\n- \n- os.chdir( cDir )\n- \n- \n- def test_shortenSequenceHeadersForFastaFile_fasta_script( self ):\n- cDir = os.getcwd()\n- \n- inFile = "dummyInFaFile_%s" % ( self._uniqId )\n- inF = open( inFile, "w" )\n- inF.write( ">DmelChr4-B-G387-MAP16\\nATGTACGATGACGATCAG\\n" )\n- inF.write( ">consensus524\\nGTGCGGATGGAACAGT\\n" )\n- inF.close()\n- \n- linkFile = "dummyLinkFile_%s" % ( self._uniqId )\n- \n- expFile = "dummyExpFile_%s" % ( self._uniqId )\n- expF = open( expFile, "w" )\n- expF.write( ">TE1\\nATGTACGATGACGATCAG\\n" )\n- expF.write( ">TE2\\nGTGCGGATGGAACAGT\\n" )\n- expF.close()\n- \n- obsFile = "dummyObsFile_%s" % ( self._uniqId )\n- \n- cmd = "python ../ChangeSequenceHeaders.py"\n- cmd += " -i %s" % ( inFile )\n- cmd += " -f fasta"\n- cmd += " -s 1"\n- cmd += " -p TE"\n- cmd += " -l %s" % ( linkFile )\n- cmd += " -o %s" % ( obsFile )\n- exitStatus = os.system( cmd )\n- \n- self.assertTrue( exitStatus == 0 )\n- self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )\n- \n- for f in [ inFile, linkFile, expFile, obsFile ]:\n- os.remove( f )\n- os.chdir( cDir )\n- \n- \n- def test_retrieveIni'..b' ):\n- cDir = os.getcwd()\n- \n- linkFile = "dummyLinkFile_%s" % ( self._uniqId )\n- linkF = open( linkFile, "w" )\n- linkF.write( "seq1\\tname=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\\t1\\t1000\\n" )\n- linkF.write( "seq2\\tname=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\\t1\\t800\\n" )\n- linkF.close()\n- \n- inFile = "dummyAlignFile_%s" % ( self._uniqId )\n- inFileHandler = open( inFile, "w" )\n- inFileHandler.write( "seq1\\t1\\t100\\tseq2\\t110\\t11\\t1e-38\\t254\\t98.5\\n" )\n- inFileHandler.write( "seq2\\t11\\t110\\tseq1\\t100\\t1\\t1e-38\\t254\\t98.5\\n" )\n- inFileHandler.close()\n- \n- expFile = "dummyExpAlignFile_%s" % ( self._uniqId )\n- expFileHandler = open( expFile, "w" )\n- expFileHandler.write( "name=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\\t1\\t100\\tname=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\\t110\\t11\\t1e-38\\t254\\t98.500000\\n" )\n- expFileHandler.write( "name=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\\t11\\t110\\tname=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\\t100\\t1\\t1e-38\\t254\\t98.500000\\n" )\n- expFileHandler.close()\n- \n- obsFile = "dummyObsAlignFile_%s" % ( self._uniqId )\n- \n- cmd = "python ../ChangeSequenceHeaders.py"\n- cmd += " -i %s" % ( inFile )\n- cmd += " -f align"\n- cmd += " -s 2"\n- cmd += " -l %s" % ( linkFile )\n- cmd += " -o %s" % ( obsFile )\n- exitStatus = os.system( cmd )\n- \n- self.assertTrue( exitStatus == 0 )\n- self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )\n- \n- for f in [ inFile, linkFile, expFile, obsFile ]:\n- os.remove( f )\n- os.chdir( cDir )\n- \n- \n- def test_retrieveInitialSequenceHeadersForPathFile( self ):\n- cDir = os.getcwd()\n- \n- linkFile = "dummyLinkFile_%s" % ( self._uniqId )\n- linkF = open( linkFile, "w" )\n- linkF.write( "seq1\\tname=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\\t1\\t1000\\n" )\n- linkF.write( "seq2\\tname=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\\t1\\t800\\n" )\n- linkF.close()\n- \n- inFile = "dummyAlignFile_%s" % ( self._uniqId )\n- inFileHandler = open( inFile, "w" )\n- inFileHandler.write( "11\\tseq1\\t1\\t100\\tseq2\\t110\\t11\\t1e-38\\t254\\t98.5\\n" )\n- inFileHandler.write( "2\\tseq2\\t11\\t110\\tseq1\\t100\\t1\\t1e-38\\t254\\t98.5\\n" )\n- inFileHandler.close()\n- \n- expFile = "dummyExpAlignFile_%s" % ( self._uniqId )\n- expFileHandler = open( expFile, "w" )\n- expFileHandler.write( "11\\tname=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\\t1\\t100\\tname=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\\t110\\t11\\t1e-38\\t254\\t98.500000\\n" )\n- expFileHandler.write( "2\\tname=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\\t11\\t110\\tname=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\\t100\\t1\\t1e-38\\t254\\t98.500000\\n" )\n- expFileHandler.close()\n- \n- obsFile = "dummyObsAlignFile_%s" % ( self._uniqId )\n- \n- cmd = "python ../ChangeSequenceHeaders.py"\n- cmd += " -i %s" % ( inFile )\n- cmd += " -f path"\n- cmd += " -s 2"\n- cmd += " -l %s" % ( linkFile )\n- cmd += " -o %s" % ( obsFile )\n- exitStatus = os.system( cmd )\n- \n- self.assertTrue( exitStatus == 0 )\n- self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )\n- \n- for f in [ inFile, linkFile, expFile, obsFile ]:\n- os.remove( f )\n- os.chdir( cDir )\n- \n- \n-if __name__ == "__main__":\n- unittest.main()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_CorrelateTEageWithGCcontent.py --- a/commons/tools/tests/Test_CorrelateTEageWithGCcontent.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,60 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils - - -class Test_CorrelateTEageWithGCcontent( unittest.TestCase ): - - def test_zLaunchAsScript( self ): - cDir = os.getcwd() - - coordFile = "dummyPathFile" - coordFileHandler = open( coordFile, "w" ) - coordFileHandler.write( "1\tchr1\t1\t5\tTE1\t1\t5\t0.0\t100\t98.7\n" ) - coordFileHandler.write( "1\tchr1\t11\t20\tTE1\t6\t15\t0.0\t100\t98.7\n" ) - coordFileHandler.write( "2\tchr1\t26\t30\tTE1\t1\t5\t0.0\t100\t96.7\n" ) - coordFileHandler.write( "3\tchr2\t1\t10\tTE2\t1\t10\t0.0\t100\t98.7\n" ) - coordFileHandler.close() - - genomeFile = "dummyGenomeFile" - genomeFileHandler = open( genomeFile, "w" ) - genomeFileHandler.write( ">chr1\n" ) - genomeFileHandler.write( "AGCTGTTTTTAGCAGACGCATTTTTGGAGGTTTT\n" ) - genomeFileHandler.write( ">chr2\n" ) - genomeFileHandler.write( "ATATATATGGTTTTTTTTTT\n" ) - genomeFileHandler.close() - - refseqFile = "dummyRefseqFile" - refseqFileHandler = open( refseqFile, "w" ) - refseqFileHandler.write( ">TE1\nAGCAGCGACGACGACGACGACTTTT\n" ) - refseqFileHandler.write( ">TE2\nAGCAGCGACGACGACGACGACTTTT\n" ) - refseqFileHandler.write( ">TE3\nAGCAGCGACGACGACGACGACTTTT\n" ) - refseqFileHandler.close() - - expFile = "dummyExpFile" - expFileHandler = open( expFile, "w" ) - expFileHandler.write( "copy\tTE\tchr\tlength\tid\tGC\tlengthPerc\n" ) - expFileHandler.write( "1\tTE1\tchr1\t15\t98.70\t%.2f\t%.2f\n" % ( 100 * 9 / 15.0, 100 * 15 / 25.0 ) ) - expFileHandler.write( "2\tTE1\tchr1\t5\t96.70\t%.2f\t%.2f\n" % ( 100 * 4 / 5.0, 100 * 5 / 25.0 ) ) - expFileHandler.write( "3\tTE2\tchr2\t10\t98.70\t%.2f\t%.2f\n" % ( 100 * 2 / 10.0, 100 * 10 / 25.0 ) ) - expFileHandler.close() - - obsFile = "dummyObsFile" - - cmd = "CorrelateTEageWithGCcontent.py" - cmd += " -i %s" % ( coordFile ) - cmd += " -g %s" % ( genomeFile ) - cmd += " -r %s" % ( refseqFile ) - cmd += " -o %s" % ( obsFile ) - cmd += " -v %i" % ( 0 ) - returnStatus = os.system( cmd ) - - self.assertTrue( returnStatus == 0 ) - self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) ) - - for f in [ coordFile, genomeFile, refseqFile, expFile, obsFile ]: - os.remove( f ) - os.chdir( cDir ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_AlignTEOnGenomeAccordingToAnnotation.py --- a/commons/tools/tests/Test_F_AlignTEOnGenomeAccordingToAnnotation.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,122 +0,0 @@ -from commons.core.sql.DbFactory import DbFactory -from commons.core.utils.FileUtils import FileUtils -import subprocess -import os -import unittest -from commons.tools.AlignTEOnGenomeAccordingToAnnotation import AlignTEOnGenomeAccordingToAnnotation - -class Test_F_AlignTEOnGenomeAccordingToAnnotation(unittest.TestCase): - - def test_run_merge_same_paths(self): - pathFileName = "%s/Tools/DmelChr4_chr_allTEs_nr_noSSR_join_path.path" % os.environ["REPET_DATA"] - queryFileName = "%s/commons/DmelChr4.fa" % os.environ["REPET_DATA"] - subjectFileName = "%s/Tools/DmelChr4_refTEs.fa" % os.environ["REPET_DATA"] - pathTableName = "testDmelChr4_chr_allTEs_nr_noSSR_join_path" - queryTableName = "testDmelChr4_chr_seq" - subjectTableName = "testDmelChr4_refTEs_seq" - iDb = DbFactory.createInstance() - iDb.createTable(queryTableName, "seq", queryFileName, True) - iDb.createTable(subjectTableName, "seq", subjectFileName, True) - iDb.createTable(pathTableName, "path", pathFileName, True) - expFileName = "%s/Tools/exp%s_merge.alignedSeq" % (os.environ["REPET_DATA"], pathTableName) - - iATOGATA = AlignTEOnGenomeAccordingToAnnotation(pathTableName, queryTableName, subjectTableName, True) - iATOGATA.run() - obsFileName = "obs%s_merge.alignedSeq" % pathTableName - iDb.exportDataToFile("%s_align" % pathTableName, obsFileName) - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - - os.remove(obsFileName) - iDb.dropTable(queryTableName) - iDb.dropTable(subjectTableName) - iDb.dropTable(pathTableName) - iDb.dropTable("%s_align" % pathTableName) - iDb.close() - - def test_run_as_script_merge_same_paths(self): - pathFileName = "%s/Tools/DmelChr4_chr_allTEs_nr_noSSR_join_path.path" % os.environ["REPET_DATA"] - queryFileName = "%s/commons/DmelChr4.fa" % os.environ["REPET_DATA"] - subjectFileName = "%s/Tools/DmelChr4_refTEs.fa" % os.environ["REPET_DATA"] - pathTableName = "testDmelChr4_chr_allTEs_nr_noSSR_join_path" - queryTableName = "testDmelChr4_chr_seq" - subjectTableName = "testDmelChr4_refTEs_seq" - iDb = DbFactory.createInstance() - iDb.createTable(queryTableName, "seq", queryFileName, True) - iDb.createTable(subjectTableName, "seq", subjectFileName, True) - iDb.createTable(pathTableName, "path", pathFileName, True) - expFileName = "%s/Tools/exp%s_merge.alignedSeq" % (os.environ["REPET_DATA"], pathTableName) - - cmd = "AlignTEOnGenomeAccordingToAnnotation.py -p %s -q %s -s %s -m " % (pathTableName, queryTableName, subjectTableName) - process = subprocess.Popen(cmd, shell = True) - process.communicate() - obsFileName = "obs%s_merge.alignedSeq" % pathTableName - iDb.exportDataToFile("%s_align" % pathTableName, obsFileName) - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - - os.remove(obsFileName) - iDb.dropTable(queryTableName) - iDb.dropTable(subjectTableName) - iDb.dropTable(pathTableName) - iDb.dropTable("%s_align" % pathTableName) - iDb.close() - - def test_run_as_script_without_merge(self): - pathFileName = "%s/Tools/DmelChr4_chr_allTEs_nr_noSSR_join_path.path" % os.environ["REPET_DATA"] - queryFileName = "%s/commons/DmelChr4.fa" % os.environ["REPET_DATA"] - subjectFileName = "%s/Tools/DmelChr4_refTEs.fa" % os.environ["REPET_DATA"] - pathTableName = "testDmelChr4_chr_allTEs_nr_noSSR_join_path" - queryTableName = "testDmelChr4_chr_seq" - subjectTableName = "testDmelChr4_refTEs_seq" - iDb = DbFactory.createInstance() - iDb.createTable(queryTableName, "seq", queryFileName, True) - iDb.createTable(subjectTableName, "seq", subjectFileName, True) - iDb.createTable(pathTableName, "path", pathFileName, True) - expFileName = "%s/Tools/exp%s.alignedSeq" % (os.environ["REPET_DATA"], pathTableName) - - cmd = "AlignTEOnGenomeAccordingToAnnotation.py -p %s -q %s -s %s" % (pathTableName, queryTableName, subjectTableName) - process = subprocess.Popen(cmd, shell = True) - process.communicate() - obsFileName = "obs%s.alignedSeq" % pathTableName - iDb.exportDataToFile("%s_align" % pathTableName, obsFileName) - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - - os.remove(obsFileName) - iDb.dropTable(queryTableName) - iDb.dropTable(subjectTableName) - iDb.dropTable(pathTableName) - iDb.dropTable("%s_align" % pathTableName) - iDb.close() - -# def test_run_as_script_merge_same_paths_old(self): -# pathFileName = "%s/Tools/DmelChr4_chr_allTEs_nr_noSSR_join_path.path" % os.environ["REPET_DATA"] -# queryFileName = "%s/commons/DmelChr4.fa" % os.environ["REPET_DATA"] -# subjectFileName = "%s/Tools/DmelChr4_refTEs.fa" % os.environ["REPET_DATA"] -# pathTableName = "testDmelChr4_chr_allTEs_nr_noSSR_join_path" -# queryTableName = "testDmelChr4_chr_seq" -# subjectTableName = "testDmelChr4_refTEs_seq" -# iDb = DbFactory.createInstance() -# iDb.createTable(queryTableName, "seq", queryFileName, True) -# iDb.createTable(subjectTableName, "seq", subjectFileName, True) -# iDb.createTable(pathTableName, "path", pathFileName, True) -# expFileName = "%s/Tools/exp%s_merge_old.alignedSeq" % (os.environ["REPET_DATA"], pathTableName) -# -# cmd = "srptAlignPath.py -m %s -q %s -s %s" % (pathTableName, queryTableName, subjectTableName) -# process = subprocess.Popen(cmd, shell = True) -# process.communicate() -# obsFileName = "obs%s.alignedSeq" % pathTableName -# iDb.exportDataToFile("%s_align" % pathTableName, obsFileName) -# -# self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) -# -# os.remove(obsFileName) -# iDb.dropTable(queryTableName) -# iDb.dropTable(subjectTableName) -# iDb.dropTable(pathTableName) -# iDb.dropTable("%s_align" % pathTableName) -# iDb.close() -# -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_CheckMysqlConnect.py --- a/commons/tools/tests/Test_F_CheckMysqlConnect.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,64 +0,0 @@ -import unittest -import os -import socket - -class Test_F_CheckMysqlConnect(unittest.TestCase): - - HOST_NAME = "compute-2-46.local" - - def setUp(self): - self._host = socket.gethostname() - self._cmd = "" - - def tearDown(self): - os.remove("testOutputCheckMysqlConnect.txt") - - def test_CheckMysqlConnect_as_script_True(self): - if self.HOST_NAME in self._host: - self._cmd = "CheckMysqlConnect.py -p /share/apps/bin/python > testOutputCheckMysqlConnect.txt" - else: - self._cmd = "CheckMysqlConnect.py > testOutputCheckMysqlConnect.txt" - os.system(self._cmd) - - self.assertFalse(self._isFailedInOutputFile()) - - def test_CheckMysqlConnect_as_script_False(self): - configFile = "%s/repet_tools/tests/config.cfg" % os.environ.get("REPET_PATH") - host = "unknownServer" - self._writeConfig(configFile, host) - - if self.HOST_NAME in self._host: - self._cmd = "CheckMysqlConnect.py -p /share/apps/bin/python -C %s > testOutputCheckMysqlConnect.txt" % configFile - else: - self._cmd = "CheckMysqlConnect.py -C %s > testOutputCheckMysqlConnect.txt " % configFile - os.system(self._cmd) - os.remove(configFile) - - self.assertTrue(self._isFailedInOutputFile()) - - def _isFailedInOutputFile(self): - f = open("testOutputCheckMysqlConnect.txt", "r") - line = f.readline() - - while line: - if "FAILED" in line: - f.close() - return True - line = f.readline() - - f.close() - return False - - def _writeConfig(self, configFileName, repetHost = os.environ.get("REPET_HOST")): - f = open( configFileName, "w" ) - f.write("[repet_env]\n") - f.write("repet_host: %s\n" % repetHost) - f.write("repet_user: %s\n" % os.environ.get("REPET_USER")) - f.write("repet_pw: %s\n" % os.environ.get("REPET_PW")) - f.write("repet_db: %s\n" % os.environ.get("REPET_DB")) - f.write("repet_port: %s\n" % os.environ.get("REPET_PORT")) - f.close() - -if __name__ == "__main__": - unittest.main() - \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_FilterAlign.py --- a/commons/tools/tests/Test_F_FilterAlign.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,168 +0,0 @@\n-from commons.core.utils.FileUtils import FileUtils\n-import unittest\n-import os\n-\n-class Test_F_FilterAlign(unittest.TestCase):\n-\n- def test_as_script(self):\n- alignFileName = "batch.fa.align"\n- self._writeAlignFile(alignFileName)\n- expFileName = "exp.filtered"\n- self._writeExpFile(expFileName)\n- obsFileName = "batch.fa.align.filtered"\n- cmd = "FilterAlign.py"\n- cmd += " -i %s" % alignFileName\n- cmd += " -S 100"\n- cmd += " -v 1"\n- os.system(cmd)\n- self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName))\n- os.remove(alignFileName)\n- os.remove(expFileName)\n- os.remove(obsFileName)\n- \n- def _writeExpFile(self, fileName):\n- f = open(fileName, "w")\n- f.write("chunk09914\\t2257\\t2722\\trefTE_747\\t2614\\t2169\\t0\\t249\\t77.5463\\n")\n- f.write("chunk09914\\t3114\\t4494\\trefTE_747\\t1598\\t228\\t0\\t571\\t78.0453\\n")\n- f.write("chunk09914\\t2251\\t4816\\trefTE_759\\t173\\t2769\\t0\\t3203\\t90.5966\\n")\n- f.write("chunk09914\\t3019\\t3698\\trefTE_764\\t49\\t735\\t0\\t343\\t78.3912\\n")\n- f.write("chunk09914\\t4102\\t4530\\trefTE_764\\t1191\\t1603\\t0\\t154\\t83.0601\\n")\n- f.write("chunk09914\\t4603\\t4864\\trefTE_779\\t291\\t24\\t6.5e-39\\t135\\t80.9917\\n")\n- f.write("chunk09914\\t4642\\t4909\\trefTE_787\\t56\\t326\\t0\\t132\\t79.0323\\n")\n- f.write("chunk09914\\t5086\\t6724\\trefTE_787\\t532\\t2194\\t0\\t218\\t71.4668\\n")\n- f.write("chunk09914\\t6180\\t6594\\trefTE_812\\t2516\\t2949\\t1.6e-32\\t125\\t72.5441\\n")\n- f.write("chunk09914\\t2349\\t2723\\trefTE_818\\t1034\\t663\\t0\\t347\\t80.0539\\n")\n- f.write("chunk09914\\t2412\\t2727\\trefTE_818\\t1169\\t1482\\t0\\t278\\t78.5942\\n")\n- f.write("chunk09914\\t3853\\t5302\\trefTE_828\\t3133\\t1713\\t0\\t417\\t77.8644\\n")\n- f.write("chunk09914\\t5486\\t6724\\trefTE_828\\t1715\\t454\\t0\\t584\\t73.8655\\n")\n- f.write("chunk09914\\t849\\t1203\\trefTE_838\\t83\\t449\\t0\\t493\\t95.7386\\n")\n- f.write("chunk09914\\t3355\\t4471\\trefTE_861\\t2024\\t3183\\t0\\t260\\t77.1289\\n")\n- f.write("chunk09914\\t2263\\t4696\\trefTE_866\\t19\\t2476\\t0\\t3136\\t91.1287\\n")\n- f.write("chunk09914\\t4803\\t5747\\trefTE_866\\t2479\\t3429\\t0\\t1352\\t93.1217\\n")\n- f.write("chunk09914\\t4134\\t4702\\trefTE_880\\t1685\\t1129\\t7.8e-35\\t126\\t80.7851\\n")\n- f.write("chunk09914\\t3598\\t4029\\trefTE_904\\t666\\t1122\\t0\\t414\\t84.7418\\n")\n- f.write("chunk09914\\t3887\\t4480\\trefTE_904\\t1030\\t1635\\t0\\t384\\t82.6087\\n")\n- f.write("chunk09914\\t2257\\t2722\\trefTE_908\\t1005\\t551\\t0\\t240\\t78.5377\\n")\n- f.write("chunk09914\\t6180\\t6594\\trefTE_914\\t1420\\t987\\t8.6e-30\\t125\\t72.5441\\n")\n- f.write("chunk09914\\t4144\\t6724\\trefTE_931\\t3801\\t1202\\t0\\t1057\\t74.7937\\n")\n- f.write("chunk09914\\t848\\t1204\\trefTE_966\\t370\\t1\\t0\\t522\\t98.0282\\n")\n- f.write("chunk09914\\t854\\t1145\\trefTE_966\\t5130\\t4829\\t0\\t411\\t95.8763\\n")\n- f.write("chunk09914\\t4142\\t4487\\trefTE_969\\t455\\t130\\t4.2039e-45\\t161\\t81.1881\\n")\n- f.write("chunk09914\\t848\\t1218\\trefTE_980\\t1182\\t814\\t0\\t431\\t92.1127\\n")\n- f.write("chunk09914\\t4093\\t4489\\trefTE_999\\t5850\\t5485\\t3.6e-39\\t142\\t81.0651\\n")\n- f.write("chunk09914\\t2257\\t2722\\trefTE_1006\\t2472\\t2025\\t0\\t257\\t77.4193\\n")\n- f.write("chunk09914\\t3755\\t4491\\trefTE_1006\\t941\\t230\\t0\\t188\\t80.0948\\n")\n- f.write("chunk09914\\t5060\\t6724\\trefTE_1006\\t7451\\t5776\\t0\\t711\\t72.3792\\n")\n- f.write("chunk09914\\t2251\\t3361\\trefTE_1015\\t7278\\t8364\\t0\\t1514\\t86.8087\\n")\n- f.write("chunk09914\\t2780\\t6724\\trefTE_1015\\t1\\t3962\\t0\\t5370\\t91.9552\\n")\n- f.write("chunk09914\\t3383\\t4672\\trefTE_1015\\t8150\\t9445\\t0\\t1746\\t92.1217\\n")\n- f.write("chunk09914\\t6228\\t6594\\trefTE_1018\\t5554\\t5920\\t6.2e-22\\t106\\t73.3138\\n")\n- f.close()\n- \n- def _writeAlignFile(self, fileName):\n- f = open(fileName, "w")\n- f.write("chunk09914\\t5038\\t5133\\trefTE_745\\t288\\t389\\t1.3e-15\\t38\\t86.747\\n")\n- '..b'k09914\\t4689\\t4718\\trefTE_914\\t3130\\t3103\\t8.6e-30\\t37\\t92.8571\\n")\n- f.write("chunk09914\\t6180\\t6594\\trefTE_914\\t1420\\t987\\t8.6e-30\\t125\\t72.5441\\n")\n- f.write("chunk09914\\t4691\\t4755\\trefTE_930\\t2120\\t2187\\t2.3e-14\\t39\\t86.6667\\n")\n- f.write("chunk09914\\t6172\\t6506\\trefTE_930\\t3738\\t4087\\t2.3e-14\\t71\\t72.293\\n")\n- f.write("chunk09914\\t3755\\t3945\\trefTE_931\\t4127\\t3947\\t0\\t45\\t79.3939\\n")\n- f.write("chunk09914\\t4144\\t6724\\trefTE_931\\t3801\\t1202\\t0\\t1057\\t74.7937\\n")\n- f.write("chunk09914\\t4692\\t4772\\trefTE_962\\t2382\\t2453\\t1.5e-16\\t39\\t85.0746\\n")\n- f.write("chunk09914\\t6178\\t6560\\trefTE_962\\t3929\\t4309\\t1.5e-16\\t79\\t70.5882\\n")\n- f.write("chunk09914\\t848\\t1204\\trefTE_966\\t370\\t1\\t4e-147\\t522\\t98.0282\\n")\n- f.write("chunk09914\\t854\\t1145\\trefTE_966\\t5130\\t4829\\t1.5e-115\\t411\\t95.8763\\n")\n- f.write("chunk09914\\t1139\\t1203\\trefTE_966\\t4770\\t4681\\t1.5e-115\\t38\\t87.5\\n")\n- f.write("chunk09914\\t646\\t734\\trefTE_967\\t4583\\t4671\\t4.8e-16\\t87\\t76.4045\\n")\n- f.write("chunk09914\\t3565\\t3698\\trefTE_969\\t1106\\t990\\t4.3e-45\\t53\\t79.646\\n")\n- f.write("chunk09914\\t4142\\t4487\\trefTE_969\\t455\\t130\\t4.3e-45\\t161\\t81.1881\\n")\n- f.write("chunk09914\\t848\\t1218\\trefTE_980\\t1182\\t814\\t6.8e-120\\t431\\t92.1127\\n")\n- f.write("chunk09914\\t4691\\t4762\\trefTE_986\\t3059\\t3133\\t3.3e-21\\t36\\t82.0895\\n")\n- f.write("chunk09914\\t6172\\t6594\\trefTE_986\\t4689\\t5120\\t3.3e-21\\t97\\t71.2121\\n")\n- f.write("chunk09914\\t149\\t280\\trefTE_987\\t3872\\t3721\\t2.8e-18\\t38\\t79.2\\n")\n- f.write("chunk09914\\t4689\\t4769\\trefTE_987\\t3186\\t3102\\t2.8e-18\\t37\\t83.5616\\n")\n- f.write("chunk09914\\t6178\\t6594\\trefTE_987\\t1600\\t1188\\t2.8e-18\\t77\\t72.0317\\n")\n- f.write("chunk09914\\t4108\\t4241\\trefTE_991\\t2079\\t2237\\t1.2e-12\\t62\\t82.1705\\n")\n- f.write("chunk09914\\t4602\\t4701\\trefTE_991\\t2535\\t2634\\t1.2e-12\\t43\\t78.022\\n")\n- f.write("chunk09914\\t3596\\t3757\\trefTE_999\\t6434\\t6307\\t3.6e-39\\t52\\t85.124\\n")\n- f.write("chunk09914\\t4093\\t4489\\trefTE_999\\t5850\\t5485\\t3.6e-39\\t142\\t81.0651\\n")\n- f.write("chunk09914\\t4348\\t4702\\trefTE_999\\t5619\\t5295\\t5.9e-13\\t54\\t79.7251\\n")\n- f.write("chunk09914\\t4541\\t4805\\trefTE_1002\\t3207\\t2973\\t6.8e-27\\t57\\t85.5769\\n")\n- f.write("chunk09914\\t6178\\t6723\\trefTE_1002\\t1494\\t946\\t6.8e-27\\t96\\t75.7764\\n")\n- f.write("chunk09914\\t4085\\t4179\\trefTE_1004\\t3933\\t4033\\t1.5e-17\\t47\\t80\\n")\n- f.write("chunk09914\\t4690\\t4718\\trefTE_1004\\t4126\\t4153\\t1.5e-17\\t38\\t92.8571\\n")\n- f.write("chunk09914\\t6262\\t6594\\trefTE_1004\\t5242\\t5574\\t1.5e-17\\t65\\t70.2265\\n")\n- f.write("chunk09914\\t2257\\t2722\\trefTE_1006\\t2472\\t2025\\t2.5e-134\\t257\\t77.4193\\n")\n- f.write("chunk09914\\t3134\\t3382\\trefTE_1006\\t1450\\t1199\\t2.9e-118\\t45\\t75.7991\\n")\n- f.write("chunk09914\\t3331\\t3661\\trefTE_1006\\t1468\\t1146\\t2.5e-134\\t98\\t78.2313\\n")\n- f.write("chunk09914\\t3755\\t4491\\trefTE_1006\\t941\\t230\\t2.5e-134\\t188\\t80.0948\\n")\n- f.write("chunk09914\\t5060\\t6724\\trefTE_1006\\t7451\\t5776\\t3.8e-204\\t711\\t72.3792\\n")\n- f.write("chunk09914\\t2670\\t2723\\trefTE_1009\\t6642\\t6591\\t7.1e-18\\t39\\t86\\n")\n- f.write("chunk09914\\t3328\\t3647\\trefTE_1009\\t5826\\t5508\\t7.1e-18\\t84\\t75\\n")\n- f.write("chunk09914\\t6\\t130\\trefTE_1011\\t3884\\t3994\\t1.6e-11\\t38\\t76.6355\\n")\n- f.write("chunk09914\\t4690\\t4741\\trefTE_1011\\t4997\\t5046\\t1.6e-11\\t37\\t91.1111\\n")\n- f.write("chunk09914\\t6180\\t6716\\trefTE_1011\\t6676\\t7235\\t1.6e-11\\t55\\t71.2274\\n")\n- f.write("chunk09914\\t2251\\t3361\\trefTE_1015\\t7278\\t8364\\t0\\t1514\\t86.8087\\n")\n- f.write("chunk09914\\t2780\\t6724\\trefTE_1015\\t1\\t3962\\t0\\t5370\\t91.9552\\n")\n- f.write("chunk09914\\t3383\\t4672\\trefTE_1015\\t8150\\t9445\\t0\\t1746\\t92.1217\\n")\n- f.write("chunk09914\\t6228\\t6594\\trefTE_1018\\t5554\\t5920\\t6.2e-22\\t106\\t73.3138\\n")\n- f.close()\n-\n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_GFF3Maker.py --- a/commons/tools/tests/Test_F_GFF3Maker.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,707 +0,0 @@\n-import unittest\n-import os\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.sql.DbMySql import DbMySql\n-from commons.tools.GFF3Maker import GFF3Maker\n-\n-class Test_F_GFF3Maker(unittest.TestCase):\n-\n- def setUp(self):\n- self._projectName = "projectName"\n- self._iDb = DbMySql()\n- self._tablesFileName = "annotation_tables.txt"\n- self._fastaFileName = "%s_chr.fa" % self._projectName\n- self._fastaTableName = "%s_chr_seq" % self._projectName\n- self._writeFastaFile(self._fastaFileName)\n- self._iDb.createTable(self._fastaTableName, "seq", self._fastaFileName, True)\n- self._inputFileName = "%s_chr_allTEs_nr_noSSR_join.pathOrSet" % self._projectName\n- self._expGFFFileName = "explm_SuperContig_29_v2.gff3"\n- self._obsGFFFileName = "lm_SuperContig_29_v2.gff3"\n- self._obsGFFEmptyFileName = "lm_SuperContig_30_v2.gff3"\n- \n- def tearDown(self):\n- self._iDb.dropTable(self._fastaTableName)\n- self._iDb.dropTable(self._inputTableName)\n- self._iDb.close()\n- os.remove(self._obsGFFFileName)\n- os.remove(self._expGFFFileName)\n- os.remove(self._fastaFileName)\n- os.remove(self._tablesFileName)\n- os.remove(self._inputFileName)\n- \n- def test_run_as_script_path_with_seq_withAllFiles(self):\n- self._writeTablesFile("path")\n- self._writePathFile(self._inputFileName)\n- self._inputTableName = "%s_chr_allTEs_nr_noSSR_join_path" % self._projectName\n- self._iDb.createTable(self._inputTableName, "path", self._inputFileName, True)\n- self._writeExpPathGFFFile(self._expGFFFileName)\n- expGFFEmptyFileName = "explm_SuperContig_30_v2.gff3"\n- self._writeExpEmptyPathGFFFileWithSeq(expGFFEmptyFileName)\n- \n- cmd = "GFF3Maker.py -t %s -f %s -w -a -p"% (self._tablesFileName, self._fastaTableName) \n- os.system(cmd)\n- \n- self.assertTrue(FileUtils.are2FilesIdentical(self._expGFFFileName, self._obsGFFFileName))\n- self.assertTrue(FileUtils.are2FilesIdentical(expGFFEmptyFileName, self._obsGFFEmptyFileName))\n- \n- os.remove(expGFFEmptyFileName)\n- os.remove(self._obsGFFEmptyFileName)\n- \n- def test_run_as_script_path_without_seq_withAllFiles(self):\n- self._writeTablesFile("path")\n- self._writePathFile(self._inputFileName)\n- self._inputTableName = "%s_chr_allTEs_nr_noSSR_join_path" % self._projectName\n- self._iDb.createTable(self._inputTableName, "path", self._inputFileName, True)\n- self._writeExpPathGFFFile_without_seq(self._expGFFFileName)\n- expGFFEmptyFileName = "explm_SuperContig_30_v2.gff3"\n- self._writeExpEmptyPathGFFFile(expGFFEmptyFileName)\n- \n- cmd = "GFF3Maker.py -t %s -f %s -a -p" % (self._tablesFileName, self._fastaTableName)\n- os.system(cmd)\n- \n- self.assertTrue(FileUtils.are2FilesIdentical(self._expGFFFileName, self._obsGFFFileName))\n- self.assertTrue(FileUtils.are2FilesIdentical(expGFFEmptyFileName, self._obsGFFEmptyFileName))\n- \n- os.remove(expGFFEmptyFileName)\n- os.remove(self._obsGFFEmptyFileName)\n- \n- def test_run_without_seq(self):\n- self._writeTablesFile("path")\n- self._writePathFile(self._inputFileName)\n- self._inputTableName = "%s_chr_allTEs_nr_noSSR_join_path" % self._projectName\n- self._iDb.createTable(self._inputTableName, "path", self._inputFileName, True)\n- self._writeExpPathGFFFile_without_seq(self._expGFFFileName)\n- \n- iGFF3Maker = GFF3Maker()\n- iGFF3Maker.setTablesFileName(self._tablesFileName)\n- iGFF3Maker.setInFastaName(self._fastaTableName)\n- iGFF3Maker.setAreMatchPartCompulsory(True)\n- iGFF3Maker.run()\n- \n- self.assertTrue(FileUtils.are2FilesIdentical(self._expGFFFileName, self._obsGFFFileName))\n- self.assertFalse(FileUtils.isResso'..b'ch\\t193781\\t194212\\t0.0\\t+\\t.\\tID=ms1_lm_SuperContig_29_v2_set1;Target=set1 1 432\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch_part\\t193781\\t194212\\t0.0\\t+\\t.\\tID=mp1-1_lm_SuperContig_29_v2_set1;Parent=ms1_lm_SuperContig_29_v2_set1;Target=set1 1 432\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch\\t192832\\t193704\\t0.0\\t+\\t.\\tID=ms2_lm_SuperContig_29_v2_set2;Target=set2 1 873\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch_part\\t192832\\t193704\\t0.0\\t+\\t.\\tID=mp2-1_lm_SuperContig_29_v2_set2;Parent=ms2_lm_SuperContig_29_v2_set2;Target=set2 1 873\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch\\t78031\\t78588\\t0.0\\t+\\t.\\tID=ms3_lm_SuperContig_29_v2_set3;Target=set3 1 558\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch_part\\t78031\\t78080\\t0.0\\t+\\t.\\tID=mp3-1_lm_SuperContig_29_v2_set3;Parent=ms3_lm_SuperContig_29_v2_set3;Target=set3 1 50\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch_part\\t78081\\t78588\\t0.0\\t+\\t.\\tID=mp3-2_lm_SuperContig_29_v2_set3;Parent=ms3_lm_SuperContig_29_v2_set3;Target=set3 1 508\\n")\n- f.write("##FASTA\\n")\n- self._writeSeq1(f)\n- f.close()\n- \n- def _writeExpSetGFFFileReversed(self, inFileName):\n- f = open(inFileName, \'w\')\n- f.write("##gff-version 3\\n")\n- f.write("##sequence-region lm_SuperContig_29_v2 1 120\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch\\t193781\\t194212\\t0.0\\t+\\t.\\tID=ms1_lm_SuperContig_29_v2_set1;Target=set1 1 432\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch_part\\t193781\\t194212\\t0.0\\t+\\t.\\tID=mp1-1_lm_SuperContig_29_v2_set1;Parent=ms1_lm_SuperContig_29_v2_set1;Target=set1 1 432\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch\\t192832\\t193704\\t0.0\\t+\\t.\\tID=ms2_lm_SuperContig_29_v2_set2;Target=set2 1 873\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch_part\\t192832\\t193704\\t0.0\\t+\\t.\\tID=mp2-1_lm_SuperContig_29_v2_set2;Parent=ms2_lm_SuperContig_29_v2_set2;Target=set2 1 873\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch\\t78031\\t78588\\t0.0\\t-\\t.\\tID=ms3_lm_SuperContig_29_v2_set3;Target=set3 1 558\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch_part\\t78031\\t78080\\t0.0\\t-\\t.\\tID=mp3-1_lm_SuperContig_29_v2_set3;Parent=ms3_lm_SuperContig_29_v2_set3;Target=set3 1 50\\n")\n- f.write("lm_SuperContig_29_v2\\tprojectName_REPET_TEs\\tmatch_part\\t78081\\t78588\\t0.0\\t-\\t.\\tID=mp3-2_lm_SuperContig_29_v2_set3;Parent=ms3_lm_SuperContig_29_v2_set3;Target=set3 1 508\\n")\n- f.write("##FASTA\\n")\n- self._writeSeq1(f)\n- f.close()\n- \n- def _writeFastaFile(self, inFileName):\n- f = open(inFileName,\'w\')\n- self._writeSeq2(f)\n- self._writeSeq1(f)\n- f.close()\n- \n- def _writeFastaFileExtended(self, inFileName):\n- f = open(inFileName,\'w\')\n- self._writeSeq2(f)\n- self._writeSeq1(f)\n- f.write(">chr1\\n")\n- f.write("CTAAGCTGCGCTATGTAG\\n")\n- f.close()\n- \n- def _writeSeq1(self, f):\n- f.write(\'>lm_SuperContig_29_v2\\n\')\n- f.write(\'CCTAGACAATTAATTATAATAATTAATAAACTATTAGGCTAGTAGTAGGTAATAATAAAA\\n\')\n- f.write(\'GGATTACTACTAAGCTGCGCTATGTAGATATTTAAAACATGTGGCTTAGGCAAGAGTATA\\n\')\n-\n- def _writeSeq2(self, f):\n- f.write(\'>lm_SuperContig_30_v2\\n\')\n- f.write(\'TGTTCATATTCATAGGATGGAGCTAGTAAGCGATGTCGGCTTAGCTCATCCACATGAATG\\n\')\n- f.write(\'CAGGAATCATGAAGGGTACGACTGTTCGTCGATTAAAGAGCTACACGAGCTGGGTTAAAT\\n\')\n- \n- def _writeFastaFile_DmelChr4(self, inFileName):\n- f = open(inFileName,\'w\')\n- f.write(">dmel_chr4\\n")\n- f.write("CTAAGCTGCGCTATGTAG\\n")\n- f.write(">dmel_chr1\\n")\n- f.write("CGTAACGCTAGCGCTTATAGTGAGC\\n")\n- f.close()\n-\n-\n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_GameXmlMaker.py --- a/commons/tools/tests/Test_F_GameXmlMaker.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,281 +0,0 @@\n-import unittest\n-import os\n-import glob\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.tools.GameXmlMaker import GameXmlMaker\n-\n-\n-class Test_F_GameXmlMaker(unittest.TestCase):\n-\n- def setUp(self):\n- pass\n-\n-\n- def tearDown(self):\n- FileUtils.removeFilesByPattern("*gamexml")\n-\n-\n- def test_run_as_script_step1(self):\n- fastaFileName = "input.fa"\n- self._writeFastaFile(fastaFileName)\n- \n- cmd = "GameXmlMaker.py -f %s " % fastaFileName \n- os.system(cmd)\n- \n- lObsGameXmlNew = glob.glob("*.gamexml")\n- self._writeStep1ExpectedXmls()\n- self.assertTrue(len(lObsGameXmlNew) > 0)\n- for obsGameXmlNew in lObsGameXmlNew:\n- expGameXmlNew = "exp_%s" % obsGameXmlNew\n- self.assertTrue(FileUtils.are2FilesIdentical(expGameXmlNew,obsGameXmlNew))\n- \n- os.remove(fastaFileName)\n- \n- def test_run_as_script_step2(self):\n- self._tableFileName = "annotation_tables.txt"\n- \n- self._writeStep2InputTableFile()\n- self._writeStep2InputXmls()\n- self._writeStep2InputPathFile()\n- self._writeStep2InputSetFile()\n- self._writeStep2InputMapFile()\n- self._createStep2Tables()\n- \n- lObsGameXmlNew = glob.glob("*.gamexml")\n- \n- cmd = "GameXmlMaker.py -t %s " % self._tableFileName\n- os.system(cmd)\n- \n- self._writeStep2ExpXmls()\n- \n- self.assertTrue(len(lObsGameXmlNew) > 0)\n- for obsGameXmlNew in lObsGameXmlNew:\n- expGameXmlNew = "exp_%s" % obsGameXmlNew\n- self.assertTrue(FileUtils.are2FilesIdentical(expGameXmlNew,obsGameXmlNew))\n- \n- os.remove("Test_F_GameXmlMaker_path.path")\n- os.remove("Test_F_GameXmlMaker_set.set")\n- os.remove("Test_F_GameXmlMaker_chk_map.map")\n- \n- os.remove(self._tableFileName)\n- os.system("ListAndDropTables.py -d Test_F_GameXmlMaker")\n- \n- def test_run_step2(self):\n- self._tableFileName = "annotation_tables.txt"\n- \n- self._writeStep2InputTableFile()\n- self._writeStep2InputXmls()\n- self._writeStep2InputPathFile()\n- self._writeStep2InputSetFile()\n- self._writeStep2InputMapFile()\n- self._createStep2Tables()\n- \n- lObsGameXmlNew = glob.glob("*.gamexml")\n- \n- iGameXmlMaker = GameXmlMaker(tablesFileName = self._tableFileName)\n- iGameXmlMaker.run()\n- self._writeStep2ExpXmls()\n- self.assertTrue(len(lObsGameXmlNew) > 0)\n- for obsGameXmlNew in lObsGameXmlNew:\n- expGameXmlNew = "exp_%s" % obsGameXmlNew\n- self.assertTrue(FileUtils.are2FilesIdentical(expGameXmlNew,obsGameXmlNew))\n- \n- os.remove("Test_F_GameXmlMaker_path.path")\n- os.remove("Test_F_GameXmlMaker_set.set")\n- os.remove("Test_F_GameXmlMaker_chk_map.map")\n- \n- os.remove(self._tableFileName)\n- os.system("ListAndDropTables.py -d Test_F_GameXmlMaker")\n- \n- def _writeFastaFile(self, inFileName):\n- f = open(inFileName,\'w\')\n- f.write(\'>seq1\\n\')\n- f.write(\'TGTTCATATTCATAGGATGGAGCTAGTAAGCGATGTCGGCTTAGCTCATCCACATGAATG\\n\')\n- f.write(\'CAGGAATCATGAAGGGTACGACTGTTCGTCGATTAAAGAGCTACACGAGCTGGGTTAAAT\\n\')\n- f.write(\'CAGGAATCATGAAGGGTACGACTGTTCGTCGATTAAAGAGCTACA\\n\')\n- f.write(\'>seq2\\n\')\n- f.write(\'TGTTCATATTCATAGGATGGAGCTAGTAAGCGATGTCGGCTTAGCTCATCCACATGAATG\\n\')\n- f.write(\'CAGGAATCATGAAGGGTACGACTGTTCGTCGATTAAAGAGCTACACGAGCTGGGTTAAAT\\n\')\n- f.write(\'CAGGAATCATGAAGGGTACGACTGTTCGTCGATTAAAGAGCTACACGAGCTGGGTTAAAT\\n\')\n- f.write(\'>seq3\\n\')\n- f.write(\'CCTAGACAATTAATTATAATAATTAATAAACTATTAGGCTAGTAGTAGGTAATAATAAAA\\n\')\n- f.write(\'GGATTACTACTAAGCTGCGCTATGTAGATATTTAAAACATGTGGCTTAGGCAAGAGTATA\\n\')\n- f.write(\'>seq4\\n\')\n- '..b'rt>-1</start><end>-1</end></span></seq_relationship>\')\n- f.write(\'<score>0</score></result_span></result_set></computational_analysis>\')\n- f.write(\'<computational_analysis><program>Test_F_GameXmlMaker_chk_map</program><database>db</database></computational_analysis></game>\')\n- f.close()\n- \n- f = open("exp_seq3.gamexml", \'w\')\n- f.write(\'<?xml version="1.0" ?><game><seq focus="true" id="seq3"><name>seq3</name>\')\n- f.write(\'<residues>CCTAGACAATTAATTATAATAATTAATAAACTATTAGGCTAGTAGTAGGTAATAATAAAAGGATTACTACTAAGCTGCGCTATGTAGATATTTAAAACATGTGGCTTAGGCAAGAGTATA</residues>\')\n- f.write(\'</seq><map_position><arm>seq3</arm><span><start>1</start><end>120</end></span></map_position>\')\n- f.write(\'<computational_analysis><program>Test_F_GameXmlMaker_path</program><database>db</database><result_set id="5"><name>TE2::5</name>\')\n- f.write(\'<result_span><seq_relationship seq="seq3" type="query"><span><start>1</start><end>120</end></span>\')\n- f.write(\'</seq_relationship><seq_relationship seq="TE2::5" type="subject"><span><start>450</start><end>550</end></span></seq_relationship>\')\n- f.write(\'<score>75.7</score></result_span></result_set></computational_analysis>\')\n- f.write(\'<computational_analysis><program>Test_F_GameXmlMaker_set</program><database>db</database><result_set id="5"><name>seq3::5</name>\')\n- f.write(\'<result_span><seq_relationship seq="seq3" type="query"><span><start>1</start><end>120</end></span></seq_relationship>\')\n- f.write(\'<seq_relationship seq="seq3::5" type="subject"><span><start>-1</start><end>-1</end></span></seq_relationship>\')\n- f.write(\'<score>0</score></result_span></result_set></computational_analysis>\')\n- f.write(\'<computational_analysis><program>Test_F_GameXmlMaker_chk_map</program><database>db</database>\')\n- f.write(\'<result_set id="-1"><name>chunk3::-1</name>\')\n- f.write(\'<result_span><seq_relationship seq="seq3" type="query"><span><start>380001</start><end>580000</end></span></seq_relationship>\')\n- f.write(\'<seq_relationship seq="chunk3::-1" type="subject"><span><start>-1</start><end>-1</end></span></seq_relationship>\')\n- f.write(\'<score>0</score></result_span></result_set></computational_analysis></game>\')\n- f.close()\n- \n- f = open("exp_seq4.gamexml", \'w\')\n- f.write(\'<?xml version="1.0" ?><game><seq focus="true" id="seq4"><name>seq4</name>\')\n- f.write(\'<residues>TGTTCATATTCATAGGATGGAGCTAGTAAGCGATGTCGGCTTAGCTCATCCACATGAATGCAGGAATCATGAAGGGTACGACTGTTCG</residues>\')\n- f.write(\'</seq><map_position><arm>seq4</arm><span><start>1</start><end>88</end></span></map_position>\')\n- f.write(\'<computational_analysis><program>Test_F_GameXmlMaker_path</program><database>db</database></computational_analysis>\')\n- f.write(\'<computational_analysis><program>Test_F_GameXmlMaker_set</program><database>db</database></computational_analysis>\')\n- f.write(\'<computational_analysis><program>Test_F_GameXmlMaker_chk_map</program><database>db</database>\')\n- f.write(\'<result_set id="-1"><name>chunk4::-1</name>\')\n- f.write(\'<result_span><seq_relationship seq="seq4" type="query"><span><start>570001</start><end>770000</end></span></seq_relationship>\')\n- f.write(\'<seq_relationship seq="chunk4::-1" type="subject"><span><start>-1</start><end>-1</end></span></seq_relationship>\')\n- f.write(\'<score>0</score></result_span></result_set></computational_analysis></game>\')\n- f.close()\n- \n- def _writeStep2InputTableFile(self):\n- f = open(self._tableFileName,\'w\')\n- f.write("Test_F_GameXmlMaker_path\\tpath\\tTest_F_GameXmlMaker_path\\n")\n- f.write("Test_F_GameXmlMaker_set\\tset\\tTest_F_GameXmlMaker_set\\n")\n- f.write("Test_F_GameXmlMaker_chk_map\\tmap\\tTest_F_GameXmlMaker_chk_map")\n- f.close()\n- \n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_GetMultiAlignAndPhylogenyPerTErefSeq.py --- a/commons/tools/tests/Test_F_GetMultiAlignAndPhylogenyPerTErefSeq.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,147 +0,0 @@\n-import subprocess\n-import unittest\n-import os\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.sql.DbMySql import DbMySql\n-from commons.tools.GetMultAlignAndPhylogenyPerTErefSeq import GetMultAlignAndPhylogenyPerTErefSeq\n-from shutil import rmtree\n-from glob import glob\n-\n-class Test_F_GetMultAlignAndPhylogenyPerTErefSeq(unittest.TestCase):\n- \n- def setUp(self):\n- self._verbosity = 3\n- \n- self._testPrefix = \'Test_GMAAPperTErefSeq_\'\n- self._configFileName = "%sConfig.cfg" % self._testPrefix\n- self._iDb = DbMySql()\n-\n- self.inPathTableName = "%sDmelChr4_chr_allTEs_nr_noSSR_join_path" % (self._testPrefix)\n- self.inPathFileName = "%s/Tools/DmelChr4_chr_allTEs_nr_noSSR_join_path.path" % os.environ["REPET_DATA"]\n- self._iDb.createTable(self.inPathTableName, "path", self.inPathFileName, True)\n- \n- self.RefTETableName = "%sDmelChr4_refTEs" % (self._testPrefix)\n- self.RefTEFileName = "%s/Tools/DmelChr4_refTEs.fa" % os.environ["REPET_DATA"]\n- self._iDb.createTable(self.RefTETableName, "seq", self.RefTEFileName, True)\n- \n- self.genomeTableName = "%sDmelChr4_chr" % (self._testPrefix)\n- self.genomeFileName = "%s/Tools/DmelChr4.fa" % os.environ["REPET_DATA"]\n- self._iDb.createTable(self.genomeTableName, "seq", self.genomeFileName, True)\n-\n- try:\n- os.makedirs(self._testPrefix)\n- except:pass\n- os.chdir(self._testPrefix)\n- self._writeConfigFile()\n- \n-# self._expFileName_FullLengthCopy = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithFullLengthCopy.txt" % os.environ["REPET_DATA"]\n-# self._expFileName_Copy = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithCopy.txt" % os.environ["REPET_DATA"]\n-# self._expFileName_FullLengthFrag = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithFullLengthFrag.txt" % os.environ["REPET_DATA"]\n-# self._expFastaFileName_FullLengthCopy = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithFullLengthCopy.fa" % os.environ["REPET_DATA"]\n-# self._expFastaFileName_Copy = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithCopy.fa" % os.environ["REPET_DATA"]\n-# self._expFastaFileName_FullLengthFrag = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithFullLengthFrag.fa" % os.environ["REPET_DATA"]\n-\n- \n-# inputFastaFileName = "input_TEannot_refTEs.fa"\n-# os.symlink(self._expFastaFileName_Copy, inputFastaFileName)\n- \n-# self._tableName = "Dummy_Atha_refTEs_seq"\n-# self._iDb.createTable(self._tableName, "seq", inputFastaFileName, True)\n-# os.remove(inputFastaFileName) \n-# \n-# self._obsFileName_FullLengthCopy = "%s_FullLengthCopy.txt" % os.path.splitext(os.path.basename(self._inFileName))[0]\n-# self._obsFileName_Copy = "%s_OneCopyAndMore.txt" % os.path.splitext(os.path.basename(self._inFileName))[0]\n-# self._obsFileName_FullLengthFrag = "%s_FullLengthFrag.txt" % os.path.splitext(os.path.basename(self._inFileName))[0]\n-# self._obsFastaFileName_FullLengthCopy = "%s.fa" % os.path.splitext(self._obsFileName_FullLengthCopy)[0]\n-# self._obsFastaFileName_Copy = "%s.fa" % os.path.splitext(self._obsFileName_Copy)[0]\n-# self._obsFastaFileName_FullLengthFrag = "%s.fa" % os.path.splitext(self._obsFileName_FullLengthFrag)[0]\n- \n- def tearDown(self):\n-# self._iDb.dropTable(self.inPathTableName)\n-# self._iDb.dropTable(self.RefTETableName)\n-# self._iDb.dropTable(self.genomeTableName)\n-# self._iDb.close()\n- \n- os.chdir("..")\n-# try:\n-# rmtree(self._testPrefix)\n-# except:pass\n- \n-\n-# def test_run_step1(self):\n-# iGMAAPperTErefSeq = GetMultAlignAndPhylogenyPerTErefSeq(pathTableName= self.inPathTableName, refSeqTableName=self.RefTETableName, genomeSeqTableName= self.genomeTableName, configFileName=self._configFileName, step=1, verbosity=self._verbosit'..b'elf._configFileName, step=1, verbosity=self._verbosity)\n-# iGMAAPperTErefSeq.run()\n-# iGMAAPperTErefSeq.step = 2\n-# iGMAAPperTErefSeq.run()\n-#\n-# self.assertTrue(os.stat("DmelChr4-B-G9-Map3_NoCat_all.fa.oriented_refalign.fa_aln")[6] != 0)\n-\n- def test_run_step1Step2Step3Map(self):\n- iGMAAPperTErefSeq = GetMultAlignAndPhylogenyPerTErefSeq(pathTableName= self.inPathTableName, refSeqTableName=self.RefTETableName, genomeSeqTableName= self.genomeTableName, mSAmethod="Map", configFileName=self._configFileName, step=1, verbosity=self._verbosity)\n- iGMAAPperTErefSeq.run()\n- iGMAAPperTErefSeq.step = 2\n- iGMAAPperTErefSeq.run()\n- iGMAAPperTErefSeq.step = 3\n- iGMAAPperTErefSeq.run()\n-\n- self.assertTrue(os.stat("DmelChr4-B-G9-Map3_NoCat_all.fa.oriented_map.fa_aln")[6] != 0)\n- \n- def _writeConfigFile(self):\n- f = open(self._configFileName, "w")\n- f.write("[repet_env]\\n")\n- f.write("repet_host: %s\\n" % os.environ["REPET_HOST"])\n- f.write("repet_user: %s\\n" % os.environ["REPET_USER"])\n- f.write("repet_pw: %s\\n" % os.environ["REPET_PW"])\n- f.write("repet_db: %s\\n" % os.environ["REPET_DB"])\n- f.write("repet_port: %s\\n" % os.environ["REPET_PORT"])\n- f.write("repet_job_manager: SGE\\n")\n- f.close()\n- \n- \n-# def test_run_as_script_step1Step2Map(self):\n-# #cmd= "GetMultAlignAndPhylogenyPerTErefSeq.py -S 1 -m \'Map\' -p %s -s %s -g %s -C %s" % (self._inPathTableName,self._RefTETableName, self._genomeTableName, self._configFileName)\n-# cmd= "GetMultAlignAndPhylogenyPerTErefSeq.py -S 1 -p %s -s %s -g %s -C %s" % (self.inPathTableName,self.RefTETableName, self.genomeTableName, self._configFileName)\n-# subprocess.call(cmd, shell = True)\n-# \n-# cmd= "GetMultAlignAndPhylogenyPerTErefSeq.py -S 2 -p %s -s %s -g %s -C %s" % (self.inPathTableName,self.RefTETableName, self.genomeTableName, self._configFileName)\n-# subprocess.call(cmd, shell = True)\n-# \n-# self.assertTrue(os.stat("DmelChr4-B-G9-Map3_NoCat_all.fa.oriented_map.fa_aln")[6] != 0)\n- \n- \n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_FullLengthCopy, self._obsFileName_FullLengthCopy))\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_Copy, self._obsFileName_Copy))\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_FullLengthFrag, self._obsFileName_FullLengthFrag))\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_FullLengthCopy, self._obsFastaFileName_FullLengthCopy))\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_Copy, self._obsFastaFileName_Copy))\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_FullLengthFrag, self._obsFastaFileName_FullLengthFrag))\n-\n-# def test_run_as_script_step2(self):\n-# cmd= "GetMultAlignAndPhylogenyPerTErefSeq.py -S 1 -p %s -s %s -g %s -C %s" % (self._inPathTableName,self._RefTETableName, self._genomeTableName, self._configFileName)\n-# print cmd\n-# subprocess.call(cmd, shell = True)\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_FullLengthCopy, self._obsFileName_FullLengthCopy))\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_Copy, self._obsFileName_Copy))\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_FullLengthFrag, self._obsFileName_FullLengthFrag))\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_FullLengthCopy, self._obsFastaFileName_FullLengthCopy))\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_Copy, self._obsFastaFileName_Copy))\n-# self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_FullLengthFrag, self._obsFastaFileName_FullLengthFrag))\n- \n-if __name__ == "__main__":\n- unittest.main()\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_GetSpecificTELibAccordingToAnnotation.py --- a/commons/tools/tests/Test_F_GetSpecificTELibAccordingToAnnotation.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,67 +0,0 @@ -import subprocess -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -from commons.core.sql.DbMySql import DbMySql -from commons.tools.GetSpecificTELibAccordingToAnnotation import GetSpecificTELibAccordingToAnnotation - -class Test_F_GetSpecificTELibAccordingToAnnotation(unittest.TestCase): - - def setUp(self): - self._expFileName_FullLengthCopy = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithFullLengthCopy.txt" % os.environ["REPET_DATA"] - self._expFileName_Copy = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithCopy.txt" % os.environ["REPET_DATA"] - self._expFileName_FullLengthFrag = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithFullLengthFrag.txt" % os.environ["REPET_DATA"] - self._expFastaFileName_FullLengthCopy = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithFullLengthCopy.fa" % os.environ["REPET_DATA"] - self._expFastaFileName_Copy = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithCopy.fa" % os.environ["REPET_DATA"] - self._expFastaFileName_FullLengthFrag = "%s/Tools/GiveInfoTeAnnotFile_ConsensusWithFullLengthFrag.fa" % os.environ["REPET_DATA"] - - self._inFileName = "%s/Tools/GiveInfoTeAnnotFile.txt" % os.environ["REPET_DATA"] - inputFastaFileName = "input_TEannot_refTEs.fa" - os.symlink(self._expFastaFileName_Copy, inputFastaFileName) - self._iDb = DbMySql() - self._tableName = "Dummy_Atha_refTEs_seq" - self._iDb.createTable(self._tableName, "seq", inputFastaFileName, True) - os.remove(inputFastaFileName) - - self._obsFileName_FullLengthCopy = "%s_FullLengthCopy.txt" % os.path.splitext(os.path.basename(self._inFileName))[0] - self._obsFileName_Copy = "%s_OneCopyAndMore.txt" % os.path.splitext(os.path.basename(self._inFileName))[0] - self._obsFileName_FullLengthFrag = "%s_FullLengthFrag.txt" % os.path.splitext(os.path.basename(self._inFileName))[0] - self._obsFastaFileName_FullLengthCopy = "%s.fa" % os.path.splitext(self._obsFileName_FullLengthCopy)[0] - self._obsFastaFileName_Copy = "%s.fa" % os.path.splitext(self._obsFileName_Copy)[0] - self._obsFastaFileName_FullLengthFrag = "%s.fa" % os.path.splitext(self._obsFileName_FullLengthFrag)[0] - - def tearDown(self): - self._iDb.dropTable(self._tableName) - self._iDb.close() - os.remove(self._obsFileName_FullLengthCopy) - os.remove(self._obsFileName_Copy) - os.remove(self._obsFileName_FullLengthFrag) - os.remove(self._obsFastaFileName_FullLengthCopy) - os.remove(self._obsFastaFileName_Copy) - os.remove(self._obsFastaFileName_FullLengthFrag) - - def test_run(self): - iGetTELib = GetSpecificTELibAccordingToAnnotation(self._inFileName) - iGetTELib.setTableName(self._tableName) - iGetTELib.run() - - self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_FullLengthCopy, self._obsFileName_FullLengthCopy)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_Copy, self._obsFileName_Copy)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_FullLengthFrag, self._obsFileName_FullLengthFrag)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_FullLengthCopy, self._obsFastaFileName_FullLengthCopy)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_Copy, self._obsFastaFileName_Copy)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_FullLengthFrag, self._obsFastaFileName_FullLengthFrag)) - - def test_run_as_script(self): - cmd = "GetSpecificTELibAccordingToAnnotation.py -i %s -t %s -v 4" % (self._inFileName, self._tableName) - subprocess.call(cmd, shell = True) - - self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_FullLengthCopy, self._obsFileName_FullLengthCopy)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_Copy, self._obsFileName_Copy)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expFileName_FullLengthFrag, self._obsFileName_FullLengthFrag)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_FullLengthCopy, self._obsFastaFileName_FullLengthCopy)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_Copy, self._obsFastaFileName_Copy)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expFastaFileName_FullLengthFrag, self._obsFastaFileName_FullLengthFrag)) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py --- a/commons/tools/tests/Test_F_HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,95 +0,0 @@ -import os -import unittest -from commons.core.utils.FileUtils import FileUtils - -CURRENT_DIR = os.getcwd() - -class Test_F_HmmOutput2alignAndTransformCoordInNtAndFilterScores_script(unittest.TestCase): - - def setUp(self): - self._inputFile = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/test_hmmpfam_output" - self._outputFile = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/hmmpfam_output.align" - self._prg = "HmmOutput2alignAndTransformCoordInNtAndFilterScores_script.py" - self._inputFile2 = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/OutputHmmpfamTest" - self._consensusFile = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/ConsensusTestFile_nt.fsa" - self._inputFileScan = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput" - self._outputFileScan = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/hmmscan_output.align" - self._expectedFile = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput.align" - os.chdir(CURRENT_DIR) - - def testHmmpfamOuput2align(self): - cmd = self._prg - cmd += " -i %s" % ( self._inputFile ) - cmd += " -o %s" % ( self._outputFile ) - os.system( cmd ) - self.assertTrue(FileUtils.isRessourceExists(self._outputFile)) - self.assertTrue(FileUtils.are2FilesIdentical(self._inputFile + ".align", self._outputFile)) - self._clean() - - def testHmmpfamOuput2align_clean_option(self): - os.system( "cp " + self._inputFile + " " + self._inputFile + "bis" ) - cmd = self._prg - cmd += " -i %s" % ( self._inputFile + "bis" ) - cmd += " -o %s" % ( self._outputFile ) - cmd += " -c" - os.system( cmd ) - self.assertTrue(FileUtils.isRessourceExists(self._outputFile)) - self.assertTrue( FileUtils.are2FilesIdentical( self._inputFile + ".align", self._outputFile) ) - self.assertFalse( FileUtils.isRessourceExists( self._inputFile + "bis" ) ) - self._clean() - - def testHmmpfamOutput2alignAndTransformCoordInNtAndFilterScores(self): - cmd = self._prg - cmd += " -i %s" % ( self._inputFile2 ) - cmd += " -o %s" % ( self._outputFile ) - cmd += " -T %s" % ( self._consensusFile ) - os.system( cmd ) - self._expectedFile = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/PostPostProcessTestFiltered.align" - self.assertTrue(FileUtils.isRessourceExists(self._outputFile)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expectedFile, self._outputFile)) - self._clean() - - def testHmmscanOuput2align(self): - cmd = self._prg - cmd += " -i %s" % ( self._inputFileScan ) - cmd += " -o %s" % ( self._outputFileScan ) - cmd += " -p hmmscan" - os.system( cmd ) - self.assertTrue(FileUtils.isRessourceExists(self._outputFileScan)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expectedFile, self._outputFileScan)) - self._cleanScan() - - def testHmmscanOuput2align_clean_option(self): - os.system( "cp " + self._inputFileScan + " " + self._inputFileScan + "bis" ) - cmd = self._prg - cmd += " -i %s" % ( self._inputFileScan + "bis" ) - cmd += " -o %s" % ( self._outputFileScan ) - cmd += " -c -p hmmscan" - os.system( cmd ) - self.assertTrue( FileUtils.are2FilesIdentical( self._expectedFile, self._outputFileScan) ) - self.assertFalse( FileUtils.isRessourceExists( self._inputFileScan + "bis" ) ) - self._cleanScan() - - def testHmmscanOutput2alignAndTransformCoordInNtAndFilterScores(self): - self._inputFileScan2 = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput" - self._consensusFileScan = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/repetHmmscan.fa" - self._expectedFileScan = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/align/hmmOutputParsing/tests/datas/hmmscanTransformedExpected.align" - cmd = self._prg - cmd += " -i %s" % ( self._inputFileScan2 ) - cmd += " -o %s" % ( self._outputFileScan ) - cmd += " -T %s" % ( self._consensusFileScan ) - cmd += " -p hmmscan" - os.system( cmd ) - self.assertTrue(FileUtils.isRessourceExists(self._outputFileScan)) - self.assertTrue(FileUtils.are2FilesIdentical(self._expectedFileScan, self._outputFileScan)) - self._cleanScan() - - def _clean(self): - os.system( "rm " + self._outputFile ) - - def _cleanScan(self): - os.system( "rm " + self._outputFileScan ) - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_LaunchBlaster.py --- a/commons/tools/tests/Test_F_LaunchBlaster.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,101 +0,0 @@ -from commons.core.utils.FileUtils import FileUtils -import unittest -import os -import glob -from commons.tools.LaunchBlaster import LaunchBlaster - -class Test_F_LaunchBlaster(unittest.TestCase): - - def setUp(self): - self._inFileName = "DmelChr4.fa" - inFilePath = "%s/Tools/%s" % (os.environ["REPET_DATA"], self._inFileName) - try: - os.remove(self._inFileName) - except: - pass - os.symlink(inFilePath, self._inFileName) - self._iLaunchBlaster = LaunchBlaster(self._inFileName) - self._iLaunchBlaster.setDoAllByall(True) - self._iLaunchBlaster.setVerbosity(4) - - def tearDown(self): - try: - FileUtils.removeFilesByPattern("%s*" % self._inFileName) - os.remove("formatdb.log") - except: - pass - - def test_run_as_class_1_file(self): - expFileName = "%s/Tools/DmelChr4.align" % os.environ["REPET_DATA"] - obsFileName = "%s.align" % self._inFileName - - self._iLaunchBlaster.run() - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - - def test_run_as_class_1_file_changed_params(self): - expFileName = "DmelChr4.align" - with open(expFileName, "w") as fh: - fh.write("dmel_chr4\t691910\t692326\tdmel_chr4\t700019\t700435\t0\t827\t100\n") - obsFileName = "%s.align" % self._inFileName - - self._iLaunchBlaster.setIdentity(100) - self._iLaunchBlaster.setCPU(4) - self._iLaunchBlaster.setDoClean(True) - self._iLaunchBlaster.run() - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(expFileName) - self.assertTrue(glob.glob("*fa_cut*") == []) - self.assertTrue(glob.glob("*Nstretch*") == []) - self.assertTrue(glob.glob("*seq_treated*") == []) - self.assertTrue(glob.glob("*.log") == []) - - def test_run_as_script_1bank_1file(self): - inputFileName = "chunks.fa" - with open(inputFileName, "w") as f: - f.write(">chunk1\n") - f.write("GAATTCGCGTCCGCTTACCCATGTGCCTGTGGATGCCGAACAGGAGGCGCCGTTGACGGC\n") - f.write("GAATGACTTACTCAAGGGAGTAGCCAATCTGTCGGATACGCCCGGATTGGAGCTGCCCAT\n") - expFileName = "exp.align" - with open(expFileName, "w") as f: - f.write("chunk1\t1\t120\tdmel_chr4\t1\t120\t2e-64\t238\t100\n") - obsFileName = "%s.align" % inputFileName - - cmd = "LaunchBlaster.py -q %s -s %s -e 0.1 -a" % (inputFileName, self._inFileName) - os.system(cmd) - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - FileUtils.removeFilesByPattern("%s*" % inputFileName) - os.remove(expFileName) - - def test_run_as_script_1bank_1file_withoutABA(self): - queryFileName = "chunks.fa" - with open(queryFileName, "w") as f: - f.write(">chunk1\n") - f.write("GAATTCGCGTCCGCTTACCCATGTGCCTGTGGATGCCGAACAGGAGGCGCCGTTGACGGC\n") - f.write("GAATGACTTACTCAAGGGAGTAGCCAATCTGTCGGATACGCCCGGATTGGAGCTGCCCAT\n") - subjectFileName = "genome.fa" - with open(subjectFileName, "w") as f: - f.write(">chunk1\n") - f.write("GAATTCGCGTCCGCTTACCCATGTGCCTGTGGATGCCGAACAGGAGGCGCCGTTGACGGC\n") - f.write("GAATGACTTACTCAAGGGAGTAGCCAATCTGTCGGATACGCCCGGATTGGAGCTGCCCAT\n") - f.write(">chunk2\n") - f.write("GAATTCGCGTCCGCTTACCCATGTGCCTGTGGATGCCGAACAGGAGGCGCCGTTGACGGC\n") - f.write("GAATGACTTACTCAAGGGAGTAGCCAATCTGTCGGATACGCCCGGATTGGAGCTGCCCAT\n") - expFileName = "exp.align" - with open(expFileName, "w") as f: - f.write("chunk1\t1\t120\tchunk1\t1\t120\t4e-68\t238\t100\n") - f.write("chunk1\t1\t120\tchunk2\t1\t120\t4e-68\t238\t100\n") - obsFileName = "%s.align" % queryFileName - - cmd = "LaunchBlaster.py -q %s -s %s -e 0.1" % (queryFileName, subjectFileName) - os.system(cmd) - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - FileUtils.removeFilesByPattern("%s*" % queryFileName) - FileUtils.removeFilesByPattern("%s*" % subjectFileName) - os.remove(expFileName) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_LaunchBlasterInParallel.py --- a/commons/tools/tests/Test_F_LaunchBlasterInParallel.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,116 +0,0 @@ -from commons.core.utils.FileUtils import FileUtils -import unittest -import os -import shutil -from commons.tools.LaunchBlasterInParallel import LaunchBlasterInParallel - -class Test_F_LaunchBlasterInParallel(unittest.TestCase): - - CLUSTER_HOST = "compute-2-46.local" - - def setUp(self): - self._inFilePath = "%s/Tools/DmelChr4_chunks.fa" % os.environ["REPET_DATA"] - self._configFileName = "TE.cfg" - self._outputFileName = "out.align.not_over" - - def tearDown(self): - try: - os.remove(self._outputFileName) - os.remove(self._configFileName) - except: - pass - - def test_run_as_script_1bank_1file_withoutABA(self): - self._outputFileName = "out.align" - os.mkdir("tmp") - os.chdir("tmp") - queryFileName = "chunks.fa" - with open(queryFileName, "w") as f: - f.write(">chunk1\n") - f.write("GAATTCGCGTCCGCTTACCCATGTGCCTGTGGATGCCGAACAGGAGGCGCCGTTGACGGC\n") - f.write("GAATGACTTACTCAAGGGAGTAGCCAATCTGTCGGATACGCCCGGATTGGAGCTGCCCAT\n") - os.chdir("..") - subjectFileName = "genome.fa" - with open(subjectFileName, "w") as f: - f.write(">chunk1\n") - f.write("GAATTCGCGTCCGCTTACCCATGTGCCTGTGGATGCCGAACAGGAGGCGCCGTTGACGGC\n") - f.write("GAATGACTTACTCAAGGGAGTAGCCAATCTGTCGGATACGCCCGGATTGGAGCTGCCCAT\n") - f.write(">chunk2\n") - f.write("GAATTCGCGTCCGCTTACCCATGTGCCTGTGGATGCCGAACAGGAGGCGCCGTTGACGGC\n") - f.write("GAATGACTTACTCAAGGGAGTAGCCAATCTGTCGGATACGCCCGGATTGGAGCTGCCCAT\n") - expFileName = "expected" - with open(expFileName, "w") as f: - f.write("chunk1\t1\t120\tchunk1\t1\t120\t4e-68\t238\t100\n") - f.write("chunk1\t1\t120\tchunk2\t1\t120\t4e-68\t238\t100\n") - self._writeConfig(0.1) - - cmd = "LaunchBlasterInParallel.py -q %s/tmp -s %s/%s -C %s -o %s" % (os.getcwd(), os.getcwd(), subjectFileName, self._configFileName, self._outputFileName) - os.system(cmd) - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, self._outputFileName)) - FileUtils.removeFilesByPattern("*.param") - shutil.rmtree("tmp") - os.remove(subjectFileName) - os.remove(expFileName) - - def test_run_as_script_1bank_2_batches(self): - os.mkdir("tmp") - os.chdir("tmp") - os.symlink("%s/Tools/batches/batch_1.fa" % os.environ["REPET_DATA"], "batch_1.fa") - os.symlink("%s/Tools/batches/batch_2.fa" % os.environ["REPET_DATA"], "batch_2.fa") - os.chdir("..") - - expFileName = "%s/Tools/DmelChr4.align.not_over" % os.environ["REPET_DATA"] - self._writeConfig() - - cmd = "LaunchBlasterInParallel.py -q %s/tmp -s %s -a -o %s -C %s" % (os.getcwd(), self._inFilePath, self._outputFileName, self._configFileName) - os.system(cmd) - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, self._outputFileName)) - FileUtils.removeFilesByPattern("*.param") - shutil.rmtree("tmp") - - def test_run_1bank_1bank_2_batches(self): - os.mkdir("tmp") - os.chdir("tmp") - os.symlink("%s/Tools/batches/batch_1.fa" % os.environ["REPET_DATA"], "batch_1.fa") - os.symlink("%s/Tools/batches/batch_2.fa" % os.environ["REPET_DATA"], "batch_2.fa") - os.chdir("..") - - expFileName = "%s/Tools/DmelChr4.align.not_over" % os.environ["REPET_DATA"] - self._writeConfig() - - iLaunchBlaster = LaunchBlasterInParallel(configFileName = self._configFileName, outFileName = self._outputFileName) - iLaunchBlaster.setDoAllByall(True) - iLaunchBlaster.setVerbosity(4) - iLaunchBlaster.setQueryDirectory("%s/tmp" % os.getcwd()) - iLaunchBlaster.setSubjectFilePath(self._inFilePath) - iLaunchBlaster.run() - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, self._outputFileName)) - FileUtils.removeFilesByPattern("*.param") - shutil.rmtree("tmp") - - def _writeConfig(self, eValue = 1e-300): - with open(self._configFileName, "w") as fh: - fh.write("[jobs]\n") - if os.getenv("HOSTNAME") == self.CLUSTER_HOST: - fh.write("resources: test\n") - else: - fh.write("resources:\n") - fh.write("tmpDir:\n") - fh.write("copy: no\n") - fh.write("clean: yes\n") - fh.write("\n") - fh.write("[prepare_data]\n") - fh.write("chunk_length: 200000\n") - fh.write("chunk_overlap: 10000\n") - fh.write("\n") - fh.write("[alignment]\n") - fh.write("blast: ncbi\n") - fh.write("Evalue: %s\n" % eValue) - fh.write("length: 100\n") - fh.write("identity: 90\n") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_LaunchMatcherInParallel.py --- a/commons/tools/tests/Test_F_LaunchMatcherInParallel.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,88 +0,0 @@ -from commons.core.utils.FileUtils import FileUtils -import shutil -import unittest -import os -from commons.tools.LaunchMatcherInParallel import LaunchMatcherInParallel - -class Test_F_LaunchMatcherInParallel(unittest.TestCase): - - CLUSTER_HOST = "compute-2-46.local" - - def setUp(self): - self._configFileName = "TE.cfg" - self._writeConfig() - - def tearDown(self): - FileUtils.removeFilesByPattern("DmelChr4*") - os.remove(self._configFileName) - - def test_run_as_class_1_seq(self): - inFileName = "DmelChr4.align" - fastaFileName = "DmelChr4.fa" - inFilePath = "%s/Tools/%s" % (os.environ["REPET_DATA"], inFileName) - inFastaPath = "%s/Tools/%s" % (os.environ["REPET_DATA"], fastaFileName) - os.symlink(inFilePath, inFileName) - os.symlink(inFastaPath, fastaFileName) - expPathFileName = "%s/Tools/DmelChr4.align.match.path" % os.environ["REPET_DATA"] - expTabFileName = "%s/Tools/DmelChr4.align.match.tab" % os.environ["REPET_DATA"] - - obsPathFileName = "%s.match.path" % inFileName - obsTabFileName = "%s.match.tab" % inFileName - - iLaunchMatcherInParallel = LaunchMatcherInParallel(align=inFileName, queryFileName=fastaFileName, subjectFileName=fastaFileName, doJoin=True, evalue="1e-20", keepConflict=True, config=self._configFileName) - iLaunchMatcherInParallel.run() - - self.assertTrue(FileUtils.are2FilesIdentical(expPathFileName, obsPathFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(expTabFileName, obsTabFileName)) - - def test_run_as_class_n_seq_less_jobs_than_n(self): - inFileName = "DmelChr4_dummy.align" - fastaFileName = "DmelChr4.fa" - inFilePath = "%s/Tools/%s" % (os.environ["REPET_DATA"], inFileName) - inFastaPath = "%s/Tools/%s" % (os.environ["REPET_DATA"], fastaFileName) - os.symlink(inFilePath, inFileName) - os.symlink(inFastaPath, fastaFileName) - expPathFileName = "%s/Tools/DmelChr4_dummy.align.match.path" % os.environ["REPET_DATA"] - expTabFileName = "%s/Tools/DmelChr4_dummy.align.match.tab" % os.environ["REPET_DATA"] - - obsPathFileName = "%s.match.path" % inFileName - obsTabFileName = "%s.match.tab" % inFileName - - iLaunchMatcherInParallel = LaunchMatcherInParallel(align=inFileName, queryFileName=fastaFileName, subjectFileName=fastaFileName, doJoin=True, evalue="1e-20", keepConflict=True, config=self._configFileName, doClean=True) - iLaunchMatcherInParallel.run() - - self.assertTrue(FileUtils.are2FilesIdentical(expPathFileName, obsPathFileName)) - self.assertTrue(FileUtils.are2FilesIdentical(expTabFileName, obsTabFileName)) - - def test_run_as_class_n_seq_less_jobs_than_n_not_merged_results(self): - inFileName = "DmelChr4_dummy.align" - fastaFileName = "DmelChr4.fa" - inFilePath = "%s/Tools/%s" % (os.environ["REPET_DATA"], inFileName) - inFastaPath = "%s/Tools/%s" % (os.environ["REPET_DATA"], fastaFileName) - os.symlink(inFilePath, inFileName) - os.symlink(inFastaPath, fastaFileName) - - iLaunchMatcherInParallel = LaunchMatcherInParallel(align=inFileName, queryFileName=fastaFileName, subjectFileName=fastaFileName, doJoin=True, evalue="1e-20", keepConflict=True, config=self._configFileName, maxFileSize=100, mergeResults=False) - iLaunchMatcherInParallel.run() - - baseFileName = os.path.splitext(inFileName)[0] - lExpMatchFileNames = ["%s_1.align.match.path" % baseFileName, "%s_2.align.match.path" % baseFileName, "%s_3.align.match.path" % baseFileName] - lExpTabFileNames = ["%s_1.align.match.tab" % baseFileName, "%s_2.align.match.tab" % baseFileName, "%s_3.align.match.tab" % baseFileName] - for i in range(0,3): - self.assertTrue(FileUtils.isRessourceExists("tmpMatcher/%s" % lExpMatchFileNames[i])) - self.assertTrue(FileUtils.isRessourceExists("tmpMatcher/%s" % lExpTabFileNames[i])) - shutil.rmtree("tmpMatcher") - - def _writeConfig(self): - with open(self._configFileName, "w") as fh: - fh.write("[jobs]\n") - if os.getenv("HOSTNAME") == self.CLUSTER_HOST: - fh.write("resources: test\n") - else: - fh.write("resources:\n") - fh.write("tmpDir:\n") - fh.write("copy: no\n") - fh.write("clean: yes\n") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_MergeMatchsFiles.py --- a/commons/tools/tests/Test_F_MergeMatchsFiles.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,302 +0,0 @@\n-import os\n-import unittest\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.tools.MergeMatchsFiles import MergeMatchsFiles\n-\n-\n-class Test_F_MergeMatchsFiles(unittest.TestCase):\n-\n- def test_run_set(self):\n- inFileName1 = "test1.set"\n- inFileName2 = "test2.set"\n- self._writeSetFiles(inFileName1, inFileName2)\n- iMMF = MergeMatchsFiles("set", "out")\n- iMMF.run()\n- obsFileName = "out.set"\n- expFileName = "exp.set"\n- self._writeExpSetFile(expFileName)\n- self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName))\n- os.remove(expFileName)\n- os.remove(obsFileName)\n-\n- def test_run_align(self):\n- inFileName1 = "test1.align"\n- inFileName2 = "test2.align"\n- self._writeAlignFiles(inFileName1, inFileName2)\n- iMMF = MergeMatchsFiles("align", "out")\n- iMMF.run()\n- obsFileName = "out.align"\n- expFileName = "exp.align"\n- self._writeExpAlignFile(expFileName)\n- self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName))\n- os.remove(expFileName)\n- os.remove(obsFileName)\n-\n- def test_run_align_allByAll(self):\n- inFileName1 = "test1.align"\n- inFileName2 = "test2.align"\n- self._writeAlignFiles(inFileName1, inFileName2)\n- iMMF = MergeMatchsFiles("align", "out", True)\n- iMMF.run()\n- obsFileName = "out.align"\n- expFileName = "exp.align"\n- self._writeExpAlignFile_allByAll(expFileName)\n- self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName))\n- os.remove(expFileName)\n- os.remove(obsFileName)\n-\n- def test_run_path(self):\n- inFileName1 = "test1.path"\n- inFileName2 = "test2.path"\n- self._writePathFiles(inFileName1, inFileName2)\n- iMMF = MergeMatchsFiles("path", "out")\n- iMMF.run()\n- obsFileName = "out.path"\n- expFileName = "exp.path"\n- self._writeExpPathFile(expFileName)\n- self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName))\n- os.remove(expFileName)\n- os.remove(obsFileName)\n-\n- def test_run_tab(self):\n- inFileName1 = "test1.tab"\n- inFileName2 = "test2.tab"\n- self._writeTabFiles(inFileName1, inFileName2)\n- iMMF = MergeMatchsFiles("tab", "out")\n- iMMF.run()\n- obsFileName = "out.tab"\n- expFileName = "exp.tab"\n- self._writeExpTabFile(expFileName)\n- self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName))\n- os.remove(expFileName)\n- os.remove(obsFileName)\n- \n- def _writeSetFiles(self, fileName1, fileName2):\n- f = open(fileName1, "w")\n- f.write("1\\t(TCTAT)3\\tchunk006\\t295\\t309\\n")\n- f.write("2\\t(A)33\\tchunk006\\t679\\t711\\n")\n- f.write("3\\t(G)16\\tchunk006\\t731\\t746\\n")\n- f.write("4\\t(GAG)9\\tchunk006\\t903\\t929\\n")\n- f.write("5\\t(GGAGGG)4\\tchunk006\\t905\\t929\\n")\n- f.close()\n- f = open(fileName2, "w")\n- f.write("1\\t(CCACT)3\\tchunk011\\t101\\t116\\n")\n- f.write("2\\t(TATATA)7\\tchunk011\\t316\\t357\\n")\n- f.write("3\\t(AT)22\\tchunk011\\t323\\t366\\n")\n- f.close()\n- \n- def _writeExpSetFile(self, fileName):\n- f = open(fileName, "w")\n- f.write("1\\t(TCTAT)3\\tchunk006\\t295\\t309\\n")\n- f.write("2\\t(A)33\\tchunk006\\t679\\t711\\n")\n- f.write("3\\t(G)16\\tchunk006\\t731\\t746\\n")\n- f.write("4\\t(GAG)9\\tchunk006\\t903\\t929\\n")\n- f.write("5\\t(GGAGGG)4\\tchunk006\\t905\\t929\\n")\n- f.write("6\\t(CCACT)3\\tchunk011\\t101\\t116\\n")\n- f.write("7\\t(TATATA)7\\tchunk011\\t316\\t357\\n")\n- f.write("8\\t(AT)22\\tchunk011\\t323\\t366\\n")\n- f.close()\n-\n- def _writeAlignFiles(self, fileName1, fileName2):\n- f = open(fileName1, "w")\n- f.write("chunk1\\t25601\\t27800\\tchunk1\\t52250\\t54450\\t0\\t4244\\t99.36\\n")\n- f.write("chunk1\\t27791\\t2862'..b' f.write("13\\tchunk006\\t29180\\t29201\\tAT_rich#Low_complexity\\t163\\t142\\t0.0\\t14\\t68.18\\n")\n- f.write("14\\tchunk006\\t33773\\t33825\\tAT_rich#Low_complexity\\t142\\t194\\t0.0\\t11\\t22.64\\n")\n- f.close()\n- \n- def _writeTabFiles(self, fileName1, fileName2):\n- f = open(fileName1, "w")\n- f.write("query.name\\tquery.start\\tquery.end\\tquery.length\\tquery.length.%\\tmatch.length.%\\tsubject.name\\tsubject.start\\tsubject.end\\tsubject.length\\tsubject.length.%\\tE.value\\tScore\\tIdentity\\tpath\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_1_Map_3\\t2\\t542\\t541\\t0.998155\\t0.32473\\tTC1_DM:ClassII:TIR:Tc1-Mariner\\t1\\t543\\t543\\t0.32593\\t1.4e-93\\t984\\t87.541\\t1\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_2_Map_8\\t2\\t517\\t516\\t0.998066\\t0.115179\\tPROTOP:ClassII:TIR:P\\t530\\t16\\t515\\t0.114955\\t1.2e-79\\t928\\t95.2118\\t2\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_3_Map_20\\t5\\t598\\t594\\t0.978583\\t0.537557\\tPROTOP_A:ClassII:TIR:P\\t572\\t1\\t572\\t0.517647\\t3e-93\\t1048\\t97.6307\\t3\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_4_Map_3\\t5\\t534\\t530\\t0.992509\\t0.479638\\tPROTOP_A:ClassII:TIR:P\\t1105\\t576\\t530\\t0.479638\\t2.9e-87\\t1828\\t98.4848\\t4\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_5_Map_3\\t5\\t704\\t700\\t0.994318\\t0.425791\\tTC1-2_DM:ClassII:TIR:Tc1-Mariner\\t1644\\t945\\t700\\t0.425791\\t7.3e-120\\t1228\\t98.1349\\t5\\n")\n- f.close()\n- f = open(fileName2, "w")\n- f.write("query.name\\tquery.start\\tquery.end\\tquery.length\\tquery.length.%\\tmatch.length.%\\tsubject.name\\tsubject.start\\tsubject.end\\tsubject.length\\tsubject.length.%\\tE.value\\tScore\\tIdentity\\tpath\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_5_Map_3\\t274\\t702\\t429\\t0.609375\\t1.26176\\tTC1-2_DMp:ClassII:TIR:Tc1-Mariner\\t340\\t198\\t143\\t0.420588\\t5e-74\\t265\\t98.6014\\t1\\n")\n- f.write("DmelChr4_bench_Blaster_Recon_12_Map_3\\t311\\t374\\t64\\t0.028021\\t0.0359349\\tBEL-27_AA-I_1p:ClassI:LTR:Bel-Pao\\t605\\t582\\t24\\t0.0134756\\t6.3e-17\\t11\\t30.8511\\t2\\n")\n- f.write("DmelChr4_bench_Blaster_Recon_12_Map_3\\t1472\\t1552\\t81\\t0.0354641\\t0.0463918\\tBEL-76_AA-I_1p:ClassI:LTR:Bel-Pao\\t79\\t52\\t28\\t0.0160367\\t1e-13\\t8\\t27.7778\\t3\\n")\n- f.close()\n- \n- def _writeExpTabFile(self, fileName):\n- f = open(fileName, "w")\n- f.write("query.name\\tquery.start\\tquery.end\\tquery.length\\tquery.length.%\\tmatch.length.%\\tsubject.name\\tsubject.start\\tsubject.end\\tsubject.length\\tsubject.length.%\\tE.value\\tScore\\tIdentity\\tpath\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_1_Map_3\\t2\\t542\\t541\\t0.998155\\t0.32473\\tTC1_DM:ClassII:TIR:Tc1-Mariner\\t1\\t543\\t543\\t0.32593\\t1.4e-93\\t984\\t87.541\\t1\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_2_Map_8\\t2\\t517\\t516\\t0.998066\\t0.115179\\tPROTOP:ClassII:TIR:P\\t530\\t16\\t515\\t0.114955\\t1.2e-79\\t928\\t95.2118\\t2\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_3_Map_20\\t5\\t598\\t594\\t0.978583\\t0.537557\\tPROTOP_A:ClassII:TIR:P\\t572\\t1\\t572\\t0.517647\\t3e-93\\t1048\\t97.6307\\t3\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_4_Map_3\\t5\\t534\\t530\\t0.992509\\t0.479638\\tPROTOP_A:ClassII:TIR:P\\t1105\\t576\\t530\\t0.479638\\t2.9e-87\\t1828\\t98.4848\\t4\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_5_Map_3\\t5\\t704\\t700\\t0.994318\\t0.425791\\tTC1-2_DM:ClassII:TIR:Tc1-Mariner\\t1644\\t945\\t700\\t0.425791\\t7.3e-120\\t1228\\t98.1349\\t5\\n")\n- f.write("DmelChr4_bench_Blaster_Grouper_5_Map_3\\t274\\t702\\t429\\t0.609375\\t1.26176\\tTC1-2_DMp:ClassII:TIR:Tc1-Mariner\\t340\\t198\\t143\\t0.420588\\t5e-74\\t265\\t98.6014\\t6\\n")\n- f.write("DmelChr4_bench_Blaster_Recon_12_Map_3\\t311\\t374\\t64\\t0.028021\\t0.0359349\\tBEL-27_AA-I_1p:ClassI:LTR:Bel-Pao\\t605\\t582\\t24\\t0.0134756\\t6.3e-17\\t11\\t30.8511\\t7\\n")\n- f.write("DmelChr4_bench_Blaster_Recon_12_Map_3\\t1472\\t1552\\t81\\t0.0354641\\t0.0463918\\tBEL-76_AA-I_1p:ClassI:LTR:Bel-Pao\\t79\\t52\\t28\\t0.0160367\\t1e-13\\t8\\t27.7778\\t8\\n")\n- f.close()\n- \n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_PostAnalyzeTELib.py --- a/commons/tools/tests/Test_F_PostAnalyzeTELib.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,294 +0,0 @@\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.core.sql.DbFactory import DbFactory\n-from commons.tools.PostAnalyzeTELib import PostAnalyzeTELib\n-import subprocess\n-import unittest\n-import os\n-\n-\n-class Test_F_PostAnalyzeTELib(unittest.TestCase):\n- \n- def setUp(self):\n- self._expStatFileName = "expStats.tab"\n- self._obsStatFileName = ""\n- self._genomeSize = 1281640\n- self._pathTableName = "dummyDmelChr4_chr_allTEs_nr_noSSR_join_path"\n- self._seqTableName = "dummyDmelChr4_denovoLibTEs_seq"\n- \n- def tearDown(self):\n- try:\n- os.remove(self._expStatFileName)\n- except: pass\n- try:\n- os.remove(self._obsStatFileName)\n- except: pass\n-\n- def test_run_analysis1(self):\n- libFileName = "TElib.fa"\n- self._writeInputFasta_analysis1(libFileName)\n- expClusterFileName = "expClusters.tab"\n- self._writeExpClusterFile_analysis1(expClusterFileName)\n- expGlobalStatFileName = "expGlobalStats.txt"\n- self._writeExpGlobalStats_analysis1(expGlobalStatFileName)\n- self._writeExpStatsFile_analysis1(self._expStatFileName)\n- obsClusterFileName = "TElib.tab"\n- obsGlobalStatFileName = "TElib.globalStatsPerCluster.txt"\n- self._obsStatFileName = "TElib.statsPerCluster.tab"\n- \n- iPATEL = PostAnalyzeTELib(analysis=1, fastaFileName=libFileName, doClean=True)\n- iPATEL.run()\n- \n- self.assertTrue(FileUtils.are2FilesIdentical(expClusterFileName, obsClusterFileName))\n- self.assertTrue(FileUtils.are2FilesIdentical(expGlobalStatFileName, obsGlobalStatFileName))\n- self.assertTrue(FileUtils.are2FilesIdentical(self._expStatFileName, self._obsStatFileName))\n- \n- os.remove(libFileName)\n- os.remove(expClusterFileName)\n- os.remove(expGlobalStatFileName)\n- os.remove(obsClusterFileName)\n- os.remove(obsGlobalStatFileName)\n-\n- def test_run_as_script_analysis1(self):\n- libFileName = "TElib.fa"\n- with open(libFileName, "w") as f:\n- f.write(">transib2\\n")\n- f.write("GGCCAGTCACAATGGGGGTTTCACTGGTGTGTCATGCACATTTAATAGGGGTAAGACTGA\\n")\n- f.write("ATAAAAAATGATTATTTGCATGAAATGGGGATGAGAGAGAAGGAAAGAGTTTCATCCTGG\\n")\n- f.write("GATTCGTTTCATTCACCGGATCTCTTGCGTCCGCCTCCGCCGTGCGACCTCCGCATTC\\n")\n- f.write(">transib3\\n")\n- f.write("ATAAAAAATGATTATTTGCATGAAATGGGGATGAGAGAGAAGGAAAGAGTTTCATCCTGG\\n")\n- f.write("TGAAACTCGTCAGCGTCGTTTCCAAGTCCT\\n")\n- f.write(">transib4\\n")\n- f.write("GGCCAGTCACAATGGGGGTTTCACTGGTGTGTCATGCACATTTAATAGGGGTAAGACTGA\\n")\n- f.write("ATAAAAAATGATTATTTGCATGAAATGGGGATGAGAGAGAAGGAAAGAGTTTCATCCTGG\\n")\n- f.write("GATTCGTTTCATTCACCGGATCTCTTGCGTCCGCCTCCGCCGTGCGACCTCCGCATTCAT\\n")\n- f.write("AAAAAATGATTATTTGCATGAAATGGGGATGAGAGAGAAGGAAAGAGTTTCATCCTGG\\n")\n- expClusterFileName = "expClusters.tab"\n- with open(expClusterFileName, "w") as f:\n- f.write("transib4 \\n")\n- f.write("transib2 \\n")\n- f.write("transib3 \\n")\n- with open(self._expStatFileName, "w") as f:\n- f.write("cluster\\tsequencesNb\\tsizeOfSmallestSeq\\tsizeOfLargestSeq\\taverageSize\\tmedSize\\n")\n- f.write("1\\t1\\t238\\t238\\t238\\t238\\n")\n- f.write("2\\t1\\t178\\t178\\t178\\t178\\n")\n- f.write("3\\t1\\t90\\t90\\t90\\t90\\n")\n- expGlobalStatFileName = "expGlobalStats.txt"\n- with open(expGlobalStatFileName, "w") as f:\n- f.write("nb of clusters: 3\\n")\n- f.write("nb of clusters with 1 sequence: 3\\n")\n- f.write("nb of clusters with 2 sequences: 0\\n")\n- f.write("nb of clusters with >2 sequences: 0 (0 sequences)\\n")\n- f.write("nb of sequences: 3\\n")\n- f.write("nb of sequences in the largest cluster: 1\\n")\n- f.write("nb of sequences in the s'..b'f.write("DmelChr4-B-G7-Map3_classII-TIR-incomp\\t1944\\t15212\\t49\\t1\\t42\\t1\\t89.44\\t382.36\\t19.67\\n")\n- f.write("DmelChr4-B-G9-Map3_NoCat\\t1590\\t11564\\t24\\t0\\t21\\t1\\t92.03\\t550.67\\t34.63\\n")\n- f.write("DmelChr4-B-P0.0-Map3_classII-TIR-incomp\\t1042\\t4001\\t13\\t3\\t11\\t3\\t85.11\\t366.36\\t35.16\\n")\n- f.write("DmelChr4-B-R1-Map4_NoCat\\t2367\\t66031\\t484\\t0\\t361\\t0\\t77.84\\t182.91\\t7.73\\n")\n- f.write("DmelChr4-B-R12-Map3_NoCat\\t2284\\t4938\\t3\\t2\\t3\\t2\\t99.26\\t1646.00\\t72.07\\n")\n- f.write("DmelChr4-B-R19-Map4_NoCat\\t705\\t3328\\t10\\t3\\t10\\t3\\t88.51\\t332.80\\t47.21\\n")\n- f.write("DmelChr4-B-R2-Map6_NoCat\\t4638\\t20539\\t34\\t2\\t29\\t3\\t80.93\\t708.24\\t15.27\\n")\n- f.write("DmelChr4-B-R4-Map5_NoCat\\t1067\\t7292\\t35\\t1\\t28\\t1\\t86.50\\t260.54\\t24.42\\n")\n- f.write("DmelChr4-B-R9-Map3_NoCat\\t714\\t5453\\t19\\t2\\t16\\t2\\t81.18\\t340.81\\t47.73\\n")\n- \n- def _writeExpGlobalStats_analysis3(self, fileName):\n- with open(fileName, "w") as f:\n- f.write("nb of sequences: 11\\n")\n- f.write("nb of matched sequences: 11\\n")\n- f.write("cumulative coverage: 150275 bp\\n")\n- f.write("coverage percentage: 11.73%\\n")\n- f.write("\\n")\n- f.write("total nb of TE fragments: 710\\n")\n- f.write("total nb full-length fragments: 18 (2.54%)\\n")\n- f.write("total nb of TE copies: 553\\n")\n- f.write("total nb full-length copies: 20 (3.62%)\\n")\n- f.write("families with full-length fragments: 8 (72.73%)\\n")\n- f.write(" with only one full-length fragment: 2\\n")\n- f.write(" with only two full-length fragments: 3\\n")\n- f.write(" with only three full-length fragments: 2\\n")\n- f.write(" with more than three full-length fragments: 1\\n")\n- f.write("families with full-length copies: 9 (81.82%)\\n")\n- f.write(" with only one full-length copy: 3\\n")\n- f.write(" with only two full-length copies: 2\\n")\n- f.write(" with only three full-length copies: 3\\n")\n- f.write(" with more than three full-length copies: 1\\n")\n- f.write("mean of median identity of all families: 88.30 +- 8.33\\n")\n- f.write("mean of median length percentage of all families: 30.83 +- 32.30\\n")\n- \n- def _writeClusterFile_analysis4(self, fileName):\n- with open(fileName, "w") as f:\n- f.write("1\\tDmelChr4-B-R1-Map4_NoCat\\tDmelChr4-B-R2-Map6_NoCat\\tDmelChr4-B-R4-Map5_NoCat\\n")\n- f.write("2\\tDmelChr4-B-G7-Map3_classII-TIR-incomp\\tDmelChr4-B-P0.0-Map3_classII-TIR-incomp\\n")\n-\n- def _writeExpStatsFile_analysis4(self, fileName):\n- with open(fileName, "w") as f:\n- f.write("Cluster\\tcovg\\tfrags\\tcopies\\n")\n- f.write("1\\t93862\\t553\\t418\\n")\n- f.write("2\\t19213\\t62\\t53\\n")\n- \n- def _writeConfigFile(self, configFileName):\n- with open(configFileName, "w") as fHandle:\n- fHandle.write("[repet_env]\\n")\n- fHandle.write("repet_host: %s\\n" % os.environ["REPET_HOST"])\n- fHandle.write("repet_user: %s\\n" % os.environ["REPET_USER"])\n- fHandle.write("repet_pw: %s\\n" % os.environ["REPET_PW"])\n- fHandle.write("repet_db: %s\\n" % os.environ["REPET_DB"])\n- fHandle.write("repet_port: 3306\\n")\n- fHandle.write("[analysis1]\\n")\n- fHandle.write("fasta_name: %s\\n" % self._expStatFileName)\n- \n- fHandle.write("[analysis2]\\n")\n- fHandle.write("clusterFileName: %s\\n" % self._expStatFileName)\n- \n- fHandle.write("[analysis3]\\n")\n- fHandle.write("pathTableName: %s\\n" % self._pathTableName)\n- fHandle.write("seqTableName: %s\\n" % self._seqTableName)\n- fHandle.write("genomeSize: %s\\n" % self._genomeSize)\n-\n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_ReplaceGreaterThanSymbolInFastaHeader.py --- a/commons/tools/tests/Test_F_ReplaceGreaterThanSymbolInFastaHeader.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,51 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -from commons.tools.tests.MockFastaForReplaceGreaterThanSymbolInFastaHeader import MockFastaForReplaceGreaterThanSymbolInFastaHeader_withoutGreaterThan,\ - MockFastaForReplaceGreaterThanSymbolInFastaHeader -from commons.tools.replaceGreaterThanSymbolInFastaHeaderProgramLauncher import replaceGreaterThanSymbolInFastaHeaderProgramLauncher - -class Test_F_ReplaceGreaterThanSymbolInHeader(unittest.TestCase): - - - def test_run(self): - inputFileName = "dummy_fasta.fsa" - mockInput = MockFastaForReplaceGreaterThanSymbolInFastaHeader() - mockInput.write(inputFileName) - - expFileName = "exp_dummy_fasta.preprocessed.fsa" - mockInput = MockFastaForReplaceGreaterThanSymbolInFastaHeader_withoutGreaterThan() - mockInput.write(expFileName) - - obsFileName = "dummy_fasta.preprocessed.fasta" - rgtspl = replaceGreaterThanSymbolInFastaHeaderProgramLauncher() - rgtspl.setInputFile(inputFileName) - rgtspl.run() - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(inputFileName) - os.remove(expFileName) - os.remove(obsFileName) - - def test_run_as_script(self): - inputFileName = "dummy_fasta.fsa" - mockInput = MockFastaForReplaceGreaterThanSymbolInFastaHeader() - mockInput.write(inputFileName) - - expFileName = "exp_dummy_fasta.preprocessed.fsa" - mockInput = MockFastaForReplaceGreaterThanSymbolInFastaHeader_withoutGreaterThan() - mockInput.write(expFileName) - - obsFileName = "dummy_fasta.preprocessed.fasta" - - cmd2Launch = "replaceGreaterThanSymbolInFastaHeaderProgramLauncher.py -i " + inputFileName - os.system(cmd2Launch) - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(inputFileName) - os.remove(expFileName) - os.remove(obsFileName) - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_RetrieveInitHeaders.py --- a/commons/tools/tests/Test_F_RetrieveInitHeaders.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,85 +0,0 @@ -from commons.core.sql.DbMySql import DbMySql -from commons.core.sql.TablePathAdaptator import TablePathAdaptator -from commons.core.coord.PathUtils import PathUtils -from commons.core.utils.FileUtils import FileUtils -import os -import unittest - -class Test_F_RetrieveInitHeaders(unittest.TestCase): - - def setUp(self): - self._iDb = DbMySql() - - def tearDown(self): - self._iDb.close() - - def test_run_as_script_rename_subject_and_clean_table(self): - shortHLinkFileName = "dummy.shortHlink" - self._writeShortHLinkFile(shortHLinkFileName) - pathTableName = "dummyInput_path" - self._createPathTable(pathTableName) - expFileName = "exp.path" - self._writeExpFile(expFileName) - obsTableName = "dummyOutput_path" - - cmd = "RetrieveInitHeaders.py -i %s -l %s -o %s -s -c -v 1" % (pathTableName, shortHLinkFileName, obsTableName) - os.system(cmd) - - self.assertTrue(self._iDb.doesTableExist(obsTableName)) - self.assertFalse(self._iDb.doesTableExist(pathTableName)) - obsFileName = "obs.path" - iTPA = TablePathAdaptator(self._iDb, obsTableName) - lPaths = iTPA.getListOfAllPaths() - PathUtils.writeListInFile(lPaths, obsFileName) - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - - os.remove(shortHLinkFileName) - os.remove(expFileName) - os.remove(obsFileName) - self._iDb.dropTable(obsTableName) - - def _writeShortHLinkFile(self, fileName): - f = open(fileName, "w") - f.write("refTE_1\tPaphi_v2-B-R11932-Map16_classI-LTR-comp\t1\t5388\n") - f.write("refTE_2\tPaphi_v2-B-R2469-Map20_classI-LTR-comp\t1\t6385\n") - f.write("refTE_3\tPaphi_v2-B-R8543-Map9_classI-LTR-comp\t1\t7148\n") - f.write("refTE_4\tPaphi_v2-B-R33384-Map4_classI-LTR-incomp\t1\t262\n") - f.write("refTE_5\tPaphi_v2-B-P73.1298-Map3_classI-LTR-incomp\t1\t389\n") - f.write("refTE_6\tPaphi_v2-B-R36143-Map3_classI-LTR-incomp\t1\t393\n") - f.write("refTE_7\tPaphi_v2-B-R35261-Map5_classI-LTR-incomp\t1\t408\n") - f.write("refTE_8\tPaphi_v2-B-R12434-Map4_classI-LTR-incomp\t1\t420\n") - f.write("refTE_9\tPaphi_v2-B-R20580-Map4_classI-LTR-incomp\t1\t426\n") - f.write("refTE_10\tPaphi_v2-B-R5129-Map3_classI-LTR-incomp\t1\t441\n") - f.close() - - def _createPathTable(self, tableName): - fileName = "dummy.path" - f = open(fileName, "w") - f.write("7615\tchunk0030\t188432\t188611\trefTE_1\t5386\t5208\t0\t174\t97.23\n") - f.write("86375\tchunk0372\t155816\t157157\trefTE_1\t2213\t3575\t0\t843\t62.89\n") - f.write("88018\tchunk0381\t52141\t53500\trefTE_1\t2191\t3575\t0\t860\t63.3\n") - f.write("110377\tchunk0473\t117281\t117518\trefTE_1\t3966\t3716\t0\t230\t97.05\n") - f.write("39621\tchunk0169\t123563\t124003\trefTE_10\t1\t441\t0\t439\t99.55\n") - f.write("544710\tchunk2778\t62387\t62625\trefTE_10\t100\t327\t0\t165\t69.09\n") - f.write("601761\tchunk4780\t441\t559\trefTE_10\t5\t123\t0\t119\t100\n") - f.write("17589\tchunk0071\t58591\t59763\trefTE_2\t5139\t6384\t0\t1150\t98.12\n") - f.write("21050\tchunk0087\t186576\t186812\trefTE_2\t3636\t3891\t0\t232\t98.31\n") - f.close() - self._iDb.createTable(tableName, "path", fileName, True) - os.remove(fileName) - - def _writeExpFile(self, fileName): - f = open(fileName, "w") - f.write("7615\tchunk0030\t188432\t188611\tPaphi_v2-B-R11932-Map16_classI-LTR-comp\t5386\t5208\t0\t174\t97.230000\n") - f.write("86375\tchunk0372\t155816\t157157\tPaphi_v2-B-R11932-Map16_classI-LTR-comp\t2213\t3575\t0\t843\t62.890000\n") - f.write("88018\tchunk0381\t52141\t53500\tPaphi_v2-B-R11932-Map16_classI-LTR-comp\t2191\t3575\t0\t860\t63.300000\n") - f.write("110377\tchunk0473\t117281\t117518\tPaphi_v2-B-R11932-Map16_classI-LTR-comp\t3966\t3716\t0\t230\t97.050000\n") - f.write("39621\tchunk0169\t123563\t124003\tPaphi_v2-B-R5129-Map3_classI-LTR-incomp\t1\t441\t0\t439\t99.550000\n") - f.write("544710\tchunk2778\t62387\t62625\tPaphi_v2-B-R5129-Map3_classI-LTR-incomp\t100\t327\t0\t165\t69.090000\n") - f.write("601761\tchunk4780\t441\t559\tPaphi_v2-B-R5129-Map3_classI-LTR-incomp\t5\t123\t0\t119\t100.000000\n") - f.write("17589\tchunk0071\t58591\t59763\tPaphi_v2-B-R2469-Map20_classI-LTR-comp\t5139\t6384\t0\t1150\t98.120000\n") - f.write("21050\tchunk0087\t186576\t186812\tPaphi_v2-B-R2469-Map20_classI-LTR-comp\t3636\t3891\t0\t232\t98.310000\n") - f.close() - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_SplicerFromAnnotation.py --- a/commons/tools/tests/Test_F_SplicerFromAnnotation.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,131 +0,0 @@\n-import unittest\n-import os\n-from commons.core.sql.DbMySql import DbMySql\n-from commons.core.utils.FileUtils import FileUtils\n-#from commons.tools.SplicerFromAnnotation import SplicerFromAnnotation\n-\n-class Test_F_SplicerFromAnnotation(unittest.TestCase):\n-\n- def setUp(self):\n- self._inFastaFileName = "%s/Tools/Splicer_inputFile.fa" % os.environ["REPET_DATA"]\n- self._outFastaFileName = "%s/Tools/Splicer_outputSplicedFile.fa.splice" % os.environ["REPET_DATA"]\n- self._refTEseqFileName = "%s/Tools/Splicer_refTEs_seq.fa" % os.environ["REPET_DATA"]\n- self.configFileName = "TEdenovo.cfg"\n- self._writeConfigFile()\n- self.pathFileName = "annotations_path"\n- self._writePathFile()\n- self._iDb = DbMySql(cfgFileName = self.configFileName)\n- self._tableName = "Splicer_inputFile_chr_allTEs_nr_noSSR_join_path"\n- self._iDb.createTable(self._tableName, "path", self.pathFileName, True)\n- self._tableName_refTEseq = "Splicer_inputFile_refTEs_seq"\n- self._iDb.createTable(self._tableName_refTEseq, "seq", self._refTEseqFileName, True)\n- \n- def tearDown(self):\n- self._iDb.dropTable(self._tableName)\n- self._iDb.dropTable(self._tableName_refTEseq)\n- self._iDb.dropTable("Splicer_inputFile_annotationIdentitySup80_path")\n- self._iDb.dropTable("Splicer_inputFile_annotationToSplice_path")\n- self._iDb.close()\n- os.remove("annotations_path")\n- os.remove("Splicer_inputFile_chr_allTEs_nr_noSSR_join_path.annotStatsPerTE.tab")\n- os.remove("Splicer_inputFile_chr_allTEs_nr_noSSR_join_path.globalAnnotStatsPerTE.txt")\n- os.remove("Splicer_inputFile_chr_allTEs_nr_noSSR_join_path.annotStatsPerTE_FullLengthCopy.fa")\n- os.remove("Splicer_inputFile_chr_allTEs_nr_noSSR_join_path.annotStatsPerTE_FullLengthCopy.txt")\n- os.remove("Splicer_inputFile_chr_allTEs_nr_noSSR_join_path.annotStatsPerTE_FullLengthFrag.fa")\n- os.remove("Splicer_inputFile_chr_allTEs_nr_noSSR_join_path.annotStatsPerTE_FullLengthFrag.txt")\n- os.remove("Splicer_inputFile_chr_allTEs_nr_noSSR_join_path.annotStatsPerTE_OneCopyAndMore.txt")\n- os.remove("Splicer_inputFile_chr_allTEs_nr_noSSR_join_path.annotStatsPerTE_OneCopyAndMore.fa")\n- os.remove("Splicer_inputFile_annotationToSplice_path.path")\n- os.remove(self.configFileName)\n-# os.remove(self.obsOutSplicedFastaFileName)\n- \n- def test_run_as_script_FLC(self):\n- expOutSplicedFastaFileName = "%s/Tools/Splicer_outputSplicedFile_FLC.fa.splice" % os.environ["REPET_DATA"]\n- self.obsOutSplicedFastaFileName = "Splicer_inputFile_FLC.fa.splice"\n- self._writeConfigFile()\n- self._writePathFile()\n- cmd = \'SplicerFromAnnotation.py -i %s -C %s -o %s -v 2\' % (self._inFastaFileName,self.configFileName, self.obsOutSplicedFastaFileName)\n- os.system(cmd)\n- \n- self.assertTrue(FileUtils.are2FilesIdentical(expOutSplicedFastaFileName, self.obsOutSplicedFastaFileName))\n- \n- def test_run_as_script_FLF(self):\n- expOutSplicedFastaFileName = "%s/Tools/Splicer_outputSplicedFile_FLF.fa.splice" % os.environ["REPET_DATA"]\n- self.obsOutSplicedFastaFileName = "Splicer_inputFile_FLF.fa.splice"\n- self._writeConfigFile()\n- self._writePathFile()\n- cmd = \'SplicerFromAnnotation.py -i %s -t 3 -C %s -o %s -v 2\' % (self._inFastaFileName,self.configFileName, self.obsOutSplicedFastaFileName)\n- os.system(cmd)\n- \n- self.assertTrue(FileUtils.are2FilesIdentical(expOutSplicedFastaFileName, self.obsOutSplicedFastaFileName))\n-\n- def _writeConfigFile(self):\n- f = open(self.configFileName, "w")\n- f.write("[repet_env]\\n")\n- f.write("repet_version: 2.0\\n")\n- f.write("repet_host: %s\\n" % os.environ["REPET_HOST"])\n- f.write("repet_user: %s\\n" % os.environ["REPET_USER"])\n- f.write("repet_pw: %s\\n" % os.environ["REPET_'..b'd\\t5551\\t5526\\t0\\t24\\t96.15\\n")\n- f.write("40\\tA_contig00033\\t19641\\t20410\\tDTX-incomp-chim_3b_Itr1_v2-L-B171-Map1_reversed\\t5533\\t4749\\t0\\t651\\t84.55\\n")\n- f.write("41\\tA_contig00033\\t19475\\t19640\\tDTX-incomp-chim_3b_Itr1_v2-L-B151-Map1_reversed\\t9514\\t9708\\t0\\t127\\t76.7025\\n")\n- f.write("42\\tA_contig00033\\t3244\\t3364\\tDTX-incomp_3b_Itr1_v2-L-B1836-Map1\\t2536\\t2405\\t6.8e-23\\t95\\t78.8462\\n")\n- f.write("43\\tA_contig00033\\t19376\\t19408\\tRLX-comp_3b_Itr1_v2-L-B1517-Map1\\t705\\t733\\t1.1e-11\\t27\\t80.4348\\n")\n- f.write("43\\tA_contig00033\\t19456\\t19474\\tRLX-comp_3b_Itr1_v2-L-B1517-Map1\\t775\\t790\\t1.1e-11\\t15\\t80.4348\\n")\n- f.write("44\\tA_contig00033\\t5494\\t5583\\tRIX-incomp-chim_3b_Itr1_v2-L-B121-Map1\\t7419\\t7507\\t4.9e-11\\t68\\t76.1905\\n")\n- f.write("45\\tA_contig00033\\t10810\\t11031\\tRLX-comp_3b_Itr1_v2-L-B2073-Map1\\t3079\\t3297\\t1e-17\\t171\\t77.2021\\n")\n- f.write("46\\tA_contig00033\\t11253\\t11406\\tRLX-comp_3b_Itr1_v2-L-B1616-Map1\\t1726\\t1569\\t0\\t120\\t78.2609\\n")\n- f.write("47\\tA_contig00033\\t11407\\t11508\\tRLX-comp_3b_Itr1_v2-L-B351-Map1_reversed\\t10133\\t10039\\t0\\t79\\t77.8689\\n")\n- f.write("48\\tA_contig00033\\t3673\\t3719\\tRLX-comp_3b_Itr1_v2-L-B228-Map1_reversed\\t13011\\t12966\\t0\\t37\\t78.629\\n")\n- f.write("49\\tA_contig00033\\t3959\\t4055\\tRLX-comp_3b_Itr1_v2-L-B134-Map1_reversed\\t1917\\t2010\\t5.5e-24\\t74\\t77.2727\\n")\n- f.write("50\\tA_contig00033\\t30505\\t37270\\tRLX-comp_3b_Itr1_v2-L-B124-Map1\\t14149\\t7383\\t0\\t6365\\t94.0818\\n")\n- f.write("51\\tA_contig00033\\t8859\\t9079\\tRLX-incomp_3b_Itr1_v2-L-B2010-Map1_reversed\\t390\\t603\\t1.9e-11\\t171\\t77.6596\\n")\n- f.write("52\\tA_contig00033\\t9080\\t9140\\tRLX-incomp_3b_Itr1_v2-L-B1720-Map1_reversed\\t1393\\t1460\\t0\\t49\\t80.8333\\n")\n- f.write("53\\tA_contig00033\\t12386\\t12435\\tRLX-incomp_3b_Itr1_v2-L-B1706-Map1\\t2678\\t2725\\t1.3e-25\\t40\\t81.1765\\n")\n- f.write("54\\tA_contig00033\\t5052\\t5096\\tRLX-incomp_3b_Itr1_v2-L-B77-Map2_reversed\\t5445\\t5402\\t6.1e-13\\t37\\t84.507\\n")\n- f.write("55\\tA_contig00033\\t14485\\t16756\\tRLX-incomp_3b_Itr1_v2-L-B965-Map1\\t4566\\t6848\\t0\\t1881\\t82.8154\\n")\n- f.write("57\\tA_contig00033\\t10229\\t10370\\tRLX-incomp_3b_Itr1_v2-L-B502-Map1_reversed\\t8598\\t8438\\t0\\t109\\t77.2727\\n")\n- f.write("59\\tA_contig00033\\t2457\\t2617\\tRLX-incomp_3b_Itr1_v2-L-B405-Map1\\t4742\\t4910\\t0\\t129\\t80.2721\\n")\n- f.write("60\\tA_contig00033\\t8071\\t8183\\tRLX-incomp_3b_Itr1_v2-L-B109-Map1\\t4413\\t4529\\t0\\t97\\t86.5979\\n")\n- f.write("61\\tA_contig00033\\t12867\\t14362\\tRXX-LARD-chim_3b_Itr1_v2-L-B1998-Map1_reversed\\t1465\\t3000\\t0\\t1283\\t85.8025\\n")\n- f.write("62\\tA_contig00033\\t90\\t256\\tRXX-LARD-chim_3b_Itr1_v2-L-B1928-Map1\\t905\\t717\\t2.5e-38\\t128\\t76.875\\n")\n- f.write("63\\tA_contig00033\\t5097\\t5249\\tRXX-LARD-chim_3b_Itr1_v2-L-B1928-Map1\\t4158\\t4017\\t4e-36\\t127\\t83.3333\\n")\n- f.write("64\\tA_contig00033\\t8689\\t8796\\tRXX-LARD-chim_3b_Itr1_v2-L-B1905-Map1\\t5584\\t5469\\t5.04467e-44\\t85\\t79.2079\\n")\n- f.write("65\\tA_contig00033\\t6800\\t6825\\tRXX-LARD-chim_3b_Itr1_v2-L-B1790-Map1_reversed\\t3426\\t3399\\t0\\t21\\t79.1667\\n")\n- f.write("66\\tA_contig00033\\t10193\\t10228\\tRLX-comp-chim_3b_Itr1_v2-L-B1760-Map1_reversed\\t1470\\t1504\\t8.7e-23\\t29\\t80.5195\\n")\n- f.write("67\\tA_contig00033\\t6542\\t6603\\tRXX-LARD-chim_3b_Itr1_v2-L-B1741-Map1_reversed\\t5509\\t5567\\t0\\t48\\t77.9412\\n")\n- f.write("69\\tA_contig00033\\t12769\\t12816\\tRLX-comp-chim_3b_Itr1_v2-L-B1518-Map1\\t2026\\t1979\\t0\\t39\\t81.25\\n")\n- f.write("70\\tA_contig00033\\t28383\\t29146\\tRLX-comp-chim_3b_Itr1_v2-L-B1494-Map1_reversed\\t999\\t1761\\t0\\t672\\t88.0282\\n")\n- f.write("71\\tA_contig00033\\t21712\\t28382\\tRLX-incomp-chim_3b_Itr1_v2-L-B1485-Map1\\t1132\\t7813\\t0\\t6011\\t90.1124\\n")\n- f.write("71\\tA_contig00033\\t20784\\t21728\\tRLX-incomp-chim_3b_Itr1_v2-L-B1485-Map1\\t159\\t1113\\t0\\t833\\t88.172 \\n")\n- f.close()\n- \n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_F_TEclassifierPE.py --- a/commons/tools/tests/Test_F_TEclassifierPE.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,87 +0,0 @@ -import os -import unittest -from commons.tools.TEclassifierPE import TEclassifierPE -from commons.core.utils.FileUtils import FileUtils -from commons.core.sql.DbFactory import DbFactory - -class Test_F_TEclassifierPE(unittest.TestCase): - - def test_run(self): - projectName = "dummy" - configFileName = "dummy.cfg" - self.writeConfigFile(configFileName, projectName) - inputFileName = "dummy.fa" - with open(inputFileName, "w") as f: - f.write(">dummySSR\n") - f.write("AGTTACCATGCCCAGCATTAACCCCCCTCAACAACCACCTCCGCCTATGAAGCCCGCCCG\n") - f.write("AGTTACCATGCCCAGCATTAACCCCCCTCAACAACCACCTCCGCCTATGAAGCCCGCCCG\n") - expFileName = "exp.classif" - with open(expFileName, "w") as f: - f.write("dummySSR\t120\t.\tok\tNA\tSSR\tNA\tCI=100; struct=(TElength: <150bps; SSRCoverage=0.00)\n") - obsFileName = "%s.classif" % projectName - statsFileName = "%s.classif_stats.txt" % projectName - analysisFileName = "%s.SSR.set" % inputFileName - - iTEclassifierPE = TEclassifierPE(inputFileName, configFileName, doClean = True) - iTEclassifierPE.run() - - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - - iDb = DbFactory.createInstance() - iDb.dropTable("%s_TR_set" % projectName) - iDb.dropTable("%s_polyA_set" % projectName) - iDb.dropTable("%s_ORF_map" % projectName) - iDb.dropTable("%s_SSR_set" % projectName) - iDb.close() - os.remove(configFileName) - os.remove(inputFileName) - os.remove(expFileName) - os.remove(obsFileName) - os.remove(statsFileName) - os.remove(analysisFileName) - - def writeConfigFile(self, fileName, projectName): - with open(fileName, "w") as f: - f.write("[repet_env]\n") - f.write("repet_host: %s\n" % os.environ["REPET_HOST"]) - f.write("repet_user: %s\n" % os.environ["REPET_USER"]) - f.write("repet_pw: %s\n" % os.environ["REPET_PW"]) - f.write("repet_db: %s\n" % os.environ["REPET_DB"]) - f.write("repet_port: %s\n" % os.environ["REPET_PORT"]) - f.write("\n") - f.write("[project]\n") - f.write("project_name: %s\n" % projectName) - f.write("project_dir: %s\n" % os.getcwd()) - f.write("\n") - f.write("[detect_features]\n") - f.write("clean: yes\n") - f.write("blast: ncbi\n") - f.write("term_rep: no\n") - f.write("polyA: no\n") - f.write("tand_rep: yes\n") - f.write("orf: no\n") - f.write("TE_HMMER: no\n") - f.write("TE_BLRtx: no\n") - f.write("TE_BLRn: no\n") - f.write("TE_BLRx: no\n") - f.write("HG_BLRn: no\n") - f.write("rDNA_BLRn: no\n") - f.write("tRNA_scan: no\n") - f.write("TRFmaxPeriod: 15\n") - f.write("\n") - f.write("[classif_consensus]\n") - f.write("max_profiles_evalue: 1e-3\n") - f.write("min_TE_profiles_coverage: 20\n") - f.write("min_HG_profiles_coverage: 75\n") - f.write("max_helitron_extremities_evalue: 1e-3\n") - f.write("min_TE_bank_coverage: 5\n") - f.write("min_HG_bank_coverage: 95\n") - f.write("min_rDNA_bank_coverage: 95\n") - f.write("min_HG_bank_identity: 90\n") - f.write("min_rDNA_bank_identity: 90\n") - f.write("min_SSR_coverage: 0.75\n") - f.write("max_SSR_size: 150\n") - f.write("clean: yes\n") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_GetMultAlignAndPhylogenyPerTErefSeq.py --- a/commons/tools/tests/Test_GetMultAlignAndPhylogenyPerTErefSeq.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,54 +0,0 @@ -import unittest -import os -import time -from commons.core.sql.DbMySql import DbMySql -from commons.tools.GetMultAlignAndPhylogenyPerTErefSeq import GetMultAlignAndPhylogenyPerTErefSeq -from commons.core.utils.FileUtils import FileUtils - - -class Test_GetMultAlignAndPhylogenyPerTErefSeq( unittest.TestCase ): - - def setUp( self ): - self.fileUtils = FileUtils() - self._inputTEFile = "dummyTE" - self._iGMAP = GetMultAlignAndPhylogenyPerTErefSeq() - self._uniqId = "%s_%s" % ( time.strftime("%Y_%m_%d_%H_%M_%S") , os.getpid() ) - self._configFileName = "dummyConfig_%s" % self._uniqId - configFile = open( self._configFileName, "w" ) - configFile.write("[repet_env]\n") - configFile.write( "repet_host: %s\n" % ( os.environ["REPET_HOST"] ) ) - configFile.write( "repet_user: %s\n" % ( os.environ["REPET_USER"] ) ) - configFile.write( "repet_pw: %s\n" % ( os.environ["REPET_PW"] ) ) - configFile.write( "repet_db: %s\n" % ( os.environ["REPET_DB"] ) ) - configFile.write( "repet_port: %s\n" % ( os.environ["REPET_PORT"] ) ) - configFile.close() - - def tearDown( self ): - os.remove( self._configFileName ) - os.remove( self._inputTEFile ) - - - def test_getNamesOfTErefSeq_fromFile_ok(self): - expTEList =["DHX-incomp-chim_Blc1_DmelChr4-L-B1-Map1_reversed", - "DT-comp_DmelChr4-B-P0.0-Map3", "RLX-incomp_Blc3_DmelChr4-L-B3-Map1"] - self._iGMAP._TErefseq = os.path.abspath(self._inputTEFile) - self.writeInputTEFile() - obsTEList = self._iGMAP.getNamesOfTErefSeq() - self.assertEqual(obsTEList, expTEList) - - def test_getNamesOfTErefSeq_from_empty_file(self): - expTEList =[] - self._iGMAP._TErefseq = os.path.abspath(self._inputTEFile) - with open(self._inputTEFile,"w") as TEFile: - TEFile.write("") - obsTEList = self._iGMAP.getNamesOfTErefSeq() - self.assertEqual(obsTEList, expTEList) - - def writeInputTEFile(self): - with open(self._inputTEFile,"w") as TEFile: - TEFile.write("""DHX-incomp-chim_Blc1_DmelChr4-L-B1-Map1_reversed -RLX-incomp_Blc3_DmelChr4-L-B3-Map1\t reverse -DT-comp_DmelChr4-B-P0.0-Map3\t""") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_GetSpecificTELibAccordingToAnnotation.py --- a/commons/tools/tests/Test_GetSpecificTELibAccordingToAnnotation.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,64 +0,0 @@ -import os -import unittest -from commons.core.utils.FileUtils import FileUtils -from commons.core.sql.DbMySql import DbMySql -from commons.tools.GetSpecificTELibAccordingToAnnotation import GetSpecificTELibAccordingToAnnotation - -class Test_GetSpecificTELibAccordingToAnnotation(unittest.TestCase): - - def test_writeFastaFileFromGiveInfoTEAnnot(self): - self._iDb = DbMySql() - fileName = "GiveInfoTEannot.txt" - self._writeGiveInfoTEannotOutput(fileName) - tableName = "projectName_refTEs_chr_seq" - self._createConsensusTable(tableName) - expFileName = "consensusExp.fa" - self._writeExpConsensusFile(expFileName) - obsFileName = "%s.fa" % os.path.splitext(fileName)[0] - iGetTElib = GetSpecificTELibAccordingToAnnotation() - iGetTElib.setTableName(tableName) - iGetTElib.writeFastaFileFromGiveInfoTEAnnot(fileName) - self._iDb.dropTable(tableName) - self._iDb.close() - self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) - os.remove(fileName) - os.remove(expFileName) - os.remove(obsFileName) - - def _writeGiveInfoTEannotOutput(self, fileName): - f = open(fileName, "w") - f.write("TE\tmaxLength\tmeanLength\tcovg\tfrags\tfullLgthFrags\tcopies\tfullLgthCopies\tmeanId\tsdId\tminId\tq25Id\tmedId\tq75Id\tmaxId\tmeanLgth\tsdLgth\tminLgth\tq25Lgth\tmedLgth\tq75Lgth\tmaxLgth\tmeanLgthPerc\tsdLgthPerc\tminLgthPerc\tq25LgthPerc\tmedLgthPerc\tq75LgthPerc\tmaxLgthPerc\n") - f.write("Atha_benchs-B-P66.38-Map20_classII-Helitron-incomp\t2150\t2150\t195657\t158\t49\t152\t52\t84.88\t8.75\t74.29\t77.16\t80.08\t96.40\t97.83\t1287.32\t776.47\t21\t570.00\t1320.50\t2077.00\t2272\t59.88\t36.11\t0.98\t26.51\t61.42\t96.60\t105.67\n") - f.write("Atha_benchs-B-R1047-Map6_classI-LINE-comp\t1653\t1653\t25423\t57\t4\t56\t4\t79.09\t8.21\t64.32\t73.63\t79.21\t83.65\t96.65\t453.98\t488.66\t29\t98.00\t244.00\t634.00\t1650\t27.46\t29.56\t1.75\t5.93\t14.76\t38.35\t99.82\n") - f.write("Atha_benchs-B-R1276-Map4_classII-Helitron-incomp\t1293\t1293\t24416\t48\t4\t47\t4\t80.31\t5.74\t75.14\t77.00\t78.25\t80.89\t99.46\t519.60\t419.01\t37\t171.00\t334.00\t838.00\t1296\t40.19\t32.41\t2.86\t13.23\t25.83\t64.81\t100.23\n") - f.close() - - def _createConsensusTable(self, tableName): - fileName = "consensus.fa" - f = open(fileName, "w") - f.write(">Atha_benchs-B-P66.38-Map20_classII-Helitron-incomp\n") - f.write("ATGCTAGCTAGCT\n") - f.write(">Atha_benchs-B-R12-Map5_classII-Helitron-comp\n") - f.write("ATGCTAGCTAGCTATGCTAGCTAGCATGCTAGCTAGCTT\n") - f.write(">Atha_benchs-B-R1047-Map6_classI-LINE-comp\n") - f.write("ATGCTAGCTAGCT\n") - f.write(">Atha_benchs-B-G56-Map5_classII-Helitron-comp\n") - f.write("ATGCTAGCTAGCTATGCTAGCTAGCT\n") - f.write(">Atha_benchs-B-R1276-Map4_classII-Helitron-incomp\n") - f.write("ATGCTAGCTAGCATGCTAGCTAGCTATGCTAGCTAGCTATGCTAGCTAGCTT\n") - f.close() - self._iDb.createTable(tableName, "seq", fileName, True) - os.remove(fileName) - - def _writeExpConsensusFile(self, fileName): - f = open(fileName, "w") - f.write(">Atha_benchs-B-P66.38-Map20_classII-Helitron-incomp\n") - f.write("ATGCTAGCTAGCT\n") - f.write(">Atha_benchs-B-R1047-Map6_classI-LINE-comp\n") - f.write("ATGCTAGCTAGCT\n") - f.write(">Atha_benchs-B-R1276-Map4_classII-Helitron-incomp\n") - f.write("ATGCTAGCTAGCATGCTAGCTAGCTATGCTAGCTAGCTATGCTAGCTAGCTT\n") - f.close() - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_OrientSequences.py --- a/commons/tools/tests/Test_OrientSequences.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,101 +0,0 @@ -import unittest -import time -import os -from commons.core.utils.FileUtils import FileUtils -from commons.tools.OrientSequences import OrientSequences - - -class Test_OrientSequences( unittest.TestCase ): - - def setUp( self ): - self._i = OrientSequences () - self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() ) - - - def tearDown( self ): - self._i = None - self._uniqId = None - - - def test_parseMummerOutput( self ): - inFileName = "dummyInFile_%s" % ( self._uniqId ) - inF = open( inFileName, "w" ) - inF.write( "> seq1\n" ) - inF.write( " seq2 20 1 20\n" ) - inF.write( "> seq1 Reverse\n" ) - inF.write( " seq2 100 1 100\n" ) - inF.write( " seq2 450 400 50\n" ) - inF.close() - dExp = { "direct": 1, "reverse": 2 } - self._i._verbose = 0 - dObs = self._i.parseMummerOutput( inFileName, "seq1", "seq2" ) - self.assertEqual( dObs, dExp ) - os.remove( inFileName ) - - - def test_getSequencesToReverseFromMatrix_2seq( self ): - lNewHeaders = [ "seq1", "seq2" ] - dMatrix = { "1_vs_2": { "direct": 1, "reverse": 2 } } - lExp = [ "seq2" ] - self._i._verbose = 0 - lObs = self._i.getSequencesToReverseFromMatrix( dMatrix, lNewHeaders ) - lExp.sort() - lObs.sort() - self.assertEqual( lObs, lExp ) - - - def test_getSequencesToReverseFromMatrix_3seq( self ): - lNewHeaders = [ "seq1", "seq2", "seq3" ] - dMatrix = { "1_vs_2": { "direct": 1, "reverse": 10 }, - "1_vs_3": { "direct": 10, "reverse": 1 }, - "2_vs_3": { "direct": 1, "reverse": 10 } } - lExp = [ "seq2" ] - self._i._verbose = 0 - lObs = self._i.getSequencesToReverseFromMatrix( dMatrix, lNewHeaders ) - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_getSequencesToReverseFromMatrix_4seq( self ): - lNewHeaders = [ "seq1", "seq2", "seq3", "seq4" ] - dMatrix = { "1_vs_2": { "direct": 10, "reverse": 1 }, - "1_vs_3": { "direct": 1, "reverse": 10 }, - "1_vs_4": { "direct": 1, "reverse": 10 }, - "2_vs_3": { "direct": 1, "reverse": 10 }, - "2_vs_4": { "direct": 1, "reverse": 10 }, - "3_vs_4": { "direct": 1, "reverse": 2 } } - lExp = [ "seq3", "seq4" ] - self._i._verbose = 0 - lObs = self._i.getSequencesToReverseFromMatrix( dMatrix, lNewHeaders ) - lExp.sort() - lObs.sort() - self.assertEqual( lExp, lObs ) - - - def test_orientInputSequences( self ): - lSeqToOrient = [ "seq1" ] - tmpFileName = "dummyInFile_%s" % ( self._uniqId ) - tmpF = open( tmpFileName, "w" ) - tmpF.write( ">seq1\n" ) - tmpF.write( "ATGCGGTGCATG\n" ) - tmpF.write( ">seq2\n" ) - tmpF.write( "GGCGAAGTGAAA\n" ) - tmpF.close() - expFileName = "dummyExpFile_%s" % ( self._uniqId ) - expF = open( expFileName, "w" ) - expF.write( ">seq1 re-oriented\n" ) - expF.write( "CATGCACCGCAT\n" ) - expF.write( ">seq2\n" ) - expF.write( "GGCGAAGTGAAA\n" ) - expF.close() - obsFileName = "dummyObsFile_%s" % ( self._uniqId ) - self._i._verbose = 0 - self._i._outFileName = obsFileName - self._i.orientInputSequences( lSeqToOrient, tmpFileName ) - self.assertTrue( FileUtils.are2FilesIdentical( obsFileName, expFileName ) ) - for f in [ tmpFileName, expFileName, obsFileName ]: - os.remove( f ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_RmvPairAlignInChunkOverlaps.py --- a/commons/tools/tests/Test_RmvPairAlignInChunkOverlaps.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,161 +0,0 @@\n-import unittest\n-import os\n-import time\n-from commons.core.coord.Align import Align\n-from commons.core.utils.FileUtils import FileUtils\n-from commons.tools.RmvPairAlignInChunkOverlaps import RmvPairAlignInChunkOverlaps\n-\n-\n-class Test_RmvPairAlignInChunkOverlaps( unittest.TestCase ):\n- \n- def setUp( self ):\n- self._i = RmvPairAlignInChunkOverlaps()\n- self._uniqId = "%s" % ( time.strftime("%Y%m%d%H%M%S") )\n-\n-\n- def tearDown( self ):\n- self._i = None\n- self._uniqId = None\n- \n- \n- def test_isPairAlignAChunkOverlap( self ):\n- a = Align()\n- a.setFromTuple( ( "chunk1", "401", "500", "chunk2", "1", "100", "0.0", "125", "97.6" ) )\n- self._i.setChunkLength( 500 )\n- self._i.setChunkOverlap( 100 )\n- obs = self._i.isPairAlignAChunkOverlap( a, 1, 2 )\n- self.assertTrue( obs )\n- a.setFromTuple( ( "chunk1", "401", "500", "chunk2", "1", "100", "0.0", "125", "97.6" ) ) # reverse subject\n- obs = self._i.isPairAlignAChunkOverlap( a, 1, 2 )\n- self.assertTrue( obs )\n- a.setFromTuple( ( "chunk1", "401", "500", "chunk3", "1", "100", "0.0", "125", "97.6" ) ) # chunk subject not contiguous\n- obs = self._i.isPairAlignAChunkOverlap( a, 1, 3 )\n- self.assertFalse( obs )\n- a.setFromTuple( ( "chunk1", "390", "500", "chunk2", "1", "110", "0.0", "125", "97.6" ) ) # hit longer than chunk overlap\n- obs = self._i.isPairAlignAChunkOverlap( a, 1, 2 )\n- self.assertFalse( obs )\n- a.setFromTuple( ( "chunk2", "1", "101", "chunk1", "401", "500", "0.0", "500", "100.0" ) ) # chunk overlap returned by PALS (+1), query > subject\n- obs = self._i.isPairAlignAChunkOverlap( a, 2, 1 )\n- self.assertTrue( obs )\n- a.setFromTuple( ( "chunk1", "401", "500", "chunk2", "1", "101", "0.0", "500", "100.0" ) ) # chunk overlap returned by PALS (+1), query < subject\n- obs = self._i.isPairAlignAChunkOverlap( a, 1, 2 )\n- self.assertTrue( obs )\n- \n- \n- def test_isPairAlignWithinAndDueToAChunkOverlap( self ):\n- a = Align()\n- a.setFromTuple( ( "chunk1", "411", "450", "chunk2", "11", "50", "0.0", "73", "97.6" ) ) # included, due to overlap\n- self._i.setChunkLength( 500 )\n- self._i.setChunkOverlap( 100 )\n- self._i._verbose = 0\n- obs = self._i.isPairAlignWithinAndDueToAChunkOverlap( a, 1, 2 )\n- self.assertTrue( obs )\n- a.setFromTuple( ( "chunk1", "411", "450", "chunk2", "50", "11", "0.0", "73", "97.6" ) ) # reverse subject\n- obs = self._i.isPairAlignWithinAndDueToAChunkOverlap( a, 1, 2 )\n- self.assertFalse( obs )\n- a.setFromTuple( ( "chunk1", "401", "500", "chunk3", "1", "100", "0.0", "125", "97.6" ) ) # chunk subject not contiguous\n- obs = self._i.isPairAlignWithinAndDueToAChunkOverlap( a, 1, 3 )\n- self.assertFalse( obs )\n- a.setFromTuple( ( "chunk1", "390", "500", "chunk2", "1", "110", "0.0", "125", "97.6" ) ) # hit longer than chunk overlap\n- obs = self._i.isPairAlignWithinAndDueToAChunkOverlap( a, 1, 2 )\n- self.assertFalse( obs )\n- a.setFromTuple( ( "chunk1", "411", "430", "chunk2", "16", "35", "0.0", "73", "97.6" ) ) # repeat within overlap...\n- self._i._margin = 2 # ... but not due to it\n- obs = self._i.isPairAlignWithinAndDueToAChunkOverlap( a, 1, 2 )\n- self.assertFalse( obs )\n- self._i._margin = 10 # ... and due to it\n- obs = self._i.isPairAlignWithinAndDueToAChunkOverlap( a, 1, 2 )\n- self.assertTrue( obs )\n- \n- \n- def test_removeChunkOverlaps( self ):\n- inFileName = "dummyInFile_%s" % ( self._uniqId )\n- inF = open( inFileName, "w" )\n- a = Align()\n- a.setFromTuple( ( "chunk1", "411", "490", "chunk2", "11", "90", "0.0", "73", "97.6" ) )\n- a.write( inF )\n- a.setFromTuple( ( "chunk1", "1", "500", "chunk1", "1", "500", "0.0"'..b'tChunkLength( 500 )\n- self._i.setChunkOverlap( 100 )\n- obsFileName = "dummyObsFile_%s" %( self._uniqId )\n- self._i.setOutputFileName( obsFileName )\n- d = self._i.removeChunkOverlaps()\n- expFileName = "dummyExpFile_%s" % ( self._uniqId )\n- expF = open( expFileName, "w" )\n- expF.write( "" )\n- expF.close()\n- self.assertTrue( FileUtils.are2FilesIdentical( obsFileName, expFileName ) )\n- for f in [ inFileName, obsFileName, expFileName ]: os.remove( f )\n- \n- \n- def test_zRunAsScript( self ):\n- cDir = os.getcwd()\n- \n- alignFileName = "dummyInFile_%s" % ( self._uniqId )\n- aF = open( alignFileName, "w" )\n- aF.write( "chunk1\\t401\\t500\\tchunk2\\t1\\t100\\t0.0\\t131\\t100.0\\n" ) # remove\n- aF.write( "chunk2\\t1\\t100\\tchunk1\\t401\\t500\\t0.0\\t132\\t100.0\\n" ) # remove\n- aF.write( "chunk1\\t401\\t500\\tchunk3\\t1\\t100\\t0.0\\t132\\t100.0\\n" ) # keep because non-contiguous chunks\n- aF.write( "chunk3\\t401\\t500\\tchunk1\\t1\\t100\\t0.0\\t132\\t100.0\\n" ) # keep because non-contiguous chunks\n- aF.write( "chunk1\\t401\\t500\\tchunk2\\t100\\t1\\t0.0\\t132\\t100.0\\n" ) # keep because within overlap but reverse\n- aF.write( "chunk1\\t431\\t490\\tchunk2\\t31\\t90\\t0.0\\t132\\t100.0\\n" ) # remove because within and due to overlap\n- aF.write( "chunk1\\t411\\t430\\tchunk2\\t61\\t90\\t0.0\\t132\\t100.0\\n" ) # keep because within but not due to overlap\n- aF.write( "chunk1\\t390\\t500\\tchunk2\\t1\\t100\\t0.0\\t132\\t100.0\\n" ) # keep because longer HSP on query\n- aF.close()\n- \n- expFileName = "dummyExpFile_%s" % ( self._uniqId )\n- expF = open( expFileName, "w" )\n- expF.write( "chunk1\\t401\\t500\\tchunk3\\t1\\t100\\t0\\t132\\t100.000000\\n" )\n- expF.write( "chunk3\\t401\\t500\\tchunk1\\t1\\t100\\t0\\t132\\t100.000000\\n" )\n- expF.write( "chunk1\\t401\\t500\\tchunk2\\t100\\t1\\t0\\t132\\t100.000000\\n" )\n- expF.write( "chunk1\\t411\\t430\\tchunk2\\t61\\t90\\t0\\t132\\t100.000000\\n" )\n- expF.write( "chunk1\\t390\\t500\\tchunk2\\t1\\t100\\t0\\t132\\t100.000000\\n" )\n- expF.close()\n- \n- obsFileName = "dummyObsFile_%s" % ( self._uniqId )\n- cmd = "RmvPairAlignInChunkOverlaps.py"\n- cmd += " -i %s" % ( alignFileName )\n- cmd += " -l 500"\n- cmd += " -o 100"\n- cmd += " -O %s" % ( obsFileName )\n- cmd += " -v 0"\n- os.system( cmd )\n- \n- self.assertTrue( FileUtils.are2FilesIdentical( obsFileName, expFileName ) )\n- for f in [ alignFileName, expFileName, obsFileName ]: os.remove( f )\n- os.chdir( cDir )\n- \n- def test_zRunAsScript_bug_to_fix(self):\n- cDir = os.getcwd()\n- \n- alignFileName = "dummyInFile_%s" % ( self._uniqId )\n- aF = open( alignFileName, "w" )\n- aF.write("chunk4\\t63217\\t63680\\tchunk5\\t195316\\t194837\\t0\\t676\\t92.71\\n")\n- aF.write("chunk4\\t63217\\t63680\\tchunk6\\t2618\\t3101\\t0\\t714\\t93.6\\n")\n- aF.write("chunk4\\t63217\\t63680\\tchunk6\\t5316\\t4837\\t0\\t676\\t92.71\\n")\n- aF.close()\n- \n- expFileName = "dummyExpFile_%s" % ( self._uniqId )\n- expF = open( expFileName, "w" )\n- expF.write("chunk4\\t63217\\t63680\\tchunk5\\t195316\\t194837\\t0\\t676\\t92.71\\n")\n- expF.write("chunk4\\t63217\\t63680\\tchunk6\\t2618\\t3101\\t0\\t714\\t93.6\\n")\n- expF.close()\n- \n- obsFileName = "dummyObsFile_%s" % ( self._uniqId )\n- cmd = "RmvPairAlignInChunkOverlaps.py"\n- cmd += " -i %s" % ( alignFileName )\n- cmd += " -l 200000"\n- cmd += " -o 10000"\n- cmd += " -O %s" % ( obsFileName )\n- cmd += " -v 0"\n- os.system( cmd )\n- \n- self.assertTrue( FileUtils.are2FilesIdentical( obsFileName, expFileName ) )\n- for f in [ alignFileName, expFileName, obsFileName ]: os.remove( f )\n- os.chdir( cDir )\n- \n-if __name__ == "__main__":\n- unittest.main()\n\\ No newline at end of file\n' |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_SpliceTEsFromGenome.py --- a/commons/tools/tests/Test_SpliceTEsFromGenome.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,57 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils -from commons.tools.SpliceTEsFromGenome import SpliceTEsFromGenome - - -class Test_SpliceTEsFromGenome( unittest.TestCase ): - - def setUp( self ): - self._i = SpliceTEsFromGenome() - - - def test_zLaunchAsScript( self ): - cDir = os.getcwd() - - coordFile = "dummyCoordFile" - coordFileHandler = open( coordFile, "w" ) - coordFileHandler.write( "TE1\tchr1\t2\t5\n" ) - coordFileHandler.write( "TE2\tchr1\t11\t15\n" ) - coordFileHandler.write( "TE3\tchr1\t12\t14\n" ) - coordFileHandler.close() - - genomeFile = "dummyGenomeFile" - genomeFileHandler = open( genomeFile, "w" ) - genomeFileHandler.write( ">chr1\n" ) - genomeFileHandler.write( "AGGGGAAAAACCCCCAAAAA\n" ) - genomeFileHandler.write( ">chr2\n" ) - genomeFileHandler.write( "TTTTTTTTTT\n" ) - genomeFileHandler.close() - - expFile = "dummyExpFile" - expFileHandler = open( expFile, "w" ) - expFileHandler.write( ">chr1\n" ) - expFileHandler.write( "AAAAAAAAAAA\n" ) - expFileHandler.write( ">chr2\n" ) - expFileHandler.write( "TTTTTTTTTT\n" ) - expFileHandler.close() - - obsFile = "dummyObsFile" - - cmd = "SpliceTEsFromGenome.py" - cmd += " -i %s" % ( coordFile ) - cmd += " -f %s" % ( "map" ) - cmd += " -g %s" % ( genomeFile ) - cmd += " -o %s" % ( obsFile ) - cmd += " -v %i" % ( 0 ) - returnStatus = os.system( cmd ) - - self.assertTrue( returnStatus == 0 ) - self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) ) - - for f in [ coordFile, genomeFile, expFile, obsFile ]: - os.remove( f ) - os.chdir( cDir ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_getCumulLengthFromTEannot.py --- a/commons/tools/tests/Test_getCumulLengthFromTEannot.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,71 +0,0 @@ -import unittest -import os -import time -from commons.core.sql.DbMySql import DbMySql -from commons.tools.getCumulLengthFromTEannot import getCumulLengthFromTEannot -from commons.core.utils.FileUtils import FileUtils - - -class Test_getCumulLengthFromTEannot( unittest.TestCase ): - - def setUp( self ): - self.fileUtils = FileUtils() - self._getCumulLengthFromTEannot = None - self._uniqId = "%s_%s" % ( time.strftime("%Y_%m_%d_%H_%M_%S") , os.getpid() ) - self._configFileName = "dummyConfig_%s" % self._uniqId - configFile = open( self._configFileName, "w" ) - configFile.write("[repet_env]\n") - configFile.write( "repet_host: %s\n" % ( os.environ["REPET_HOST"] ) ) - configFile.write( "repet_user: %s\n" % ( os.environ["REPET_USER"] ) ) - configFile.write( "repet_pw: %s\n" % ( os.environ["REPET_PW"] ) ) - configFile.write( "repet_db: %s\n" % ( os.environ["REPET_DB"] ) ) - configFile.write( "repet_port: %s\n" % ( os.environ["REPET_PORT"] ) ) - configFile.close() - - - def tearDown( self ): - os.remove( self._configFileName ) - - - def test_getAllSubjectsAsMapOfQueries( self ): - inFileName = "dummyInFile_%s" % self._uniqId - expFileName = "dummyExp_%s" % self._uniqId - for f in [inFileName,expFileName]: - if os.path.exists(f): os.remove(f) - inFile = open( inFileName, "w" ) - inFile.write( "1\tchr1\t1501\t2500\tTE1\t1\t500\t0.0\t880\t95.7\n" ) - inFile.write( "2\tchr1\t3401\t4000\tTE3\t101\t700\t0.0\t950\t97.2\n" ) - inFile.close() - inTable = "dummyPathTable_%s" % self._uniqId - db = DbMySql(cfgFileName=self._configFileName) - db.createTable(inTable, "path", inFileName) - expFile = open( expFileName, "w" ) - expFile.write( "TE1\tchr1\t1501\t2500\n" ) - expFile.write( "TE3\tchr1\t3401\t4000\n" ) - expFile.close() - self._getCumulLengthFromTEannot = getCumulLengthFromTEannot() - self._getCumulLengthFromTEannot._tableName = inTable - self._getCumulLengthFromTEannot._configFileName = self._configFileName - self._getCumulLengthFromTEannot.setAdaptatorToTable() - obsFileName = self._getCumulLengthFromTEannot.getAllSubjectsAsMapOfQueries() - self.assertTrue( self.fileUtils.are2FilesIdentical( obsFileName, expFileName ) ) - for f in [inFileName,inTable+".map",expFileName]: - if os.path.exists(f): os.remove(f) - db.dropTable(inTable) - db.close() - - - def test_getCumulLength( self ): - mergeFileName = "dummyInFile_%s" % self._uniqId - mergeFile = open( mergeFileName, "w" ) - mergeFile.write( "TE1\tchr1\t1501\t2500\n" ) - mergeFile.write( "TE3\tchr1\t4000\t3401\n" ) - mergeFile.close() - exp = 1000+600 - self._getCumulLengthFromTEannot = getCumulLengthFromTEannot() - obs = self._getCumulLengthFromTEannot.getCumulLength( mergeFileName ) - self.assertEqual( obs, exp ) - os.remove( mergeFileName ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_pathnum2id.py --- a/commons/tools/tests/Test_pathnum2id.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,84 +0,0 @@ -import unittest -import os -from commons.core.utils.FileUtils import FileUtils - - -class Test_pathnum2id( unittest.TestCase ): - - def setUp( self ): - self._inputFileName = "dummyInputPathFile" - self._outputFileName = "dummyOutputPathFile" - self._expectedFileName = "dummyExpectedPathFile" - self._prg = "pathnum2id.py" - - - def test_runWhithoutReturnAtEndOfFile( self ): - cDir = os.getcwd() - - self._createAndFillInputFileWhithoutReturnAtTheEnd() - self._createExpectedFile() - cmd = self._prg - cmd += " -i %s" % ( self._inputFileName ) - cmd += " -o %s" % ( self._outputFileName ) - os.system( cmd ) - self.assertTrue( FileUtils.are2FilesIdentical( self._outputFileName, self._expectedFileName ) ) - - os.remove( self._inputFileName ) - os.remove( self._expectedFileName ) - if os.path.exists( self._outputFileName ): - os.remove( self._outputFileName ) - os.chdir( cDir ) - - - def test_runWhithReturnAtEndOfFile( self ): - cDir = os.getcwd() - - self._createAndFillInputFileWhithReturnAtTheEnd() - self._createExpectedFile() - cmd = self._prg - cmd += " -i %s" % ( self._inputFileName ) - cmd += " -o %s" % ( self._outputFileName ) - os.system( cmd ) - self.assertTrue( FileUtils.are2FilesIdentical( self._outputFileName, self._expectedFileName ) ) - - os.remove( self._inputFileName ) - os.remove( self._expectedFileName ) - if os.path.exists( self._outputFileName ): - os.remove( self._outputFileName ) - os.chdir( cDir ) - - - def _createExpectedFile( self ): - f = open(self._expectedFileName, "w") - f.write("1\tblumeria_Grouper_590_20:NoCat_1\t91\t108\tDUF234\t5\t22\t1.5\t3.2\t0\n") - f.write("2\tblumeria_Grouper_590_20:NoCat_1\t111\t119\tDUF1414\t1\t9\t6.3\t2.9\t0\n") - f.write("3\tblumeria_Grouper_590_20:NoCat_3\t30\t37\tCPW_WPC\t1\t9\t7.7\t1.5\t0\n") - f.write("4\tblumeria_Grouper_590_20:NoCat_3\t55\t69\tHECT\t341\t355\t9.2e-06\t0.0\t0\n") - f.write("5\tblumeria_Grouper_590_20:NoCat_4\t82\t91\tDUF46\t173\t182\t0.11\t6.4\t0\n") - f.write("6\tblumeria_Grouper_590_20:NoCat_5\t121\t125\tPOC4\t276\t280\t6.3\t-1.7\t0\n") - f.close() - - - def _createAndFillInputFileWhithoutReturnAtTheEnd( self ): - f = open(self._inputFileName, "w") - f.write("1\tblumeria_Grouper_590_20:NoCat_1\t91\t108\tDUF234\t5\t22\t1.5\t3.2\t0\n") - f.write("2\tblumeria_Grouper_590_20:NoCat_1\t111\t119\tDUF1414\t1\t9\t6.3\t2.9\t0\n") - f.write("3\tblumeria_Grouper_590_20:NoCat_3\t30\t37\tCPW_WPC\t1\t9\t7.7\t1.5\t0\n") - f.write("1\tblumeria_Grouper_590_20:NoCat_3\t55\t69\tHECT\t341\t355\t9.2e-06\t0.0\t0\n") - f.write("2\tblumeria_Grouper_590_20:NoCat_4\t82\t91\tDUF46\t173\t182\t0.11\t6.4\t0\n") - f.write("3\tblumeria_Grouper_590_20:NoCat_5\t121\t125\tPOC4\t276\t280\t6.3\t-1.7\t0") - f.close() - - - def _createAndFillInputFileWhithReturnAtTheEnd( self ): - f = open(self._inputFileName, "w") - f.write("1\tblumeria_Grouper_590_20:NoCat_1\t91\t108\tDUF234\t5\t22\t1.5\t3.2\t0\n") - f.write("2\tblumeria_Grouper_590_20:NoCat_1\t111\t119\tDUF1414\t1\t9\t6.3\t2.9\t0\n") - f.write("3\tblumeria_Grouper_590_20:NoCat_3\t30\t37\tCPW_WPC\t1\t9\t7.7\t1.5\t0\n") - f.write("1\tblumeria_Grouper_590_20:NoCat_3\t55\t69\tHECT\t341\t355\t9.2e-06\t0.0\t0\n") - f.write("2\tblumeria_Grouper_590_20:NoCat_4\t82\t91\tDUF46\t173\t182\t0.11\t6.4\t0\n") - f.write("3\tblumeria_Grouper_590_20:NoCat_5\t121\t125\tPOC4\t276\t280\t6.3\t-1.7\t0\n") - f.close() - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_refalign2fasta.py --- a/commons/tools/tests/Test_refalign2fasta.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,135 +0,0 @@ -import unittest -import time -from commons.tools.refalign2fasta import * -from commons.core.utils.FileUtils import FileUtils - - -class Test_refalign2fasta( unittest.TestCase ): - - - def setUp( self ): - self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S") , os.getpid() ) - - - def tearDown( self ): - self._uniqId = None - - - def test_getAlignments( self ): - inFile = "dummyInFile_%s" % ( self._uniqId ) - inFileHandler = open( inFile, "w" ) - inFileHandler.write( "AAAACTTTT-T\tAAAA-TTTGGT\trefseq::1 chr3 1..10\n" ) # 1 insertion and 1 deletion in the copy + 1 mismatch - inFileHandler.close() - lExp = [ ( "AAAACTTTT-T", "AAAA-TTTGGT", "refseq::1 chr3 1..10" ) ] - lObs = getAlignments( inFile ) - self.assertEqual( lExp, lObs ) - os.remove( inFile ) - - - def test_getGaps_OneGap( self ): - sequence = "AAAACTTTT-T" - lExp = [ ( 9, 1 ) ] - lObs = getGaps( sequence ) - self.assertEqual( lExp, lObs ) - - - def test_getGaps_TwoGaps( self ): - sequence = "AAAA--CTTT-TT" - lExp = [ ( 4, 2 ), ( 8, 1 ) ] - lObs = getGaps( sequence ) - self.assertEqual( lExp, lObs ) - - - def test_getGapsOnRefSeq_OneSeq( self ): - lAlign = [ ( "AAAACTTTT-T", "AAAA-TTTGGT", "refseq::1 chr3 1..10" ) ] - lExp = [ [ ( 9, 1 ) ] ] - lObs = getGapsOnRefSeq( lAlign ) - self.assertEqual( lExp, lObs ) - - - def test_getGapsOnRefSeq_TwoSeq( self ): - lAlign = [ ( "AAAACTTTT-T", "AAAA-TTTGGT", "refseq::1 chr3 1..10" ) ] - lAlign.append( ( "AAAA--CTTT-TT", "AAAAGGCTTTGTT", "refseq::2 chr5 1..10" ) ) - lExp = [ [ ( 9, 1 ) ] ] - lExp.append( [ ( 4, 2 ), ( 8, 1 ) ] ) - lObs = getGapsOnRefSeq( lAlign ) - self.assertEqual( lExp, lObs ) - - - def test_insertGap( self ): - sequence = "GGGGAAAGTTG" - start = 5 - length = 3 - exp = "GGGGA---AAGTTG" - obs = insertGap( sequence, start, length ) - self.assertEqual( exp, obs ) - - - def test_insertListGaps( self ): - sequence = "GGGGAAAGTTG" - lGaps =[ ( 5, 3 ), ( 9, 1 ) ] - exp = "GGGGA---AAGT-TG" - obs = insertListGaps( sequence, lGaps ) - self.assertEqual( exp, obs ) - - - def test_insertGapsInRefSeq( self ): - lAlign = [ ( "AAAACTTTT-T", "AAAA-TTTGGT", "refseq::1 chr3 1..10" ) ] - lAlign.append( ( "AAAA--CTTT-TT", "AAAAGGCTTTGTT", "refseq::2 chr5 1..10" ) ) - lGapsOnRefSeqPerAlign = [ [ ( 9, 1 ) ] ] - lGapsOnRefSeqPerAlign.append( [ ( 4, 2 ), ( 8, 1 ) ] ) - refseqName = "reference_sequence" - lExp = ( refseqName, "AAAA--CTTT-T-T" ) - lObs = insertGapsInRefSeq( lAlign, lGapsOnRefSeqPerAlign, refseqName ) - self.assertEqual( lExp, lObs ) - - - def test_insertgap_seq( self ): - # AAAACTTTT-T (refseq) - # AAAA-TTTGGT ( copy 1) - # - # AAAA--CTTT-TT (refseq) - # AAAAGGCTTTGTT (copy 2) - lAlign = [ ( "AAAACTTTT-T", "AAAA-TTTGGT", "refseq::1 chr3 1..10" ) ] - lAlign.append( ( "AAAA--CTTT-TT", "AAAAGGCTTTGTT", "refseq::2 chr5 1..10" ) ) - lGapsOnRefSeqPerAlign = [ [ ( 9, 1 ) ] ] - lGapsOnRefSeqPerAlign.append( [ ( 4, 2 ), ( 8, 1 ) ] ) - lExp = [ ( "refseq::1 chr3 1..10", "AAAA---TTT-GGT" ) ] - lExp.append( ( "refseq::2 chr5 1..10", "AAAAGGCTTTGT-T" ) ) - lObs = insertgap_seq( lAlign, lGapsOnRefSeqPerAlign ) - self.assertEqual( lExp, lObs ) - - - def test_getSeqWithDeletions( self ): - lAlign = [ ( "AAAACTTTT-T", "AAAA-TTTGGT", "refseq::1 chr3 1..10" ) ] - lExp = [ ( "refseq::1 chr3 1..10", "AAAA-TTTGT" ) ] - lObs = getSeqWithDeletions( lAlign ) - self.assertEqual( lExp, lObs ) - - - def test_saveOnlyWithDeletions( self ): - refseqName = "Dm-B-G54-Map3" - lAlign = [ ( "AAAACTTTT-T", "AAAA-TTTGGT", "Dm-B-G54-Map3::1 chr3 1..10" ) ] - lAlign.append( ( "AAAA--CTTT-TT", "AAAAGGCTTTGTT", "Dm-B-G54-Map3::2 chr5 1..10" ) ) - - expFile = "dummyExpFile_%s" %( self._uniqId ) - expFileHandler = open( expFile, "w" ) - expFileHandler.write( ">Dm-B-G54-Map3\n" ) - expFileHandler.write( "AAAACTTTTT\n" ) - expFileHandler.write( ">Dm-B-G54-Map3::1 chr3 1..10\n" ) - expFileHandler.write( "AAAA-TTTGT\n" ) - expFileHandler.write( ">Dm-B-G54-Map3::2 chr5 1..10\n" ) - expFileHandler.write( "AAAACTTTTT\n" ) - expFileHandler.close() - - obsFile = "dummyObsFile_%s" % ( self._uniqId ) - - saveOnlyWithDeletions( lAlign, refseqName, obsFile ) - - self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) ) - - for f in [ expFile, obsFile ]: - os.remove( f ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |
b |
diff -r 0ab839023fe4 -r 3441fe98a2ba commons/tools/tests/Test_srptTableOverlap.py --- a/commons/tools/tests/Test_srptTableOverlap.py Tue Apr 30 14:33:21 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,79 +0,0 @@ -import unittest -import os -import time -import pyRepet.sql.RepetDBMySQL -from commons.core.utils.FileUtils import FileUtils -from commons.tools import srptTableOverlap - - -class Test_srptTableOverlap( unittest.TestCase ): - - def setUp(self): - self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S") , os.getpid() ) - self._db = pyRepet.sql.RepetDBMySQL.RepetDB( os.environ["REPET_USER"], - os.environ["REPET_HOST"], - os.environ["REPET_PW"], - os.environ["REPET_DB"] ) - - - def test_getOverlapAllPaths(self): - qryFileName = "dummyQryFile_%s" % ( self._uniqId ) - qryF = open( qryFileName, "w" ) - qryF.write("1\tchr1\t1301\t2000\tTE2\t11\t17\t1e-20\t30\t90.2\n") - qryF.close() - qryTable = "dummyQryTable_%s" % ( self._uniqId ) - self._db.create_table( self._db, qryTable, qryFileName, "path" ) - sbjFileName = "dummySbjFile_%s" % ( self._uniqId ) - sbjF = open( sbjFileName, "w" ) - sbjF.write("1\tchr1\t1001\t1500\tTE1\t11\t17\t1e-20\t30\t90.2\n") # 200-bp overlap: 1301-1500 - sbjF.write("2\tchr1\t1401\t1800\tTE2\t11\t17\t1e-20\t30\t90.2\n") # 300-bp overlap: 1501-1800 - sbjF.write("3\tchr1\t2001\t2100\tTE2\t11\t17\t1e-20\t30\t90.2\n") - sbjF.write("4\tchr2\t1301\t2000\tTE2\t11\t17\t1e-20\t30\t90.2\n") # different query - sbjF.close() - sbjTable = "dummySbjTable_%s" % ( self._uniqId ) - self._db.create_table( self._db, sbjTable, sbjFileName, "path" ) - exp_sum_osize, exp_sum_non_osize, exp_sum_qsize = 500, 200, 700 - obs_sum_osize, obs_sum_non_osize, obs_sum_qsize = srptTableOverlap.getOverlapAllPaths( qryTable, "path", sbjTable, "path", self._db ) - self.assertEqual( obs_sum_osize, exp_sum_osize ) - self.assertEqual( obs_sum_non_osize, exp_sum_non_osize ) - self.assertEqual( obs_sum_qsize, exp_sum_qsize ) - os.remove( qryFileName ) - os.remove( sbjFileName ) - self._db.remove_if_exist( qryTable ) - self._db.remove_if_exist( sbjTable ) - - - def test_pathOverlapByPath(self): - qryFileName = "dummyQryFile_%s" % ( self._uniqId ) - qryF = open( qryFileName, "w" ) - qryF.write("1\tchr1\t1301\t2000\tTE2\t1\t700\t1e-80\t850\t90.2\n") - qryF.write("1\tchr1\t2301\t3000\tTE2\t801\t1500\t1e-90\t930\t90.2\n") - qryF.close() - qryTable = "dummyQryTable_%s" % ( self._uniqId ) - self._db.create_table( self._db, qryTable, qryFileName, "path" ) - sbjFileName = "dummySbjFile_%s" % ( self._uniqId ) - sbjF = open( sbjFileName, "w" ) - sbjF.write("1\tchr1\t1401\t1800\tTE2\t11\t17\t1e-20\t30\t90.2\n") - sbjF.write("1\tchr1\t2101\t250000\tTE2\t11\t17\t1e-20\t30\t90.2\n") - sbjF.write("2\tchr1\t3501\t4000\tTE3\t11\t17\t1e-20\t30\t90.2\n") - sbjF.close() - sbjTable = "dummySbjTable_%s" % ( self._uniqId ) - self._db.create_table( self._db, sbjTable, sbjFileName, "path" ) - expFileName = "dummyOutFileExp_%s" % ( self._uniqId ) - expF = open( expFileName, "w" ) - expF.write("1\tTE2\t1400\t1:TE2\t1\t248300\t1100\t0.785714\t0.004430\n") - expF.close() - obsFileName = "dummyOutFileObs_%s" % ( self._uniqId ) - obsF = open( obsFileName, "w" ) - srptTableOverlap.pathOverlapByPath( qryTable, "path", sbjTable, "path", self._db, obsF ) - obsF.close() - self.assertTrue( FileUtils.are2FilesIdentical( obsFileName, expFileName ) ) - for f in [ qryFileName, sbjFileName, expFileName, obsFileName ]: - os.remove( f ) - self._db.remove_if_exist( qryTable ) - self._db.remove_if_exist( sbjTable ) - self._db.remove_if_exist( sbjTable+"_bin" ) - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file |