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 @@ -140,7 +140,7 @@ PairwiseSequenceAlignerType.LOCAL, new SimpleGapPenalty(),
}

proteinIndex = proteinIndex + seq.length();
if (startIndex != null && endIndex != null && startIndex != endIndex) {
if (startIndex != null && endIndex != null && !startIndex.equals(endIndex)) {
CDSSequence cdsSequence = cdsSequenceList.get(i);
String hitLabel = "";
if (transcriptSequence.getStrand() == Strand.POSITIVE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ private boolean domainsAvailable() {
return false;

// Re-download old copies of "latest"
if(updateFrequency != null && requestedVersion == DEFAULT_VERSION ) {
if(updateFrequency != null && requestedVersion.equals(DEFAULT_VERSION)) {
long mod = f.lastModified();
// Time of last update
Date lastUpdate = new Date();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ private void formBondAltlocAware(Group g1, String name1, Group g2, String name2,
for (Atom a1:a1s) {
for (Atom a2:a2s) {
if (a1.getAltLoc() != null && a2.getAltLoc()!=null &&
a1.getAltLoc()!=' ' && a2.getAltLoc()!=' ' &&
a1.getAltLoc() != a2.getAltLoc()) {
!a1.getAltLoc().equals(' ') && !a2.getAltLoc().equals(' ') &&
!a1.getAltLoc().equals(a2.getAltLoc())) {
logger.debug("Skipping bond between atoms with differently named alt locs {} (altLoc '{}') -- {} (altLoc '{}')",
a1.toString(), a1.getAltLoc(), a2.toString(), a2.getAltLoc());
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ private List<Integer> getPermutation(Matrix4d transformation) {
int permutation = -1;
double minDistSq = Double.MAX_VALUE;
for (int j = 0; j < centers.size(); j++) {
if (seqClusterId.get(i) == seqClusterId.get(j)) {
if (Objects.equals(seqClusterId.get(i), seqClusterId.get(j))) {
if (!used[j]) {
double dSq = tCenter.distanceSquared(centers.get(j));
if (dSq < minDistSq && dSq <= rmsdThresholdSq) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@

package org.biojava.nbio.structure.symmetry.core;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.vecmath.AxisAngle4d;
import javax.vecmath.Matrix4d;
Expand All @@ -40,6 +34,14 @@
import org.biojava.nbio.structure.symmetry.geometry.DistanceBox;
import org.biojava.nbio.structure.symmetry.geometry.SphereSampler;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;


/**
*
Expand Down Expand Up @@ -90,7 +92,7 @@ private void solve() {
// isSpherical check added 08-04-11
if (maxSymOps % 60 == 0 && isSpherical) {
maxSymOps = 60;
}
}

AxisAngle4d sphereAngle = new AxisAngle4d();
Matrix4d transformation = new Matrix4d();
Expand Down Expand Up @@ -122,7 +124,7 @@ private void solve() {

// get permutation of subunits and check validity/uniqueness
List<Integer> permutation = getPermutation();
// System.out.println("Rotation Solver: permutation: " + i + ": " + permutation);
// System.out.println("Rotation Solver: permutation: " + i + ": " + permutation);

// check if novel
if ( evaluatedPermutations.containsKey(permutation)) {
Expand Down Expand Up @@ -277,7 +279,7 @@ private List<Double> getAngles() {
int n = subunits.getSubunitCount();
// for spherical symmetric cases, n cannot be higher than 60
if (n % 60 == 0 && isSpherical()) {
n = 60;
n = 60;
}
List<Integer> folds = subunits.getFolds();
List<Double> angles = new ArrayList<Double>(folds.size()-1);
Expand Down Expand Up @@ -334,7 +336,7 @@ private boolean isAllowedPermutation(List<Integer> permutation) {
int selfaligned = 0;
for (int i = 0; i < permutation.size(); i++) {
int j = permutation.get(i);
if ( seqClusterId.get(i) != seqClusterId.get(j)) {
if (!Objects.equals(seqClusterId.get(i), seqClusterId.get(j))) {
return false;
}
if(i == j ) {
Expand All @@ -344,6 +346,7 @@ private boolean isAllowedPermutation(List<Integer> permutation) {
// either identity (all self aligned) or all unique
return selfaligned == 0 || selfaligned == permutation.size();
}

/**
* Adds translational component to rotation matrix
* @param rotation
Expand Down Expand Up @@ -407,7 +410,7 @@ private List<Integer> getPermutation() {
int closest = -1;
double minDist = Double.MAX_VALUE;

for (int j : neighbors) {
for (int j : neighbors) {
double dist = t.distanceSquared(originalCoords[j]);
if (dist < minDist) {
closest = j;
Expand All @@ -417,7 +420,7 @@ private List<Integer> getPermutation() {

sum += minDist;
if (closest == -1) {
break;
break;
}
permutation.add(closest);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
import javax.vecmath.Point3d;
import javax.vecmath.Quat4d;
import javax.vecmath.Vector3d;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;


Expand Down Expand Up @@ -176,7 +176,7 @@ private boolean isAllowedPermuation(List<Integer> permutation) {
List<Integer> seqClusterId = subunits.getClusterIds();
for (int i = 0; i < permutation.size(); i++) {
int j = permutation.get(i);
if (seqClusterId.get(i) != seqClusterId.get(j)) {
if (!Objects.equals(seqClusterId.get(i), seqClusterId.get(j))) {
return false;
}
}
Expand Down