Skip to content

Commit 81c4395

Browse files
committed
biojava#320 updating API
1 parent be55ad2 commit 81c4395

2 files changed

Lines changed: 41 additions & 17 deletions

File tree

biojava-structure/src/main/java/org/biojava/nbio/structure/Chain.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,18 +313,31 @@ public interface Chain {
313313
* Sets the back-reference to its parent Structure.
314314
* @param parent the parent Structure object for this Chain
315315
* @see #getParent()
316+
* @deprecated use setStructure instead
316317
*
317318
*/
318-
public void setParent(Structure parent) ;
319-
319+
public void setParent(Structure parent) ;
320+
321+
public void setStructure(Structure parent) ;
322+
320323
/**
321324
* Returns the parent Structure of this chain.
322325
*
323326
* @return the parent Structure object
324327
* @see #setParent(Structure)
328+
* @deprecated use getStructure(Structure) instead.
325329
*/
326-
330+
327331
public Structure getParent() ;
332+
333+
334+
/**
335+
* Returns the parent Structure of this chain.
336+
*
337+
* @return the parent Structure object
338+
* @see #setStructure(Structure)
339+
*/
340+
public Structure getStructure() ;
328341

329342
/**
330343
* Gets all groups that are not polymer groups and that are not solvent groups.

biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,24 @@ public void setParent(Structure parent) {
117117
* @return the parent Structure object
118118
*/
119119
@Override
120-
public Structure getParent() {
121-
120+
public Structure getStructure() {
122121

123122
return parent;
124123
}
125124

126125

126+
/** Returns the parent Structure of this chain.
127+
*
128+
* @return the parent Structure object
129+
* @deprecated use getStructure instead.
130+
*/
131+
@Override
132+
public Structure getParent() {
133+
134+
135+
return getStructure();
136+
}
137+
127138
/** Returns an identical copy of this Chain .
128139
* @return an identical copy of this Chain
129140
*/
@@ -161,7 +172,7 @@ public Object clone() {
161172
}
162173

163174
Chain tmp = new ChainImpl();
164-
// that's a bit confusing, but that's how to set the seqres so that SeqRes2AtomAligner can use them
175+
// that's a bit confusing, but that's how to set the seqres so that SeqRes2AtomAligner can use them
165176
tmp.setAtomGroups(tmpSeqRes);
166177

167178
// now match them up..
@@ -484,7 +495,7 @@ public String toString(){
484495
}
485496

486497
/**
487-
* {@inheritDoc}
498+
* {@inheritDoc}
488499
*/
489500
@Override
490501
public Sequence<?> getBJSequence() {
@@ -504,7 +515,7 @@ public Sequence<?> getBJSequence() {
504515

505516
}
506517

507-
/**
518+
/**
508519
* {@inheritDoc}
509520
*/
510521
@Override
@@ -516,7 +527,7 @@ public String getAtomSequence(){
516527

517528
logger.info("The property {} is true. Will use the chemical component dictionary files to produce the atom sequence",
518529
PDBFileReader.LOAD_CHEM_COMP_PROPERTY);
519-
530+
520531
List<Group> groups = getAtomGroups();
521532
StringBuilder sequence = new StringBuilder() ;
522533

@@ -538,12 +549,12 @@ public String getAtomSequence(){
538549

539550
logger.info("The property {} is false or not set. Will use only amino acids for the atom sequence",
540551
PDBFileReader.LOAD_CHEM_COMP_PROPERTY);
541-
552+
542553
// not using ChemComp records...
543554
List<Group> aminos = getAtomGroups(GroupType.AMINOACID);
544555
StringBuilder sequence = new StringBuilder() ;
545556
for (Group amino : aminos) {
546-
if (amino instanceof AminoAcid) {
557+
if (amino instanceof AminoAcid) {
547558
AminoAcid a = (AminoAcid) amino;
548559
sequence.append(a.getAminoType());
549560
} else {
@@ -565,10 +576,10 @@ public String getSeqResSequence(){
565576
String prop = System.getProperty(PDBFileReader.LOAD_CHEM_COMP_PROPERTY);
566577

567578
if ( prop != null && prop.equalsIgnoreCase("true")) {
568-
579+
569580
logger.info("The property {} is true. Will use the chemical component dictionary files to produce the seqres sequence",
570581
PDBFileReader.LOAD_CHEM_COMP_PROPERTY);
571-
582+
572583
StringBuilder str = new StringBuilder();
573584
for (Group g : seqResGroups) {
574585
ChemComp cc = g.getChemComp();
@@ -588,7 +599,7 @@ public String getSeqResSequence(){
588599
}
589600
return str.toString();
590601
}
591-
602+
592603
logger.info("The property {} is false or not set. Will use only amino acids for the seqres sequence",
593604
PDBFileReader.LOAD_CHEM_COMP_PROPERTY);
594605

@@ -606,7 +617,7 @@ public String getSeqResSequence(){
606617
}
607618

608619

609-
/**
620+
/**
610621
* {@inheritDoc}
611622
*/
612623
@Override
@@ -615,7 +626,7 @@ public Group getSeqResGroup(int position) {
615626
return seqResGroups.get(position);
616627
}
617628

618-
/**
629+
/**
619630
* {@inheritDoc}
620631
*/
621632
@Override
@@ -692,7 +703,7 @@ public void setInternalChainID(String internalChainID) {
692703
public String toPDB() {
693704
return FileConvert.toPDB(this);
694705
}
695-
706+
696707
@Override
697708
public String toMMCIF() {
698709
return FileConvert.toMMCIF(this, true);

0 commit comments

Comments
 (0)