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 '
In reply to Optimizing PDB data structures by seaver
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |