|Date:||June 10, 2010|
Suppose we want to find binding sites in our ChIP data. We can do that by extracting sequences near the peaks, and then use MEME to “discover” motifs.
We’ll make use of a handy script made available by Anton Valouev from Stanford which will take your peak/region coordinates and create a fasta file containing flanking DNA sequence for each peak/region.:
%% cd ~/ %% curl -O http://www.stanford.edu/%7evalouev/QuEST/output_genomic_regions_from_calls.pl.gz %% gunzip output_genomic_regions_from_calls.pl.gz
Then you can run:
%% perl output_genomic_regions_from_calls.pl
to see the command-line options.
To extract 200 bp around each peak call, type the following command (make sure to replace paths to all_chr.fasta and peak call file if they are different on your computer):
%% cd /mnt/myxo %% perl /root/output_genomic_regions_from_calls.pl -i ./QuEST_analysis/calls/peak_caller.ChIP.out.accepted -o ./MrpC -r ./myxo-genome.fa -w 200
you will now have files ‘MrpC.peaks.200bp.fa’ and ‘MrpC.regions.200bp.fa’.
These are the files we want to use to look for motifs.
First, download, unpack, configure, and build MEME:
%% cd %% curl -O http://meme.nbcr.net/downloads/meme_current.tar.gz %% tar zxf meme_current.tar.gz %% cd meme_4.3.0/ %% ./configure --prefix=/usr/local --with-url=http://meme.nbcr.net/meme %% make %% make install %% apt-get -y install csh
The full set of command line options for running MEME can be found here if you feel adventurous and want to play. For our purposes today, the following command should get the job done:
%% cd /mnt/myxo %% meme MrpC.peaks.200bp.fa -dna -nmotifs 5 -mod oops -revcomp -o MrpC_meme
This tells meme to use the file MrpC.peaks.200bp.fa as input. That it should use a nucleotide alphabet (amino acid is the default). It should look for a maximum of 5 motifs (1 is the default). The revcomp flag tells meme to look for motifs on both strands (default is only the forward strand) and the ‘-mod oops’ argument tells meme to expect one motif in every sequence. Finally the -o flag allows you to specify an output directory for files generated by meme.
The ouput directory will (upon completion) contain among other files a html file. You can either zip it up
%% apt-get install -y zip %% zip -r meme.zip MrpC_meme
copy it to your local computer, unzip it, and open ‘mem.html’ with a Web browser...
... OR you can configure your AWS machine to be a Web server to serve it from there. To do that, type:
%% apt-get -y install apache2
You will also need to edit your security rules on Amazon AWS to let HTTP through; this will take effect immediately so you don’t need to restart your EC2 machine.
Once you can go to ‘http://$amazon-machine-name‘ and see “it works!”, you’re good – run the following command:
%% cd /mnt/myxo %% ln -fs $PWD/MrpC_meme /var/www/
and then go visit: