1 #summary Tutorial for multiple sequence alignments and phylogenetic methods in BioRuby -- under development!
7 Tutorial for multiple sequence alignments and phylogenetic methods in !BioRuby -- under development!
9 Author: [http://www.cmzmasek.net/ Christian M Zmasek], Sanford-Burnham Medical Research Institute
13 Copyright (C) 2011 Christian M Zmasek
16 = Multiple Sequence Alignments =
19 == Multiple Sequence Alignment Input and Output ==
21 === Reading in a Multiple Sequence Alignment from a File ===
23 Reading in a clustalw formatted multiple sequence alignment:
29 # Reads in a clustalw formatted multiple sequence alignment
30 # from a file named "infile_clustalw.aln" and stores it in 'report'.
31 report = Bio::ClustalW::Report.new(File.read('infile_clustalw.aln'))
33 # Accesses the actual alignment.
34 align = report.alignment
36 # Goes through all sequences in 'align' and prints the
37 # actual molecular sequence.
45 === Writing a Multiple Sequence Alignment to a File ===
47 Writing a multiple sequence alignment in fasta format:
53 # Creates a new file named "outfile.fasta" and writes
54 # multiple sequence alignment 'align' to it in fasta format.
55 File.open('outfile.fasta', 'w') do |f|
56 f.write(align.output(:fasta))
61 Writing a multiple sequence alignment in clustalw format:
67 # Creates a new file named "outfile.aln" and writes
68 # multiple sequence alignment 'align' to it in clustal format.
69 File.open('outfile.aln', 'w') do |f|
70 f.write(align.output(:clustal))
75 == Calculating Multiple Sequence Alignments ==
77 !BioRuby can be used to execute a variety of multiple sequence alignment
78 programs (such as [http://mafft.cbrc.jp/alignment/software/ MAFFT], [http://probcons.stanford.edu/ Probcons], [http://www.clustal.org/ ClustalW], [http://www.drive5.com/muscle/ Muscle], and [http://www.tcoffee.org/Projects_home_page/t_coffee_home_page.html T-Coffee]).
79 In the following, examples for using the MAFFT and Muscle are shown.
84 The following example uses the MAFFT program to align four sequences
85 and then prints the result to the screen.
86 Please note that if the path to the MAFFT executable is properly set `mafft=Bio::MAFFT.new(options)` can be used instead of explicitly indicating the path as in the example.
92 # 'seqs' is either an array of sequences or a multiple sequence
93 # alignment. In general this is read in from a file as described in ?.
94 # For the purpose of this tutorial, it is generated in code.
95 seqs = ["KMLFGVVFFFGG",
101 # Calculates the alignment using the MAFFT program on the local
102 # machine with options '--maxiterate 1000 --localpair'
103 # and stores the result in 'report'.
104 options = ['--maxiterate', '1000', '--localpair']
105 mafft = Bio::MAFFT.new('path/to/mafft', options)
106 report = mafft.query_align(seqs)
108 # Accesses the actual alignment.
109 align = report.alignment
111 # Prints each sequence to the console.
112 align.each { |s| puts s.to_s }
118 * Katoh, Toh (2008) "Recent developments in the MAFFT multiple sequence alignment program" Briefings in Bioinformatics 9:286-298
120 * Katoh, Toh 2010 (2010) "Parallelization of the MAFFT multiple sequence alignment program" Bioinformatics 26:1899-1900
130 # 'seqs' is either an array of sequences or a multiple sequence
131 # alignment. In general this is read in from a file as described in ?.
132 # For the purpose of this tutorial, it is generated in code.
133 seqs = ["KMLFGVVFFFGG",
138 # Calculates the alignment using the Muscle program on the local
139 # machine with options '-quiet -maxiters 64'
140 # and stores the result in 'report'.
141 options = ['-quiet', '-maxiters', '64']
142 muscle = Bio::Muscle.new('path/to/muscle', options)
143 report = muscle.query_align(seqs)
145 # Accesses the actual alignment.
146 align = report.alignment
148 # Prints each sequence to the console.
149 align.each { |s| puts s.to_s }
155 * Edgar, R.C. (2004) "MUSCLE: multiple sequence alignment with high accuracy and high throughput" Nucleic Acids Res 32(5):1792-1797
157 === Other Programs ===
159 [http://probcons.stanford.edu/ Probcons], [http://www.clustal.org/ ClustalW], and [http://www.tcoffee.org/Projects_home_page/t_coffee_home_page.html T-Coffee] can be used in the same manner as the programs above.
162 == Manipulating Multiple Sequence Alignments ==
164 Oftentimes, multiple sequence to be used for phylogenetic inference are 'cleaned up' in some manner. For instance, some researchers prefer to delete columns with more than 50% gaps. The following code is an example of how to do that in !BioRuby.
178 = Phylogenetic Trees =
180 == Phylogenetic Tree Input and Output ==
182 === Reading in of Phylogenetic Trees ===
192 Also, see: https://www.nescent.org/wg_phyloinformatics/BioRuby_PhyloXML_HowTo_documentation
196 === Writing of Phylogenetic Trees ===
206 Also, see: https://www.nescent.org/wg_phyloinformatics/BioRuby_PhyloXML_HowTo_documentation
210 == Phylogenetic Inference ==
212 _Currently !BioRuby does not contain wrappers for phylogenetic inference programs, thus I am progress of writing a RAxML wrapper followed by a wrapper for FastME..._
214 _What about pairwise distance calculation?_
218 == Maximum Likelihood ==
241 == Pairwise Distance Based Methods ==
259 == Support Calculation? ==
261 === Bootstrap Resampling? ===
266 = Analyzing Phylogenetic Trees =
271 == Gene Duplication Inference ==
273 _need to further test and then import GSoC 'SDI' work..._