From: tcofoegbu Date: Wed, 27 Apr 2016 12:57:28 +0000 (+0100) Subject: JAL-1563 Modified Uniprot data column configurations and improved implementation... X-Git-Tag: Release_2_10_0~245 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f0a6a74187eda02037680aea3d4de4e7128f2cb0;p=jalview.git JAL-1563 Modified Uniprot data column configurations and improved implementation to cope with when there are discrepancies between search code and column code --- diff --git a/resources/fts/uniprot_data_columns.txt b/resources/fts/uniprot_data_columns.txt index 40e28e4..a7365c5 100644 --- a/resources/fts/uniprot_data_columns.txt +++ b/resources/fts/uniprot_data_columns.txt @@ -23,10 +23,10 @@ g17;Date of;17 g18;Family & Domain;18 # _data_column.primary_key;entry name -_data_column.default_response_page_size;100 +_data_column.default_response_page_size;150 # _data_column.name -_data_column.code +_data_column.code|_data_column.alt_code (optional: used for specifying search code when different from original code) _data_column.group_id _data_column.data_type _data_column.min_col_width @@ -35,7 +35,7 @@ _data_column.preferred_col_width _data_column.is_shown_by_default _data_column.is_searchable Entry Name;entry name;String;g3;90;150;95;true;true -Protein names;protein names;String;g3;300;1500;500;true;true +Protein names;protein names|protein name;String;g3;300;1500;500;true;true Gene Names;genes;String;g3;50;1000;95;true;true Organism;organism;String;g3;50;1000;95;true;true Organism ID;organism-id;int;g3;60;100;80;false;true @@ -53,7 +53,7 @@ Mass spectrometry;comment(MASS SPECTROMETRY);String;g7;50;1000;95;false;false Polymorphism;comment(POLYMORPHISM);String;g7;50;1000;95;false;false RNA editing;comment(RNA EDITING);String;g7;50;1000;95;false;false Sequence caution;comment(SEQUENCE CAUTION);String;g7;50;1000;95;false;false -Length;length;int;g7;50;100;95;false;true +Length;length;int;g7;50;100;65;true;true Mass;mass;String;g7;50;100;80;false;true Sequence;sequence;String;g7;50;1000;95;false;true Alternative sequence;feature(ALTERNATIVE SEQUENCE);String;g7;50;1000;95;false;false @@ -87,8 +87,8 @@ Caution;comment(CAUTION);String;g6;50;1000;95;false;false Miscellaneous [CC];comment(GENERAL);String;g6;50;1000;95;false;false Keywords;keywords;String;g6;50;1000;95;false;true Protein existence;existence;String;g6;50;1000;95;false;true -Status;reviewed;String;g6;50;1000;95;false;true -ALL;name;String;g7;50;1000;95;false;true; +Status;reviewed;String;g6;50;100;95;true;true +ALL;Search All;String;g7;50;1000;95;false;true; Subunit structure [CC];comment(SUBUNIT);String;g9;50;1000;95;false;false Interacts with;interactor;String;g9;50;1000;95;false;true Developmental stage;comment(DEVELOPMENTAL STAGE);String;g10;50;1000;95;false;false @@ -126,8 +126,8 @@ Beta strand;feature(BETA STRAND);String;g15;50;1000;95;false;false Helix;feature(HELIX);String;g15;50;1000;95;false;false Turn;feature(TURN);String;g15;50;1000;95;false;false PubMed ID;citation;String;g16;50;1000;95;false;true -Date of creation;created;String;g17;80;150;100;true;true -Date of last modification;last-modified;String;g17;80;150;100;true;true +Date of creation;created;String;g17;80;150;100;false;true +Date of last modification;last-modified;String;g17;80;150;100;false;true Date of last sequence modification;sequence-modified;String;g17;80;150;100;false;true Version (entry);version(entry);int;g17;80;100;80;false;false Domain [CC];comment(DOMAIN);String;g18;80;1000;95;false;false diff --git a/src/jalview/fts/api/FTSDataColumnI.java b/src/jalview/fts/api/FTSDataColumnI.java index ea30d01..7741d73 100644 --- a/src/jalview/fts/api/FTSDataColumnI.java +++ b/src/jalview/fts/api/FTSDataColumnI.java @@ -44,6 +44,13 @@ public interface FTSDataColumnI public String getCode(); /** + * Returns the alternative code value for the data column + * + * @return the data column's code + */ + public String getAltCode(); + + /** * Returns the minimum width of the data column * * @return the data column's minimum width diff --git a/src/jalview/fts/core/FTSRestClient.java b/src/jalview/fts/core/FTSRestClient.java index 0605fef..e3e2354 100644 --- a/src/jalview/fts/core/FTSRestClient.java +++ b/src/jalview/fts/core/FTSRestClient.java @@ -131,7 +131,14 @@ public abstract class FTSRestClient implements FTSRestClientI @Override public String getCode() { - return lineData[1]; + return lineData[1].split("\\|")[0]; + } + + @Override + public String getAltCode() + { + return lineData[1].split("\\|").length > 1 ? lineData[1] + .split("\\|")[1] : getCode(); } @Override diff --git a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java index c8e21e0..7eda9f8 100644 --- a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java +++ b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java @@ -58,8 +58,12 @@ public class UniProtFTSRestClient extends FTSRestClient int responseSize = (uniportRestRequest.getResponseSize() == 0) ? getDefaultResponsePageSize() : uniportRestRequest.getResponseSize(); - String query = uniportRestRequest.getFieldToSearchBy() + ":" - + uniportRestRequest.getSearchTerm(); + String query = uniportRestRequest.getFieldToSearchBy() + .equalsIgnoreCase("Search All") ? uniportRestRequest + .getSearchTerm() + : uniportRestRequest.getFieldToSearchBy() + ":" + + uniportRestRequest.getSearchTerm(); + // + (uniportRestRequest.isAllowUnpublishedEntries() ? "" // : " AND status:REL"); // System.out.println(">>>>> Query : " + query); diff --git a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java index dcef358..21343d3 100644 --- a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java +++ b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java @@ -63,7 +63,7 @@ public class UniprotFTSPanel extends GFTSPanel long startTime = System.currentTimeMillis(); String searchTarget = ((FTSDataColumnI) cmb_searchTarget - .getSelectedItem()).getCode(); + .getSelectedItem()).getAltCode(); wantedFields = UniProtFTSRestClient.getInstance() .getAllDefaulDisplayedDataColumns();