public void check(final Validation validation, EntityReference eref) { Set<Set<SimplePhysicalEntity>> clasters = algorithm.cluster(eref.getEntityReferenceOf(), Integer.MAX_VALUE); // report the error case once per cluster for (Set<SimplePhysicalEntity> col : clasters) { if(col.size() > 1) { SimplePhysicalEntity u = col.iterator().next(); col.remove(u); error(validation, eref, "same.state.entity", false, u, col); } } }
public void check(EntityReference eref, boolean fix) { Set<Set<SimplePhysicalEntity>> clasters = algorithm.cluster(eref.getEntityReferenceOf(), Integer.MAX_VALUE); // report the error case once per cluster for (Set<SimplePhysicalEntity> col : clasters) { if(col.size() > 1) { SimplePhysicalEntity u = col.iterator().next(); col.remove(u); error(eref, "same.state.entity", false, u, BiopaxValidatorUtils.getIdListAsString(col)); } } }
/** * Given a model this method will analyze the states and populate the stateChangeMap and extendedControls maps. * @param model to be analyzed. */ public void analyzeStates(Model model) { GroupMap groupMap = Grouper.inferGroups(model); ModelUtils.replaceEquivalentFeatures(model); stateChangeMap = new HashMap<BioPAXElement, Set<PEStateChange>>(); extendedControls = new HashMap<Conversion, Set<EntityReference>>(); for (EntityReference pr : model.getObjects(EntityReference.class)) { if (!pr.getRDFId().startsWith("http://biopax.org/generated/fixer/normalizeGenerics/")) { Set<PEStateChange> stateChanges = stateChangeMap.get(pr); if (stateChanges == null) { stateChanges = new HashSet<PEStateChange>(); stateChangeMap.put(pr, stateChanges); } for (SimplePhysicalEntity spe : pr.getEntityReferenceOf()) { scanInteractions(groupMap, stateChanges, pr, spe); } } } }
for(SimplePhysicalEntity spe : er.getEntityReferenceOf()) { if(spe.getDisplayName() == null || spe.getDisplayName().trim().length() == 0) { if(er.getDisplayName() != null && er.getDisplayName().trim().length() > 0) {
for(SimplePhysicalEntity spe : er.getEntityReferenceOf()) { if(spe.getDisplayName() == null || spe.getDisplayName().trim().length() == 0) { if(er.getDisplayName() != null && er.getDisplayName().trim().length() > 0) {
assert(((Xref)clone).getXrefOf().isEmpty()); else if(clone instanceof EntityReference) assert(((EntityReference)clone).getEntityReferenceOf().isEmpty());
er.removeEntityFeature(ef); er.addEntityFeature(newEf); for(SimplePhysicalEntity spe : er.getEntityReferenceOf()) {