[BioRuby-cvs] bioruby/lib/bio/data aa.rb,0.10,0.11
Katayama Toshiaki
k at pub.open-bio.org
Wed Aug 31 03:22:55 EDT 2005
Update of /home/repository/bioruby/bioruby/lib/bio/data
In directory pub.open-bio.org:/tmp/cvs-serv30477/lib/bio/data
Modified Files:
aa.rb
Log Message:
* fixed one2name method (reported by Nakao)
* one and three methods are added as aliases for to_1 and to_3 methods.
Index: aa.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/data/aa.rb,v
retrieving revision 0.10
retrieving revision 0.11
diff -C2 -d -r0.10 -r0.11
*** aa.rb 7 Aug 2005 23:28:14 -0000 0.10
--- aa.rb 31 Aug 2005 07:22:53 -0000 0.11
***************
*** 161,164 ****
--- 161,165 ----
end
end
+ alias :one :to_1
def to_3(x)
***************
*** 172,175 ****
--- 173,177 ----
end
end
+ alias :three :to_3
def one2three(x)
***************
*** 193,197 ****
raise ArgumentError
else
! Names[x]
end
end
--- 195,199 ----
raise ArgumentError
else
! three2name(Names[x])
end
end
***************
*** 200,204 ****
str = reverse[x.to_s.downcase]
if str and str.length == 3
! reverse[str]
else
str
--- 202,206 ----
str = reverse[x.to_s.downcase]
if str and str.length == 3
! three2one(str)
else
str
***************
*** 280,313 ****
p aa['A']
! puts "# Bio::AminoAcid.name('A')"
! p Bio::AminoAcid.name('A')
! puts "# aa.name('A')"
! p aa.name('A')
! puts "# Bio::AminoAcid.to_1('alanine')"
! p Bio::AminoAcid.to_1('alanine')
! puts "# aa.to_1('alanine')"
! p aa.to_1('alanine')
! puts "# Bio::AminoAcid.to_1('Ala')"
! p Bio::AminoAcid.to_1('Ala')
! puts "# aa.to_1('Ala')"
! p aa.to_1('Ala')
! puts "# Bio::AminoAcid.to_1('A')"
! p Bio::AminoAcid.to_1('A')
! puts "# aa.to_1('A')"
! p aa.to_1('A')
! puts "# Bio::AminoAcid.to_3('alanine')"
! p Bio::AminoAcid.to_3('alanine')
! puts "# aa.to_3('alanine')"
! p aa.to_3('alanine')
! puts "# Bio::AminoAcid.to_3('Ala')"
! p Bio::AminoAcid.to_3('Ala')
! puts "# aa.to_3('Ala')"
! p aa.to_3('Ala')
! puts "# Bio::AminoAcid.to_3('A')"
! p Bio::AminoAcid.to_3('A')
! puts "# aa.to_3('A')"
! p aa.to_3('A')
puts "# Bio::AminoAcid.one2three('A')"
--- 282,315 ----
p aa['A']
! puts "# Bio::AminoAcid.name('A'), Bio::AminoAcid.name('Ala')"
! p Bio::AminoAcid.name('A'), Bio::AminoAcid.name('Ala')
! puts "# aa.name('A'), aa.name('Ala')"
! p aa.name('A'), aa.name('Ala')
! puts "# Bio::AminoAcid.to_1('alanine'), Bio::AminoAcid.one('alanine')"
! p Bio::AminoAcid.to_1('alanine'), Bio::AminoAcid.one('alanine')
! puts "# aa.to_1('alanine'), aa.one('alanine')"
! p aa.to_1('alanine'), aa.one('alanine')
! puts "# Bio::AminoAcid.to_1('Ala'), Bio::AminoAcid.one('Ala')"
! p Bio::AminoAcid.to_1('Ala'), Bio::AminoAcid.one('Ala')
! puts "# aa.to_1('Ala'), aa.one('Ala')"
! p aa.to_1('Ala'), aa.one('Ala')
! puts "# Bio::AminoAcid.to_1('A'), Bio::AminoAcid.one('A')"
! p Bio::AminoAcid.to_1('A'), Bio::AminoAcid.one('A')
! puts "# aa.to_1('A'), aa.one('A')"
! p aa.to_1('A'), aa.one('A')
! puts "# Bio::AminoAcid.to_3('alanine'), Bio::AminoAcid.three('alanine')"
! p Bio::AminoAcid.to_3('alanine'), Bio::AminoAcid.three('alanine')
! puts "# aa.to_3('alanine'), aa.three('alanine')"
! p aa.to_3('alanine'), aa.three('alanine')
! puts "# Bio::AminoAcid.to_3('Ala'), Bio::AminoAcid.three('Ala')"
! p Bio::AminoAcid.to_3('Ala'), Bio::AminoAcid.three('Ala')
! puts "# aa.to_3('Ala'), aa.three('Ala')"
! p aa.to_3('Ala'), aa.three('Ala')
! puts "# Bio::AminoAcid.to_3('A'), Bio::AminoAcid.three('A')"
! p Bio::AminoAcid.to_3('A'), Bio::AminoAcid.three('A')
! puts "# aa.to_3('A'), aa.three('A')"
! p aa.to_3('A'), aa.three('A')
puts "# Bio::AminoAcid.one2three('A')"
More information about the bioruby-cvs
mailing list