From: tcofoegbu Date: Wed, 27 Apr 2016 17:57:37 +0000 (+0100) Subject: JAL-1563 Added Id (Uniprot Id) to the dynamic column config file and changed primary... X-Git-Tag: Release_2_10_0~242 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1e10231846acf6ad3c40d950870a304e5d19f12c;p=jalview.git JAL-1563 Added Id (Uniprot Id) to the dynamic column config file and changed primary key from 'entry name' to 'Id'. Also fixed generic batch retrieval mode when the search target is set to the primary key column --- diff --git a/resources/fts/uniprot_data_columns.txt b/resources/fts/uniprot_data_columns.txt index df7a03a..4d67f3f 100644 --- a/resources/fts/uniprot_data_columns.txt +++ b/resources/fts/uniprot_data_columns.txt @@ -22,7 +22,7 @@ g16;Publications;16 g17;Date of;17 g18;Family & Domain;18 # -_data_column.primary_key;entry name +_data_column.primary_key;id _data_column.default_response_page_size;150 # _data_column.name @@ -34,7 +34,8 @@ _data_column.max_col_width _data_column.preferred_col_width _data_column.is_shown_by_default _data_column.is_searchable -Entry Name;entry name|name;String;g3;90;150;95;true;true +Uniprot Id;id;String;g3;80;150;85;true;true +Entry Name;entry name|name;String;g3;100;150;105;true;true Protein names;protein names|protein name;String;g3;300;1500;500;true;true Gene Names;genes|gene;String;g3;50;1000;95;true;true Organism;organism;String;g3;50;1000;95;true;true diff --git a/src/jalview/fts/core/FTSRestClient.java b/src/jalview/fts/core/FTSRestClient.java index e3e2354..7a4f72e 100644 --- a/src/jalview/fts/core/FTSRestClient.java +++ b/src/jalview/fts/core/FTSRestClient.java @@ -302,31 +302,6 @@ public abstract class FTSRestClient implements FTSRestClientI return result; } - /** - * Takes a collection of FTSDataColumnI and converts its 'code' values into a - * tab delimited string. - * - * @param dataColumnFields - * the collection of FTSDataColumnI to process - * @return the generated comma delimited string from the supplied - * FTSDataColumnI collection - */ - public String getDataColumnsFieldsAsTabDelimitedString( - Collection dataColumnFields) - { - String result = ""; - if (dataColumnFields != null && !dataColumnFields.isEmpty()) - { - StringBuilder returnedFields = new StringBuilder(); - for (FTSDataColumnI field : dataColumnFields) - { - returnedFields.append("\t").append(field.getName()); - } - returnedFields.deleteCharAt(0); - result = returnedFields.toString(); - } - return result; - } @Override public Collection getAllFTSDataColumns() diff --git a/src/jalview/fts/core/GFTSPanel.java b/src/jalview/fts/core/GFTSPanel.java index 0b23503..f8a9034 100644 --- a/src/jalview/fts/core/GFTSPanel.java +++ b/src/jalview/fts/core/GFTSPanel.java @@ -350,7 +350,9 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI { return; } - if ("pdb id".equalsIgnoreCase(getCmbSearchTarget() + String primaryKeyName = getFTSRestClient().getPrimaryKeyColumn() + .getName(); + if (primaryKeyName.equalsIgnoreCase(getCmbSearchTarget() .getSelectedItem().toString())) { transferToSequenceFetcher(txt_search.getText()); diff --git a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java index 7eda9f8..f6d7221 100644 --- a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java +++ b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java @@ -119,6 +119,38 @@ public class UniProtFTSRestClient extends FTSRestClient return searchResult; } + /** + * Takes a collection of FTSDataColumnI and converts its 'code' values into a + * tab delimited string. + * + * @param dataColumnFields + * the collection of FTSDataColumnI to process + * @return the generated comma delimited string from the supplied + * FTSDataColumnI collection + */ + private String getDataColumnsFieldsAsTabDelimitedString( + Collection dataColumnFields) + { + String result = ""; + if (dataColumnFields != null && !dataColumnFields.isEmpty()) + { + StringBuilder returnedFields = new StringBuilder(); + for (FTSDataColumnI field : dataColumnFields) + { + if (field.getName().equalsIgnoreCase("Uniprot Id")) + { + returnedFields.append("\t").append("Entry"); + } + else + { + returnedFields.append("\t").append(field.getName()); + } + } + returnedFields.deleteCharAt(0); + result = returnedFields.toString(); + } + return result; + } public static FTSData getFTSData(String tabDelimittedDataStr, FTSRestRequest request) { diff --git a/test/jalview/fts/core/FTSRestClientTest.java b/test/jalview/fts/core/FTSRestClientTest.java index a5c6390..24a98fb 100644 --- a/test/jalview/fts/core/FTSRestClientTest.java +++ b/test/jalview/fts/core/FTSRestClientTest.java @@ -79,16 +79,6 @@ public class FTSRestClientTest "entry name,protein names,genes,organism,created,last-modified"); } - @Test(groups = { "Functional" }) - public void getDataColumnsFieldsAsTabDelimitedString() - { - Collection wantedFields = ftsRestClient - .getAllDefaulDisplayedDataColumns(); - String actual = ftsRestClient - .getDataColumnsFieldsAsTabDelimitedString(wantedFields); - Assert.assertEquals(actual, - "Entry Name\tProtein names\tGene Names\tOrganism\tDate of creation\tDate of last modification"); - } @Test(groups = { "Functional" }) public void getAllFTSDataColumns()