import javax.ws.rs.HttpMethod;
+import com.stevesoft.pat.Regex;
+
/**
* Base class for Ensembl REST service clients
*
private final static long RETEST_INTERVAL = 10000L; // 10 seconds
+ private static final Regex TRANSCRIPT_REGEX = new Regex(
+ "(ENS)([A-Z]{3}|)T[0-9]{11}$");
+
+ private static final Regex GENE_REGEX = new Regex(
+ "(ENS)([A-Z]{3}|)G[0-9]{11}$");
+
private static boolean ensemblRestAvailable = false;
private static long lastCheck = -1;
protected volatile boolean inProgress = false;
+ public static boolean isTranscriptIdentifier(String query)
+ {
+ return query == null ? false : TRANSCRIPT_REGEX.search(query);
+ }
+
+ public static boolean isGeneIdentifier(String query)
+ {
+ return query == null ? false : GENE_REGEX.search(query);
+ }
+
@Override
public boolean queryInProgress()
{