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!
11 = Multiple Sequence Alignments =
14 == Multiple Sequence Alignment Input and Output ==
16 === Reading in a Multiple Sequence Alignment from a File ===
18 Reading in a clustalw formatted multiple sequence alignment:
24 # Reads in a clustalw formatted multiple sequence alignment
25 # from a file named "infile_clustalw.aln" and stores it in 'report'.
26 report = Bio::ClustalW::Report.new(File.read('infile_clustalw.aln'))
28 # Accesses the actual alignment.
29 align = report.alignment
31 # Goes through all sequences in 'align' and prints the
32 # actual molecular sequence.
40 === Writing a Multiple Sequence Alignment to a File ===
42 Writing a multiple sequence alignment in fasta format:
48 # Creates a new file named "outfile.fasta" and writes
49 # multiple sequence alignment 'align' to it in fasta format.
50 File.open('outfile.fasta', 'w') do |f|
51 f.write(align.output(:fasta))
56 Writing a multiple sequence alignment in clustalw format:
62 # Creates a new file named "outfile.aln" and writes
63 # multiple sequence alignment 'align' to it in clustal format.
64 File.open('outfile.aln', 'w') do |f|
65 f.write(align.output(:clustal))
70 == Calculating Multiple Sequence Alignments ==
72 !BioRuby can be used to execute a variety of multiple sequence alignment
73 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]).
74 In the following, examples for using the MAFFT and Muscle are shown.
83 # 'seqs' is either an array of sequences or a multiple sequence
84 # alignment. In general this is read in from a file as described in ?.
85 # For the purpose of this tutorial, it is generated in code.
86 seqs = ["KMLFGVVFFFGG",
92 # Calculates the alignment using the MAFFT program on the local
93 # machine with options '--maxiterate 1000 --localpair'
94 # and stores the result in 'report'.
95 options = ['--maxiterate', '1000', '--localpair']
96 mafft = Bio::MAFFT.new('path/to/mafft', options)
97 report = mafft.query_align(seqs)
99 # Accesses the actual alignment.
100 align = report.alignment
102 # Prints each sequence to the console.
103 align.each { |s| puts s.to_s }
109 * Katoh, Toh (2008) "Recent developments in the MAFFT multiple sequence alignment program" Briefings in Bioinformatics 9:286-298
111 * Katoh, Toh 2010 (2010) "Parallelization of the MAFFT multiple sequence alignment program" Bioinformatics 26:1899-1900
121 # 'seqs' is either an array of sequences or a multiple sequence
122 # alignment. In general this is read in from a file as described in ?.
123 # For the purpose of this tutorial, it is generated in code.
124 seqs = ["KMLFGVVFFFGG",
129 # Calculates the alignment using the Muscle program on the local
130 # machine with options '-quiet -maxiters 64'
131 # and stores the result in 'report'.
132 options = ['-quiet', '-maxiters', '64']
133 muscle = Bio::Muscle.new('path/to/muscle', options)
134 report = muscle.query_align(seqs)
136 # Accesses the actual alignment.
137 align = report.alignment
139 # Prints each sequence to the console.
140 align.each { |s| puts s.to_s }
146 * Edgar, R.C. (2004) "MUSCLE: multiple sequence alignment with high accuracy and high throughput" Nucleic Acids Res 32(5):1792-1797
148 === Other Programs ===
150 [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.
153 == Manipulating Multiple Sequence Alignments ==
155 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.
169 = Phylogenetic Trees =
171 == Phylogenetic Tree Input and Output ==
173 === Reading in of Phylogenetic Trees ===
183 Also, see: https://www.nescent.org/wg_phyloinformatics/BioRuby_PhyloXML_HowTo_documentation
187 === Writing of Phylogenetic Trees ===
197 Also, see: https://www.nescent.org/wg_phyloinformatics/BioRuby_PhyloXML_HowTo_documentation
201 == Phylogenetic Inference ==
203 _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..._
205 _What about pairwise distance calculation?_
209 == Maximum Likelihood ==
232 == Pairwise Distance Based Methods ==
250 == Support Calculation? ==
252 === Bootstrap Resampling? ===
257 = Analyzing Phylogenetic Trees =
262 == Gene Duplication Inference ==
264 _need to further test and then import GSoC 'SDI' work..._