JAL-1705 regular expression updates, tests, other refactoring
[jalview.git] / src / jalview / ext / ensembl / EnsemblCdna.java
index f60125b..467fc6d 100644 (file)
@@ -10,9 +10,13 @@ import com.stevesoft.pat.Regex;
 
 public class EnsemblCdna extends EnsemblSeqProxy
 {
-  // TODO modify to accept other species e.g. ENSMUSPnnn
+  /*
+   * accepts ENST or ENSTG with 11 digits
+   * or ENSMUST or similar for other species
+   * or CCDSnnnnn.nn with at least 3 digits
+   */
   private static final Regex ACCESSION_REGEX = new Regex(
-          "(ENST|ENSG|CCDS)[0-9.]{3,}$");
+          "(ENS([A-Z]{3}|)[TG][0-9]{11}$)" + "|" + "(CCDS[0-9.]{3,}$)");
   
   /*
    * fetch exon features on genomic sequence (to identify the cdna regions)