예제 #1
0
def runWorkflow_multipleExamples(inputGenFunction,
                                 testNumber=1, 
                                 testRestrictions=(TestStatus.TEST_SHORT, TestStatus.TEST_MEDIUM, \
                                                   TestStatus.TEST_LONG, TestStatus.TEST_VERY_LONG,),
                               inverseTestRestrictions=False,
                               batchSystem="single_machine",
                               buildAvgs=False, buildReference=False,
                               buildReferenceSequence=False,
                               buildCactusPDF=False, buildAdjacencyPDF=False,
                               buildReferencePDF=False,
                               makeCactusTreeStats=False, makeMAFs=False,
                               configFile=None, buildJobTreeStats=False):
    """A wrapper to run a number of examples.
    """
    if (inverseTestRestrictions and TestStatus.getTestStatus() not in testRestrictions) or \
        (not inverseTestRestrictions and TestStatus.getTestStatus() in testRestrictions):
        for test in xrange(testNumber): 
            tempDir = getTempDirectory(os.getcwd())
            sequences, newickTreeString = inputGenFunction(regionNumber=test, tempDir=tempDir)
            runWorkflow_TestScript(sequences, newickTreeString,
                                   batchSystem=batchSystem,
                                   buildAvgs=buildAvgs, buildReference=buildReference, 
                                   buildCactusPDF=buildCactusPDF, buildAdjacencyPDF=buildAdjacencyPDF,
                                   makeCactusTreeStats=makeCactusTreeStats, makeMAFs=makeMAFs, configFile=configFile,
                                   buildJobTreeStats=buildJobTreeStats)
            system("rm -rf %s" % tempDir)
            logger.info("Finished random test %i" % test)
예제 #2
0
def runWorkflow_multipleExamples(inputGenFunction,
                                 testNumber=1,
                                 testRestrictions=(TestStatus.TEST_SHORT, TestStatus.TEST_MEDIUM, \
                                                   TestStatus.TEST_LONG, TestStatus.TEST_VERY_LONG,),
                               inverseTestRestrictions=False,
                               batchSystem="single_machine",
                               buildAvgs=False, buildReference=False,
                               buildReferenceSequence=False,
                               buildCactusPDF=False, buildAdjacencyPDF=False,
                               buildReferencePDF=False,
                               makeCactusTreeStats=False, makeMAFs=False,
                               configFile=None, buildJobTreeStats=False):
    """A wrapper to run a number of examples.
    """
    if (inverseTestRestrictions and TestStatus.getTestStatus() not in testRestrictions) or \
        (not inverseTestRestrictions and TestStatus.getTestStatus() in testRestrictions):
        for test in xrange(testNumber):
            tempDir = getTempDirectory(os.getcwd())
            sequences, newickTreeString = inputGenFunction(regionNumber=test,
                                                           tempDir=tempDir)
            runWorkflow_TestScript(sequences,
                                   newickTreeString,
                                   batchSystem=batchSystem,
                                   buildAvgs=buildAvgs,
                                   buildReference=buildReference,
                                   buildCactusPDF=buildCactusPDF,
                                   buildAdjacencyPDF=buildAdjacencyPDF,
                                   makeCactusTreeStats=makeCactusTreeStats,
                                   makeMAFs=makeMAFs,
                                   configFile=configFile,
                                   buildJobTreeStats=buildJobTreeStats)
            system("rm -rf %s" % tempDir)
            logger.info("Finished random test %i" % test)
예제 #3
0
파일: test.py 프로젝트: sanboissel/cactus
def runWorkflow_multipleExamples(inputGenFunction,
                                 testNumber=1,
                                 testRestrictions=(TestStatus.TEST_SHORT, TestStatus.TEST_MEDIUM, \
                                                   TestStatus.TEST_LONG, TestStatus.TEST_VERY_LONG,),
                                 inverseTestRestrictions=False,
                                 batchSystem="single_machine",
                                 buildAvgs=False, buildReference=False,
                                 configFile=None, buildToilStats=False,
                                 useConstraints=False,
                                 cactusWorkflowFunction=runCactusWorkflow,
                                 buildHal=False,
                                 buildFasta=False,
                                 progressive=False):
    """A wrapper to run a number of examples.
    """
    if (inverseTestRestrictions and TestStatus.getTestStatus() not in testRestrictions) or \
        (not inverseTestRestrictions and TestStatus.getTestStatus() in testRestrictions):
        for test in xrange(testNumber):
            tempDir = getTempDirectory(os.getcwd())
            if useConstraints:
                sequences, newickTreeString, constraints = inputGenFunction(
                    regionNumber=test, tempDir=tempDir)
            else:
                sequences, newickTreeString = inputGenFunction(
                    regionNumber=test, tempDir=tempDir)
                constraints = None
            runWorkflow_TestScript(
                sequences,
                newickTreeString,
                outputDir=tempDir,
                batchSystem=batchSystem,
                buildAvgs=buildAvgs,
                buildReference=buildReference,
                buildHal=buildHal,
                buildFasta=buildFasta,
                configFile=configFile,
                buildToilStats=buildToilStats,
                constraints=constraints,
                progressive=progressive,
                cactusWorkflowFunction=cactusWorkflowFunction)
            system("rm -rf %s" % tempDir)
            logger.info("Finished random test %i" % test)
예제 #4
0
 def testSimulation(self):
     if TestStatus.getTestStatus() == TestStatus.TEST_LONG:
         blanchettePath = TestStatus.getPathToDataSets() + "/blanchettesSimulation/00.job"
         outputPath = TestStatus.getPathToDataSets() + "/ortheus/blanchettesSimulationTest"
         treeString = "(((((((((((((human:0.006969,chimp:0.009727):0.025291,((baboon:0.008968):0.011019):0.024581):0.023649):0.066673):0.018405,((rat:0.081244,mouse:0.072818):0.238435):0.021892):0.02326,(((cow:0.164728,(cat:0.109852,dog:0.107805):0.049576):0.004663):0.010883):0.033242):0.028346):0.016015):0.226853):0.063898):0.126639):0.119814):0.16696);"
         seqFiles = ["HUMAN", "CHIMP", "BABOON", "RAT", "MOUSE", "COW", "CAT", "DOG"]
         seqFiles = [blanchettePath + "/" + i for i in seqFiles]
         outputFile = outputPath + "/outputJob1.mfa"
         command = "Ortheus.py -e %s -d '%s' -f %s -j -a -b" % (" ".join(seqFiles), treeString, outputFile)
         print "running command", command
         system(command)
예제 #5
0
def runWorkflow_multipleExamples(inputGenFunction,
                                 testNumber=1, 
                                 testRestrictions=(TestStatus.TEST_SHORT, TestStatus.TEST_MEDIUM, \
                                                   TestStatus.TEST_LONG, TestStatus.TEST_VERY_LONG,),
                                 inverseTestRestrictions=False,
                                 batchSystem="single_machine",
                                 buildAvgs=False, buildReference=False,
                                 configFile=None, buildJobTreeStats=False, 
                                 useConstraints=False,
                                 cactusWorkflowFunction=runCactusWorkflow,
                                 buildHal=False,
                                 buildFasta=False,
                                 progressive=False):
    """A wrapper to run a number of examples.
    """
    if (inverseTestRestrictions and TestStatus.getTestStatus() not in testRestrictions) or \
        (not inverseTestRestrictions and TestStatus.getTestStatus() in testRestrictions):
        for test in xrange(testNumber): 
            tempDir = getTempDirectory(os.getcwd())
            if useConstraints:
                sequences, newickTreeString, constraints = inputGenFunction(regionNumber=test, tempDir=tempDir)
            else:
                sequences, newickTreeString = inputGenFunction(regionNumber=test, tempDir=tempDir)
                constraints = None
            experiment = runWorkflow_TestScript(sequences, newickTreeString,
                                                outputDir=tempDir,
                                                batchSystem=batchSystem,
                                                buildAvgs=buildAvgs, buildReference=buildReference, 
                                                buildHal=buildHal,
                                                buildFasta=buildFasta,
                                                configFile=configFile,
                                                buildJobTreeStats=buildJobTreeStats,
                                                constraints=constraints,
                                                progressive=progressive,
                                                cactusWorkflowFunction=cactusWorkflowFunction)
            experiment.cleanupDb()
            system("rm -rf %s" % tempDir)
            logger.info("Finished random test %i" % test)
예제 #6
0
    def testAndyYatesFirstExample(self):
        if TestStatus.getTestStatus() == TestStatus.TEST_LONG:
            filePath = TestStatus.getPathToDataSets(
            ) + "/ortheus/andyYatesExample1"
            seqs = "seq1.fa seq2.fa seq3.fa seq4.fa seq5.fa seq6.fa seq7.fa seq8.fa seq9.fa seq10.fa seq11.fa \
            seq12.fa seq13.fa seq14.fa seq15.fa seq16.fa seq17.fa seq18.fa seq19.fa seq20.fa seq21.fa seq22.fa seq23.fa seq24.fa seq25.fa seq26.fa \
            seq27.fa seq28.fa seq29.fa seq30.fa seq31.fa seq32.fa seq33.fa seq34.fa seq35.fa seq36.fa"

            seqs = " ".join(["%s/%s" % (filePath, i) for i in seqs.split()])
            command = 'Ortheus.py -l "#-j 0 -e" -e %s -z \
            "(((1012:0.0112,1051:0.0119):0.0026,(1055:0.0015,1052:0.0018):0.0370):0.0022,1054:0.0108,1053:0.0116);" \
            -A 1054 1051 1054 1054 1053 1012 1054 1054 1053 1054 1051 1054 1051 1051 1053 1051 1051 1012 1051 1054 1012 1054 1053 1051 1053 \
            1054 1054 1051 1012 1012 1054 1053 1053 1012 1054 1051 -f %s/output.16163.mfa -g %s/output.16163.tree-a -k "# -A" -m "java -Xmx1800m -Xms1800m" -a -b'                                                                                                                                                                   % \
            (seqs, filePath, filePath)
            print "running command", command
            system(command)
예제 #7
0
 def testSimulation(self):
     if TestStatus.getTestStatus() == TestStatus.TEST_LONG:
         blanchettePath = TestStatus.getPathToDataSets(
         ) + "/blanchettesSimulation/00.job"
         outputPath = TestStatus.getPathToDataSets(
         ) + "/ortheus/blanchettesSimulationTest"
         treeString = '(((((((((((((human:0.006969,chimp:0.009727):0.025291,((baboon:0.008968):0.011019):0.024581):0.023649):0.066673):0.018405,((rat:0.081244,mouse:0.072818):0.238435):0.021892):0.02326,(((cow:0.164728,(cat:0.109852,dog:0.107805):0.049576):0.004663):0.010883):0.033242):0.028346):0.016015):0.226853):0.063898):0.126639):0.119814):0.16696);'
         seqFiles = [
             "HUMAN", "CHIMP", "BABOON", "RAT", "MOUSE", "COW", "CAT", "DOG"
         ]
         seqFiles = [blanchettePath + "/" + i for i in seqFiles]
         outputFile = outputPath + "/outputJob1.mfa"
         command = "Ortheus.py -e %s -d '%s' -f %s -j -a -b" % \
         (" ".join(seqFiles), treeString, outputFile)
         print "running command", command
         system(command)
예제 #8
0
 def testAndyYatesFirstExample(self):
     if TestStatus.getTestStatus() == TestStatus.TEST_LONG:
         filePath = TestStatus.getPathToDataSets() + "/ortheus/andyYatesExample1"
         seqs = "seq1.fa seq2.fa seq3.fa seq4.fa seq5.fa seq6.fa seq7.fa seq8.fa seq9.fa seq10.fa seq11.fa \
         seq12.fa seq13.fa seq14.fa seq15.fa seq16.fa seq17.fa seq18.fa seq19.fa seq20.fa seq21.fa seq22.fa seq23.fa seq24.fa seq25.fa seq26.fa \
         seq27.fa seq28.fa seq29.fa seq30.fa seq31.fa seq32.fa seq33.fa seq34.fa seq35.fa seq36.fa"
         seqs = " ".join(["%s/%s" % (filePath, i) for i in seqs.split()])
         command = (
             'Ortheus.py -l "#-j 0 -e" -e %s -z \
         "(((1012:0.0112,1051:0.0119):0.0026,(1055:0.0015,1052:0.0018):0.0370):0.0022,1054:0.0108,1053:0.0116);" \
         -A 1054 1051 1054 1054 1053 1012 1054 1054 1053 1054 1051 1054 1051 1051 1053 1051 1051 1012 1051 1054 1012 1054 1053 1051 1053 \
         1054 1054 1051 1012 1012 1054 1053 1053 1012 1054 1051 -f %s/output.16163.mfa -g %s/output.16163.tree-a -k "# -A" -m "java -Xmx1800m -Xms1800m" -a -b'
             % (seqs, filePath, filePath)
         )
         print "running command", command
         system(command)
예제 #9
0
 def testENm001(self):
     if TestStatus.getTestStatus() == TestStatus.TEST_VERY_LONG:
         encodePath = TestStatus.getPathToDataSets() + "/MAY-2005/ENm001"
         outputPath = TestStatus.getPathToDataSets() + "/ortheus/encodeTest"
         #treeString = '(((((((((((((human:0.006969,chimp:0.009727):0.025291,((baboon:0.008968):0.011019):0.024581):0.023649):0.066673):0.018405,((rat:0.081244,mouse:0.072818):0.238435):0.021892):0.02326,(((cow:0.164728,(cat:0.109852,dog:0.107805):0.049576):0.004663):0.010883):0.033242):0.028346):0.016015):0.226853):0.063898):0.126639):0.119814):0.16696);'
         treeString = '((((human:0.006969,chimp:0.009727):0.025291,baboon:0.044568):0.108727,(rat:0.081244,mouse:0.072818):0.260327):0.02326,(cow:0.164728,(cat:0.109852,dog:0.107805):0.049576):0.048788):0.749525;'
         seqFiles = [
             "human.ENm001.fa", "chimp.ENm001.fa", "baboon.ENm001.fa",
             "rat.ENm001.fa", "mouse.ENm001.fa", "cow.ENm001.fa",
             "cat.ENm001.fa", "dog.ENm001.fa"
         ]
         seqFiles = [encodePath + "/" + i for i in seqFiles]
         outputFile = outputPath + "/outputENm001.mfa"
         command = "Ortheus.py -e %s -d '%s' -f %s -j -a -b" % \
         (" ".join(seqFiles), treeString, outputFile)
         print "running command", command
         system(command)
예제 #10
0
 def testENm001(self):
     if TestStatus.getTestStatus() == TestStatus.TEST_VERY_LONG:
         encodePath = TestStatus.getPathToDataSets() + "/MAY-2005/ENm001"
         outputPath = TestStatus.getPathToDataSets() + "/ortheus/encodeTest"
         # treeString = '(((((((((((((human:0.006969,chimp:0.009727):0.025291,((baboon:0.008968):0.011019):0.024581):0.023649):0.066673):0.018405,((rat:0.081244,mouse:0.072818):0.238435):0.021892):0.02326,(((cow:0.164728,(cat:0.109852,dog:0.107805):0.049576):0.004663):0.010883):0.033242):0.028346):0.016015):0.226853):0.063898):0.126639):0.119814):0.16696);'
         treeString = "((((human:0.006969,chimp:0.009727):0.025291,baboon:0.044568):0.108727,(rat:0.081244,mouse:0.072818):0.260327):0.02326,(cow:0.164728,(cat:0.109852,dog:0.107805):0.049576):0.048788):0.749525;"
         seqFiles = [
             "human.ENm001.fa",
             "chimp.ENm001.fa",
             "baboon.ENm001.fa",
             "rat.ENm001.fa",
             "mouse.ENm001.fa",
             "cow.ENm001.fa",
             "cat.ENm001.fa",
             "dog.ENm001.fa",
         ]
         seqFiles = [encodePath + "/" + i for i in seqFiles]
         outputFile = outputPath + "/outputENm001.mfa"
         command = "Ortheus.py -e %s -d '%s' -f %s -j -a -b" % (" ".join(seqFiles), treeString, outputFile)
         print "running command", command
         system(command)