import java.util.Hashtable;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import com.stevesoft.pat.Regex;
canonicalSourceNameLookup.put("pdb", DBRefSource.PDB);
canonicalSourceNameLookup.put("ensembl", DBRefSource.ENSEMBL);
+ // Ensembl Gn and Tr are for Ensembl genomic and transcript IDs as served
+ // from ENA.
+ canonicalSourceNameLookup.put("ensembl-tr", DBRefSource.ENSEMBL);
+ canonicalSourceNameLookup.put("ensembl-gn", DBRefSource.ENSEMBL);
+
+ // Make sure we have lowercase entries for all canonical string lookups
+ Set<String> keys = canonicalSourceNameLookup.keySet();
+ for (String k : keys)
+ {
+ canonicalSourceNameLookup.put(k.toLowerCase(),
+ canonicalSourceNameLookup.get(k));
+ }
dasCoordinateSystemsLookup.put("pdbresnum", DBRefSource.PDB);
dasCoordinateSystemsLookup.put("uniprot", DBRefSource.UNIPROT);
{
return true;
}
- return (o1 == null ? o2.equals(o1) : o1.equals(o2));
+ return o1.equals(o2);
}
/**
/**
* Returns the (possibly empty) list of those supplied dbrefs which have the
- * specified source databse
+ * specified source database, with a case-insensitive match of source name
*
* @param dbRefs
* @param source
{
for (DBRefEntry dbref : dbRefs)
{
- if (source.equals(dbref.getSource()))
+ if (source.equalsIgnoreCase(dbref.getSource()))
{
matches.add(dbref);
}