Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ public Object clone() {

for (Group seqResGroup : seqResGroups) {

if (seqResGroup==null)
continue;

int i = groups.indexOf(seqResGroup);

Group g ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,15 @@ public static List<Subunit> extractSubunits(Structure structure,
// The extracted subunit container
List<Subunit> subunits = new ArrayList<Subunit>();


for (Chain c : structure.getChains()) {

for (Chain c : structure.getPolyChains()) {
// Only take protein chains
if (c.isProtein()) {
Atom[] ca = StructureTools.getRepresentativeAtomArray(c);
logger.debug("Chain " + c.getId() + "; CA Atoms: "
+ ca.length + "; SEQRES: " + c.getSeqResSequence());
subunits.add(new Subunit(ca, c.getName(), null, structure));

}
}


// Calculate the minimum length of a Subunit
int adjustedMinLen = calcAdjustedMinimumSequenceLength(subunits,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
*/
package org.biojava.nbio.structure.symmetry.core;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.biojava.nbio.structure.Structure;
import org.biojava.nbio.structure.cluster.Subunit;
import org.biojava.nbio.structure.cluster.SubunitCluster;
import org.biojava.nbio.structure.cluster.SubunitClusterUtils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
* Holds the results of quaternary symmetry perception obtained with
* {@link QuatSymmetryDetector}.
Expand Down Expand Up @@ -111,14 +111,17 @@ public QuatSymmetryResults(List<SubunitCluster> clusters,
public List<SubunitCluster> getSubunitClusters() {
return Collections.unmodifiableList(clusters);
}

/**
* Returns the List of Subunits used to calculate symmetry.
*
* @return an unmodifiable view of the List
*/
public List<Subunit> getSubunits() {
return Collections.unmodifiableList(subunits);
if (subunits != null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subunits should never be null. The bug is that some code is missing from the helical symmetry constructor. The right fix is to add the following code into line 101:

 subunits = new ArrayList();
 for (SubunitCluster c : clusters) {
 	subunits.addAll(c.getSubunits());
 }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip, now done in 96c6816

return Collections.unmodifiableList(subunits);
else
return Collections.unmodifiableList(new ArrayList<>());
}

/**
Expand Down