def _runNubiscanMotifSearch( infile, outfile, motif, mode="straight" ):
    '''run NUBISCAN to find matches to nuclear receptors.
    '''

    to_cluster = True
    job_options = "-l mem_free=8000M"

    track = re.sub( ".nubiscan.*", "", outfile )
    tmpfasta = P.getTempFilename( "." )

    if mode == "shuffled":
        nseq = writeSequencesForIntervals( track,
                                           tmpfasta,
                                           full = False,
                                           halfwidth = 100,
                                           shuffled = True )
    elif mode == "shifted":
        nseq = writeSequencesForIntervals( track,
                                           tmpfasta,
                                           full = False,
                                           halfwidth = 100,
                                           offset = -1000000)
    elif mode == "straight":
        nseq = writeSequencesForIntervals( track,
                                           tmpfasta,
                                           full = False,
                                           halfwidth = 100 )
    else:
        raise ValueError(mode % "invalid mode `%s`" )


    arrangements = ",".join( PARAMS["motifs_nubiscan_arrangements"] )

    statement = '''python %(scriptsdir)s/run_nubiscan.py \
    --qvalue=%(motifs_nubiscan_qvalue)f \
    --iterations=%(motifs_nubiscan_iterations)i \
    --arrangements=%(arrangements)s \
    --motif=%(motif)s \
    --mask=dust \
    --add-sequence \
    --log=%(outfile)s.log \
    < %(tmpfasta)s > %(outfile)s'''

    P.run()

    os.unlink( tmpfasta )

############################################################
############################################################
############################################################
# todo: fix, causes a problem: exportSequences and exportMASTControlSequences,
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_vitaminD.py/_runNubiscanMotifSearch/swapped operands of `%`