lib/bio/db/pdb/chain.rb in bio-1.2.1 vs lib/bio/db/pdb/chain.rb in bio-1.3.0
- old
+ new
@@ -4,11 +4,11 @@
# Copyright:: Copyright (C) 2004, 2006
# Alex Gutteridge <alexg@ebi.ac.uk>
# Naohisa Goto <ng@bioruby.org>
# License:: The Ruby License
#
-# $Id: chain.rb,v 1.9 2007/12/18 13:48:42 ngoto Exp $
+# $Id: chain.rb,v 1.10 2008/04/01 10:36:44 ngoto Exp $
#
# = Bio::PDB::Chain
#
# Please refer Bio::PDB::Chain.
#
@@ -187,10 +187,14 @@
if last_residue_num and
(x = (residue.resSeq.to_i - last_residue_num).abs) > 1 then
x.times { string << 'X' }
end
tlc = residue.resName.capitalize
- olc = (Bio::AminoAcid.three2one(tlc) or 'X')
+ olc = (begin
+ Bio::AminoAcid.three2one(tlc)
+ rescue ArgumentError
+ nil
+ end || 'X')
string << olc
end
@aaseq = Bio::Sequence::AA.new(string)
end
@aaseq