/*
* lookup from lower-case form of a name to its canonical (standardised) form
*/
- private static Map<String, String> canonicalSourceNameLookup = new HashMap<String, String>();
+ private static Map<String, String> canonicalSourceNameLookup = new HashMap<>();
- private static Map<String, String> dasCoordinateSystemsLookup = new HashMap<String, String>();
static
{
canonicalSourceNameLookup.get(k));
}
- dasCoordinateSystemsLookup.put("pdbresnum", DBRefSource.PDB);
- dasCoordinateSystemsLookup.put("uniprot", DBRefSource.UNIPROT);
- dasCoordinateSystemsLookup.put("embl", DBRefSource.EMBL);
- // dasCoordinateSystemsLookup.put("embl", DBRefSource.EMBLCDS);
}
/**
{
return dbrefs;
}
- HashSet<String> srcs = new HashSet<String>();
+ HashSet<String> srcs = new HashSet<>();
for (String src : sources)
{
srcs.add(src.toUpperCase());
}
- List<DBRefEntry> res = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> res = new ArrayList<>();
for (DBRefEntry dbr : dbrefs)
{
String source = getCanonicalName(dbr.getSource());
}
/**
- * isDasCoordinateSystem
- *
- * @param string
- * String
- * @param dBRefEntry
- * DBRefEntry
- * @return boolean true if Source DBRefEntry is compatible with DAS
- * CoordinateSystem name
- */
-
- public static boolean isDasCoordinateSystem(String string,
- DBRefEntry dBRefEntry)
- {
- if (string == null || dBRefEntry == null)
- {
- return false;
- }
- String coordsys = dasCoordinateSystemsLookup.get(string.toLowerCase());
- return coordsys == null ? false
- : coordsys.equals(dBRefEntry.getSource());
- }
-
- /**
* look up source in an internal list of database reference sources and return
* the canonical jalview name for the source, or the original string if it has
* no canonical form.
static List<DBRefEntry> searchRefs(DBRefEntry[] refs, DBRefEntry entry,
DbRefComp comparator)
{
- List<DBRefEntry> rfs = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> rfs = new ArrayList<>();
if (refs == null || entry == null)
{
return rfs;
else
{
// default:
- ref = new DBRefEntry(locsrc, version, acn);
+ ref = new DBRefEntry(locsrc, version, acn.trim());
}
}
if (ref != null)
public static List<DBRefEntry> searchRefsForSource(DBRefEntry[] dbRefs,
String source)
{
- List<DBRefEntry> matches = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> matches = new ArrayList<>();
if (dbRefs != null && source != null)
{
for (DBRefEntry dbref : dbRefs)
// nothing to do
return;
}
- List<DBRefEntry> selfs = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> selfs = new ArrayList<>();
{
DBRefEntry[] selfArray = selectDbRefs(!sequence.isProtein(),
sequence.getDBRefs());
selfs.remove(p);
}
}
- List<DBRefEntry> toPromote = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> toPromote = new ArrayList<>();
for (DBRefEntry p : pr)
{
- List<String> promType = new ArrayList<String>();
+ List<String> promType = new ArrayList<>();
if (sequence.isProtein())
{
switch (getCanonicalName(p.getSource()))