[BioRuby-cvs] bioruby/lib/bio/shell/plugin codon.rb,1.1,1.2

Katayama Toshiaki k at pub.open-bio.org
Sat Nov 5 06:54:38 EST 2005


Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin
In directory pub.open-bio.org:/tmp/cvs-serv820/lib/bio/shell/plugin

Modified Files:
	codon.rb 
Log Message:
* nucleicacids, aminoacids methods are added


Index: codon.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/plugin/codon.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** codon.rb	5 Nov 2005 08:24:24 -0000	1.1
--- codon.rb	5 Nov 2005 11:54:35 -0000	1.2
***************
*** 29,32 ****
--- 29,33 ----
  require 'bio/data/codontable'
  require 'bio/data/aa'
+ require 'bio/data/na'
  
  module Bio::Shell
***************
*** 165,167 ****
--- 166,203 ----
    end
  
+   def aminoacids
+     names = Bio::AminoAcid.names
+     names.sort.each do |aa, code|
+       if aa.length == 1
+         puts "#{aa}\t#{code}\t#{names[code]}"
+       end
+     end
+     return names
+   end
+ 
+   def nucleicacids
+     [
+       [ 'A', 'Adenine'  ],
+       [ 'T', 'Thymine'  ],
+       [ 'G', 'Guanine'  ],
+       [ 'C', 'Cytosine' ],
+       [ 'U', 'Uracil'   ],
+       [ 'r', '[ag]', 'puRine' ],
+       [ 'y', '[tc]', 'pYrimidine' ],
+       [ 'w', '[at]', 'Weak' ],
+       [ 's', '[gc]', 'Strong' ],
+       [ 'k', '[tg]', 'Keto' ],
+       [ 'm', '[ac]', 'aMino' ],
+       [ 'b', '[tgc]', 'not A' ],
+       [ 'v', '[agc]', 'not T' ],
+       [ 'h', '[atc]', 'not G' ],
+       [ 'd', '[atg]', 'not C' ],
+       [ 'n', '[atgc]', 'any' ],
+     ].each do |list|
+       puts list.join("\t")
+     end
+     return Bio::NucleicAcid.names
+   end
+ 
  end
+ 



More information about the bioruby-cvs mailing list