public boolean canCheck(Object thing) { return thing instanceof PathwayStep /* can be null, e.g., when the check is called * during a new PathwayStep is added to the model * but not yet assigned to any Pathway! * This is ignored. */ && ((PathwayStep)thing).getPathwayOrderOf() != null; }
public boolean canCheck(Object thing) { return thing instanceof PathwayStep && !((PathwayStep) thing).getNextStepOf().isEmpty(); }
public void check(PathwayStep step, boolean fix) { Pathway pathway = step.getPathwayOrderOf(); /* can be null, e.g., when the check is called * during a new PathwayStep is added to the model * but not yet assigned to any Pathway! This case is ignored. */ if (pathway != null) { Set<Process> pathwayComponents = pathway.getPathwayComponent(); for (Process stepProcess : step.getStepProcess()) { if (!pathwayComponents.contains(stepProcess)) { error(step, "component.not.found", false, stepProcess, pathway); } } } }
Collection<Entity> getParticipants(PathwayStep step) { // this is a protection from an infinite loop //(which normally should never occur; another rule will check that.) Collection<Process> processes = new HashSet<Process>(); Set<Entity> ret = new HashSet<Entity>(); if(step instanceof BiochemicalPathwayStep) { Conversion c = ((BiochemicalPathwayStep) step).getStepConversion(); ret.addAll( getParticipants(c, processes) ); } for(Process p : step.getStepProcess()) { ret.addAll( getParticipants(p, processes) ); } return ret; }
public void check(final Validation validation, PathwayStep step) { Pathway pathway = step.getPathwayOrderOf(); /* can be null, e.g., when the check is called * during a new PathwayStep is added to the model * but not yet assigned to any Pathway! This case is ignored. */ if (pathway != null) { Set<Process> pathwayComponents = pathway.getPathwayComponent(); for (Process stepProcess : step.getStepProcess()) { if (!pathwayComponents.contains(stepProcess)) { error(validation, step, "component.not.found", false, stepProcess, pathway); } } } }
Collection<Entity> getParticipants(PathwayStep step) { // this is a protection from an infinite loop //(which normally should never occur; another rule will check that.) Collection<Process> processes = new HashSet<Process>(); Set<Entity> ret = new HashSet<Entity>(); if(step instanceof BiochemicalPathwayStep) { Conversion c = ((BiochemicalPathwayStep) step).getStepConversion(); ret.addAll( getParticipants(c, processes) ); } for(Process p : step.getStepProcess()) { ret.addAll( getParticipants(p, processes) ); } return ret; }
public boolean canCheck(Object thing) { return thing instanceof PathwayStep /* can be null, e.g., when the check is called * during a new PathwayStep is added to the model * but not yet assigned to any Pathway! * This is ignored. */ && ((PathwayStep)thing).getPathwayOrderOf() != null; }
public boolean canCheck(Object thing) { return thing instanceof PathwayStep && !((PathwayStep) thing).getNextStepOf().isEmpty(); }
/** * Gets the direction of the Control chain the the Interaction. * @param conv controlled conversion * @param pathway the container pathway * @return the direction of the conversion related to the catalysis */ protected ConversionDirectionType getDirection(Conversion conv, Pathway pathway) { Set<StepDirection> dirs = new HashSet<StepDirection>(); // find the direction in the pathway step for (PathwayStep step : conv.getStepProcessOf()) { if (step.getPathwayOrderOf().equals(pathway) && step instanceof BiochemicalPathwayStep) { StepDirection dir = ((BiochemicalPathwayStep) step).getStepDirection(); if (dir != null) dirs.add(dir); } } if (dirs.size() > 1) return ConversionDirectionType.REVERSIBLE; else if (!dirs.isEmpty()) return convertStepDirection(dirs.iterator().next()); return getDirection(conv); }
public void check(PathwayStep step, boolean fix) { if(step.getNextStepOf().isEmpty()) return; // get all the participants Collection<Entity> thisStepParticipants = getParticipants(step); // now find participants intersection with each previous step: for (PathwayStep prevStep : step.getNextStepOf()) { Collection<Entity> participants = getParticipants(prevStep); // first set becomes the intersection of the two: participants.retainAll(thisStepParticipants); if (participants.isEmpty()) { error(step, "empty.participants.intersection", false, prevStep); } } }
/** * Gets the direction of the Control chain the the Interaction. * @param conv controlled conversion * @param pathway the container pathway * @param cont top control * @return the direction of the conversion related to the catalysis */ protected ConversionDirectionType getDirection(Conversion conv, Pathway pathway, Control cont) { for (Control ctrl : getControlChain(cont, conv)) { ConversionDirectionType dir = getCatalysisDirection(ctrl); if (dir != null) return dir; } Set<StepDirection> dirs = new HashSet<StepDirection>(); Set<PathwayStep> convSteps = conv.getStepProcessOf(); // maybe the direction is embedded in a pathway step for (PathwayStep step : cont.getStepProcessOf()) { if (pathway != null && !step.getPathwayOrderOf().equals(pathway)) continue; if (step instanceof BiochemicalPathwayStep && convSteps.contains(step)) { StepDirection dir = ((BiochemicalPathwayStep) step).getStepDirection(); if (dir != null) dirs.add(dir); } } if (dirs.size() > 1) return ConversionDirectionType.REVERSIBLE; else if (!dirs.isEmpty()) return convertStepDirection(dirs.iterator().next()); return getDirection(conv); }
public void check(final Validation validation, PathwayStep step) { if(step.getNextStepOf().isEmpty()) return; // get all the participants Collection<Entity> thisStepParticipants = getParticipants(step); // now find participants intersection with each previous step: for (PathwayStep prevStep : step.getNextStepOf()) { Collection<Entity> participants = getParticipants(prevStep); // first set becomes the intersection of the two: participants.retainAll(thisStepParticipants); if (participants.isEmpty()) { error(validation, step, "empty.participants.intersection", false, prevStep); } } }
interaction.getProcessOfPathway().add(pathwayStep.getPathwayOrderOf().getRDFId().split("#")[1]);