2 # bioperl module for Bio::Structure::Atom
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Kris Boulez <kris.boulez@algonomics.com>
8 # Copyright Kris Boulez
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::Structure::Atom - Bioperl structure Object, describes an Atom
24 This object stores a Bio::Structure::Atom
30 User feedback is an integral part of the evolution of this and other
31 Bioperl modules. Send your comments and suggestions preferably to one
32 of the Bioperl mailing lists. Your participation is much appreciated.
34 bioperl-l@bioperl.org - General discussion
35 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
39 Please direct usage questions or support issues to the mailing list:
41 I<bioperl-l@bioperl.org>
43 rather than to the module maintainer directly. Many experienced and
44 reponsive experts will be able look at the problem and quickly
45 address it. Please include a thorough description of the problem
46 with code and data examples if at all possible.
50 Report bugs to the Bioperl bug tracking system to help us keep track
51 the bugs and their resolution. Bug reports can be submitted via the web:
53 https://github.com/bioperl/bioperl-live/issues
55 =head1 AUTHOR - Kris Boulez
57 Email kris.boulez@algonomics.com
61 The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
66 # Let the code begin...
68 package Bio
::Structure
::Atom
;
71 use Bio
::Structure
::Residue
;
72 use base
qw(Bio::Root::Root);
78 Usage : $struc = Bio::Structure::Atom->new(
82 Function: Returns a new Bio::Structure::Atom object from basic
83 constructors. Probably most called from Bio::Structure::IO.
84 Returns : a new Bio::Structure::Atom object
90 my ($class, @args) = @_;
91 my $self = $class->SUPER::new
(@args);
94 $self->_rearrange([qw(
102 $id && $self->id($id);
115 Usage : $x = $atom->x($x);
116 Function: Set/gets the X coordinate for an Atom
117 Returns : The value for the X coordinate of the Atom (This is just a number,
118 it is expected to be in Angstrom, but no garantees)
119 Args : The X coordinate as a number
124 my ($self,$value) = @_;
125 if( defined $value) {
126 # do we want to check if $value contains really a number ?
127 $self->{'x'} = $value;
136 Usage : $y = $atom->y($y);
137 Function: Set/gets the Y coordinate for an Atom
138 Returns : The value for the Y coordinate of the Atom (This is just a number,
139 it is eypected to be in Angstrom, but no garantees)
140 Args : The Y coordinate as a number
145 my ($self,$value) = @_;
146 if( defined $value) {
147 # do we want to check if $value contains really a number ?
148 $self->{'y'} = $value;
157 Usage : $z = $atom->z($z);
158 Function: Set/gets the Z coordinate for an Atom
159 Returns : The value for the Z coordinate of the Atom (This is just a number,
160 it is ezpected to be in Angstrom, but no garantees)
161 Args : The Z coordinate as a number
166 my ($self,$value) = @_;
167 if( defined $value) {
168 # do we want to check if $value contains really a number ?
169 $self->{'z'} = $value;
178 Usage : ($x,$y,$z) = $atom->xyz;
179 Function: Gets the XYZ coordinates for an Atom
180 Returns : A list with the value for the XYZ coordinate of the Atom
188 return ($self->x, $self->y, $self->z);
196 Function: No code here, all parent/child stuff via Entry
203 my($self, $value) = @_;
205 $self->throw("all parent/child stuff via Entry\n");
212 Usage : $icode = $atom->icode($icode)
213 Function: Sets/gets the icode
214 Returns : Returns the icode for this atom
215 Args : reference to an Atom
220 my($self, $value) = @_;
222 if (defined $value) {
223 $self->{'icode'} = $value;
225 return $self->{'icode'};
232 Usage : $serial = $atom->serial($serial)
233 Function: Sets/gets the serial number
234 Returns : Returns the serial number for this atom
235 Args : reference to an Atom
240 my($self, $value) = @_;
242 if (defined $value) {
243 $self->{'serial'} = $value;
245 return $self->{'serial'};
252 Usage : $occupancy = $atom->occupancy($occupancy)
253 Function: Sets/gets the occupancy
254 Returns : Returns the occupancy for this atom
255 Args : reference to an Atom
260 my($self, $value) = @_;
262 if (defined $value) {
263 $self->{'occupancy'} = $value;
265 return $self->{'occupancy'};
272 Usage : $tempfactor = $atom->tempfactor($tempfactor)
273 Function: Sets/gets the tempfactor
274 Returns : Returns the tempfactor for this atom
275 Args : reference to an Atom
280 my($self, $value) = @_;
282 if (defined $value) {
283 $self->{'tempfactor'} = $value;
285 return $self->{'tempfactor'};
292 Usage : $segID = $atom->segID($segID)
293 Function: Sets/gets the segID
294 Returns : Returns the segID for this atom
295 Args : reference to an Atom
300 my($self, $value) = @_;
302 if (defined $value) {
303 $self->{'segID'} = $value;
305 return $self->{'segID'};
309 =head2 pdb_atomname()
312 Usage : $pdb_atomname = $atom->pdb_atomname($pdb_atomname)
313 Function: Sets/gets the pdb_atomname (atomname used in the PDB file)
314 Returns : Returns the pdb_atomname for this atom
315 Args : reference to an Atom
320 my($self, $value) = @_;
322 if (defined $value) {
323 $self->{'pdb_atomname'} = $value;
325 return $self->{'pdb_atomname'};
332 Usage : $element = $atom->element($element)
333 Function: Sets/gets the element
334 Returns : Returns the element for this atom
335 Args : reference to an Atom
340 my($self, $value) = @_;
342 if (defined $value) {
343 $self->{'element'} = $value;
345 return $self->{'element'};
352 Usage : $charge = $atom->charge($charge)
353 Function: Sets/gets the charge
354 Returns : Returns the charge for this atom
355 Args : reference to an Atom
360 my($self, $value) = @_;
362 if (defined $value) {
363 $self->{'charge'} = $value;
365 return $self->{'charge'};
372 Usage : $sigx = $atom->sigx($sigx)
373 Function: Sets/gets the sigx
374 Returns : Returns the sigx for this atom
375 Args : reference to an Atom
380 my($self, $value) = @_;
382 if (defined $value) {
383 $self->{'sigx'} = $value;
385 return $self->{'sigx'};
392 Usage : $sigy = $atom->sigy($sigy)
393 Function: Sets/gets the sigy
394 Returns : Returns the sigy for this atom
395 Args : reference to an Atom
400 my($self, $value) = @_;
402 if (defined $value) {
403 $self->{'sigy'} = $value;
405 return $self->{'sigy'};
412 Usage : $sigz = $atom->sigz($sigz)
413 Function: Sets/gets the sigz
414 Returns : Returns the sigz for this atom
415 Args : reference to an Atom
420 my($self, $value) = @_;
422 if (defined $value) {
423 $self->{'sigz'} = $value;
425 return $self->{'sigz'};
432 Usage : $sigocc = $atom->sigocc($sigocc)
433 Function: Sets/gets the sigocc
434 Returns : Returns the sigocc for this atom
435 Args : reference to an Atom
440 my($self, $value) = @_;
442 if (defined $value) {
443 $self->{'sigocc'} = $value;
445 return $self->{'sigocc'};
452 Usage : $sigtemp = $atom->sigtemp($sigtemp)
453 Function: Sets/gets the sigtemp
454 Returns : Returns the sigtemp for this atom
455 Args : reference to an Atom
460 my($self, $value) = @_;
462 if (defined $value) {
463 $self->{'sigtemp'} = $value;
465 return $self->{'sigtemp'};
472 Usage : $u12 = $atom->aniso("u12", $u12)
473 Function: Sets/gets the anisotropic temperature factors
474 Returns : Returns the requested factor for this atom
475 Args : reference to an Atom, name of the factor, value for the factor
480 my($self, $name, $value) = @_;
482 if ( !defined $name) {
483 $self->throw("You need to supply a name of the anisotropic temp factor you want to get");
485 if (defined $value) {
486 $self->{$name} = $value;
488 return $self->{$name};
493 my ($self, $name, $value) = @_;
494 $self->aniso($name,$value);
497 my ($self, $name, $value) = @_;
498 $self->aniso($name,$value);
501 my ($self, $name, $value) = @_;
502 $self->aniso($name,$value);
505 my ($self, $name, $value) = @_;
506 $self->aniso($name,$value);
509 my ($self, $name, $value) = @_;
510 $self->aniso($name,$value);
513 my ($self, $name, $value) = @_;
514 $self->aniso($name,$value);
517 my ($self, $name, $value) = @_;
518 $self->aniso($name,$value);
521 my ($self, $name, $value) = @_;
522 $self->aniso($name,$value);
525 my ($self, $name, $value) = @_;
526 $self->aniso($name,$value);
529 my ($self, $name, $value) = @_;
530 $self->aniso($name,$value);
533 my ($self, $name, $value) = @_;
534 $self->aniso($name,$value);
537 my ($self, $name, $value) = @_;
538 $self->aniso($name,$value);
556 Usage : $atom->id("CZ2")
557 Function: Gets/sets the ID for this atom
564 my ($self, $value) = @_;;
565 if (defined $value) {
566 $self->{'id'} = $value;
568 return $self->{'id'};
574 # dummy, nothing needs to be done here
578 # from here on only private methods
581 =head2 _remove_residue()
583 Title : _remove_residue
585 Function: Removes the Residue this Atom is atttached to.
591 sub _remove_residue
{
594 $self->throw("no code here at the moment\n");
598 =head2 _grandparent()
602 Function: get/set a symbolic reference to our grandparent
609 my($self,$symref) = @_;
612 $self->throw("Thou shall only pass strings in here, no references $symref\n");
614 if (defined $symref) {
615 $self->{'grandparent'} = $symref;
617 return $self->{'grandparent'};