private void mapInteractionType(final Collection<InteractionType> types, final CyTable table, final Long suid) { if(types == null) return; final List<String> typeList = new ArrayList<String>(); for(final InteractionType type: types) { final String label = type.getNames().getShortLabel(); typeList.add(label); } table.getRow(suid).set(INTERACTION_TYPE, typeList); }
protected String displayParticipant(Participant p) { // fetch role String role = ""; for (ExperimentalRole aRole : p.getExperimentalRoles()) { if (role.length() > 0) { role += "&"; } if (aRole.hasNames()) { role += aRole.getNames().getShortLabel(); } else { role += "?"; } } // fetch interactor String interactor = p.getInteractor().getNames().getShortLabel(); return interactor + ":" + role; }
private String displayParticipant( Participant p ) { // fetch role String role = ""; for ( ExperimentalRole aRole : p.getExperimentalRoles() ) { if ( role.length() > 0 ) { role += "&"; } if ( aRole.hasNames() ) { role += aRole.getNames().getShortLabel(); } else { role += "?"; } } // fetch interactor String interactor = p.getInteractor().getNames().getShortLabel(); return interactor + ":" + role; }
/** * @param interaction * @return names of these interaction. */ private Names getInteractionName(Interaction interaction) { Names interactionName = null; Collection<Participant> participants = interaction.getParticipants(); for (Participant participant : participants) { if (interactionName != null) { String shortLabel = interactionName.getShortLabel().concat("-"); shortLabel = shortLabel.concat(participant.getInteractor().getNames().getShortLabel().split("_")[0]); interactionName.setShortLabel(shortLabel); } if (interactionName == null) { interactionName = new Names(); interactionName.setShortLabel(participant.getInteractor().getNames().getShortLabel().split("_")[0]); } } if (interactionName == null) { log.warn("Interaction don't have a name"); } return interactionName; }
private String getName(Names name) { if (name.hasShortLabel()) { return name.getShortLabel(); } else if (name.hasFullName()) { return name.getFullName(); } return null; }
name = cv.getNames().getShortLabel();
/** * Get the interactor's shortlabel. * @param interactor * @return the name of null of no shortlabel available. */ private String getName(Interactor interactor) { if( interactor.getNames() != null ) { if ( interactor.getNames().hasShortLabel() ) { return interactor.getNames().getShortLabel(); } } return null; } }
@Override protected Interactor newIntactObjectInstance( psidev.psi.mi.xml.model.Interactor psiObject ) { String shortLabel = psiObject.getNames().getShortLabel(); return newInteractorAccordingToType( psiObject.getOrganism(), shortLabel, psiObject.getInteractorType() ); }
public static String getShortLabelFromNames(Names names) { if ( names == null || names.getShortLabel() == null ) { return IntactConverterUtils.createTempShortLabel(); } String shortLabel = names.getShortLabel(); String fullName = names.getFullName(); // If the short label is null, but not the full name, use the full name as short label. // Truncate the full name if its length > SHORT_LABEL_LENGTH if (shortLabel == null) { if (fullName != null) { if (log.isWarnEnabled()) log.warn("Short label is null. Using full name as short label: " + fullName); shortLabel = fullName; } else { throw new NullPointerException("Both fullName and shortLabel are null"); } } if (shortLabel.length() > AnnotatedObject.MAX_SHORT_LABEL_LEN) { shortLabel = shortLabel.substring(0, AnnotatedObject.MAX_SHORT_LABEL_LEN); if (log.isWarnEnabled()) { String msg = "\tFull name to short label truncated to: '" + shortLabel+"'"; if (ConverterContext.getInstance().getLocation() != null && ConverterContext.getInstance().getLocation().getCurrentLocation() != null) { msg = msg + " in location: "+ ConverterContext.getInstance().getLocation().getCurrentLocation().pathFromRootAsString(); } log.warn(msg); } } return shortLabel; }
System.out.println( interaction.getNames().getShortLabel() ); String name = interactor.getNames().getShortLabel(); String type = interactor.getInteractorType().getNames().getShortLabel(); role = participant.getBiologicalRole().getNames().getShortLabel();
public psidev.psi.mi.xml253.jaxb.NamesType toJaxb( psidev.psi.mi.xml.model.Names mNames ) { if ( mNames == null ) { throw new IllegalArgumentException( "You must give a non null model Names." ); } psidev.psi.mi.xml253.jaxb.NamesType jNames = new psidev.psi.mi.xml253.jaxb.NamesType(); // Initialise the JAXB object reading the model // 1. set attributes // shortlabel jNames.setShortLabel( mNames.getShortLabel() ); // fullname jNames.setFullName( mNames.getFullName() ); // 2. set encapsulated objects // aliases for ( psidev.psi.mi.xml.model.Alias mAlias : mNames.getAliases() ) { jNames.getAlias().add( aliasConverter.toJaxb( mAlias ) ); } return jNames; } }
public psidev.psi.mi.xml254.jaxb.Names toJaxb( psidev.psi.mi.xml.model.Names mNames ) { if ( mNames == null ) { throw new IllegalArgumentException( "You must give a non null model Names." ); } psidev.psi.mi.xml254.jaxb.Names jNames = new psidev.psi.mi.xml254.jaxb.Names(); // Initialise the JAXB object reading the model // 1. set attributes // shortlabel jNames.setShortLabel( mNames.getShortLabel() ); // fullname jNames.setFullName( mNames.getFullName() ); // 2. set encapsulated objects // aliases for ( psidev.psi.mi.xml.model.Alias mAlias : mNames.getAliases() ) { jNames.getAlias().add( aliasConverter.toJaxb( mAlias ) ); } return jNames; } }
private boolean isStatusOfType( RangeStatus status, String psimiName, String psimiIdentifier ) { boolean hasMiNumber = false; if (status.getXref() != null){ if (status.getXref().getPrimaryRef() != null){ final DbReference ref = status.getXref().getPrimaryRef(); if (ref.getDbAc() != null){ if (ref.getDbAc().equals(CvDatabase.PSI_MI_MI_REF)){ hasMiNumber = true; } else if (ref.getDb().equalsIgnoreCase(CvDatabase.PSI_MI)){ hasMiNumber = true; } } } } if ( status.getXref() != null && psimiIdentifier != null && hasMiNumber) { final DbReference ref = status.getXref().getPrimaryRef(); return psimiIdentifier.equalsIgnoreCase( ref.getId() ); } else if (status.getNames() != null){ final Names names = status.getNames(); return psimiName.equalsIgnoreCase(names.getShortLabel()) || psimiName.equalsIgnoreCase(names.getFullName()); } return false; }
if (source.hasNames()) { Names names = source.getNames(); if (names.getShortLabel() != null) { sourceName = names.getShortLabel();
protected Object psiElementKey(Source psiObject) { String key; if (psiObject.getNames() != null) { key = "source:"+psiObject.getNames().getShortLabel(); } else if (psiObject.getXref() != null) { key = "source:xref:"+psiObject.getXref().getPrimaryRef().getId(); } else if (psiObject.getBibref() != null) { key = "source:bibref:"+psiObject.getBibref().getXref().getPrimaryRef().getId(); } else { throw new PsiConversionException("Could not create key to cache the source: "+psiObject); } return key; } }
String interactorTypeLabel = psiInteractorType.getNames().getShortLabel();
if (names1.getShortLabel() != null && names2.getShortLabel() == null){ return false; else if (names1.getShortLabel() == null && names2.getShortLabel() != null){ return false; else if (names1.getShortLabel() != null && names2.getShortLabel() != null && !names1.getShortLabel().equalsIgnoreCase(names2.getShortLabel())) { return false;
final String nameColumn = interactor.getNames().getShortLabel(); nodeTable.getRow(node.getSUID()).set(CyNetwork.NAME, nameColumn); final Names typeNames = itrType.getNames(); if(typeNames != null) { final String shortName = typeNames.getShortLabel(); nodeTable.getRow(node.getSUID()).set(INTERACTOR_TYPE, shortName);
evidence.addComment(names.getFullName().trim()); if(names.hasShortLabel()) evidence.addComment(names.getShortLabel().trim());
return; final String shortName = names.getShortLabel(); final String shortNameLael; final String fullNameLabel;