@transform( runTomTom, suffix(".tomtom"), ".motif" )
    def filterMotifs( infile, outfile ):
        '''scan motifs found with MEME against master motif using tomtom.
        '''

        infile_meme = infile[:-len(".tomtom")] + ".meme"

        selected = []
        max_pvalue = float(PARAMS["motifs_tomtom_filter_pvalue"])
        for line in open( infile, "r" ):
            if line.startswith( "#Query" ): continue
            (query_id, target_id, 
             optimal_offset, pvalue, qvalue, overlap, query_consensus,
             target_consensus, orientation) = line[:-1].split("\t")
            if max_pvalue <= float(pvalue):
                selected.append( target_id )

        E.info( "%s: keeping %i motifs" % (infile, len(selected) ) )

        PipelineMotifs.filterMotifsFromMEME( infile_meme, outfile, selected )
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_vitaminD.py/filterMotifs/swapped operands of `<=`