def save_meme(motifs_ppm_dict, output_file='found_motifs.meme'):
    "Saves the found PPMs (given as dictionary) to a file that's\n    compatible with MEME suite applications.\n    "
    import pandas as pd
    meme_string = ['MEME version 4', '', 'ALPHABET= ACGT', '', 'strands: + -', '']
    for (idx, key) in enumerate(motifs_ppm_dict.keys()):
        curr_motif = pd.DataFrame(motifs_ppm_dict[key])
        s1 = ('MOTIF ' + str(key))
        s2 = ((('letter-probability matrix: alength= ' + str(curr_motif.shape[1])) + ' w= ') + str(curr_motif.shape[0]))
        s3 = curr_motif.to_csv(sep='\t', index=False, header=False)
        meme_string = (meme_string + [s1, s2, s3])
    meme_string = '\n'.join(meme_string)
    with open(output_file, 'w') as the_file:
        the_file.write(meme_string)
    print('wrote meme list')
Saves the found PPMs (given as dictionary) to a file that's
compatible with MEME suite applications.
def save_meme(motifs_ppm_dict, output_file='found_motifs.meme'):
    "Saves the found PPMs (given as dictionary) to a file that's\n    compatible with MEME suite applications.\n    "
    import pandas as pd
    meme_string = ['MEME version 4', , 'ALPHABET= ACGT', , 'strands: + -', ]
    for (idx, key) in enumerate(motifs_ppm_dict.keys()):
        curr_motif = pd.DataFrame(motifs_ppm_dict[key])
        s1 = ('MOTIF ' + str(key))
        s2 = ((('letter-probability matrix: alength= ' + str(curr_motif.shape[1])) + ' w= ') + str(curr_motif.shape[0]))
        s3 = curr_motif.to_csv(sep='\t', index=False, header=False)
        meme_string = (meme_string + [s1, s2, s3])
    meme_string = '\n'.join(meme_string)
    with open(output_file, 'w') as the_file:
        the_file.write(meme_string)
    print('wrote meme list')