Class IDARESettingsManager


  • public class IDARESettingsManager
    extends Object
    Class to keep track of IDARE IDs and complain (throw exceptions) if duplicate IDs are found. hopefully there wont be any instances with > max(long) nodes in one network...
    Author:
    thomas
    • Constructor Summary

      Constructors 
      Constructor Description
      IDARESettingsManager()
      Initialize the IDare Manager
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addIDs​(Collection<Long> ids)
      Add all IDs of the collection to this manager.
      static Set<String> getNetworkIDAREIDs​(org.cytoscape.model.CyNetwork network, String IDCol)
      Get the set of nodeIDs present in the provided network
      long getNextGeneID()
      Get the next gene ID which is the largest current ID + 1 This Id should be used otherwise it will be blocked for this manager.
      long getNextNetworkID()
      Get the next network ID which is the largest current ID + 1 This Id should be used otherwise it will be blocked for this manager.
      long getNextNodeID()
      Get the next ID which is the largest current ID + 1 This Id should be used otherwise it will be blocked for this manager.
      long getNextProteinComplexID()
      Get the nextprotein Complex ID which is the largest current ID + 1 This Id should be used otherwise it will be blocked for this manager.
      long getNextProteinID()
      Get the next protein ID which is the largest current ID + 1 This Id should be used otherwise it will be blocked for this manager.
      String getSubNetworkType​(String targetType)
      Get the IDAREType associated with a specific Target Type for the subnetwork generation.
      String getType​(String name)
      Get the Type associated with a specific Name.
      void handleSessionLoadedEvent​(org.cytoscape.session.events.SessionLoadedEvent arg0)
      Handle the loading of a session
      static void initNetwork​(org.cytoscape.model.CyNetwork network)
      Set up the provided network using the Provided IDCol for the IDARE Names and the NodeTypesCol for the IDARE Node Types
      static boolean isSetupNetwork​(org.cytoscape.model.CyNetwork network)
      Test whether a Network has the table Columns required for usage in IDARE
      static void resetNetworks​(Collection<org.cytoscape.model.CyNetwork> networks)  
      void resetSubNetworkTypes()
      Reset the SubNetworkTypes.
      static void setIDARENames​(org.cytoscape.model.CyNetwork network, Collection<String> IDs, String ColForNames)
      Set the matching IDARENames to the values set in the Selected Column(except that Strings will be used in the IDARE_NAME column
      static void SetNetworkData​(org.cytoscape.model.CyNetwork network, IDARESettingsManager IDAREIdmgr, String NodeTypeCol, String IDCol, boolean overwrite, idare.imagenode.internal.DataManagement.NodeManager nm)
      Set up the provided network using the Provided IDCol for the IDARE Names and the NodeTypesCol for the IDARE Node Types
      void setSubNetworkType​(String IDAREType, String targetType)
      Set the IDAREType associated with a specific Target Type for subnetwork generation.
      void setType​(String IDAREType, String targetType)
      Set the IDAREType associated with a specific Target Type.
      static void SetupNetwork​(org.cytoscape.model.CyNetwork network, IDARESettingsManager IDAREIdmgr, String NodeTypeCol, String IDCol)
      Set up the provided network using the Provided IDCol for the IDARE Names and the NodeTypesCol for the IDARE Node Types
    • Constructor Detail

      • IDARESettingsManager

        public IDARESettingsManager()
        Initialize the IDare Manager
    • Method Detail

      • getNextProteinID

        public long getNextProteinID()
        Get the next protein ID which is the largest current ID + 1 This Id should be used otherwise it will be blocked for this manager.
        Returns:
        a valid IDARE identifier
      • getNextGeneID

        public long getNextGeneID()
        Get the next gene ID which is the largest current ID + 1 This Id should be used otherwise it will be blocked for this manager.
        Returns:
        a valid IDARE identifier
      • getNextProteinComplexID

        public long getNextProteinComplexID()
        Get the nextprotein Complex ID which is the largest current ID + 1 This Id should be used otherwise it will be blocked for this manager.
        Returns:
        a valid IDARE identifier
      • getNextNodeID

        public long getNextNodeID()
        Get the next ID which is the largest current ID + 1 This Id should be used otherwise it will be blocked for this manager.
        Returns:
        a valid IDARE identifier
      • getNextNetworkID

        public long getNextNetworkID()
        Get the next network ID which is the largest current ID + 1 This Id should be used otherwise it will be blocked for this manager.
        Returns:
        a valid IDARE identifier
      • addIDs

        public void addIDs​(Collection<Long> ids)
                    throws IllegalArgumentException
        Add all IDs of the collection to this manager. The manager checks whether any ID is already used.
        Parameters:
        ids - - The ids that need to be checked
        Throws:
        IllegalArgumentException - - If the provided ID is already present in this Manager this exception is thrown IF an exception is thrown, the Manager is still valid and none of the provided ids has been added.
      • getType

        public String getType​(String name)
        Get the Type associated with a specific Name.
        Parameters:
        name - the name to request the type for..
        Returns:
        the type associated with the given name.
      • setType

        public void setType​(String IDAREType,
                            String targetType)
        Set the IDAREType associated with a specific Target Type.
        Parameters:
        IDAREType - The IDAREType for a specified targettype (i.e. entries from IDAREProperties;
        targetType - The type to match to the given IDAREType
      • resetSubNetworkTypes

        public void resetSubNetworkTypes()
        Reset the SubNetworkTypes. This should be called when new subnetworktypes are being set for a subnetwork generation process.
      • setSubNetworkType

        public void setSubNetworkType​(String IDAREType,
                                      String targetType)
        Set the IDAREType associated with a specific Target Type for subnetwork generation.
        Parameters:
        IDAREType - The IDAREType to assign a string to
        targetType - The string the IDAREType should be assigned to.
      • getSubNetworkType

        public String getSubNetworkType​(String targetType)
        Get the IDAREType associated with a specific Target Type for the subnetwork generation.
        Parameters:
        targetType - the type to extract an IDAREType for.
        Returns:
        the IDARE String associate with the given type
      • handleSessionLoadedEvent

        public void handleSessionLoadedEvent​(org.cytoscape.session.events.SessionLoadedEvent arg0)
        Handle the loading of a session
        Parameters:
        arg0 - - The SessionLoadedEvent to use.
      • resetNetworks

        public static void resetNetworks​(Collection<org.cytoscape.model.CyNetwork> networks)
      • SetupNetwork

        public static void SetupNetwork​(org.cytoscape.model.CyNetwork network,
                                        IDARESettingsManager IDAREIdmgr,
                                        String NodeTypeCol,
                                        String IDCol)
        Set up the provided network using the Provided IDCol for the IDARE Names and the NodeTypesCol for the IDARE Node Types
        Parameters:
        network - the network to set up
        IDAREIdmgr - A IDARE ID Manager to set up the IDs of all
        NodeTypeCol - The Column indicating the node type.
        IDCol - The Column name indicating the node ID
      • SetNetworkData

        public static void SetNetworkData​(org.cytoscape.model.CyNetwork network,
                                          IDARESettingsManager IDAREIdmgr,
                                          String NodeTypeCol,
                                          String IDCol,
                                          boolean overwrite,
                                          idare.imagenode.internal.DataManagement.NodeManager nm)
        Set up the provided network using the Provided IDCol for the IDARE Names and the NodeTypesCol for the IDARE Node Types
        Parameters:
        network - - the network to set up
        IDAREIdmgr - - A IDARE ID Manager to set up the IDs of all
        NodeTypeCol - The Column indicating the node type.
        IDCol - The Column name indicating the node ID
        overwrite - Whether to overwrite existing names and types.
        nm - The nodemanager, which should be updated according to the overwritten entries.
      • isSetupNetwork

        public static boolean isSetupNetwork​(org.cytoscape.model.CyNetwork network)
        Test whether a Network has the table Columns required for usage in IDARE
        Parameters:
        network - The network to test.
        Returns:
        whether the network is set up to be used with IDARE.
      • setIDARENames

        public static void setIDARENames​(org.cytoscape.model.CyNetwork network,
                                         Collection<String> IDs,
                                         String ColForNames)
        Set the matching IDARENames to the values set in the Selected Column(except that Strings will be used in the IDARE_NAME column
        Parameters:
        network - - the network for which to assign the names
        IDs - - The IDs which are transferred
        ColForNames - - The Column to get the IDs from.
      • initNetwork

        public static void initNetwork​(org.cytoscape.model.CyNetwork network)
        Set up the provided network using the Provided IDCol for the IDARE Names and the NodeTypesCol for the IDARE Node Types
        Parameters:
        network - - the network to set up
      • getNetworkIDAREIDs

        public static Set<String> getNetworkIDAREIDs​(org.cytoscape.model.CyNetwork network,
                                                     String IDCol)
        Get the set of nodeIDs present in the provided network
        Parameters:
        network - - the CyNetwork to retrieve the nodeids from
        IDCol - - The column in the networks node CyTable containing the IDs.
        Returns:
        - a Set of IDs present in the provided network