def runAssembler(snpRate, typeOfGen, detail, parameterRobot):
    #N, G, L, p,K,snpRate, typeOfGen, detail = 100, 100, 10000, 0.01,30,0.001, 'r', "1000"

    motherGen, reads, noisyReads = dataGen.generateData(
        typeOfGen, detail, parameterRobot)
    motherGen, reads, noisyReads = logging.rawDataLoad(
        parameterRobot.defaultFolder + "UnitTest", parameterRobot.G,
        parameterRobot.N, parameterRobot.L, "dn")

    f1 = cluster.groupIndelNoisyKmers(noisyReads, parameterRobot)

    G1, startList, f1 = graphForm.getSeqGraph(f1, noisyReads, parameterRobot)
    f2, G2 = branchClear.clearResidual(f1, G1, parameterRobot)

    G3 = bridgeResolve.resolveRepeats(f2, G2, parameterRobot)

    G4 = alignmentBridge.MSAresolve(f2, G3, noisyReads, snpRate,
                                    parameterRobot)
    #G4 = G3
    recovSeq = eulerCycle.findEC(G4)

    recovGen = readAns.reportRecovSeq(recovSeq, f2, noisyReads, parameterRobot)

    numMistakes, success = compare.subAlignCompare(recovGen, motherGen,
                                                   parameterRobot)
    #numMistakes, success = 0 , 0
    return numMistakes, success


# Target of the new code : Fast Assemble and assembly in optimal amount of information
#t0 = time.time()
#N, G, L, p,snpRate, typeOfGen, detail = 1000, 10000,200, 0.015, 0.001 ,'m', "500-300-50"
#runAssembler(N, G, L, p,snpRate, typeOfGen, detail)
#print "Time (sec) :", time.time() - t0
def runAssembler(snpRate, typeOfGen, detail,parameterRobot):
    #N, G, L, p,K,snpRate, typeOfGen, detail = 100, 100, 10000, 0.01,30,0.001, 'r', "1000"

    
    motherGen, reads, noisyReads = dataGen.generateData(typeOfGen, detail,parameterRobot)
    motherGen, reads, noisyReads = logging.rawDataLoad(parameterRobot.defaultFolder+"UnitTest",parameterRobot.G,parameterRobot.N,parameterRobot.L, "dn")

    f1 = cluster.groupIndelNoisyKmers(noisyReads,parameterRobot)
    
    G1,startList, f1 = graphForm.getSeqGraph(f1,noisyReads, parameterRobot)
    f2, G2 = branchClear.clearResidual(f1, G1,parameterRobot)
    
    G3 = bridgeResolve.resolveRepeats(f2, G2,parameterRobot)  

    G4 = alignmentBridge.MSAresolve(f2, G3, noisyReads, snpRate,parameterRobot )
    #G4 = G3 
    recovSeq = eulerCycle.findEC(G4)
    
    recovGen = readAns.reportRecovSeq(recovSeq, f2, noisyReads,parameterRobot)
    
    numMistakes, success = compare.subAlignCompare(recovGen, motherGen,parameterRobot)
    #numMistakes, success = 0 , 0 
    return numMistakes, success

# Target of the new code : Fast Assemble and assembly in optimal amount of information 
#t0 = time.time()
#N, G, L, p,snpRate, typeOfGen, detail = 1000, 10000,200, 0.015, 0.001 ,'m', "500-300-50" 
#runAssembler(N, G, L, p,snpRate, typeOfGen, detail)
#print "Time (sec) :", time.time() - t0
示例#3
0
def clusterUnitTest2():
    # Unit Test 1 : Generate 30 reads with 10 copies with noise , length being 20

    motherGen, reads, noisyReads = logging.rawDataLoad("clusterReadsUnitTest",
                                                       10, 300, 40, "dn")

    parameterRobot = logging.parameterObj()
    parameterRobot.N = 300
    parameterRobot.L = 40
    parameterRobot.G = 10000
    parameterRobot.liid = 30
    parameterRobot.K = 30
    parameterRobot.threshold = 5
    parameterRobot.p = 0.01

    parameterRobot.indel = True

    cluster.groupIndelNoisyKmers(noisyReads, parameterRobot, "fast")
def clusterUnitTest2():
   # Unit Test 1 : Generate 30 reads with 10 copies with noise , length being 20 
    
    motherGen, reads, noisyReads = logging.rawDataLoad("clusterReadsUnitTest",10,300,40,"dn")
    
    
    parameterRobot = logging.parameterObj()
    parameterRobot.N = 300 
    parameterRobot.L = 40
    parameterRobot.G = 10000
    parameterRobot.liid = 30
    parameterRobot.K = 30
    parameterRobot.threshold = 5
    parameterRobot.p = 0.01
    
    parameterRobot.indel = True

    
    cluster.groupIndelNoisyKmers(noisyReads, parameterRobot,  "fast")
def graphFormUnitTest(N, G, L, folderName =""):
    print "dataGenUnitTest"
    dummyParameters = logging.parameterObj()
    dummyParameters.defaultFolder = folderName
    dummyParameters.liid = 40
    dummyParameters.K = 40
    dummyParameters.threshold = 6
    dummyParameters.p = 0.015
    dummyParameters.indel = True


    dummyParameters.N, dummyParameters.G, dummyParameters.L, dummyParameters.p, typeOfGen, detail = N, G, L, 0.015, 'm', "500-200-50" 
    
   # motherGen, reads, noisyReads = dataGen.generateData( typeOfGen,detail,dummyParameters)    
    motherGen, reads, noisyReads = logging.rawDataLoad(dummyParameters.defaultFolder+"UnitTest",dummyParameters.G,dummyParameters.N,dummyParameters.L, "dn")
    
    returnfmapping= cluster.groupIndelNoisyKmers(noisyReads, dummyParameters,  "fast")
示例#6
0
def graphFormUnitTest(N, G, L, folderName=""):
    print "dataGenUnitTest"
    dummyParameters = logging.parameterObj()
    dummyParameters.defaultFolder = folderName
    dummyParameters.liid = 40
    dummyParameters.K = 40
    dummyParameters.threshold = 6
    dummyParameters.p = 0.015
    dummyParameters.indel = True

    dummyParameters.N, dummyParameters.G, dummyParameters.L, dummyParameters.p, typeOfGen, detail = N, G, L, 0.015, 'm', "500-200-50"

    # motherGen, reads, noisyReads = dataGen.generateData( typeOfGen,detail,dummyParameters)
    motherGen, reads, noisyReads = logging.rawDataLoad(
        dummyParameters.defaultFolder + "UnitTest", dummyParameters.G,
        dummyParameters.N, dummyParameters.L, "dn")

    returnfmapping = cluster.groupIndelNoisyKmers(noisyReads, dummyParameters,
                                                  "fast")