[BioRuby-cvs] bioruby/lib/bio/db/pdb chain.rb, 1.5, 1.6 model.rb,
1.6, 1.7 pdb.rb, 1.12, 1.13 residue.rb, 1.9, 1.10
Naohisa Goto
ngoto at pub.open-bio.org
Fri Jan 20 08:54:10 EST 2006
Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb
In directory pub.open-bio.org:/tmp/cvs-serv26464
Modified Files:
chain.rb model.rb pdb.rb residue.rb
Log Message:
Added Bio::PDB::Record::ATOM#to_s and modified Bio::PDB::*.to_s.
Note that Bio::PDB#to_s and Bio::PDB::{Model,Chain,Residue,Heterogen}#to_s is still imcomplete.
Note that Bio::PDB::Record::ATOM#to_s (and Bio::PDB::Record::HETATM#to_s)
may return invalid data when giving inordinary data.
Index: residue.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/residue.rb,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** residue.rb 9 Jan 2006 11:22:36 -0000 1.9
--- residue.rb 20 Jan 2006 13:54:08 -0000 1.10
***************
*** 143,149 ****
# Stringifies each atom
def to_s
! string = ""
! @atoms.each{ |atom| string << atom.to_s << "\n" }
! return string
end
--- 143,147 ----
# Stringifies each atom
def to_s
! @atoms.join('')
end
Index: model.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/model.rb,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** model.rb 9 Jan 2006 11:22:36 -0000 1.6
--- model.rb 20 Jan 2006 13:54:08 -0000 1.7
***************
*** 140,144 ****
string = ""
if model_serial
! string = "MODEL #{model_serial}" #Should use proper formatting
end
@chains.each{ |chain| string << chain.to_s }
--- 140,144 ----
string = ""
if model_serial
! string = "MODEL #{model_serial}\n" #Should use proper formatting
end
@chains.each{ |chain| string << chain.to_s }
***************
*** 147,151 ****
#end
if model_serial
! string << "ENDMDL"
end
return string
--- 147,151 ----
#end
if model_serial
! string << "ENDMDL\n"
end
return string
Index: pdb.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** pdb.rb 8 Jan 2006 12:59:04 -0000 1.12
--- pdb.rb 20 Jan 2006 13:54:08 -0000 1.13
***************
*** 1010,1013 ****
--- 1010,1031 ----
self
end
+
+ def to_s
+ sprintf("%-6s%5d %-4s%-1s%3s %-1s%4d%-1s %8.3f%8.3f%8.3f%6.2f%6.2f %-4s%2s%-2s\n",
+ self.record_name,
+ self.serial,
+ self.name,
+ self.altLoc,
+ self.resName,
+ self.chainID,
+ self.resSeq,
+ self.iCode,
+ self.x, self.y, self.z,
+ self.occupancy,
+ self.tempFactor,
+ self.segID,
+ self.element,
+ self.charge)
+ end
end #class ATOM
***************
*** 1577,1581 ****
string = ""
@models.each{ |model| string << model.to_s }
! string << "END"
return string
end
--- 1595,1599 ----
string = ""
@models.each{ |model| string << model.to_s }
! string << "END\n"
return string
end
Index: chain.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/chain.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** chain.rb 9 Jan 2006 11:22:36 -0000 1.5
--- chain.rb 20 Jan 2006 13:54:08 -0000 1.6
***************
*** 186,190 ****
# Stringifies each residue
def to_s
! @residues.join('') + "TER\n"
end
--- 186,190 ----
# Stringifies each residue
def to_s
! @residues.join('') + "TER\n" + @heterogens.join('')
end
More information about the bioruby-cvs
mailing list