Collection<Entity> getParticipants(Process process, Collection<Process> visited) { Collection<Entity> ret = new HashSet<Entity>(); // escape infinite loop if(visited.contains(process)) { //"Step Processes Form a Loop!" return ret; // empty } visited.add(process); if(process instanceof Interaction) { for(Entity pat : ((Interaction) process).getParticipant()) { if(pat instanceof PhysicalEntity || pat instanceof Gene) ret.add(pat); } } else { // a pathway for (Process p : ((Pathway) process).getPathwayComponent()) { ret.addAll(getParticipants(p, visited)); } } return ret; }
/** * Collects the names of the related pathways. * @return pathway names */ public List<String> getPathwayNames() { Set<Pathway> set = getPathways(); List<String> names = new ArrayList<String>(); for (Pathway p : set) { String name = p.getDisplayName(); if (!names.contains(name)) names.add(name); } Collections.sort(names); return names; }
public boolean canCheck(Object thing) { return thing instanceof Pathway && ((Pathway)thing).getOrganism() != null; }
Collection<Pathway> pws = model.getObjects(Pathway.class); for(Pathway pw: pws) { if(pw.getPathwayComponentOf().isEmpty() && pw.getParticipantOf().isEmpty() && pw.getControlledOf().isEmpty()) { modelName.append(" ").append(getNodeName(pw));
@Override protected void visit(Object value, BioPAXElement bpe, Model model, PropertyEditor<?,?> editor) { if (value instanceof Process || value instanceof PathwayStep) { if (value instanceof Pathway && thing.getRDFId() .equalsIgnoreCase(((Pathway) value).getRDFId())) { error(thing, "cyclic.inclusion", false, getVisited().toString()); } else { if (log.isTraceEnabled()) log.trace("Traverse into " + value + " " + value.getClass().getSimpleName()); traverse((BioPAXElement) value, model); } } } };
System.currentTimeMillis() + "PaxtoolsPatternGeneratedMatch" + (++i)); pathway.setDisplayName("Match " + getLeadingZeros(i, inters.size()) + i); pathway.addPathwayComponent((Process) clonedModel.getByID(anInt.getUri()));
/** * Collects the related pathway URIs. * @return URIs */ public List<String> getPathwayUris() { List<String> uris = new ArrayList<String>(); for (Pathway p : getPathways()) { String uri = p.getUri(); if (!uris.contains(uri)) uris.add(uri); } Collections.sort(uris); return uris; }
for (Pathway pathway : pathwayComponentOf) String s = pathway.getName().toString(); if (s.isEmpty())
interaction.getProcessOfPathway().add(pathwayStep.getPathwayOrderOf().getRDFId().split("#")[1]);
Collection<Entity> getParticipants(Process process, Collection<Process> visited) { Collection<Entity> ret = new HashSet<Entity>(); // escape infinite loop if(visited.contains(process)) { //"Step Processes Form a Loop!" return ret; // empty } visited.add(process); if(process instanceof Interaction) { for(Entity pat : ((Interaction) process).getParticipant()) { if(pat instanceof PhysicalEntity || pat instanceof Gene) ret.add(pat); } } else { // a pathway for (Process p : ((Pathway) process).getPathwayComponent()) { ret.addAll(getParticipants(p, visited)); } } return ret; }
public void check(final Pathway pathway, boolean fix) { final Collection<BioPAXElement> organisms = new HashSet<BioPAXElement>(); final BioSource organism = pathway.getOrganism(); // not null - due to the canCheck method!
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); } } } }
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); } } } }