Пример #1
0
        public virtual void addSecondaryStructure(sbyte type, int indexStart, int indexEnd)
		{
			int structureCount = indexEnd - indexStart + 1;
			if (structureCount < 1)
			{
				System.Console.Out.WriteLine("structure definition error\n" + " indexStart:" + indexStart + " indexEnd:" + indexEnd);
				return ;
			}
			ProteinStructure proteinstructure = null;
			switch (type)
			{
				
				case JmolConstants.PROTEIN_STRUCTURE_HELIX: 
					proteinstructure = new Helix(this, indexStart, structureCount);
					break;
				
				case JmolConstants.PROTEIN_STRUCTURE_SHEET: 
					if (this is AminoPolymer)
						proteinstructure = new Sheet((AminoPolymer) this, indexStart, structureCount);
					break;
				
				case JmolConstants.PROTEIN_STRUCTURE_TURN: 
					proteinstructure = new Turn(this, indexStart, structureCount);
					break;
				
				default: 
					System.Console.Out.WriteLine("unrecognized secondary structure type");
					return ;
				
			}
			for (int i = indexStart; i <= indexEnd; ++i)
				monomers[i].Structure = proteinstructure;
		}
Пример #2
0
        public virtual void addSecondaryStructure(sbyte type, int indexStart, int indexEnd)
        {
            int structureCount = indexEnd - indexStart + 1;

            if (structureCount < 1)
            {
                System.Console.Out.WriteLine("structure definition error\n" + " indexStart:" + indexStart + " indexEnd:" + indexEnd);
                return;
            }
            ProteinStructure proteinstructure = null;

            switch (type)
            {
            case JmolConstants.PROTEIN_STRUCTURE_HELIX:
                proteinstructure = new Helix(this, indexStart, structureCount);
                break;

            case JmolConstants.PROTEIN_STRUCTURE_SHEET:
                if (this is AminoPolymer)
                {
                    proteinstructure = new Sheet((AminoPolymer)this, indexStart, structureCount);
                }
                break;

            case JmolConstants.PROTEIN_STRUCTURE_TURN:
                proteinstructure = new Turn(this, indexStart, structureCount);
                break;

            default:
                System.Console.Out.WriteLine("unrecognized secondary structure type");
                return;
            }
            for (int i = indexStart; i <= indexEnd; ++i)
            {
                monomers[i].Structure = proteinstructure;
            }
        }