System.out.println( interaction.getNames().getShortLabel() );
/** * Build a new Interaction with no participants but holding a copy of all other attributes of the given interaction. * <br/> WARNING: all attributes of the newly created interaction are the same as the source's (that is same object * instance). This is not an object clone. * * @param source the source interaction. * @return a target interaction which is a copy of the source interaction but the participants or * inferredInteractions. */ protected Interaction copyInteraction(Interaction source) { Interaction target = new Interaction(); // clone inner attributes target.setId(source.getId()); target.setImexId(source.getImexId()); // objects target.setNames(source.getNames()); target.setXref(source.getXref()); // collections target.getConfidences().addAll(source.getConfidences()); target.getExperiments().addAll(source.getExperiments()); target.getInteractionTypes().addAll(source.getInteractionTypes()); // added with mitab 27 target.setModelled(source.isModelled()); target.setIntraMolecular(source.isIntraMolecular()); target.setNegative(source.isNegative()); target.getParameters().addAll(source.getParameters()); target.getAttributes().addAll(source.getAttributes()); target.setAvailability(source.getAvailability()); return target; }
String shortName = null; if (interaction.hasNames()) { Names names = interaction.getNames(); name = (names.hasFullName()) ? names.getFullName() : ""; shortName = (names.hasShortLabel()) ? names.getShortLabel() : "";
private void processEdge(final Participant source, final Participant target, final Interaction interaction, final Collection<Participant> nodes, CyTable nodeTable, CyTable edgeTable) { Interactor sourceInteractor = source.getInteractor(); Interactor targetInteractor = target.getInteractor(); if (sourceInteractor == null || targetInteractor == null) { return; } final CyNode sourceCyNode = id2NodeMap.get(sourceInteractor.getId()); final CyNode targetCyNode = id2NodeMap.get(targetInteractor.getId()); // PPI does not have directinarity final CyEdge edge = network.addEdge(sourceCyNode, targetCyNode, false); // TODO: what's the best value for interaction? edgeTable.getRow(edge.getSUID()).set(CyEdge.INTERACTION, "pp"); final String sourceName = nodeTable.getRow(sourceCyNode.getSUID()).get(CyNetwork.NAME, String.class); final String targetName = nodeTable.getRow(targetCyNode.getSUID()).get(CyNetwork.NAME, String.class); edgeTable.getRow(edge.getSUID()).set(CyNetwork.NAME, sourceName + " (pp) " + targetName); mapNames(edgeTable, edge.getSUID(), interaction.getNames(), null); mapAttributes(interaction.getAttributes(), edgeTable, edge.getSUID()); final Collection<InteractionType> types = interaction.getInteractionTypes(); mapInteractionType(types, edgeTable, edge.getSUID()); }
IntactConverterUtils.populateNames(psiObject.getNames(), interaction, aliasConverter); IntactConverterUtils.populateXref(psiObject.getXref(), interaction, xrefConverter); IntactConverterUtils.populateAnnotations(psiObject, interaction, getInstitution(), annotationConverter); throw new PsiConversionException("Problem converting PSI interaction to Intact: "+psiObject.getNames(), t);
jInteraction.setNames( namesConverter.toJaxb( mInteraction.getNames() ) );
jInteraction.setNames( namesConverter.toJaxb( mInteraction.getNames() ) );