def decompressBWT(inputDir, outputDir, numProcs, logger):
    '''
    This is called for taking a BWT and decompressing it back out to it's original form.  While unusual to do,
    it's included in this package for completion purposes.
    @param inputDir - the directory of the compressed BWT we plan on decompressing
    @param outputFN - the directory for the output decompressed BWT, it can be the same, we don't care
    @param numProcs - number of processes we're allowed to use
    @param logger - log all the things!
    '''
    #load it, force it to be a compressed bwt also
    msbwt = MultiStringBWT.CompressedMSBWT()
    msbwt.loadMsbwt(inputDir, logger)
    
    #make the output file
    outputFile = np.lib.format.open_memmap(outputDir+'/msbwt.npy', 'w+', '<u1', (msbwt.getTotalSize(),))
    del outputFile
    
    worksize = 1000000
    tups = [None]*(msbwt.getTotalSize()/worksize+1)
    x = 0
    
    if msbwt.getTotalSize() > worksize:
        for x in xrange(0, msbwt.getTotalSize()/worksize):
            tups[x] = (inputDir, outputDir, x*worksize, (x+1)*worksize)
        tups[-1] = (inputDir, outputDir, (x+1)*worksize, msbwt.getTotalSize())
    else:
        tups[0] = (inputDir, outputDir, 0, msbwt.getTotalSize())
        
    if numProcs > 1:
        myPool = multiprocessing.Pool(numProcs)
        rets = myPool.map(decompressBWTPoolProcess, tups)
    else:
        rets = []
        for tup in tups:
            rets.append(decompressBWTPoolProcess(tup))
def decompressBWT ( inputDir , outputDir , numProcs , logger ) : msbwt = MultiStringBWT . CompressedMSBWT ( ) msbwt . loadMsbwt ( inputDir , logger ) outputFile = np . lib . format . open_memmap ( outputDir + '/msbwt.npy' , 'w+' , '<u1' , ( msbwt . getTotalSize ( ) , ) ) del outputFile worksize = 1000000 tups = [ None ] * ( msbwt . getTotalSize ( ) / worksize + 1 ) x = 0 if msbwt . getTotalSize ( ) > worksize : for x in xrange ( 0 , msbwt . getTotalSize ( ) / worksize ) : tups [ x ] = ( inputDir , outputDir , x * worksize , ( x + 1 ) * worksize ) tups [ - 1 ] = ( inputDir , outputDir , ( x + 1 ) * worksize , msbwt . getTotalSize ( ) ) else : tups [ 0 ] = ( inputDir , outputDir , 0 , msbwt . getTotalSize ( ) ) if numProcs > 1 : myPool = multiprocessing . Pool ( numProcs ) rets = myPool . map ( decompressBWTPoolProcess , tups ) else : rets = [ ] for tup in tups : rets . append ( decompressBWTPoolProcess ( tup ) )
This is called for taking a BWT and decompressing it back out to it's original form.  While unusual to do,
    it's included in this package for completion purposes.
    @param inputDir - the directory of the compressed BWT we plan on decompressing
    @param outputFN - the directory for the output decompressed BWT, it can be the same, we don't care
    @param numProcs - number of processes we're allowed to use
    @param logger - log all the things!