private String getName(Names name) { if (name.hasShortLabel()) { return name.getShortLabel(); } else if (name.hasFullName()) { return name.getFullName(); } return null; }
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; } }
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; }
public static void populateNames(Names names, AnnotatedObject<?, ?> annotatedObject) { String shortLabel = getShortLabelFromNames(names); if (names == null && (annotatedObject instanceof Experiment) ) { shortLabel = createExperimentTempShortLabel(); } if ( ! ( annotatedObject instanceof Institution ) ) { if ( shortLabel != null ) { shortLabel = shortLabel.toLowerCase(); } } annotatedObject.setShortLabel(shortLabel); if (names != null) { annotatedObject.setFullName(names.getFullName()); Class<?> aliasClass = AnnotatedObjectUtils.getAliasClassType(annotatedObject.getClass()); AliasConverter aliasConverter = new AliasConverter(getInstitution(annotatedObject), aliasClass); populateAliases(names.getAliases(), annotatedObject, aliasConverter); } }
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; }
public static void populateNames(Names names, AnnotatedObject<?, ?> annotatedObject, AliasConverter aliasConverter) { String shortLabel = getShortLabelFromNames(names); if (names == null && (annotatedObject instanceof Experiment) ) { shortLabel = createExperimentTempShortLabel(); } if ( ! ( annotatedObject instanceof Institution ) ) { if ( shortLabel != null ) { shortLabel = shortLabel.toLowerCase(); } } annotatedObject.setShortLabel(shortLabel); if (names != null) { annotatedObject.setFullName(names.getFullName()); if (aliasConverter == null){ Class<?> aliasClass = AnnotatedObjectUtils.getAliasClassType(annotatedObject.getClass()); aliasConverter = new AliasConverter(getInstitution(annotatedObject), aliasClass); } populateAliases(names.getAliases(), annotatedObject, aliasConverter); } }
sourceName = names.getShortLabel(); else if (names.getFullName() != null) { sourceName = names.getFullName(); } else { sourceName = UNKNOWN;
String fullName = xmlInteractor.getNames().getFullName(); if (fullName != null) { psidev.psi.mi.tab.model.Alias a = new psidev.psi.mi.tab.model.AliasImpl(UNKNOWN, fullName); String fullName = o.getNames().getFullName(); if (fullName != null && !shortLabel.equalsIgnoreCase(fullName)) { organismXrefs.add(new CrossReferenceImpl("taxid", taxId, fullName)); if (featureType.hasNames()) { String shortLabel = featureType.getNames().getShortLabel(); String fullName = featureType.getNames().getFullName(); String fullName = xmlFeature.getNames().getFullName();
if (unit.getNames() != null) { type = unit.getNames().getShortLabel(); text = unit.getNames().getFullName();
Names psiNames = interactor.getNames(); if (psiNames != null) { name = (psiNames.hasFullName()) ? psiNames.getFullName() : null; shortName = (psiNames.hasShortLabel()) ? psiNames.getShortLabel() : null; if (psiNames.hasAliases()) {
if (interaction.hasNames()) { Names names = interaction.getNames(); name = (names.hasFullName()) ? names.getFullName() : ""; shortName = (names.hasShortLabel()) ? names.getShortLabel() : "";
interactorTypeLabel = psiInteractorType.getNames().getFullName();
if (names1.getFullName() != null && names2.getFullName() == null){ return false; else if (names1.getFullName() == null && names2.getFullName() != null){ return false; else if (names1.getFullName() != null && names2.getFullName() != null && !names1.getFullName().equalsIgnoreCase(names2.getFullName())) { return false;
Names names = experimentDescription.getNames(); if(names.hasFullName()) evidence.addComment(names.getFullName().trim()); if(names.hasShortLabel()) evidence.addComment(names.getShortLabel().trim());
final String fullName = names.getFullName(); if(fullName != null) { if(table.getColumn(fullNameLabel) == null)
experiment.setFullName(psiObject.getNames().getFullName());