From a1086647aff9dc4f73d6ed539e8243d184e9d43d Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Wed, 23 Feb 2011 22:43:16 +0000 Subject: [PATCH] bioruby examples for wiki........ --- forester/ruby/scripts/bioruby_examples/msa_1.rb | 49 +++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 forester/ruby/scripts/bioruby_examples/msa_1.rb diff --git a/forester/ruby/scripts/bioruby_examples/msa_1.rb b/forester/ruby/scripts/bioruby_examples/msa_1.rb new file mode 100644 index 0000000..dca6106 --- /dev/null +++ b/forester/ruby/scripts/bioruby_examples/msa_1.rb @@ -0,0 +1,49 @@ +require 'rubygems' +require 'bio' + +# creating a Bio::Sequence::NA object containing ambiguous alphabets +#as = Bio::Sequence::NA.new("atgcyrwskmbdhvn") + +#print as.to_s + +#print "\n" + + +#seq1 = Bio::Sequence::AA.new("gggggg") +#seq2 = Bio::Sequence::AA.new("ggggt") +#seq3 = Bio::Sequence::AA.new("ggt") + + + +seq1 = "KMLFGVVFFFGG" +seq2 ="LMGGHHF" +seq3 = "GKKKKGHHHGHRRRGR" +seq4 = "KKKGHHHGHRERGR" +seqs = [ seq1, seq2, seq3, seq4 ] + + +# MAFFT +options = [ '--maxiterate', '1000', '--localpair' ] +mafft = Bio::MAFFT.new('/home/zma/SOFTWARE/mafft-6.847-without-extensions/scripts/mafft', options ) +report = mafft.query_align( seqs) +#puts report.alignment.output_fasta +report.alignment.each { |x| puts x.to_s } +puts 'OK' +puts + +#clustalw +clustalw = Bio::ClustalW.new('/home/zma/SOFTWARE/clustalw-2.1/src/clustalw2' ) +report = clustalw.query_align( seqs) +#puts report.alignment.output_fasta.to_s +report.alignment.each { |x| puts x.to_s } +puts 'OK' +puts + +#muscle +options = [ '-quiet', '-maxiters', '64' ] +muscle = Bio::Muscle.new('/home/zma/SOFTWARE/muscle3.8.31/src/muscle', options ) +report = muscle.query_align( seqs) +#puts report.alignment.output_fasta.to_s +report.alignment.each { |x| puts x.to_s } +puts 'OK' +puts \ No newline at end of file -- 1.7.10.2