Search in sources :

Example 1 with Interactant

use of org.nextprot.api.core.domain.Interactant in project nextprot-api by calipho-sib.

the class InteractionFieldBuilder method init.

@Override
protected void init(Entry entry) {
    // WAIT FOR BIO OBJECTS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    // String id = entry.getUniqueName();
    String recName = "";
    String interactantAC = "";
    List<Interaction> interactions = entry.getInteractions();
    // System.err.println(interactions.size() + " interactions");
    for (Interaction currinteraction : interactions) {
        // System.err.println(currinteraction.getEvidenceXrefAC()); // EBI-372273,EBI-603319
        List<Interactant> interactants = currinteraction.getInteractants();
        for (Interactant currinteractant : interactants) {
            if (currinteractant.getGenename() != null) {
                // otherwise it is the entry itself
                interactantAC = currinteractant.getAccession();
                if (currinteractant.isNextprot()) {
                    interactantAC = "NX_" + interactantAC.split("-")[0];
                    // We need the entryBuilderService to get interactant's recname
                    recName = entryBuilderService.build(EntryConfig.newConfig(interactantAC).withOverview()).getOverview().getMainProteinName();
                } else
                    // Xeno interaction
                    recName = "";
                if (!this.isGold() || currinteraction.getQuality().equals("GOLD"))
                    addField(Fields.INTERACTIONS, "AC: " + interactantAC + " gene: " + currinteractant.getGenename() + " name: " + recName + " refs: " + currinteraction.getEvidenceXrefAC());
            } else if (currinteraction.isSelfInteraction() == true)
                if (!this.isGold() || currinteraction.getQuality().equals("GOLD"))
                    addField(Fields.INTERACTIONS, "selfInteraction");
        }
    }
    List<Annotation> annots = entry.getAnnotations();
    for (Annotation currannot : annots) if (// Always GOLD
    currannot.getCategory().equals("subunit"))
        addField(Fields.INTERACTIONS, currannot.getDescription());
/*
		//Gets interactions using xrefs
		List<DbXref> xrefs = entry.getXrefs();
		for (DbXref xref : xrefs) {
			String acc = xref.getAccession();
			String db = xref.getDatabaseName();

			// wrong for nextprot gene designation -> protein name
			if ((db.equals("UniProt") || db.equals("neXtProt")) && !id.contains(acc)) {
				String gen = xref.getPropertyValue("gene designation");
				if (gen != null && gen != "-") {
					gen = gen.toUpperCase();
					addField(Fields.INTERACTIONS, gen);
				}
			}
		}
		
		//WAIT FOR BIO OBJECTS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
		
		}*/
}
Also used : Interactant(org.nextprot.api.core.domain.Interactant) Interaction(org.nextprot.api.core.domain.Interaction) Annotation(org.nextprot.api.core.domain.annotation.Annotation)

Aggregations

Interactant (org.nextprot.api.core.domain.Interactant)1 Interaction (org.nextprot.api.core.domain.Interaction)1 Annotation (org.nextprot.api.core.domain.annotation.Annotation)1