X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FAlignmentSorter.java;h=b5cefe0baa860082d1fa6093782270c5cf839e69;hb=948bd3bcbacc509da0cefaae3eedd97300a6ccce;hp=e7733e9b065ac3c9ce062cf054999ffdc9a01b87;hpb=60e252f7e0084336b0a85620842ce3db8f63e5b0;p=jalview.git diff --git a/src/jalview/analysis/AlignmentSorter.java b/src/jalview/analysis/AlignmentSorter.java index e7733e9..b5cefe0 100755 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@ -108,8 +108,9 @@ public class AlignmentSorter true); for (int i = 0; i < nSeq; i++) { - scores[i] = (float) PIDModel.computePID(align.getSequenceAt(i) - .getSequenceAsString(), refSeq, pidParams); + scores[i] = (float) PIDModel.computePID( + align.getSequenceAt(i).getSequenceAsString(), refSeq, + pidParams); seqs[i] = align.getSequenceAt(i); } @@ -415,7 +416,8 @@ public class AlignmentSorter } else { - setReverseOrder(align, vectorSubsetToArray(tmp, align.getSequences())); + setReverseOrder(align, + vectorSubsetToArray(tmp, align.getSequences())); } } @@ -450,12 +452,9 @@ public class AlignmentSorter if (tmp.size() != nSeq) { - System.err - .println("WARNING: tmp.size()=" - + tmp.size() - + " != nseq=" - + nSeq - + " in getOrderByTree - tree contains sequences not in alignment"); + System.err.println("WARNING: tmp.size()=" + tmp.size() + " != nseq=" + + nSeq + + " in getOrderByTree - tree contains sequences not in alignment"); } } @@ -491,7 +490,8 @@ public class AlignmentSorter } else { - setReverseOrder(align, vectorSubsetToArray(tmp, align.getSequences())); + setReverseOrder(align, + vectorSubsetToArray(tmp, align.getSequences())); } } @@ -681,27 +681,6 @@ public class AlignmentSorter public static String FEATURE_DENSITY = "density"; - private static boolean containsIgnoreCase(final String lab, - final List labs) - { - if (labs == null) - { - return true; - } - if (lab == null) - { - return false; - } - for (String label : labs) - { - if (lab.equalsIgnoreCase(label)) - { - return true; - } - } - return false; - } - /** * Sort sequences by feature score or density, optionally restricted by * feature types, feature groups, or alignment start/end positions. @@ -755,13 +734,10 @@ public class AlignmentSorter * get sequence residues overlapping column region * and features for residue positions and specified types */ - // TODO new method findPositions(startCol, endCol)? JAL-2544 - int startResidue = seqs[i].findPosition(startCol); - int endResidue = seqs[i].findPosition(endCol); String[] types = featureTypes == null ? null : featureTypes .toArray(new String[featureTypes.size()]); - List sfs = seqs[i].getFeatures().findFeatures( - startResidue, endResidue, types); + List sfs = seqs[i].findFeatures(startCol + 1, + endCol + 1, types); seqScores[i] = 0; scores[i] = 0.0; @@ -772,18 +748,6 @@ public class AlignmentSorter SequenceFeature sf = it.next(); /* - * double-check feature overlaps columns (JAL-2544) - * (could avoid this with a findPositions(fromCol, toCol) method) - * findIndex returns base 1 column values, startCol/endCol are base 0 - */ - if (seqs[i].findIndex(sf.getBegin()) > endCol + 1 - || seqs[i].findIndex(sf.getEnd()) < startCol + 1) - { - it.remove(); - continue; - } - - /* * accept all features with null or empty group, otherwise * check group is one of the currently visible groups */