merge commit
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 27 Mar 2015 11:37:34 +0000 (11:37 +0000)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 27 Mar 2015 11:37:34 +0000 (11:37 +0000)
1  2 
.classpath
resources/lang/Messages.properties
src/jalview/io/SequenceAnnotationReport.java
src/jalview/renderer/seqfeatures/FeatureRenderer.java
src/jalview/ws/dbsources/PDBRestClient.java
test/jalview/datamodel/SequenceTest.java
test/jalview/ws/dbsources/PDBRestClientTest.java

diff --combined .classpath
@@@ -51,7 -51,7 +51,7 @@@
        <classpathentry kind="lib" path="lib/VARNAv3-91.jar"/>
        <classpathentry kind="lib" path="lib/jfreesvg-2.1.jar"/>
        <classpathentry kind="lib" path="lib/quaqua-filechooser-only-8.0.jar"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin.jar"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin"/>
        <classpathentry kind="lib" path="lib/xml-apis.jar"/>
        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
@@@ -60,5 -60,6 +60,5 @@@
        <classpathentry kind="lib" path="lib/jersey-core-1.19.jar"/>
        <classpathentry kind="lib" path="lib/jersey-json-1.19.jar"/>
        <classpathentry kind="lib" path="lib/jsr311-api-1.1.1.jar"/>
 -      <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin.jar"/>
        <classpathentry kind="output" path="classes"/>
  </classpath>
@@@ -216,6 -216,7 +216,7 @@@ label.none = Non
  label.above_identity_threshold = Above Identity Threshold
  label.show_sequence_features = Show Sequence Features
  label.nucleotide = Nucleotide
+ label.protein = Protein
  label.to_new_alignment = To New Alignment
  label.to_this_alignment = Add To This Alignment
  label.apply_colour_to_all_groups = Apply Colour To All Groups
@@@ -228,14 -229,17 +229,17 @@@ label.documentation = Documentatio
  label.about = About...
  label.show_sequence_limits = Show Sequence Limits
  label.feature_settings = Feature Settings...
- label.sequence_features = Sequence Features
  label.all_columns = All Columns
  label.all_sequences = All Sequences
  label.selected_columns = Selected Columns 
  label.selected_sequences = Selected Sequences
+ label.except_selected_sequences = All except selected sequences
  label.all_but_selected_region = All but Selected Region (Shift+Ctrl+H)
  label.selected_region = Selected Region
  label.all_sequences_columns = All Sequences and Columns
+ label.hide_insertions = Hide columns gapped for selection
+ label.hide_selected_annotations = Hide selected annotations
+ label.show_selected_annotations = Show selected annotations
  label.group_consensus = Group Consensus
  label.group_conservation = Group Conservation
  label.show_consensus_histogram = Show Consensus Histogram
@@@ -382,6 -386,7 +386,7 @@@ label.automatically_associate_pdb_files
  label.automatically_associate_pdb_files_by_name = Automatically Associate PDB files by name
  label.ignore_unmatched_dropped_files_info = <html>Do you want to <em>ignore</em> the {0} files whose names did not match any sequence IDs ?</html>
  label.ignore_unmatched_dropped_files = Ignore unmatched dropped files?
+ label.view_name_original = Original
  label.enter_view_name = Enter View Name
  label.enter_label = Enter label
  label.enter_label_for_the_structure = Enter a label for the structure?
@@@ -480,8 -485,6 +485,6 @@@ label.load_associated_tree = Load Assoc
  label.load_features_annotations = Load Features/Annotations ...
  label.export_features = Export Features ...
  label.export_annotations = Export Annotations ...
- label.jalview_copy = Copy (Jalview Only)
- label.jalview_cut = Cut (Jalview Only)
  label.to_upper_case = To Upper Case
  label.to_lower_case = To Lower Case
  label.toggle_case = Toggle Case
@@@ -576,7 -579,8 +579,8 @@@ label.database_references = Database Re
  label.share_selection_across_views = Share selection across views
  label.scroll_highlighted_regions = Scroll to highlighted regions
  label.gap_symbol = Gap Symbol
- label.alignment_colour = Alignment Colour
+ label.prot_alignment_colour = Protein Alignment Colour
+ label.nuc_alignment_colour = Nucleotide Alignment Colour
  label.address = Address
  label.port = Port
  label.default_browser_unix = Default Browser (Unix)
@@@ -689,12 -693,15 +693,15 @@@ label.save_png_image = Save As PNG Imag
  label.load_tree_for_sequence_set = Load a tree for this sequence set
  label.export_image = Export Image
  label.vamsas_store = VAMSAS store
- label.translate_cDNA = Translate cDNA
+ label.translate_cDNA = Translate as cDNA
+ label.linked_view_title = Linked cDNA and protein view
+ label.align = Align
  label.extract_scores = Extract Scores
  label.get_cross_refs = Get Cross References
  label.sort_alignment_new_tree = Sort Alignment With New Tree
  label.add_sequences = Add Sequences
  label.new_window = New Window
+ label.split_window = Split Window
  label.refresh_available_sources = Refresh Available Sources
  label.use_registry = Use Registry
  label.add_local_source = Add Local Source
@@@ -734,6 -741,7 +741,7 @@@ label.paste_new_window = Paste To New W
  label.settings_for_param = Settings for {0}
  label.view_params = View {0}
  label.select_all_views = Select all views
+ label.all_views = All Views
  label.align_sequences_to_existing_alignment = Align sequences to an existing alignment
  label.realign_with_params = Realign with {0}
  label.calcname_with_default_settings = {0} with Defaults
@@@ -1177,6 -1185,13 +1185,13 @@@ label.show_logo = Show Log
  label.normalise_logo = Normalise Logo
  label.no_colour_selection_in_scheme = Please, make a colour selection before to apply colour scheme
  label.no_colour_selection_warn = Error saving colour scheme
+ label.open_split_window? = Would you like to open as a split window, with cDNA and protein linked?
+ label.open_split_window = Open split window
+ label.no_mappings = No mappings found
+ label.mapping_failed = No sequence mapping could be made between the alignments.<br>A mapping requires sequence names to match, and equivalent sequence lengths.
+ action.no = No
+ action.yes = Yes
+ label.for = for
  label.select_by_annotation = Select By Annotation
  action.select_by_annotation = Select by Annotation...
  label.threshold_filter =  Threshold Filter
@@@ -1207,4 -1222,6 +1222,23 @@@ info.select_filter_option = Select Filt
  info.associate_wit_sequence = Associate with Sequence
  label.search_result = Search Result
  label.found_structures_summary = Found Structures Summary
+ label.configure_displayed_columns = Configure Displayed Columns
+ label.start_jalview = Start Jalview
+ label.biojs_html_export = BioJS
++action.back = Back
++label.hide_insertions = Hide Insertions
++label.mark_as_representative = Mark as representative
++label.open_jabaws_web_page = Open JABAWS web page
++label.opens_the_jabaws_server_homepage = Opens the JABAWS server's homepage in web browser
++label.pdb_sequence_getcher = PDB Sequence Fetcher
++label.result = result
++label.results = results
++label.structure_chooser = Structure Chooser
++label.select = Select : 
++label.invert = Invert 
++label.select_pdb_file = Select PDB File
++info.select_filter_option = Select Filter Option/Manual Entry
++info.associate_wit_sequence = Associate with Sequence
++label.search_result = Search Result
++label.found_structures_summary = Found Structures Summary
 +label.configure_displayed_columns = Configure Displayed Columns
@@@ -1,6 -1,6 +1,6 @@@
  /*
-  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
-  * Copyright (C) 2014 The Jalview Authors
+  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+  * Copyright (C) $$Year-Rel$$ The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
   */
  package jalview.io;
  
 -import java.util.ArrayList;
 -import java.util.Hashtable;
 -import java.util.List;
 -import java.util.Vector;
 -
  import jalview.datamodel.DBRefEntry;
  import jalview.datamodel.SequenceFeature;
  import jalview.datamodel.SequenceI;
  import jalview.util.UrlLink;
  
 +import java.util.ArrayList;
 +import java.util.Hashtable;
 +import java.util.List;
- import java.util.Vector;
++
 +
  /**
   * generate HTML reports for a sequence
   * 
@@@ -179,7 -180,7 +180,7 @@@ public class SequenceAnnotationRepor
            }
            else
            {
--            for (String urlstring : (Vector<String>) feature.links)
++            for (String urlstring : feature.links)
              {
                try
                {
@@@ -77,7 -77,6 +77,7 @@@ public class FeatureRenderer extend
          charOffset = (av_charWidth - fm.charWidth(s)) / 2;
          g.drawString(String.valueOf(s), charOffset
                  + (av_charWidth * (i - start)), pady);
 +
        }
      }
    }
          charOffset = (av_charWidth - fm.charWidth(s)) / 2;
          g.drawString(String.valueOf(s), charOffset
                  + (av_charWidth * (i - start)), pady);
        }
      }
    }
        // current feature to render
        for (sfindex = 0; sfindex < sfSize; sfindex++)
        {
-         if (!lastSequenceFeatures[sfindex].type.equals(type))
+         final SequenceFeature sequenceFeature = lastSequenceFeatures[sfindex];
+         if (!sequenceFeature.type.equals(type))
          {
            continue;
          }
  
          if (featureGroups != null
-                 && lastSequenceFeatures[sfindex].featureGroup != null
-                 && lastSequenceFeatures[sfindex].featureGroup.length() != 0
-                 && featureGroups
-                         .containsKey(lastSequenceFeatures[sfindex].featureGroup)
-                 && !featureGroups
- .get(
-                         lastSequenceFeatures[sfindex].featureGroup)
+                 && sequenceFeature.featureGroup != null
+                 && sequenceFeature.featureGroup.length() != 0
+                 && featureGroups.containsKey(sequenceFeature.featureGroup)
+                 && !featureGroups.get(sequenceFeature.featureGroup)
                          .booleanValue())
          {
            continue;
          }
  
          if (!offscreenRender
-                 && (lastSequenceFeatures[sfindex].getBegin() > epos || lastSequenceFeatures[sfindex]
+                 && (sequenceFeature.getBegin() > epos || sequenceFeature
                          .getEnd() < spos))
          {
            continue;
          }
  
          if (offscreenRender && offscreenImage == null)
--        {
-           if (lastSequenceFeatures[sfindex].begin <= start
-                   && lastSequenceFeatures[sfindex].end >= start)
++        {      
+           if (sequenceFeature.begin <= start
+                   && sequenceFeature.end >= start)
            {
              // this is passed out to the overview and other sequence renderers
              // (e.g. molecule viewer) to get displayed colour for rendered
              // sequence
-             currentColour = new Integer(
- getColour(
-                     lastSequenceFeatures[sfindex]).getRGB());
+             currentColour = new Integer(getColour(sequenceFeature).getRGB());
              // used to be retreived from av.featuresDisplayed
              // currentColour = av.featuresDisplayed
              // .get(sequenceFeatures[sfindex].type);
  
            }
          }
-         else if (lastSequenceFeatures[sfindex].type
-                 .equals("disulfide bond"))
+         else if (sequenceFeature.type.equals("disulfide bond"))
          {
-           renderFeature(g, seq,
-                   seq.findIndex(lastSequenceFeatures[sfindex].begin) - 1,
-                   seq.findIndex(lastSequenceFeatures[sfindex].begin) - 1,
-                   getColour(lastSequenceFeatures[sfindex])
+           renderFeature(g, seq, seq.findIndex(sequenceFeature.begin) - 1,
+                   seq.findIndex(sequenceFeature.begin) - 1,
+                   getColour(sequenceFeature)
                    // new Color(((Integer) av.featuresDisplayed
                    // .get(sequenceFeatures[sfindex].type)).intValue())
                    , start, end, y1);
-           renderFeature(g, seq,
-                   seq.findIndex(lastSequenceFeatures[sfindex].end) - 1,
-                   seq.findIndex(lastSequenceFeatures[sfindex].end) - 1,
-                   getColour(lastSequenceFeatures[sfindex])
+           renderFeature(g, seq, seq.findIndex(sequenceFeature.end) - 1,
+                   seq.findIndex(sequenceFeature.end) - 1,
+                   getColour(sequenceFeature)
                    // new Color(((Integer) av.featuresDisplayed
                    // .get(sequenceFeatures[sfindex].type)).intValue())
                    , start, end, y1);
  
          }
-         else if (showFeature(lastSequenceFeatures[sfindex]))
+         else if (showFeature(sequenceFeature))
          {
            if (av_isShowSeqFeatureHeight
-                   && lastSequenceFeatures[sfindex].score != Float.NaN)
+                   && sequenceFeature.score != Float.NaN)
            {
              renderScoreFeature(g, seq,
-                     seq.findIndex(lastSequenceFeatures[sfindex].begin) - 1,
-                     seq.findIndex(lastSequenceFeatures[sfindex].end) - 1,
-                     getColour(lastSequenceFeatures[sfindex]), start, end,
-                     y1, normaliseScore(lastSequenceFeatures[sfindex]));
+                     seq.findIndex(sequenceFeature.begin) - 1,
+                     seq.findIndex(sequenceFeature.end) - 1,
+                     getColour(sequenceFeature), start, end, y1,
+                     normaliseScore(sequenceFeature));
            }
            else
            {
-             renderFeature(g, seq,
-                     seq.findIndex(lastSequenceFeatures[sfindex].begin) - 1,
-                     seq.findIndex(lastSequenceFeatures[sfindex].end) - 1,
-                     getColour(lastSequenceFeatures[sfindex]), start, end,
-                     y1);
+             renderFeature(g, seq, seq.findIndex(sequenceFeature.begin) - 1,
+                     seq.findIndex(sequenceFeature.end) - 1,
+                     getColour(sequenceFeature), start, end, y1);
            }
          }
  
@@@ -107,30 -107,22 +107,33 @@@ public class PDBRestClien
     */
    public static String parseJsonExceptionString(String jsonErrorResponse)
    {
 -    String errorMessage = "RunTime error";
 +    StringBuilder errorMessage = new StringBuilder(
 +            "\n============= PDB Rest Client RunTime error =============\n");
++
      try
      {
        JSONParser jsonParser = new JSONParser();
        JSONObject jsonObj = (JSONObject) jsonParser.parse(jsonErrorResponse);
        JSONObject errorResponse = (JSONObject) jsonObj.get("error");
 -      errorMessage = errorResponse.get("msg").toString();
        JSONObject responseHeader = (JSONObject) jsonObj
                .get("responseHeader");
 -      errorMessage += responseHeader.get("params").toString();
 +      JSONObject paramsObj = (JSONObject) responseHeader.get("params");
 +      String status = responseHeader.get("status").toString();
 +      String message = errorResponse.get("msg").toString();
 +      String query = paramsObj.get("q").toString();
 +      String fl = paramsObj.get("fl").toString();
 +
 +      errorMessage.append("Status: ").append(status).append("\n");
 +      errorMessage.append("Message: ").append(message).append("\n");
 +      errorMessage.append("query: ").append(query).append("\n");
 +      errorMessage.append("fl: ").append(fl).append("\n");
++
      } catch (ParseException e)
      {
        e.printStackTrace();
      }
 -    return errorMessage;
 +    return errorMessage.toString();
    }
  
    /**
@@@ -247,7 -247,6 +247,7 @@@ public class SequenceTes
      assertEquals("zABCDEF", seq.getSequenceAsString());
      seq.insertCharAt(2, 2, 'x');
      assertEquals("zAxxBCDEF", seq.getSequenceAsString());
 +
      // for static method see StringUtilsTest
    }
  
      seq.getDatasetSequence().setDatasetSequence(seq); // loop!
      assertNull(seq.getSequenceFeatures());
    }
- }
+ }
@@@ -61,12 -61,9 +61,12 @@@ public class PDBRestClientTes
      wantedFields.add(PDBDocField.GENUS);
      wantedFields.add(PDBDocField.GENE_NAME);
      wantedFields.add(PDBDocField.TITLE);
 -    assertEquals("molecule_type,pdb_id,genus,gene_name,title",
 -            PDBRestClient
 -                    .getPDBDocFieldsAsCommaDelimitedString(wantedFields));
 +
 +    String expectedResult = "molecule_type,pdb_id,genus,gene_name,title";
 +    String actualResult = PDBRestClient
 +            .getPDBDocFieldsAsCommaDelimitedString(wantedFields);
 +
 +    assertEquals("", expectedResult, actualResult);
    }
  
    @Test
  
      String parsedErrorResponse = PDBRestClient
              .parseJsonExceptionString(jsonErrorResponse);
 -    String expectedErrorMsg = "org.apache.solr.search.SyntaxError: Cannot parse 'text:abc OR text:go:abc AND molecule_sequence:['' TO *]': Encountered \" \":\" \": \"\" at line 1, column 19.{\"q\":\"text:abc OR text:go:abc AND molecule_sequence:['' TO *]\",\"fl\":\"pdb_id\",\"sort\":\"\",\"rows\":\"100\",\"wt\":\"json\"}";
 +    System.out.println(parsedErrorResponse);
 +
 +    String expectedErrorMsg = "\n============= PDB Rest Client RunTime error =============\n"
 +            + "Status: 400\n"
 +            + "Message: org.apache.solr.search.SyntaxError: Cannot parse 'text:abc OR text:go:abc AND molecule_sequence:['' TO *]': Encountered \" \":\" \": \"\" at line 1, column 19.\n"
 +            + "query: text:abc OR text:go:abc AND molecule_sequence:['' TO *]\n"
 +            + "fl: pdb_id\n";
      assertEquals(expectedErrorMsg, parsedErrorResponse);
    }