markCalcIds();
}
- private static String calcIdPrefix = "JalviewPDB:";
+ private static String calcIdPrefix = "JalviewPDB";
public static boolean isCalcIdHandled(String calcId)
{
return calcId != null
- && (calcId.startsWith(calcIdPrefix) && calcId.indexOf(
- calcIdPrefix,
- calcIdPrefix.length() + 1) > -1);
+ && (calcIdPrefix.equals(calcId));
}
- public static boolean isCalcIdForFile(String calcId, String pdbFile)
+
+ public static boolean isCalcIdForFile(AlignmentAnnotation alan, String pdbFile)
{
- return (calcId != null && calcId.startsWith(calcIdPrefix + pdbFile
- + ":" + calcIdPrefix));
+ return alan.getCalcId() != null
+ && calcIdPrefix.equals(alan.getCalcId())
+ && pdbFile.equals(alan.getProperty("PDBID"));
}
public static String relocateCalcId(String calcId,
{
oldId = "";
}
- aa.setCalcId("JalviewPDB:" + id + ":JalviewPDB:" + oldId);
+ aa.setCalcId(calcIdPrefix);
+ aa.setProperty("PDBID", id);
+ aa.setProperty("oldCalcId", oldId);
}
}
}
{
for (AlignmentAnnotation ala : ds.getAnnotation())
{
-
// false if any annotation present from this structure
// JBPNote this fails for jmol/chimera view because the *file* is
// passed, not the structure data ID -
- if (MCview.PDBfile.isCalcIdForFile(ala.getCalcId(),
+ if (MCview.PDBfile.isCalcIdForFile(ala,
findIdForPDBFile(pdbFile)))
{
parseSecStr = false;
{
System.out.println("CalcId: " + aa.getCalcId());
- assertTrue(MCview.PDBfile.isCalcIdForFile(aa.getCalcId(), pdbId));
+ assertTrue(MCview.PDBfile.isCalcIdForFile(aa, pdbId));
}
}
}
&& MCview.PDBfile.isCalcIdHandled(ana.getCalcId()))
{
exists = true;
- if (MCview.PDBfile.isCalcIdForFile(ana.getCalcId(),
+ if (MCview.PDBfile.isCalcIdForFile(ana,
pdbentry.getId()))
{
found = true;