molsel.append(chainCd);
molsel.append("}");
}
- selcom[pdbfnum] = molsel.toString();
- selectioncom.append("((");
- selectioncom.append(selcom[pdbfnum].substring(1,
- selcom[pdbfnum].length() - 1));
- selectioncom.append(" )& ");
- selectioncom.append(pdbfnum + 1);
- selectioncom.append(".1)");
- if (pdbfnum < files.length - 1)
+ if (molsel.length() > 1)
{
- selectioncom.append("|");
+ selcom[pdbfnum] = molsel.toString();
+ selectioncom.append("((");
+ selectioncom.append(selcom[pdbfnum].substring(1,
+ selcom[pdbfnum].length() - 1));
+ selectioncom.append(" )& ");
+ selectioncom.append(pdbfnum + 1);
+ selectioncom.append(".1)");
+ if (pdbfnum < files.length - 1)
+ {
+ selectioncom.append("|");
+ }
+ } else {
+ selcom[pdbfnum] = null;
}
}
}
for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)
{
- if (pdbfnum == refStructure)
+ if (pdbfnum == refStructure || selcom[pdbfnum]==null || selcom[refStructure]==null)
{
continue;
}
}
command.append(" ROTATE TRANSLATE;\n");
}
- System.out.println("Select regions:\n" + selectioncom.toString());
- evalStateCommand("select *; cartoons off; backbone; select ("
- + selectioncom.toString() + "); cartoons; ");
- // selcom.append("; ribbons; ");
- System.out.println("Superimpose command(s):\n" + command.toString());
-
- evalStateCommand(command.toString());
+ if (selectioncom.length() > 0)
+ {
+ System.out.println("Select regions:\n" + selectioncom.toString());
+ evalStateCommand("select *; cartoons off; backbone; select ("
+ + selectioncom.toString() + "); cartoons; ");
+ // selcom.append("; ribbons; ");
+ System.out
+ .println("Superimpose command(s):\n" + command.toString());
+
+ evalStateCommand(command.toString());
+ }
}
if (selectioncom.length() > 0)
{// finally, mark all regions that were superposed.