BioSIMI-Python/modules/System.py
def createSubsystem(self, filename, subsystemName = ''):
        ''' 
        Creates a new Subsystem object inside the System
        with the SubsystemName suffixed to all elements of the given SBML filename
        '''
    # 1. Read the SBML model
    # 2. Create an object of the Subsystem class with the SBMLDocument read in Step 1
        name = self.getSystemName()
        sbmlDoc = getFromXML(filename)
        model = sbmlDoc.getModel()
        subsystem = Subsystem(sbmlDoc)
        subsystem.setSystem(self)
        if subsystem.getSubsystemDoc().getLevel() != 3:
            print('BioSIMI-Python WARNING -- Subsystem SBML model is not the latest. Converting to SBML level 3, version 1')
            subsystem.convertSubsystemLevelAndVersion(3,1)
        subsystem.suffixAllElementIds(subsystemName)
        if model.getNumCompartments() == 0:
            print('BioSIMI-Python WARNING -- No compartments in the Subsystem model, the System compartment will be used. Compartment Size will be set to zero for this Subsystem.')
        elif model.getNumCompartments() > 1:
            print('BioSIMI-Python WARNING -- More than 1 compartments in the Subsystem model. Check resulting models for consistency.')

        if not model.getCompartment(0).isSetSize():
            print('BioSIMI-Python WARNING -- Compartment Size is not set. Setting to zero.')
            model.getCompartment(0).setSize(0)
    
        subsystem.setCompartments([name])
        # handling sbml events --- incomplete ---
        # model = subsystem.getSubsystemDoc().getModel()
        # if model.getNumEvents():
        #     for event in model.getListOfEvents()
        self.ListOfSubsystems.append(subsystem)
        self.Size += model.getCompartment(0).getSize()
        return subsystem
 
        Creates a new Subsystem object inside the System
        with the SubsystemName suffixed to all elements of the given SBML filename
        
Creates a new Subsystem object inside the System
with the SubsystemName suffixed to all elements of the given SBML filename
Creates a new Subsystem object inside the System with the SubsystemName suffixed to all elements of the given SBML filename
def createSubsystem(self, filename, subsystemName = ''):
        name = self.getSystemName()
        sbmlDoc = getFromXML(filename)
        model = sbmlDoc.getModel()
        subsystem = Subsystem(sbmlDoc)
        subsystem.setSystem(self)
        if subsystem.getSubsystemDoc().getLevel() != 3:
            print('BioSIMI-Python WARNING -- Subsystem SBML model is not the latest. Converting to SBML level 3, version 1')
            subsystem.convertSubsystemLevelAndVersion(3,1)
        subsystem.suffixAllElementIds(subsystemName)
        if model.getNumCompartments() == 0:
            print('BioSIMI-Python WARNING -- No compartments in the Subsystem model, the System compartment will be used. Compartment Size will be set to zero for this Subsystem.')
        elif model.getNumCompartments() > 1:
            print('BioSIMI-Python WARNING -- More than 1 compartments in the Subsystem model. Check resulting models for consistency.')
        if not model.getCompartment(0).isSetSize():
            print('BioSIMI-Python WARNING -- Compartment Size is not set. Setting to zero.')
            model.getCompartment(0).setSize(0)
        subsystem.setCompartments([name])
        self.ListOfSubsystems.append(subsystem)
        self.Size += model.getCompartment(0).getSize()
        return subsystem
def createSubsystem ( self , filename , subsystemName = '' ) : name = self . getSystemName ( ) sbmlDoc = getFromXML ( filename ) model = sbmlDoc . getModel ( ) subsystem = Subsystem ( sbmlDoc ) subsystem . setSystem ( self ) if subsystem . getSubsystemDoc ( ) . getLevel ( ) != 3 : print ( 'BioSIMI-Python WARNING -- Subsystem SBML model is not the latest. Converting to SBML level 3, version 1' ) subsystem . convertSubsystemLevelAndVersion ( 3 , 1 ) subsystem . suffixAllElementIds ( subsystemName ) if model . getNumCompartments ( ) == 0 : print ( 'BioSIMI-Python WARNING -- No compartments in the Subsystem model, the System compartment will be used. Compartment Size will be set to zero for this Subsystem.' ) elif model . getNumCompartments ( ) > 1 : print ( 'BioSIMI-Python WARNING -- More than 1 compartments in the Subsystem model. Check resulting models for consistency.' ) if not model . getCompartment ( 0 ) . isSetSize ( ) : print ( 'BioSIMI-Python WARNING -- Compartment Size is not set. Setting to zero.' ) model . getCompartment ( 0 ) . setSize ( 0 ) subsystem . setCompartments ( [ name ] ) self . ListOfSubsystems . append ( subsystem ) self . Size += model . getCompartment ( 0 ) . getSize ( ) return subsystem
Creates a new Subsystem object inside the System
with the SubsystemName suffixed to all elements of the given SBML filename
Creates a new Subsystem object inside the System with the SubsystemName suffixed to all elements of the given SBML filename
''' 
        Creates a new Subsystem object inside the System
        with the SubsystemName suffixed to all elements of the given SBML filename
        ''' # 1. Read the SBML model # 2. Create an object of the Subsystem class with the SBMLDocument read in Step 1 # handling sbml events --- incomplete --- # model = subsystem.getSubsystemDoc().getModel() # if model.getNumEvents(): #     for event in model.getListOfEvents()
self
filename
subsystemName