geneIds.add(geneId);
}
}
+ else if (isProteinIdentifier(acc))
+ {
+ String tscriptId = new EnsemblLookup(getDomain()).getParent(acc);
+ if (tscriptId != null)
+ {
+ String geneId = new EnsemblLookup(getDomain())
+ .getParent(tscriptId);
+
+ if (geneId != null && !geneIds.contains(geneId))
+ {
+ geneIds.add(geneId);
+ }
+ }
+ // NOTE - acc is lost if it resembles an ENS.+ ID but isn't actually
+ // resolving to one... e.g. ENSMICP00000009241
+ }
+ /*
+ * if given a gene or other external name, lookup and fetch
+ * the corresponding gene for all model organisms
+ */
else
{
+ /*
+ * if given a gene or other external name, lookup and fetch
+ * the corresponding gene for all model organisms
+ */
List<String> ids = new EnsemblSymbol(getDomain(), getDbSource(),
- getDbVersion()).getIds(acc);
- for (String geneId : ids)
+ getDbVersion()).getGeneIds(acc);
+ for (String id : ids)
{
- if (!geneIds.contains(geneId))
+ if (!geneIds.contains(id))
{
- geneIds.add(geneId);
+ geneIds.add(id);
}
}
}
setDomain(d);
}
++<<<<<<< HEAD
+ /**
+ * Answers true if the query matches the regular expression pattern for an
+ * Ensembl transcript stable identifier
+ *
+ * @param query
+ * @return
+ */
+ public boolean isTranscriptIdentifier(String query)
+ {
+ return query == null ? false : TRANSCRIPT_REGEX.search(query);
+ }
+
+ /**
+ * Answers true if the query matches the regular expression pattern for an
+ * Ensembl protein stable identifier
+ *
+ * @param query
+ * @return
+ */
+ public boolean isProteinIdentifier(String query)
+ {
+ return query == null ? false : PROTEIN_REGEX.search(query);
+ }
+
+ /**
+ * Answers true if the query matches the regular expression pattern for an
+ * Ensembl gene stable identifier
+ *
+ * @param query
+ * @return
+ */
+ public boolean isGeneIdentifier(String query)
+ {
+ return query == null ? false : GENE_REGEX.search(query);
+ }
+
@Override
public boolean queryInProgress()
{