# Alignment Practical Exercises

This tutorial assumes a UNIX command line. On Linux or Mac this is built in; on Windows install Cygwin.

Look around: % cd // go to your home directory % pwd // where are we? = print working directory % ls // look around
Check if `~/bin/` is in your PATH % echo $PATH If its not there, then we need to add it: % mkdir ~/bin // make a subdirectory % nano ~/.profile // edit the startup script % less ~/.profile // examine .profile to see if your changes are there Add a line “PATH=~/bin:$PATH”. Then log out and log back in. % echo $PATH // check that ~/bin is in PATH
% cd % mkdir alignment_files % cd ~/alignment_files % wget http://www.bali-phy.org/examples.tgz // Download the files – Linux (On cygwin, first install wget). % curl -O http://www.bali-phy.org/examples.tgz // Download the files – Mac (Alternatively, download the files using your browser) % tar -zxf examples.tgz // extract the compressed archive % ls examples // look inside the new directory that was created % less examples/5S-rRNA/5d.fasta // examine the downloaded files – type q to quit % alignment-info examples/5S-rRNA/5d.fasta
% cd ~/alignment_files/examples % chmod +x fasta-flip.pl // make the file executable % cp fasta-flip.pl ~/bin // copy the file to ~/bin % which fasta-flip.pl // check to make sure its in your PATH
% cp 5S-rRNA/25.fasta . // make a copy of a file % mafft --auto 25.fasta > 25-mafft.fasta // try a simple sequence alignment % fasta-flip.pl 25.fasta | mafft --auto - | fasta-flip.pl > 25-mafft-flipped.fasta // align the sequences when flipped
% seaview 25-mafft.fasta & seaview 25-mafft-flipped.fasta & // take a look at the two alignments
% cd ~/alignment_files/examples % cp HIV/HIVSIV.fasta . // Make a copy of the file in the current directory % alignment-info HIVSIV.fasta // Some basic info about the sequences
Look at the time to perform different numbers of iterations with muscle % time muscle -maxiters 1 < HIVSIV.fasta > HIVSIV-muscle1.fasta // use a bad guide tree % time muscle -maxiters 2 < HIVSIV.fasta > HIVSIV-muscle2.fasta // obtain a better guide tree and realign % time muscle -maxiters 3 < HIVSIV.fasta > HIVSIV-muscle3.fasta // also add refinement % time muscle < HIVSIV.fasta > HIVSIV-muscle.fasta % muscle -in HIVSIV.fasta -out HIVSIV-muscle.fasta // This is the same as the previous command. Compare the first and last alignments % alignment-cat HIVSIV-muscle1.fasta --reorder-by-alignment=HIVSIV-muscle.fasta > a // reorder sequences % mv a HIVSIV-muscle1.fasta % seaview HIVSIV-muscle1.fasta & seaview HIVSIV-muscle.fasta &
Align sequences and reversed sequences with probcons % probcons HIVSIV.fasta > HIVSIV-probcons.fasta % fasta-flip.pl HIVSIV.fasta > HIVSIV-flipped.fasta % probcons HIVSIV-flipped.fasta | fasta-flip.pl > HIVSIV-probcons-flipped.fasta
Compare alignments using SuiteMSA % SuiteMSA & Choose Pixel Plot, and select `HIVSIV-probcons.fasta`. Click on Add to load a new alignment file, and choose `HIVSIV-probcons-flipped.fasta`. Click on Add to load a new alignment file, and choose `HIVSIV-muscle.fasta`. Q: What is the spatial pattern of the differences?
Construct an alignment that only contains homologies present in both mafft and probcons alignments % echo > blank % cat blank // It should print a blank line to the screen. % cat HIVSIV-muscle.fasta blank HIVSIV-probcons.fasta > two-alignments.fasta % alignment-consensus –strict=0.99 < two-alignments.fasta > consensus.fasta % seaview consensus.fasta &
Align sequences with fsa. This will take some time. % cd ~/alignment_files/examples % fsa --fast --gapfactor 0 HIVSIV.fasta > HIVSIV-fsa0.fasta & // This is similar to probcons – few gaps. % fsa --fast --gapfactor 0.5 HIVSIV.fasta > HIVSIV-fsa.fasta & // This is the default. Some gaps. Look at the alignment lengths for the different fsa parameters: % alignment-info HIVSIV-fsa0.fasta % alignment-info HIVSIV-fsa.fasta
Align a (short) 5S data set with prank % cd ~/alignment_files/examples/ % prank -d=ITS/ITS1.fasta +F % cp output.best.fas ITS1-prank1.fasta % mafft ITS/ITS1.fasta > ITS1-mafft.fasta % muscle < ITS/ITS1.fasta > ITS1-muscle.fasta % SuiteMSA & Compare ITS1-prank.fasta, ITS1-mafft.fasta, and ITS1-muscle.fasta using SuiteMSA