[BioRuby-cvs] bioruby/lib/bio/db/pdb chain.rb, 1.9, 1.10 pdb.rb, 1.27, 1.28

Naohisa Goto ngoto at dev.open-bio.org
Tue Apr 1 10:36:47 UTC 2008


Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb
In directory dev.open-bio.org:/tmp/cvs-serv9574/lib/bio/db/pdb

Modified Files:
	chain.rb pdb.rb 
Log Message:
* Fixed a bug that ArgumentError occurred in Bio::PDB::Chain#aaseq method 
  for nucleic acid chains. The same error might also be occurred in
  Bio::PDB#seqres and also fixed.
* Fixed a bug that current residue/heterogen is not properly initialized when
  current chain is changed.


Index: pdb.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** pdb.rb	28 Dec 2007 14:43:44 -0000	1.27
--- pdb.rb	1 Apr 2008 10:36:44 -0000	1.28
***************
*** 1498,1501 ****
--- 1498,1504 ----
                chain = newChain
              end
+             # chain might be changed, clearing cResidue and cLigand
+             cResidue = nil
+             cLigand = nil
            end
          end
***************
*** 1551,1554 ****
--- 1554,1559 ----
            c_atom = nil
            cChain = nil
+           cResidue = nil
+           cLigand = nil
            if cModel.model_serial or cModel.chains.size > 0 then
              self.addModel(cModel)
***************
*** 1810,1814 ****
                #need to look up with Ala
                aa = aa.capitalize
!               (Bio::AminoAcid.three2one(aa) or 'X')
              end
              seq = Bio::Sequence::AA.new(a.to_s)
--- 1815,1823 ----
                #need to look up with Ala
                aa = aa.capitalize
!               (begin
!                  Bio::AminoAcid.three2one(aa)
!                rescue ArgumentError
!                  nil
!                end || 'X')
              end
              seq = Bio::Sequence::AA.new(a.to_s)
***************
*** 1816,1820 ****
              # nucleic acid sequence
              a.collect! do |na|
!               na = na.strip
                na.size == 1 ? na : 'n'
              end
--- 1825,1829 ----
              # nucleic acid sequence
              a.collect! do |na|
!               na = na.delete('^a-zA-Z')
                na.size == 1 ? na : 'n'
              end

Index: chain.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/chain.rb,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** chain.rb	18 Dec 2007 13:48:42 -0000	1.9
--- chain.rb	1 Apr 2008 10:36:44 -0000	1.10
***************
*** 190,194 ****
              end
              tlc = residue.resName.capitalize
!             olc = (Bio::AminoAcid.three2one(tlc) or 'X')
              string << olc
            end
--- 190,198 ----
              end
              tlc = residue.resName.capitalize
!             olc = (begin
!                      Bio::AminoAcid.three2one(tlc)
!                    rescue ArgumentError
!                      nil
!                    end || 'X')
              string << olc
            end




More information about the bioruby-cvs mailing list