!entity.getComment().contains(EXPERIMENTAL_FORM_ENTITY_COMMENT) && !existingEntity.getComment().contains(EXPERIMENTAL_FORM_ENTITY_COMMENT) entity.getComment().contains(EXPERIMENTAL_FORM_ENTITY_COMMENT) && existingEntity.getComment().contains(EXPERIMENTAL_FORM_ENTITY_COMMENT) && entity.getDisplayName().equalsIgnoreCase(existingEntity.getDisplayName()) if(existingEntity.getEvidence().isEmpty() && entity.getEvidence().isEmpty() && existingEntity.isEquivalent(entity)) { toReturn = (Entity) existingEntity; break;
/** * Checks if the ID of the PhysicalEntity is in the set. * @param e PhysicalEntity or Gene to check * @return true if ubique */ public boolean isUbique(Entity e) { return uris.contains(e.getUri()); } }
private void addAvailabilityAndProvenance(Entity bpEntity, Set<String> avail, Provenance pro) { if(pro != null) bpEntity.addDataSource(pro); if(avail != null) for(String a : avail) bpEntity.addAvailability(a); }
bpInteraction.addComment(c); bpInteraction.addEvidence(evidence); bpInteraction.addName(name); if (shortName != null) { if(shortName.length()<51) bpInteraction.setDisplayName(shortName); else bpInteraction.addName(shortName); bpInteraction.addXref(bpXref);
for (Xref xref : pe.getXref()) String name = pe.getDisplayName(); name = pe.getStandardName(); if (!pe.getName().isEmpty()) name = pe.getName().iterator().next();
g.setId(convertID(e.getUri())); String s = typeMatchMap.get(e.getModelInterface()); if(( //use 'or' sbgn class for special generic physical entities e instanceof Complex && !((Complex)e).getMemberPhysicalEntity().isEmpty() uris.add(e.getUri()); sbgn2BPMap.put(g.getId(), uris);
for(ExperimentDescription exp : experimentalInteractor.getExperiments()) { LOG.debug("createBiopaxEntity, making EFs for exp: " + exp.getId() + "; exp.ent: " + expEntity.getUri()); createAddExperimentalForm(participant, participantEvidence, expEntity, exp); + "; exp.ent: " + expEntity.getUri()); createAddExperimentalForm(participant, participantEvidence, expEntity, null); entity.addEvidence(participantEvidence);
/** * Initially, we don't want to represent every PhysicalEntity or Gene node. * For example, if a Complex is nested under another Complex, * and if it is not a participant of any interaction, * then we don't want to draw it separately; also skip for dangling entities. * * @param ent physical entity or gene (it returns false for other entity types) to test * @return true if we want to draw this entity in SBGN; false - otherwise, or - to be auto-created later */ private boolean needsToBeCreatedInitially(Entity ent) { boolean create = false; if(ent instanceof PhysicalEntity || ent instanceof Gene) { if(ubiqueDet != null && ubiqueDet.isUbique(ent)) create = false; // ubiques will be created where they are actually used. else if (!ent.getParticipantOf().isEmpty()) create = true; else if(ent instanceof Complex && ((Complex) ent).getComponentOf().isEmpty() && ((Complex) ent).getMemberPhysicalEntityOf().isEmpty()) create = true; //do make a root/top complex despite it's dangling } return create; }
ef.addComment(EXPERIMENTAL_FORM_ENTITY_COMMENT + ": " + expEntity.getDisplayName());
/** * Gets the Availability Field. * * @param bpe BioPAX element * @return availability field or null, if not available. */ public static String getAvailability(BioPAXElement bpe) { if(bpe instanceof physicalEntityParticipant) { return getAvailability(((physicalEntityParticipant)bpe).getPHYSICAL_ENTITY()); } String availability = null; if (bpe instanceof entity) { availability = ((entity)bpe).getAVAILABILITY().toString(); } else if(bpe instanceof Entity) { availability = ((Entity)bpe).getAvailability().toString(); } return availability; }
entity.addComment(name); else entity.addName(name); entity.setDisplayName(shortName); entity.addName(synonym); entity.addXref((Xref) xref); entity.addComment(EXPERIMENTAL_FORM_ENTITY_COMMENT); else entity.addComment("psi-mi participant");
private void createEntityNodes(CyNetwork network) { Set<Entity> entities = model.getObjects(Entity.class); for(Entity bpe: entities) { // do not make nodes for top/main pathways if(bpe instanceof Pathway) { if(bpe.getParticipantOf().isEmpty() && ((Process)bpe).getPathwayComponentOf().isEmpty()) continue; } // Create node symbolizing the interaction CyNode node = network.addNode(); bpeToCyNodeMap.put(bpe, node); // traverse createAttributesFromProperties(bpe, model, node, network); } if(log.isDebugEnabled()) log.debug(network.getRow(network).get(CyNetwork.NAME, String.class) + "" + network.getNodeList().size() + " nodes created."); }
/** * Gets the representing glyph of the PhysicalEntity or Gene. * @param e PhysicalEntity or Gene to get its glyph * @param linkID Edge id, used if the Entity is ubique * @return Representing glyph */ private Glyph getGlyphToLink(Entity e, String linkID) { if (ubiqueDet == null || !ubiqueDet.isUbique(e)) { return glyphMap.get(convertID(e.getUri())); } else { // Create a new glyph for each use of ubique Glyph g = createGlyphBasics(e, false); g.setId(convertID(e.getUri()) + "_" + ModelUtils.md5hex(linkID)); Set<String> uris = new HashSet<String>(); uris.add(e.getUri()); sbgn2BPMap.put(g.getId(), uris); if(e instanceof PhysicalEntity && ((PhysicalEntity)e).getCellularLocation() != null) { assignLocation((PhysicalEntity) e, g); } ubiqueSet.add(g); return g; } }
String id = convertID(e.getUri()); if (glyphMap.containsKey(id)) return glyphMap.get(id);