From: cmzmasek@gmail.com Date: Sun, 27 Feb 2011 04:26:02 +0000 (+0000) Subject: Edited wiki page PhyloBioRuby through web user interface. X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=58be801bd132a091390bf97902840b8135c78176;p=jalview.git Edited wiki page PhyloBioRuby through web user interface. --- diff --git a/wiki/PhyloBioRuby.wiki b/wiki/PhyloBioRuby.wiki index 80d1927..8d372e1 100644 --- a/wiki/PhyloBioRuby.wiki +++ b/wiki/PhyloBioRuby.wiki @@ -25,21 +25,47 @@ require 'bio' # from a file named "infile_clustalw.aln" and stores it in 'report'. report = Bio::ClustalW::Report.new(File.read('infile_clustalw.aln')) +# Accesses the actual alignment. +align = report.alignment + +# Goes through all sequences in 'align' and prints the +# actual molecular sequence. +align.each do |entry| + puts entry.seq +end }}} === Writing a Multiple Sequence Alignment to a File === -_... to be done_ +Writing a multiple sequence alignment in fasta format: {{{ #!/usr/bin/env ruby require 'bio' +# Creates a new file named "outfile.fasta" and writes +# multiple sequence alignment 'align' to it in fasta format. +File.open('outfile.fasta', 'w') do |f| + f.write(align.output(:fasta)) +end }}} +Writing a multiple sequence alignment in clustalw format: + +{{{ +#!/usr/bin/env ruby +require 'bio' + +# Creates a new file named "outfile.aln" and writes +# multiple sequence alignment 'align' to it in clustal format. +File.open('outfile.aln', 'w') do |f| + f.write(align.output(:clustal)) +end +}}} + == Calculating Multiple Sequence Alignments ==