git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-1705 various refactoring towards Uniprot-to-Ensembl fetching
[jalview.git]
/
src
/
jalview
/
ws
/
seqfetcher
/
DbSourceProxyImpl.java
diff --git
a/src/jalview/ws/seqfetcher/DbSourceProxyImpl.java
b/src/jalview/ws/seqfetcher/DbSourceProxyImpl.java
index
0a4d9a8
..
84072c0
100644
(file)
--- a/
src/jalview/ws/seqfetcher/DbSourceProxyImpl.java
+++ b/
src/jalview/ws/seqfetcher/DbSourceProxyImpl.java
@@
-24,8
+24,6
@@
import jalview.datamodel.AlignmentI;
import jalview.io.FormatAdapter;
import jalview.io.IdentifyFile;
import jalview.io.FormatAdapter;
import jalview.io.IdentifyFile;
-import com.stevesoft.pat.Regex;
-
/**
* common methods for implementations of the DbSourceProxy interface.
*
/**
* common methods for implementations of the DbSourceProxy interface.
*
@@
-102,23
+100,20
@@
public abstract class DbSourceProxyImpl implements DbSourceProxy
return sequences;
}
return sequences;
}
+ /**
+ * Returns the first accession id in the query (up to the first accession id
+ * separator), or the whole query if there is no separator or it is not found
+ */
@Override
public String getAccessionIdFromQuery(String query)
{
@Override
public String getAccessionIdFromQuery(String query)
{
- Regex vgr = getAccessionValidator();
- if (vgr == null)
+ String sep = getAccessionSeparator();
+ if (sep == null)
{
return query;
}
{
return query;
}
- vgr.search(query);
- if (vgr.numSubs() > 0)
- {
- return (vgr.stringMatched(1));
- }
- else
- {
- return (vgr.stringMatched());
- }
+ int sepPos = query.indexOf(sep);
+ return sepPos == -1 ? query : query.substring(0, sepPos);
}
/**
}
/**