@@ -57,7 +57,7 @@ public class StructureImpl implements Structure, Serializable {
5757 private List <List <Chain >> models ;
5858
5959 private List <Map <String ,Integer >> connections ;
60- private List <EntityInfo > compounds ;
60+ private List <EntityInfo > entityInfos ;
6161 private List <DBRef > dbrefs ;
6262 private List <Bond > ssbonds ;
6363 private List <Site > sites ;
@@ -79,7 +79,7 @@ public StructureImpl() {
7979 models = new ArrayList <List <Chain >>();
8080 name = "" ;
8181 connections = new ArrayList <Map <String ,Integer >>();
82- compounds = new ArrayList <EntityInfo >();
82+ entityInfos = new ArrayList <EntityInfo >();
8383 dbrefs = new ArrayList <DBRef >();
8484 pdbHeader = new PDBHeader ();
8585 ssbonds = new ArrayList <Bond >();
@@ -167,27 +167,27 @@ public Structure clone() {
167167
168168 }
169169
170- // deep-copying of Compounds is tricky: there's cross references also in the Chains
171- // beware: if we copy the compounds we would also need to reset the references to compounds in the individual chains
172- List <EntityInfo > newCompoundList = new ArrayList <EntityInfo >();
173- for (EntityInfo compound : this .compounds ) {
174- EntityInfo newCompound = new EntityInfo (compound ); // this sets everything but the chains
175- for (String chainId :compound .getChainIds ()) {
170+ // deep-copying of entityInfofos is tricky: there's cross references also in the Chains
171+ // beware: if we copy the entityInfos we would also need to reset the references to entityInfos in the individual chains
172+ List <EntityInfo > newEntityInfoList = new ArrayList <EntityInfo >();
173+ for (EntityInfo entityInfo : this .entityInfos ) {
174+ EntityInfo newEntityInfo = new EntityInfo (entityInfo ); // this sets everything but the chains
175+ for (String chainId :entityInfo .getChainIds ()) {
176176
177177 for (int modelNr =0 ;modelNr <n .nrModels ();modelNr ++) {
178178 try {
179179 Chain newChain = n .getChainByPDB (chainId ,modelNr );
180- newChain .setEntityInfo (newCompound );
181- newCompound .addChain (newChain );
180+ newChain .setEntityInfo (newEntityInfo );
181+ newEntityInfo .addChain (newChain );
182182 } catch (StructureException e ) {
183183 // this actually happens for structure 1msh, which has no chain B for model 29 (clearly a deposition error)
184- logger .warn ("Could not find chain id " +chainId +" of model " +modelNr +" while cloning compound " +compound .getMolId ()+". Something is wrong!" );
184+ logger .warn ("Could not find chain id " +chainId +" of model " +modelNr +" while cloning entityInfo " +entityInfo .getMolId ()+". Something is wrong!" );
185185 }
186186 }
187187 }
188- newCompoundList .add (newCompound );
188+ newEntityInfoList .add (newEntityInfo );
189189 }
190- n .setEntityInfos (newCompoundList );
190+ n .setEntityInfos (newEntityInfoList );
191191 // TODO ssbonds are complicated to clone: there are deep references inside Atom objects, how would we do it? - JD 2016-03-03
192192
193193 return n ;
@@ -464,7 +464,7 @@ public String toString(){
464464 str .append (dbref .toPDB ()).append (newline );
465465 }
466466 str .append ("Molecules: " ).append (newline );
467- for (EntityInfo mol : compounds ) {
467+ for (EntityInfo mol : entityInfos ) {
468468 str .append (mol ).append (newline );
469469 }
470470
@@ -665,33 +665,33 @@ public boolean hasChain(String chainId) {
665665 /** {@inheritDoc} */
666666 @ Override
667667 public void setEntityInfos (List <EntityInfo > molList ){
668- this .compounds = molList ;
668+ this .entityInfos = molList ;
669669 }
670670
671671 /** {@inheritDoc} */
672672 @ Override
673- public void addEntityInfo (EntityInfo compound ) {
674- this .compounds .add (compound );
673+ public void addEntityInfo (EntityInfo entityInfo ) {
674+ this .entityInfos .add (entityInfo );
675675 }
676676
677677 /** {@inheritDoc} */
678678 @ Override
679679 public List <EntityInfo > getEntityInfos () {
680- // compounds are parsed from the PDB/mmCIF file normally
681- // but if the file is incomplete, it won't have the Compounds information and we try
680+ // entity information is parsed from the PDB/mmCIF file normally
681+ // but if the file is incomplete, it won't have the entityInfo information and we try
682682 // to guess it from the existing seqres/atom sequences
683- if (compounds ==null || compounds .isEmpty ()) {
683+ if (entityInfos ==null || entityInfos .isEmpty ()) {
684684 EntityFinder cf = new EntityFinder (this );
685- this .compounds = cf .findEntities ();
685+ this .entityInfos = cf .findEntities ();
686686
687687 // now we need to set references in chains:
688- for (EntityInfo compound :compounds ) {
688+ for (EntityInfo compound :entityInfos ) {
689689 for (Chain c :compound .getChains ()) {
690690 c .setEntityInfo (compound );
691691 }
692692 }
693693 }
694- return compounds ;
694+ return entityInfos ;
695695 }
696696
697697 /** {@inheritDoc} */
@@ -703,7 +703,7 @@ public EntityInfo getCompoundById(int molId) {
703703 /** {@inheritDoc} */
704704 @ Override
705705 public EntityInfo getEntityById (int entityId ) {
706- for (EntityInfo mol : this .compounds ){
706+ for (EntityInfo mol : this .entityInfos ){
707707 if (mol .getMolId ()==entityId ){
708708 return mol ;
709709 }
0 commit comments