jInteractor.setId( mInteractor.getId() ); jInteractor.setInteractorType( cvTypeConverter.toJaxb( mInteractor.getInteractorType() ) ); if ( mInteractor.getNames() != null ) { jInteractor.setNames( namesConverter.toJaxb( mInteractor.getNames() ) ); if ( mInteractor.hasXref() ) { jInteractor.setXref( xrefConverter.toJaxb( mInteractor.getXref() ) ); if ( mInteractor.hasOrganism() ) { jInteractor.setOrganism( organismConverter.toJaxb( mInteractor.getOrganism(), psidev.psi.mi.xml254.jaxb.Interactor.Organism.class ) ); String sequence = mInteractor.getSequence(); if ( sequence != null ) { sequence = sequence.trim(); if ( mInteractor.hasAttributes() ) { jInteractor.setAttributeList( new AttributeList() ); for ( Attribute attribute : mInteractor.getAttributes() ) { jInteractor.getAttributeList().getAttributes().add( attributeConverter.toJaxb( attribute ) );
psidev.psi.mi.xml.model.Interactor mInteractor = new psidev.psi.mi.xml.model.Interactor(); mInteractor.setId( jInteractor.getId() ); mInteractor.setInteractorType( cvTypeConverter.fromJaxb( jInteractor.getInteractorType(), InteractorType.class ) ); mInteractor.setNames( namesConverter.fromJaxb( jInteractor.getNames() ) ); mInteractor.setXref( xrefConverter.fromJaxb( jInteractor.getXref() ) ); mInteractor.setOrganism( organismConverter.fromJaxb( jInteractor.getOrganism() ) ); sequence = sequence.trim(); mInteractor.setSequence( sequence ); mInteractor.getAttributes().add( attributeConverter.fromJaxb( attribute ) );
public static Interactor createInteractor(String primaryId, String dbMi, InteractorType interactorType, Organism organism) { Interactor interactor = new Interactor(); assignNextId(interactor); interactor.setNames(createNames(primaryId, null)); interactor.setInteractorType(interactorType); interactor.setOrganism(organism); interactor.setXref(createXrefIdentity(primaryId, dbMi, dbMi)); return interactor; }
@Override protected Interactor newIntactObjectInstance( psidev.psi.mi.xml.model.Interactor psiObject ) { String shortLabel = psiObject.getNames().getShortLabel(); return newInteractorAccordingToType( psiObject.getOrganism(), shortLabel, psiObject.getInteractorType() ); }
if (xmlInteractor.getXref() != null) { identityRefs = XrefUtils.searchByType(xmlInteractor.getXref(), IDENTITY, IDENTITY_REF); List<DbReference> allRefs = XrefUtils.getAllDbReferences(xmlInteractor.getXref()); List<DbReference> allRefs = XrefUtils.getAllDbReferences(xmlInteractor.getXref()); throw new TabConversionException("Could not find any identifiers for interactor " + xmlInteractor.getId()); if (xmlInteractor.getNames() != null) { Collection<Alias> aliases = xmlInteractor.getNames().getAliases(); String shortLabel = xmlInteractor.getNames().getShortLabel(); if (shortLabel != null) { psidev.psi.mi.tab.model.Alias a = new psidev.psi.mi.tab.model.AliasImpl(UNKNOWN, shortLabel); String fullName = xmlInteractor.getNames().getFullName(); if (fullName != null) { psidev.psi.mi.tab.model.Alias a = new psidev.psi.mi.tab.model.AliasImpl(UNKNOWN, fullName); if (xmlInteractor.hasOrganism()) { psidev.psi.mi.xml.model.Organism o = xmlInteractor.getOrganism(); List<CrossReference> organismXrefs = new ArrayList<CrossReference>(); String taxId = String.valueOf(o.getNcbiTaxId()); if (xmlInteractor.getInteractorType() != null) {
CvType interactorType = interactor.getInteractorType(); if (interactorType != null && interactorType.hasNames()) { entityType = getName(interactorType.getNames()); String shortName = null; Set<String> synonyms = new HashSet<String>(); Names psiNames = interactor.getNames(); if (psiNames != null) { name = (psiNames.hasFullName()) ? psiNames.getFullName() : null; if((interactor.hasOrganism() && interactor.getOrganism().hasCompartment())) { cellularLocation = findOrCreateControlledVocabulary( interactor.getOrganism().getCompartment(), CellularLocationVocabulary.class); LOG.warn("EntryMapper.createParticipant(): skip for interactor: " + interactor.getId() + " that has type: " + entityType + ", participant:" + participant.getId() + ")."); final RelationshipXref x = getInteractorPrimaryRef(interactor.getXref()); if(x != null) { baseUri += encode(x.getDb() + "_" + x.getId()); final Set<Xref> bpXrefsOfInteractor = getXrefs(interactor.getXref()); final BioSource bioSource = getBioSource(interactor); String newUri = baseUri + "_" + (counter++); LOG.warn("A different " + er.getModelInterface().getSimpleName() + ", URI=" + baseUri + ", was found; for interactor:" + interactor.getId() + ", a new ("+entityReferenceClass.getSimpleName()+") URI will be used:" + newUri);
return; final int id = interactor.getId(); final String nameColumn = interactor.getNames().getShortLabel(); nodeTable.getRow(node.getSUID()).set(CyNetwork.NAME, nameColumn); final InteractorType itrType = interactor.getInteractorType(); final Names typeNames = itrType.getNames(); if(typeNames != null) { nodeTable.getRow(node.getSUID()).set(INTERACTOR_TYPE, shortName); final Organism org = interactor.getOrganism(); if(org != null) { final Integer taxID = org.getNcbiTaxId(); mapNames(nodeTable, node.getSUID(), interactor.getNames(), null); mapAttributes(interactor.getAttributes(), nodeTable, node.getSUID());
psidev.psi.mi.xml.model.Interactor xmlInteractor = new psidev.psi.mi.xml.model.Interactor(); xmlInteractor.setId(IdentifierGenerator.getInstance().nextId()); xmlInteractor.setNames(interactorName); xmlInteractor.setOrganism(organism); if (!secondaryRefs.isEmpty()) { Xref interactorXref = new Xref(primaryReferece, secondaryRefs); xmlInteractor.setXref(interactorXref); } else { Xref interactorXref = new Xref(primaryReferece); xmlInteractor.setXref(interactorXref); xmlInteractor.setInteractorType(interactorType); if (xmlInteractor.hasXref()) { interactorType = new InteractorType(); String xrefPrimaryDB = xmlInteractor.getXref().getPrimaryRef().getDb(); if (xrefPrimaryDB.equals(UNIPROT)) { xmlInteractor.setInteractorType(interactorType); for (Annotation annotation : tabInteractor.getAnnotations()) { Attribute attribute = new Attribute(annotation.getTopic(), annotation.getText()); xmlInteractor.getAttributes().add(attribute); for (Checksum checksum : checksums) {
IntactConverterUtils.populateNames(psiObject.getNames(), interactor, aliasConverter); IntactConverterUtils.populateXref( psiObject.getXref(), interactor, xrefConverter ); IntactConverterUtils.populateAnnotations( psiObject, interactor, getInstitution(), annotationConverter ); Organism organism = psiObject.getOrganism(); String sequence = psiObject.getSequence();
public static Collection<Object> nonRedundantInteractorsFromPsiEntry(Entry psiEntry) { Map<Integer, Object> nonRedundantInteractors = new HashMap<Integer, Object>(); if( ConverterContext.getInstance().isGenerateExpandedXml() ) { // iterate to get the unique experiments/interactors for (psidev.psi.mi.xml.model.Interaction interaction : psiEntry.getInteractions()) { for (Participant participant : interaction.getParticipants()) { if (participant.getInteractor() != null){ nonRedundantInteractors.put(participant.getInteractor().getId(), participant.getInteractor()); } else if (participant.getInteraction() != null){ nonRedundantInteractors.put(participant.getInteraction().getId(), participant.getInteraction()); } } } } else { for ( psidev.psi.mi.xml.model.Interactor interactor : psiEntry.getInteractors() ) { nonRedundantInteractors.put( interactor.getId(), interactor ); } } return nonRedundantInteractors.values(); }
String name = interactor.getNames().getShortLabel(); String type = interactor.getInteractorType().getNames().getShortLabel();
private BioSource getBioSource(Interactor interactor) { Organism organism = interactor.getOrganism(); LOG.error("Taxonomy: " + ncbiId + " of organism: " + organism + ", interactor: " + interactor.getId() + " does not belong to '" + name + "'; the name will be removed. "
/** * 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; } }
sequence = polymer.getSequence(); interactor.setSequence( sequence ); interactor.setInteractorType( interactorType ); interactor.setOrganism(organism);
for(Participant p : interaction.getParticipants()) { if(p.hasInteractor()) { String type = getName(p.getInteractor().getInteractorType().getNames()); if(type==null) type = "protein"; //default type (if unspecified) participantTypes.add(type.toLowerCase()); + "; so we'll replace 'gene' with 'dna' (a quick fix)"); for(Participant p : interaction.getParticipants()) { if(p.hasInteractor() && p.getInteractor().getInteractorType().hasNames()) { String type = getName(p.getInteractor().getInteractorType().getNames()); if("gene".equalsIgnoreCase(type)) { p.getInteractor().getInteractorType().getNames().setShortLabel("dna");
psiIndex.addInteractor( interactor.getId(), isr );
/** * @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; }
jInteractor.setId( mInteractor.getId() ); jInteractor.setInteractorType( cvTypeConverter.toJaxb( mInteractor.getInteractorType() ) ); if ( mInteractor.getNames() != null ) { jInteractor.setNames( namesConverter.toJaxb( mInteractor.getNames() ) ); if ( mInteractor.hasXref() ) { jInteractor.setXref( xrefConverter.toJaxb( mInteractor.getXref() ) ); if ( mInteractor.hasOrganism() ) { jInteractor.setOrganism( organismConverter.toJaxb( mInteractor.getOrganism(), InteractorElementType.Organism.class ) ); String sequence = mInteractor.getSequence(); if ( sequence != null ) { sequence = sequence.trim(); if ( mInteractor.hasAttributes() ) { jInteractor.setAttributeList( new AttributeListType() ); for ( Attribute attribute : mInteractor.getAttributes() ) { jInteractor.getAttributeList().getAttributes().add( attributeConverter.toJaxb( attribute ) );
psidev.psi.mi.xml.model.Interactor mInteractor = new psidev.psi.mi.xml.model.Interactor(); mInteractor.setId( jInteractor.getId() ); mInteractor.setInteractorType( cvTypeConverter.fromJaxb( jInteractor.getInteractorType(), InteractorType.class ) ); mInteractor.setNames( namesConverter.fromJaxb( jInteractor.getNames() ) ); mInteractor.setXref( xrefConverter.fromJaxb( jInteractor.getXref() ) ); mInteractor.setOrganism( organismConverter.fromJaxb( jInteractor.getOrganism() ) ); sequence = sequence.trim(); mInteractor.setSequence( sequence ); mInteractor.getAttributes().add( attributeConverter.fromJaxb( attribute ) );
psiIndex.addInteractor( interactor.getId(), isr );