public static Collection<Attribute> extractAuthorConfidencesFrom(Collection<Attribute> attributes){ if (attributes != null && !attributes.isEmpty()){ Collection<Attribute> attributesConf = new ArrayList<Attribute>(attributes.size()); for (Attribute att : attributes){ if (att.getNameAc() != null){ if (att.getNameAc().equals(AUTH_CONF_MI)){ attributesConf.add(att); } } else if (att.getName() != null){ if (att.getName().equals(AUTH_CONF)){ attributesConf.add(att); } } } return attributesConf; } return Collections.EMPTY_LIST; }
public Collection<Attribute> extractPublicationAttributesFromExperiment(ExperimentDescription expDesc){ if (!expDesc.hasAttributes()){ return Collections.EMPTY_LIST; } Collection<Attribute> attributes = new ArrayList<Attribute>(expDesc.getAttributes().size()); for (Attribute attr : expDesc.getAttributes()){ if (attr.getNameAc() != null){ if (publicationTopicsMi.contains(attr.getNameAc())){ attributes.add(attr); } } else if (attr.getName() != null){ if (publicationTopics.contains(attr.getName().toLowerCase())){ attributes.add(attr); } } } return attributes; }
private Set<String> getAttributes(Collection<Attribute> attributes) { // set to return Set<String> toReturn = new HashSet<String>(); // iterate over the attributes for (Attribute attribute : attributes) { String attributeStr = ""; if (attribute.hasValue()) { attributeStr = attribute.getValue(); } String name = attribute.getName(); attributeStr = (name != null) ? attributeStr += " " + name : attributeStr; if (attribute.hasNameAc()) { attributeStr += " " + attribute.getNameAc(); } if (attributeStr.length() > 0) toReturn.add(attributeStr); } return toReturn; }
public Annotation psiToIntact(Attribute psiObject) { psiStartConversion(psiObject); CvTopic cvTopic = new CvTopic(getInstitution(), psiObject.getName()); // all name Acs should be from psi mi controlled vocabularies if (psiObject.getNameAc() != null) { cvTopic.setIdentifier(psiObject.getNameAc()); psiMiPopulator.populateWithPsiMi(cvTopic, psiObject.getNameAc()); } Annotation annotation = new Annotation(getInstitution(), cvTopic, psiObject.getValue()); psiEndConversion(psiObject); return annotation; }
private void mapAttributes(final Collection<Attribute> attrs, final CyTable table, final Long suid) { for(Attribute attr: attrs) { final String name = attr.getName(); if(table.getColumn(name) == null) table.createListColumn(name, String.class, false); final CyRow row = table.getRow(suid); List<String> list = row.getList(name, String.class); if(list == null) list = new ArrayList<String>(); final String nameAc = attr.getNameAc(); final String value = attr.getValue(); list.add(value); row.set(name, list); } }
public psidev.psi.mi.xml254.jaxb.Attribute toJaxb( psidev.psi.mi.xml.model.Attribute mAttribute ) { if ( mAttribute == null ) { throw new IllegalArgumentException( "You must give a non null model attribute." ); } psidev.psi.mi.xml254.jaxb.Attribute jAttribute = new psidev.psi.mi.xml254.jaxb.Attribute(); // Initialise the JAXB object reading the model // 1. set attributes jAttribute.setName( mAttribute.getName() ); jAttribute.setNameAc( mAttribute.getNameAc() ); jAttribute.setValue( mAttribute.getValue() ); return jAttribute; } }
public psidev.psi.mi.xml253.jaxb.AttributeListType.Attribute toJaxb( psidev.psi.mi.xml.model.Attribute mAttribute ) { if ( mAttribute == null ) { throw new IllegalArgumentException( "You must give a non null model attribute." ); } psidev.psi.mi.xml253.jaxb.AttributeListType.Attribute jAttribute = new psidev.psi.mi.xml253.jaxb.AttributeListType.Attribute(); // Initialise the JAXB object reading the model // 1. set attributes jAttribute.setName( mAttribute.getName() ); jAttribute.setNameAc( mAttribute.getNameAc() ); jAttribute.setValue( mAttribute.getValue() ); return jAttribute; } }
if (attribute.getName().equals("comment") || attribute.getNameAc().equals("MI:0612")) { if (attribute.getValue() != null && attribute.getValue().contains("Stoichiometry:")) { String[] s = attribute.getValue().split(" ");