From: gmungoc Date: Mon, 21 Aug 2017 13:06:46 +0000 (+0100) Subject: Merge branch 'develop' into features/JAL-2446NCList X-Git-Tag: Release_2_10_3b1~150 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=be762d8d9c71a7aa3121e845c45911c7192b7827;p=jalview.git Merge branch 'develop' into features/JAL-2446NCList Conflicts: src/MCview/PDBChain.java src/jalview/analysis/AlignmentSorter.java src/jalview/analysis/AlignmentUtils.java src/jalview/analysis/Dna.java src/jalview/appletgui/AlignFrame.java src/jalview/appletgui/FeatureRenderer.java src/jalview/appletgui/Finder.java src/jalview/appletgui/SeqPanel.java src/jalview/commands/EditCommand.java src/jalview/datamodel/AlignedCodonFrame.java src/jalview/datamodel/Sequence.java src/jalview/datamodel/SequenceFeature.java src/jalview/datamodel/xdb/embl/EmblEntry.java src/jalview/ext/ensembl/EnsemblGene.java src/jalview/gui/AlignmentPanel.java src/jalview/gui/AnnotationExporter.java src/jalview/gui/CutAndPasteTransfer.java src/jalview/gui/FeatureRenderer.java src/jalview/gui/Finder.java src/jalview/gui/PopupMenu.java src/jalview/gui/SeqCanvas.java src/jalview/gui/SeqPanel.java src/jalview/io/FeaturesFile.java src/jalview/io/JSONFile.java src/jalview/io/gff/InterProScanHelper.java src/jalview/io/vamsas/Datasetsequence.java src/jalview/renderer/seqfeatures/FeatureRenderer.java src/jalview/util/RangeComparator.java src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java src/jalview/ws/jws2/AADisorderClient.java --- be762d8d9c71a7aa3121e845c45911c7192b7827 diff --cc src/MCview/PDBChain.java index 8285d88,f2dd3d0..f4bd31c --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@@ -41,11 -41,11 +41,6 @@@ public class PDBChai { public static final String RESNUM_FEATURE = "RESNUM"; -- /** -- * SequenceFeature group for PDB File features added to sequences -- */ -- private static final String PDBFILEFEATURE = "PDBFile"; -- private static final String IEASTATUS = "IEA:jalview"; public String id; @@@ -83,10 -83,10 +78,10 @@@ public String pdbid = ""; -- public PDBChain(String pdbid, String id) ++ public PDBChain(String thePdbid, String theId) { -- this.pdbid = pdbid == null ? pdbid : pdbid.toLowerCase(); -- this.id = id; ++ this.pdbid = thePdbid == null ? thePdbid : thePdbid.toLowerCase(); ++ this.id = theId; } /** @@@ -197,21 -197,24 +192,22 @@@ { status = PDBChain.IEASTATUS; } - SequenceFeature[] features = sequence.getSequenceFeatures(); - if (features == null) - { - return null; - } - for (int i = 0; i < features.length; i++) + + List features = sequence.getSequenceFeatures(); + for (SequenceFeature feature : features) { - if (features[i].getFeatureGroup() != null - && features[i].getFeatureGroup().equals(pdbid)) + if (feature.getFeatureGroup() != null + && feature.getFeatureGroup().equals(pdbid)) { - SequenceFeature tx = new SequenceFeature(features[i]); - tx.setBegin(1 + residues.elementAt(tx.getBegin() - offset).atoms - .elementAt(0).alignmentMapping); - tx.setEnd(1 + residues.elementAt(tx.getEnd() - offset).atoms - .elementAt(0).alignmentMapping); + int newBegin = 1 + residues.elementAt(feature.getBegin() - offset).atoms + .elementAt(0).alignmentMapping; + int newEnd = 1 + residues.elementAt(feature.getEnd() - offset).atoms + .elementAt(0).alignmentMapping; + SequenceFeature tx = new SequenceFeature(feature, newBegin, newEnd, + feature.getFeatureGroup(), feature.getScore()); tx.setStatus(status - + ((tx.getStatus() == null || tx.getStatus().length() == 0) ? "" + + ((tx.getStatus() == null || tx.getStatus().length() == 0) + ? "" : ":" + tx.getStatus())); if (tx.begin != 0 && tx.end != 0) { @@@ -346,14 -350,14 +342,14 @@@ // Add inserted residues as features to the base residue Atom currAtom = resAtoms.get(0); - if (currAtom.insCode != ' ' - && !residues.isEmpty() - && residues.lastElement().atoms.get(0).resNumber == currAtom.resNumber) + if (currAtom.insCode != ' ' && !residues.isEmpty() + && residues.lastElement().atoms + .get(0).resNumber == currAtom.resNumber) { - SequenceFeature sf = new SequenceFeature("INSERTION", - currAtom.resName + ":" + currAtom.resNumIns + " " + pdbid - + id, - "", offset + count - 1, offset + count - 1, "PDB_INS"); + String desc = currAtom.resName + ":" + currAtom.resNumIns + " " + + pdbid + id; + SequenceFeature sf = new SequenceFeature("INSERTION", desc, offset + + count - 1, offset + count - 1, "PDB_INS"); resFeatures.addElement(sf); residues.lastElement().atoms.addAll(resAtoms); } diff --cc src/jalview/analysis/AAFrequency.java index a792d24,f8e8379..e4f2dfa --- a/src/jalview/analysis/AAFrequency.java +++ b/src/jalview/analysis/AAFrequency.java @@@ -147,13 -147,14 +147,13 @@@ public class AAFrequenc { if (sequences[row] == null) { - System.err - .println("WARNING: Consensus skipping null sequence - possible race condition."); + System.err.println( + "WARNING: Consensus skipping null sequence - possible race condition."); continue; } - char[] seq = sequences[row].getSequence(); - if (seq.length > column) + if (sequences[row].getLength() > column) { - char c = seq[column]; + char c = sequences[row].getCharAt(column); residueCounts.add(c); if (Comparison.isNucleotide(c)) { diff --cc src/jalview/analysis/AlignmentSorter.java index 9943a22,6b8ea4a..b5cefe0 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@@ -681,49 -682,57 +681,28 @@@ public class AlignmentSorte 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 the alignment using the features on each sequence found between start - * and stop with the given featureLabel (and optional group qualifier) + * Sort sequences by feature score or density, optionally restricted by + * feature types, feature groups, or alignment start/end positions. + *

+ * If the sort is repeated for the same combination of types and groups, sort + * order is reversed. * - * @param featureLabel - * (may not be null) - * @param groupLabel - * (may be null) - * @param start - * (-1 to include non-positional features) - * @param stop - * (-1 to only sort on non-positional features) + * @param featureTypes + * a list of feature types to include (or null for all) + * @param groups + * a list of feature groups to include (or null for all) + * @param startCol + * start column position to include (base zero) + * @param endCol + * end column position to include (base zero) * @param alignment - * - aligned sequences containing features + * the alignment to be sorted * @param method - * - one of the string constants FEATURE_SCORE, FEATURE_LABEL, - * FEATURE_DENSITY + * either "average_score" or "density" ("text" not yet implemented) */ - public static void sortByFeature(String featureLabel, String groupLabel, - int start, int stop, AlignmentI alignment, String method) - { - sortByFeature( - featureLabel == null ? null : Arrays.asList(new String[] - { featureLabel }), - groupLabel == null ? null : Arrays.asList(new String[] - { groupLabel }), start, stop, alignment, method); - } - - 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; - } - - public static void sortByFeature(List featureLabels, - List groupLabels, int start, int stop, + public static void sortByFeature(List featureTypes, + List groups, final int startCol, final int endCol, AlignmentI alignment, String method) { if (method != FEATURE_SCORE && method != FEATURE_LABEL diff --cc src/jalview/analysis/AlignmentUtils.java index b65096c,1b8f84f..2b9b9f9 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@@ -2885,11 -2906,13 +2890,11 @@@ public class AlignmentUtil */ if (seqMap.getTo() == fromSeq.getDatasetSequence()) { - seqMap = new Mapping(seq.getDatasetSequence(), seqMap.getMap() - .getInverse()); + seqMap = new Mapping(seq.getDatasetSequence(), + seqMap.getMap().getInverse()); } - char[] fromChars = fromSeq.getSequence(); int toStart = seq.getStart(); - char[] toChars = seq.getSequence(); /* * traverse [start, end, start, end...] ranges in fromSeq diff --cc src/jalview/analysis/Conservation.java index f94a658,ba4f705..131b39c --- a/src/jalview/analysis/Conservation.java +++ b/src/jalview/analysis/Conservation.java @@@ -860,11 -866,12 +861,12 @@@ public class Conservatio */ String getTooltip(int column) { - char[] sequence = getConsSequence().getSequence(); - char val = column < sequence.length ? sequence[column] : '-'; + SequenceI cons = getConsSequence(); + char val = column < cons.getLength() ? cons.getCharAt(column) : '-'; boolean hasConservation = val != '-' && val != '0'; int consp = column - start; - String tip = (hasConservation && consp > -1 && consp < consSymbs.length) ? consSymbs[consp] + String tip = (hasConservation && consp > -1 && consp < consSymbs.length) + ? consSymbs[consp] : ""; return tip; } diff --cc src/jalview/appletgui/AlignFrame.java index b30c5ae,b48dec9..ed04a0a --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@@ -1734,8 -1725,8 +1736,8 @@@ public class AlignFrame extends Embmenu { EditCommand editCommand = (EditCommand) command; al = editCommand.getAlignment(); - Vector comps = (Vector) PaintRefresher.components.get(viewport - .getSequenceSetId()); - Vector comps = (Vector) PaintRefresher.components ++ Vector comps = PaintRefresher.components + .get(viewport.getSequenceSetId()); for (int i = 0; i < comps.size(); i++) { if (comps.elementAt(i) instanceof AlignmentPanel) @@@ -2498,8 -2485,8 +2496,8 @@@ PaintRefresher.Register(newaf.alignPanel.seqPanel.seqCanvas, newaf.alignPanel.av.getSequenceSetId()); - Vector comps = (Vector) PaintRefresher.components.get(viewport - .getSequenceSetId()); - Vector comps = (Vector) PaintRefresher.components ++ Vector comps = PaintRefresher.components + .get(viewport.getSequenceSetId()); int viewSize = -1; for (int i = 0; i < comps.size(); i++) { diff --cc src/jalview/appletgui/FeatureSettings.java index f6f9727,5e15364..20d4d74 --- a/src/jalview/appletgui/FeatureSettings.java +++ b/src/jalview/appletgui/FeatureSettings.java @@@ -62,10 -62,11 +62,10 @@@ import java.util.HashSet import java.util.List; import java.util.Map; import java.util.Set; -import java.util.Vector; - public class FeatureSettings extends Panel implements ItemListener, - MouseListener, MouseMotionListener, ActionListener, - AdjustmentListener, FeatureSettingsControllerI + public class FeatureSettings extends Panel + implements ItemListener, MouseListener, MouseMotionListener, + ActionListener, AdjustmentListener, FeatureSettingsControllerI { FeatureRenderer fr; @@@ -445,17 -452,17 +453,17 @@@ } } - // now add checkboxes which should be visible, - // if they have not already been added - Enumeration en = visibleChecks.elements(); - - while (en.hasMoreElements()) + /* + * now add checkboxes which should be visible, + * if they have not already been added + */ + for (String type : displayableTypes) { - addCheck(groupsChanged, en.nextElement().toString()); + addCheck(groupsChanged, type); } - featurePanel.setLayout(new GridLayout(featurePanel.getComponentCount(), - 1, 10, 5)); + featurePanel.setLayout( + new GridLayout(featurePanel.getComponentCount(), 1, 10, 5)); featurePanel.validate(); if (scrollPane != null) diff --cc src/jalview/appletgui/IdPanel.java index a5c2e5a,8ac02be..7d9d278 --- a/src/jalview/appletgui/IdPanel.java +++ b/src/jalview/appletgui/IdPanel.java @@@ -278,14 -287,13 +279,15 @@@ public class IdPanel extends Pane int seq = alignPanel.seqPanel.findSeq(e); - if ((e.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) + if ((e.getModifiers() + & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) { - Sequence sq = (Sequence) av.getAlignment().getSequenceAt(seq); + SequenceI sq = av.getAlignment().getSequenceAt(seq); - // build a new links menu based on the current links + any non-positional - // features + /* + * build a new links menu based on the current links + * and any non-positional features + */ List nlinks; if (urlProvider != null) { diff --cc src/jalview/appletgui/SeqPanel.java index 21eb6a4,be4f9e6..fc7c46e --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@@ -1440,10 -1486,11 +1437,11 @@@ public class SeqPanel extends Panel imp } // DETECT RIGHT MOUSE BUTTON IN AWT - if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) + if ((evt.getModifiers() + & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) { - List allFeatures = findFeaturesAtRes(sequence, - sequence.findPosition(res)); + List allFeatures = findFeaturesAtColumn(sequence, + sequence.findPosition(column + 1)); Vector links = null; for (SequenceFeature sf : allFeatures) diff --cc src/jalview/datamodel/Sequence.java index a01d185,0103237..2f1da7f --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@@ -1617,12 -1326,13 +1619,12 @@@ public class Sequence extends ASequenc if (entry.getSequenceFeatures() != null) { - SequenceFeature[] sfs = entry.getSequenceFeatures(); - for (int si = 0; si < sfs.length; si++) + List sfs = entry.getSequenceFeatures(); + for (SequenceFeature feature : sfs) { - SequenceFeature sf[] = (mp != null) ? mp.locateFeature(feature) - SequenceFeature sf[] = (mp != null) ? mp.locateFeature(sfs[si]) - : new SequenceFeature[] - { new SequenceFeature(sfs[si]) }; - if (sf != null && sf.length > 0) ++ SequenceFeature sf[] = (mp != null) ? mp.locateFeature(feature) + : new SequenceFeature[] { new SequenceFeature(feature) }; + if (sf != null) { for (int sfi = 0; sfi < sf.length; sfi++) { diff --cc src/jalview/datamodel/xdb/embl/EmblEntry.java index 5784f04,fe3f6ef..8cc81d9 --- a/src/jalview/datamodel/xdb/embl/EmblEntry.java +++ b/src/jalview/datamodel/xdb/embl/EmblEntry.java @@@ -364,28 -368,31 +368,30 @@@ public class EmblEntr * workaround until we handle dna location for CDS sequence * e.g. location="X53828.1:60..1058" correctly */ - System.err - .println("Implementation Notice: EMBLCDS records not properly supported yet - Making up the CDNA region of this sequence... may be incorrect (" + System.err.println( + "Implementation Notice: EMBLCDS records not properly supported yet - Making up the CDNA region of this sequence... may be incorrect (" + sourceDb + ":" + getAccession() + ")"); - if (translationLength - * 3 == (1 - codonStart + dna.getSequence().length)) + int dnaLength = dna.getLength(); + if (translationLength * 3 == (1 - codonStart + dnaLength)) { - System.err - .println("Not allowing for additional stop codon at end of cDNA fragment... !"); + System.err.println( + "Not allowing for additional stop codon at end of cDNA fragment... !"); // this might occur for CDS sequences where no features are marked exons = new int[] { dna.getStart() + (codonStart - 1), dna.getEnd() }; - dnaToProteinMapping = new Mapping(product, exons, new int[] { 1, - translationLength }, 3, 1); + dnaToProteinMapping = new Mapping(product, exons, + new int[] + { 1, translationLength }, 3, 1); } - if ((translationLength + 1) - * 3 == (1 - codonStart + dna.getSequence().length)) + if ((translationLength + 1) * 3 == (1 - codonStart + dnaLength)) { - System.err - .println("Allowing for additional stop codon at end of cDNA fragment... will probably cause an error in VAMSAs!"); + System.err.println( + "Allowing for additional stop codon at end of cDNA fragment... will probably cause an error in VAMSAs!"); exons = new int[] { dna.getStart() + (codonStart - 1), dna.getEnd() - 3 }; - dnaToProteinMapping = new Mapping(product, exons, new int[] { 1, - translationLength }, 3, 1); + dnaToProteinMapping = new Mapping(product, exons, + new int[] + { 1, translationLength }, 3, 1); } } else @@@ -577,25 -577,33 +590,24 @@@ /** * Helper method to construct a SequenceFeature for one cds range * - * @param exons - * array of cds [start, end, ...] positions - * @param exonStartIndex - * offset into the exons array - * @param proteinName - * @param proteinAccessionId + * @param type + * feature type ("CDS") + * @param desc + * description + * @param begin + * start position + * @param end + * end position + * @param group + * feature group * @param vals * map of 'miscellaneous values' for feature - * @param codonStart - * codon start position for CDS (1/2/3, normally 1) * @return */ - protected SequenceFeature makeCdsFeature(int[] exons, int exonStartIndex, - String proteinName, String proteinAccessionId, - Map vals, int codonStart) + protected SequenceFeature makeCdsFeature(String type, String desc, + int begin, int end, String group, Map vals) { - int exonNumber = exonStartIndex / 2 + 1; - SequenceFeature sf = new SequenceFeature(); - sf.setBegin(Math.min(exons[exonStartIndex], exons[exonStartIndex + 1])); - sf.setEnd(Math.max(exons[exonStartIndex], exons[exonStartIndex + 1])); - sf.setDescription(String.format("Exon %d for protein '%s' EMBLCDS:%s", - exonNumber, proteinName, proteinAccessionId)); - sf.setPhase(String.valueOf(codonStart - 1)); - sf.setStrand( - exons[exonStartIndex] <= exons[exonStartIndex + 1] ? "+" : "-"); - sf.setValue(FeatureProperties.EXONPOS, exonNumber); - sf.setValue(FeatureProperties.EXONPRODUCT, proteinName); + SequenceFeature sf = new SequenceFeature(type, desc, begin, end, group); - if (!vals.isEmpty()) { StringBuilder sb = new StringBuilder(); diff --cc src/jalview/ext/ensembl/EnsemblSeqProxy.java index 79d6c0a,16b858a..4da4f15 --- a/src/jalview/ext/ensembl/EnsemblSeqProxy.java +++ b/src/jalview/ext/ensembl/EnsemblSeqProxy.java @@@ -631,11 -609,11 +633,12 @@@ public abstract class EnsemblSeqProxy e * a final sort is needed since Ensembl returns CDS sorted within source * (havana / ensembl_havana) */ - Collections.sort(regions, new RangeComparator(direction == 1)); + Collections.sort(regions, direction == 1 ? IntRangeComparator.ASCENDING + : IntRangeComparator.DESCENDING); - List to = Arrays.asList(new int[] { start, - start + mappedLength - 1 }); + List to = Arrays + .asList(new int[] + { start, start + mappedLength - 1 }); return new MapList(regions, to, 1, 1); } diff --cc src/jalview/ext/rbvi/chimera/AtomSpecModel.java index f3c9c1e,8c0ea66..f923f7f --- a/src/jalview/ext/rbvi/chimera/AtomSpecModel.java +++ b/src/jalview/ext/rbvi/chimera/AtomSpecModel.java @@@ -1,6 -1,26 +1,26 @@@ + /* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.ext.rbvi.chimera; -import jalview.util.RangeComparator; +import jalview.util.IntRangeComparator; import java.util.ArrayList; import java.util.Collections; diff --cc src/jalview/gui/FeatureRenderer.java index d580eaf,358798d..17f5a71 --- a/src/jalview/gui/FeatureRenderer.java +++ b/src/jalview/gui/FeatureRenderer.java @@@ -241,21 -239,14 +241,20 @@@ public class FeatureRendere */ gridPanel = new JPanel(new GridLayout(4, 1)); JPanel choosePanel = new JPanel(); - choosePanel.add(new JLabel(MessageManager - .getString("label.select_feature") - + ":")); + choosePanel.add(new JLabel( + MessageManager.getString("label.select_feature") + ":")); final JComboBox overlaps = new JComboBox(); + List added = new ArrayList<>(); for (SequenceFeature sf : features) { - String text = sf.getType() + "/" + sf.getBegin() + "-" + sf.getEnd() - + " (" + sf.getFeatureGroup() + ")"; + String text = String.format("%s/%d-%d (%s)", sf.getType(), + sf.getBegin(), sf.getEnd(), sf.getFeatureGroup()); + while (added.contains(text)) + { + text += " "; + } overlaps.addItem(text); + added.add(text); } choosePanel.add(overlaps); @@@ -279,9 -270,9 +278,8 @@@ highlight.addResult(sequences.get(0), sf.getBegin(), sf.getEnd()); - alignPanel.getSeqPanel().seqCanvas - .highlightSearchResults(highlight); - + alignPanel.getSeqPanel().seqCanvas.highlightSearchResults( + highlight, false); - } FeatureColourI col = getFeatureStyle(name.getText()); if (col == null) diff --cc src/jalview/gui/FeatureSettings.java index 45b6b0d,109d0b6..bd74db5 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@@ -633,10 -672,10 +636,10 @@@ public class FeatureSettings extends JP data[dataIndex][0] = type; data[dataIndex][1] = fr.getFeatureStyle(type); - data[dataIndex][2] = new Boolean(af.getViewport() - .getFeaturesDisplayed().isVisible(type)); + data[dataIndex][2] = new Boolean( + af.getViewport().getFeaturesDisplayed().isVisible(type)); dataIndex++; - visibleChecks.removeElement(type); + displayableTypes.remove(type); } } diff --cc src/jalview/gui/PopupMenu.java index c78021c,3e2eba9..2473ba9 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@@ -1949,12 -1954,11 +1953,12 @@@ public class PopupMenu extends JPopupMe */ if (!seqs.isEmpty()) { - if (ap.getSeqPanel().seqCanvas.getFeatureRenderer().amendFeatures( - seqs, features, true, ap)) + if (ap.getSeqPanel().seqCanvas.getFeatureRenderer() + .amendFeatures(seqs, features, true, ap)) { ap.alignFrame.setShowSeqFeatures(true); - ap.highlightSearchResults(null); + ap.av.setSearchResults(null); // clear highlighting + ap.repaint(); // draw new/amended features } } } diff --cc src/jalview/gui/SeqCanvas.java index 0e31246,a052ae3..d4b3e73 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@@ -208,10 -206,10 +208,10 @@@ public class SeqCanvas extends JCompone if (value != -1) { - int x = LABEL_WEST - fm.stringWidth(String.valueOf(value)) + int x = labelWidthWest - fm.stringWidth(String.valueOf(value)) - charWidth / 2; - g.drawString(value + "", x, (ypos + (i * charHeight)) - - (charHeight / 5)); + g.drawString(value + "", x, + (ypos + (i * charHeight)) - (charHeight / 5)); } } } @@@ -768,17 -749,15 +769,17 @@@ if (av.isShowSequenceFeatures()) { - fr.drawSequence(g, nextSeq, startRes, endRes, offset - + ((i - startSeq) * charHeight), false); + fr.drawSequence(g, nextSeq, startRes, endRes, + offset + ((i - startSeq) * charHeight), false); } - // / Highlight search Results once all sequences have been drawn - // //////////////////////////////////////////////////////// + /* + * highlight search Results once sequence has been drawn + */ if (av.hasSearchResults()) { - int[] visibleResults = av.getSearchResults().getResults(nextSeq, + SearchResultsI searchResults = av.getSearchResults(); + int[] visibleResults = searchResults.getResults(nextSeq, startRes, endRes); if (visibleResults != null) { diff --cc src/jalview/gui/SeqPanel.java index d14e908,056a602..e8cc68b --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@@ -1275,7 -1258,7 +1274,7 @@@ public class SeqPanel extends JPane // Find the next gap before the end // of the visible region boundary boolean blank = false; -- for (fixedRight = fixedRight; fixedRight > lastres; fixedRight--) ++ for (; fixedRight > lastres; fixedRight--) { blank = true; diff --cc src/jalview/io/FeaturesFile.java index e1fccaf,4be8d0e..d2282b1 --- a/src/jalview/io/FeaturesFile.java +++ b/src/jalview/io/FeaturesFile.java @@@ -44,9 -44,8 +44,8 @@@ import java.awt.Color import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; - import java.util.Comparator; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@@ -108,14 -94,14 +94,14 @@@ public class FeaturesFile extends Align /** * Constructor which does not parse the file immediately * -- * @param inFile ++ * @param file * @param paste * @throws IOException */ -- public FeaturesFile(String inFile, DataSourceType paste) ++ public FeaturesFile(String file, DataSourceType paste) throws IOException { -- super(false, inFile, paste); ++ super(false, file, paste); } /** @@@ -131,15 -117,14 +117,14 @@@ * Constructor that optionally parses the file immediately * * @param parseImmediately -- * @param inFile ++ * @param file * @param type * @throws IOException */ -- public FeaturesFile(boolean parseImmediately, String inFile, - DataSourceType type) - throws IOException ++ public FeaturesFile(boolean parseImmediately, String file, + DataSourceType type) throws IOException { -- super(parseImmediately, inFile, type); ++ super(parseImmediately, file, type); } /** diff --cc src/jalview/io/vamsas/Datasetsequence.java index e1340e2,462f5af..a399c04 --- a/src/jalview/io/vamsas/Datasetsequence.java +++ b/src/jalview/io/vamsas/Datasetsequence.java @@@ -48,12 -45,12 +48,12 @@@ public class Datasetsequence extends Da // private AlignmentI jvdset; public Datasetsequence(VamsasAppDatastore vamsasAppDatastore, -- SequenceI sq, String dict, DataSet dataset) ++ SequenceI sq, String theDict, DataSet theDataset) { super(vamsasAppDatastore, sq, uk.ac.vamsas.objects.core.Sequence.class); -- this.dataset = dataset; ++ this.dataset = theDataset; // this.jvdset = jvdset; -- this.dict = dict; ++ this.dict = theDict; doSync(); } @@@ -218,10 -218,10 +219,11 @@@ return modifiedtheseq; } + @Override public void conflict() { - log.warn("Conflict in dataset sequence update to document. Overwriting document"); + log.warn( + "Conflict in dataset sequence update to document. Overwriting document"); // TODO: could try to import from document data to jalview first. and then updateToDoc(); } diff --cc src/jalview/renderer/seqfeatures/FeatureRenderer.java index 8feee1f,9f57510..e81e519 --- a/src/jalview/renderer/seqfeatures/FeatureRenderer.java +++ b/src/jalview/renderer/seqfeatures/FeatureRenderer.java @@@ -402,6 -400,23 +401,27 @@@ public class FeatureRenderer extends Fe } /** ++<<<<<<< HEAD ++======= + * Answers true if the feature belongs to a feature group which is not + * currently displayed, else false + * + * @param sequenceFeature + * @return + */ ++ @Override + protected boolean featureGroupNotShown( + final SequenceFeature sequenceFeature) + { + return featureGroups != null && sequenceFeature.featureGroup != null + && sequenceFeature.featureGroup.length() != 0 + && featureGroups.containsKey(sequenceFeature.featureGroup) + && !featureGroups.get(sequenceFeature.featureGroup) + .booleanValue(); + } + + /** ++>>>>>>> refs/heads/develop * Called when alignment in associated view has new/modified features to * discover and display. * diff --cc src/jalview/ws/jws2/AADisorderClient.java index b877d20,fb6ffc4..c24ea05 --- a/src/jalview/ws/jws2/AADisorderClient.java +++ b/src/jalview/ws/jws2/AADisorderClient.java @@@ -62,9 -63,9 +62,9 @@@ public class AADisorderClient extends J AlignFrame af; public AADisorderClient(Jws2Instance sh, AlignFrame alignFrame, -- WsParamSetI preset, List paramset) ++ WsParamSetI thePreset, List paramset) { -- super(sh, alignFrame, preset, paramset); ++ super(sh, alignFrame, thePreset, paramset); af = alignFrame; typeName = sh.action; methodName = sh.serviceType;