isBioBricksSequenceValid() public static method

public static isBioBricksSequenceValid ( LinkedList bioBricksToCheck ) : bool
bioBricksToCheck LinkedList
return bool
示例#1
0
    protected override DNABit produceDNABit()
    {
        LinkedList <BioBrick> deviceBricks = new LinkedList <BioBrick>();

        string[] bricks = new string[] { promoterName, rbsName, geneName, terminatorName };

        foreach (string brickName in bricks)
        {
            BioBrick brick = AvailableBioBricksManager.get().getBioBrickFromAll(brickName);
            if (brick != null)
            {
                deviceBricks.AddLast(brick);
            }
            else
            {
                Logger.Log("PickableDeviceRef4Bricks::produceDNABit failed to add brick with name " + brickName + "!", Logger.Level.WARN);
            }
        }

        if (ExpressionModule.isBioBricksSequenceValid(deviceBricks))
        {
            ExpressionModule deviceModule = new ExpressionModule(deviceName, deviceBricks);
            LinkedList <ExpressionModule> deviceModules = new LinkedList <ExpressionModule>();
            deviceModules.AddLast(deviceModule);
            Device result = Device.buildDevice(deviceName, deviceModules);
            return(result);
        }
        else
        {
            Logger.Log("PickableDeviceRef4Bricks::produceDNABit failed to produce DNABit - BioBrick sequence is incorrect: list=" + Logger.ToString <BioBrick>(deviceBricks), Logger.Level.WARN);
            return(null);
        }
    }
示例#2
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // utilities

    private Device getDeviceFromBricks(LinkedList <BioBrick> bricks)
    {
        Logger.Log("CraftZoneManager::getDeviceFromBricks(" + Logger.ToString <BioBrick>(bricks) + ")", Logger.Level.TRACE);

        if (!ExpressionModule.isBioBricksSequenceValid(bricks))
        {
            Logger.Log("CraftZoneManager::getDeviceFromBricks invalid biobricks sequence", Logger.Level.TRACE);
            return(null);
        }

        ExpressionModule module = new ExpressionModule("test", bricks);
        LinkedList <ExpressionModule> modules = new LinkedList <ExpressionModule>();

        modules.AddLast(module);

        Device device = Device.buildDevice(modules);

        if (device != null)
        {
            Logger.Log("CraftZoneManager::getDeviceFromBricks produced " + device, Logger.Level.TRACE);
        }
        else
        {
            Logger.Log("CraftZoneManager::getDeviceFromBricks device==null with bricks=" + Logger.ToString <BioBrick>(bricks)
                       , Logger.Level.WARN);
        }
        return(device);
    }