1 #summary Tutorial for multiple sequence alignments and phylogenetic methods in BioRuby -- under development!
9 Tutorial for multiple sequence alignments and phylogenetic methods in [http://bioruby.open-bio.org/ BioRuby].
11 Eventually, this is expected to be placed on the official !BioRuby page.
13 Author: [http://www.cmzmasek.net/ Christian M Zmasek], Sanford-Burnham Medical Research Institute
16 Copyright (C) 2011 Christian M Zmasek
19 = Multiple Sequence Alignments =
22 == Multiple Sequence Alignment Input and Output ==
24 === Reading in a Multiple Sequence Alignment from a File ===
26 The follow example shows how to read in a *ClustalW*-formatted multiple sequence alignment.
32 # Reads in a ClustalW-formatted multiple sequence alignment
33 # from a file named "infile_clustalw.aln" and stores it in 'report'.
34 report = Bio::ClustalW::Report.new(File.read('infile_clustalw.aln'))
36 # Accesses the actual alignment.
37 align = report.alignment
39 # Goes through all sequences in 'align' and prints the
40 # actual molecular sequence.
48 === Writing a Multiple Sequence Alignment to a File ===
51 The follow example shows how to writing a multiple sequence alignment in *Fasta*-format:
57 # Creates a new file named "outfile.fasta" and writes
58 # multiple sequence alignment 'align' to it in fasta format.
59 File.open('outfile.fasta', 'w') do |f|
60 f.write(align.output(:fasta))
64 The following constants a
68 * Phylip interleaved: :phylip
69 * Phylip non-interleaved: :phylipnon
74 For example, the following writes in Phylip's non-interleaved format:
76 `f.write(align.output(:phylipnon))`
79 == Calculating Multiple Sequence Alignments ==
81 !BioRuby can be used to execute a variety of multiple sequence alignment
82 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]).
83 In the following, examples for using the MAFFT and Muscle are shown.
88 The following example uses the MAFFT program to align four sequences
89 and then prints the result to the screen.
90 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.
96 # 'seqs' is either an array of sequences or a multiple sequence
97 # alignment. In general this is read in from a file as described in ?.
98 # For the purpose of this tutorial, it is generated in code.
99 seqs = ["KMLFGVVFFFGG",
105 # Calculates the alignment using the MAFFT program on the local
106 # machine with options '--maxiterate 1000 --localpair'
107 # and stores the result in 'report'.
108 options = ['--maxiterate', '1000', '--localpair']
109 mafft = Bio::MAFFT.new('path/to/mafft', options)
110 report = mafft.query_align(seqs)
112 # Accesses the actual alignment.
113 align = report.alignment
115 # Prints each sequence to the console.
116 align.each { |s| puts s.to_s }
122 * Katoh, Toh (2008) "Recent developments in the MAFFT multiple sequence alignment program" Briefings in Bioinformatics 9:286-298
124 * Katoh, Toh 2010 (2010) "Parallelization of the MAFFT multiple sequence alignment program" Bioinformatics 26:1899-1900
134 # 'seqs' is either an array of sequences or a multiple sequence
135 # alignment. In general this is read in from a file as described in ?.
136 # For the purpose of this tutorial, it is generated in code.
137 seqs = ["KMLFGVVFFFGG",
142 # Calculates the alignment using the Muscle program on the local
143 # machine with options '-quiet -maxiters 64'
144 # and stores the result in 'report'.
145 options = ['-quiet', '-maxiters', '64']
146 muscle = Bio::Muscle.new('path/to/muscle', options)
147 report = muscle.query_align(seqs)
149 # Accesses the actual alignment.
150 align = report.alignment
152 # Prints each sequence to the console.
153 align.each { |s| puts s.to_s }
159 * Edgar, R.C. (2004) "MUSCLE: multiple sequence alignment with high accuracy and high throughput" Nucleic Acids Res 32(5):1792-1797
161 === Other Programs ===
163 [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.
166 == Manipulating Multiple Sequence Alignments ==
168 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.
182 = Phylogenetic Trees =
184 == Phylogenetic Tree Input and Output ==
186 === Reading in of Phylogenetic Trees ===
196 Also, see: https://www.nescent.org/wg_phyloinformatics/BioRuby_PhyloXML_HowTo_documentation
200 === Writing of Phylogenetic Trees ===
210 Also, see: https://www.nescent.org/wg_phyloinformatics/BioRuby_PhyloXML_HowTo_documentation
214 == Phylogenetic Inference ==
216 _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..._
218 _What about pairwise distance calculation?_
222 == Maximum Likelihood ==
245 == Pairwise Distance Based Methods ==
263 == Support Calculation? ==
265 === Bootstrap Resampling? ===
270 = Analyzing Phylogenetic Trees =
275 == Gene Duplication Inference ==
277 _need to further test and then import GSoC 'SDI' work..._
285 = Putting It All Together =
287 Example of a small "pipeline"-type program running a mininal phyogenetic analysis: starting with a set of sequences and ending with a phylogenetic tree.