Пример #1
0
def testCase(folderName):
    
    
    print "Debugging: preprocessingRepeatInfo ---------------"
    dataList = ioLib.preprocessingRepeatInfo(folderName)
    #dataList= ioLib.filterData(dataList)   
    testRepeat = dataList[2]
    # E.g. ['EcoliK12/long_repeats.txt', 3465034, 2724834, 3027]
    
    ### Plot distance between consecutive rise
    print "Debugging: findapproxrepeatLength ---------------"
    startIndex1, startIndex2, lapprox, mutationRate = approximateRepeatLib.findapproxrepeatLength(folderName+ "/oneLine.fasta", folderName+ "/oneLine2.fasta" , testRepeat[1], testRepeat[2], testRepeat[3])
    # E.g. [2724708 3464908 3154 0.000317057704502]
    testApproxRepeat = [startIndex1, startIndex2, lapprox, mutationRate,testRepeat[3], testRepeat[1], testRepeat[2]]
    print "Debugging: plotdetailedPatternForTopRepeats2 ---------------"
    #approximateRepeatLib.plotdetailedPatternForTopRepeats(folderName, 1, [testApproxRepeat],inverted = False)
    approximateRepeatLib.plotdetailedPatternForTopRepeats(folderName, 1, [testApproxRepeat],inverted = False)

    ### Plot sliding hamming window
    print "Debugging: extractApproxRepeatStatistics ---------------"    
    plt.figure(3)    
    graphPlottingLib.plotPatternBeyondRepeat( folderName+ "/oneLine.fasta",folderName+ "/oneLine2.fasta",  startIndex1 - int( 1.5*lapprox), startIndex1 - int( 1.5*lapprox),  startIndex2 - int( 1.5*lapprox) ,  startIndex2 - int( 1.5*lapprox) ,int(lapprox*5/10))
    
    ### Outputing values
    print "Debugging: reportPatternBeyondRepeat ---------------"  
    approximateRepeatLib.reportPatternBeyondRepeat(folderName+ "/oneLine.fasta",folderName+ "/oneLine2.fasta",  startIndex1 - int( 1.5*lapprox), startIndex1 - int( 1.5*lapprox),  startIndex2 - int( 1.5*lapprox) ,  startIndex2 - int( 1.5*lapprox) ,int(lapprox*5/10),folderName+"\outputResult.txt")
      
    ### Edit distance Plot    
    print "Debugging: findapproxrepeatLengthEditDistance ---------------"  
    plt.figure(4)
    approximateRepeatLib.findapproxrepeatLengthEditDistance(folderName+ "/oneLine.fasta",folderName+ "/oneLine2.fasta", testRepeat[1],testRepeat[2], testRepeat[3])
    ### 

    plt.show()	
Пример #2
0
def combinedStatisticsPlot(folderName,topX,typeOferror):
    dataList = ioLib.preprocessingRepeatInfo(folderName)
    

    metaListForInterleaveRepeat, metaListForTripleRepeat = differentTypeOfRepeatLib.findDifferentTypesOfRepeat(dataList,topX)
    
    
    maxInterleaveRepeatLength = metaListForInterleaveRepeat[0][-1]
    maxTripleRepeatLength = metaListForTripleRepeat[0][-1]
    
    print "maxInterleaveRepeatLength,maxTripleRepeatLength", maxInterleaveRepeatLength,maxTripleRepeatLength  

    listOfRepeat = ioLib.extractExactRepeats(folderName)
    print listOfRepeat
    listOfApproxRepeat = approximateRepeatLib.clusteringRepeatMain(folderName, listOfRepeat, topX, 'r', typeOferror , -1, [])


    for eachitem in listOfApproxRepeat:
        #startIndex1, startIndex2, lapprox, mutationRate,lengthOfExactRepeat, start1, start2
        if eachitem[2] < eachitem[4]:
            print "Errorrrrrrrrrrrrrrrr", eachitem[2] , eachitem[4]
        eachitem.insert(0,'eee')
     
    print "listOfApproxRepeat", listOfApproxRepeat
    metaListForInterleaveRepeat, metaListForTripleRepeat = differentTypeOfRepeatLib.findDifferentTypesOfRepeat(listOfApproxRepeat,topX)    
    print "metaListForInterleaveRepeat, metaListForTripleRepeat",metaListForInterleaveRepeat, metaListForTripleRepeat
    
    listOfInterleaveRepeat = differentTypeOfRepeatLib.extractShorterCopy(metaListForInterleaveRepeat)
    
    if len(listOfInterleaveRepeat) > 0:
        approximateRepeatLib.clusteringRepeatMain(folderName, listOfInterleaveRepeat, topX, 'i',typeOferror, maxInterleaveRepeatLength,listOfApproxRepeat)

    listOfTripleRepeat = differentTypeOfRepeatLib.extractShorterCopy(metaListForTripleRepeat)
    
    if len(listOfTripleRepeat) > 0:
        approximateRepeatLib.clusteringRepeatMain(folderName, listOfTripleRepeat, topX, 't',typeOferror,maxTripleRepeatLength,listOfApproxRepeat)

    '''