# Tool for cross referencing a newly found MOTIF to database of known MOTIFS

I need a tool or a function I can use in my code (R, or Python) that I can cross reference a MOTIF against known MOTIFS, a function that will take as input a MOTIF (a probability weight matrix, PWM which is a 4 by m matrix for an m-length motif) and spit out the closest -n- known motif(s). Is there such a function/tool or something close to it? Thanks much.

A popular tool for doing this is tomtom, part of the meme package.

You can try it via interactive web form here.

Once installed locally it can be run via command line

Additionally, it is available in the Bioconductor package memes as explained in Motif Comparison using TomTom

• Thanks @malcook: TomTom seems like the tool. The list of required libraries/tools to install first before tomtom can be installed is quite lengthy and even after that the installation is riddled with errors in the "make" step for me. Any hints on installation on Linux/Ubuntu? Aug 7 at 22:22
• Hi @ZebraFish - I have no hints - you are right: the meme suite is a bit of bear to install. The R/BioConductor package 'universalmotif' also addresses this purpose and is easier to install. I have not (yet?) used it for such, but have been recently impressed by its documentation specifically that on "Motif comparisons and P-values". Aug 8 at 15:24
• Thanks @malcook: After much haggling and hacking around I discovered the simple way to install TomTom is actually through "conda install -c bioconda meme". This puts a slew of meme command line executables into a conda env. directory including TomTom. This simple method of installation was unnecessarily hard to find if you are new to this field. Just looking at the meme suite webpage It's a curiosity why such simple tools (from a computational person's perspective motif search against a database of motifs is a very simple task) can be so obfuscated. Aug 8 at 17:56

Answer from @m, converted from comment:

Hi @ZebraFish Motifs package Biopython

https://biopython.org/docs/1.76/api/Bio.motifs.html