seaver has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing data structures to contaim atomic co-ordinates from a PDB file, and am trying to keep an idea of structure whilst at the same time making the data very accessible for any LEVEL of structure, hence this:
foreach my $ref (keys %$data){ if($data->{$ref}->type eq 'ATOM'){ my $atom = $data->{$ref}->atom; $self->{'atoms'}{$ref}=$atom; $self->{'residues'}{$atom->chainId.$atom->resNumber}{$ref}=1; $self->{'chain'}{$atom->chainId}{$atom->chainId.$atom->resNumb +er}{$ref}=1; } }
as you can see, the three levels are chain, residue and atom. The data itself is atomic, hence all $refs are to the atomic data. I added the residue and chain data structures, so i could step through the chains, or the residues as so desired. Im not copying the data, just the references.
my question is, can anyone see a better way of doing this?
Thanks
Sam Seaver
20030923 Edit by jeffa: Changed title from 'Data structures '
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Optimizing PDB data structures
by kvale (Monsignor) on Sep 22, 2003 at 21:47 UTC | |
by seaver (Pilgrim) on Sep 23, 2003 at 13:15 UTC | |
by kvale (Monsignor) on Sep 23, 2003 at 17:17 UTC | |
|
Re: Optimizing PDB data structures
by Anonymous Monk on Sep 23, 2003 at 20:58 UTC | |
by seaver (Pilgrim) on Sep 25, 2003 at 13:43 UTC |