Class DefaultInteractorFactory

    • Constructor Detail

      • DefaultInteractorFactory

        public DefaultInteractorFactory()

        Constructor for DefaultInteractorFactory.

    • Method Detail

      • createInteractorFromInteractorType

        public Interactor createInteractorFromInteractorType​(CvTerm type,
                                                             String name)
        Return the proper instance of the interactor if the type is recognized and not null. It returns null otherwise. Return the proper instance of the interactor if the type is recognized and not null. It returns null otherwise.
        Specified by:
        createInteractorFromInteractorType in interface InteractorFactory
        Parameters:
        type - : interactor type
        name - : short name
        Returns:
        the proper instance of the interactor if the type is recognized. It returns null otherwise.
      • createInteractorFromDatabase

        public Interactor createInteractorFromDatabase​(CvTerm database,
                                                       String name)
        Return the proper instance of the interactor if the database is recognized. It returns null otherwise. Return the proper instance of the interactor if the database is recognized. It returns null otherwise.
        Specified by:
        createInteractorFromDatabase in interface InteractorFactory
        Parameters:
        database - : database
        name - :name
        Returns:
        the proper instance of the interactor if the database is recognized. It returns null otherwise.
      • createInteractorFromIdentityXrefs

        public Interactor createInteractorFromIdentityXrefs​(Collection<? extends Xref> xrefs,
                                                            String name)
        Return the proper instance of the interactor if the database is recognized (the interactor will be returned on the first database which is recognized). It returns null otherwise. Return the proper instance of the interactor if the database is recognized (the interactor will be returned on the first database which is recognized). It returns null otherwise.
        Specified by:
        createInteractorFromIdentityXrefs in interface InteractorFactory
        Parameters:
        xrefs - : identifiers
        name - : name
        Returns:
        the proper instance of the interactor if the database is recognized (the interactor will be returned on the first database which is recognized). It returns null otherwise.
      • createProtein

        public Protein createProtein​(String name,
                                     CvTerm type)
        Creates a new Protein with the name and interactor type Creates a new Protein with the name and interactor type
        Specified by:
        createProtein in interface InteractorFactory
        Parameters:
        name - : short name
        type - : interactor type
        Returns:
        created protein
      • createNucleicAcid

        public NucleicAcid createNucleicAcid​(String name,
                                             CvTerm type)
        Creates a new NucleicAcid with the name and interactor type Creates a new NucleicAcid with the name and interactor type
        Specified by:
        createNucleicAcid in interface InteractorFactory
        Parameters:
        name - : short name
        type - : interactor type
        Returns:
        created nucleic acid
      • createGene

        public Gene createGene​(String name)
        Creates a new Gene with the name Creates a new Gene with the name
        Specified by:
        createGene in interface InteractorFactory
        Parameters:
        name - : name
        Returns:
        created gene
      • createComplex

        public Complex createComplex​(String name,
                                     CvTerm type)
        Creates a new Complex with the name and interactor type Creates a new Complex with the name and interactor type
        Specified by:
        createComplex in interface InteractorFactory
        Parameters:
        name - : short name
        type - : interactor type
        Returns:
        created complex
      • createBioactiveEntity

        public BioactiveEntity createBioactiveEntity​(String name,
                                                     CvTerm type)
        Creates a new BioactiveEntity with the name and interactor type Creates a new BioactiveEntity with the name and interactor type
        Specified by:
        createBioactiveEntity in interface InteractorFactory
        Parameters:
        name - : short name
        type - : interactor type
        Returns:
        created bioactive entity
      • createPolymer

        public Polymer createPolymer​(String name,
                                     CvTerm type)
        Creates a new Polymer with the name and interactor type Creates a new Polymer with the name and interactor type
        Specified by:
        createPolymer in interface InteractorFactory
        Parameters:
        name - : short name
        type - : interactor type
        Returns:
        created polymer
      • createInteractor

        public Interactor createInteractor​(String name,
                                           CvTerm type)
        Creates a default interactor from the name and interactor type Creates a default interactor from the name and interactor type
        Specified by:
        createInteractor in interface InteractorFactory
        Parameters:
        name - : short name
        type - : interactor type
        Returns:
        created default interactor
      • createInteractorSet

        public InteractorPool createInteractorSet​(String name,
                                                  CvTerm type)
        Creates an interactor pool from the name and interactor type Creates an interactor pool from the name and interactor type
        Specified by:
        createInteractorSet in interface InteractorFactory
        Parameters:
        name - : short name
        type - : interactor type
        Returns:
        created interactor pool
      • initialiseDeterministicInteractorMaps

        protected void initialiseDeterministicInteractorMaps()
        Loads some properties to recognize interactor type from different MI terms
      • loadProperties

        protected void loadProperties​(Properties prop)
        Loads the properties in the deterministicInteractorMap
        Parameters:
        prop - : properties
      • extractCvTermFromKey

        protected String[] extractCvTermFromKey​(String key)
        Reads the cv term from the properties file
        Parameters:
        key - : the property ky
        Returns:
        cv term values extracted from the key (name - MI identifier)
      • createInteractorFromRecognizedCategory

        protected Interactor createInteractorFromRecognizedCategory​(InteractorCategory category,
                                                                    String name,
                                                                    CvTerm type)
        Creates an interactor from a given category (should be the canonical name of an Interactor interface)
        Parameters:
        category - : the category of interactor
        name - : name
        type - : interactor type
        Returns:
        the created interactor