public CodonOptimizationPanel(int purpose){
		
		mode = purpose;
		
		// get vectors of component names
		organismVector = MainFrame.myss.getOrganismNames();

		
		for(int i = 0; i < MainFrame.myss.standards.size(); i++){
			standardVector.add(MainFrame.myss.standards.get(i).getName());
		}

		
		for(int i = 0; i < MainFrame.myss.backbones.size(); i++){
			plasmidVector.add(MainFrame.myss.backbones.get(i).getPlasmidName());
			
		}
		
		organismComboBox = new JComboBox(organismVector);
		standardComboBox = new JComboBox(standardVector);
		plasmidComboBox = new JComboBox(plasmidVector);
		
		
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{0, 132, 0, 0, 47, 0, 0, 0, 0, 0};
		gridBagLayout.rowHeights = new int[]{0, 0, 0};
		gridBagLayout.columnWeights = new double[]{0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		setLayout(gridBagLayout);
		
		JLabel nameLabel = new JLabel("Sequence Name");
		GridBagConstraints gbc_nameLabel = new GridBagConstraints();
		gbc_nameLabel.anchor = GridBagConstraints.EAST;
		gbc_nameLabel.insets = new Insets(5, 10, 5, 5);
		gbc_nameLabel.gridx = 0;
		gbc_nameLabel.gridy = 0;
		add(nameLabel, gbc_nameLabel);
		
		nameTextField.setColumns(15);
		GridBagConstraints gbc_nameTextField = new GridBagConstraints();
		gbc_nameTextField.insets = new Insets(5, 0, 5, 5);
		gbc_nameTextField.fill = GridBagConstraints.HORIZONTAL;
		gbc_nameTextField.gridx = 1;
		gbc_nameTextField.gridy = 0;
		add(nameTextField, gbc_nameTextField);
		
		GridBagConstraints gbc_organismLabel = new GridBagConstraints();
		gbc_organismLabel.anchor = GridBagConstraints.EAST;
		gbc_organismLabel.insets = new Insets(5, 5, 5, 5);
		gbc_organismLabel.gridx = 2;
		gbc_organismLabel.gridy = 0;
		add(organismLabel, gbc_organismLabel);
		
		GridBagConstraints gbc_organismComboBox = new GridBagConstraints();
		gbc_organismComboBox.insets = new Insets(5, 0, 5, 5);
		gbc_organismComboBox.fill = GridBagConstraints.HORIZONTAL;
		gbc_organismComboBox.gridx = 3;
		gbc_organismComboBox.gridy = 0;
		add(organismComboBox, gbc_organismComboBox);
		
		GridBagConstraints gbc_standardLabel = new GridBagConstraints();
		gbc_standardLabel.anchor = GridBagConstraints.EAST;
		gbc_standardLabel.insets = new Insets(5, 5, 5, 5);
		gbc_standardLabel.gridx = 4;
		gbc_standardLabel.gridy = 0;
		add(standardLabel, gbc_standardLabel);
		
		GridBagConstraints gbc_standardComboBox = new GridBagConstraints();
		gbc_standardComboBox.insets = new Insets(5, 0, 5, 5);
		gbc_standardComboBox.fill = GridBagConstraints.HORIZONTAL;
		gbc_standardComboBox.gridx = 5;
		gbc_standardComboBox.gridy = 0;
		add(standardComboBox, gbc_standardComboBox);
		
		GridBagConstraints gbc_plasmidLabel = new GridBagConstraints();
		gbc_plasmidLabel.anchor = GridBagConstraints.EAST;
		gbc_plasmidLabel.insets = new Insets(5, 5, 5, 5);
		gbc_plasmidLabel.gridx = 6;
		gbc_plasmidLabel.gridy = 0;
		add(plasmidLabel, gbc_plasmidLabel);
		
		GridBagConstraints gbc_plasmidComboBox = new GridBagConstraints();
		gbc_plasmidComboBox.insets = new Insets(5, 0, 5, 5);
		gbc_plasmidComboBox.fill = GridBagConstraints.HORIZONTAL;
		gbc_plasmidComboBox.gridx = 7;
		gbc_plasmidComboBox.gridy = 0;
		add(plasmidComboBox, gbc_plasmidComboBox);
		
		GridBagConstraints gbc_goButton = new GridBagConstraints();
		gbc_goButton.insets = new Insets(5, 5, 5, 0);
		gbc_goButton.gridx = 8;
		gbc_goButton.gridy = 0;
		goButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				// check fields
				if(checkFields() == true){
				
					// gather data and create codon optimization object
					currentCO = gatherData();
				
					// perform codon optimization
					if(mode == 1){
						currentCO = UtilityMethods.performCodonOptimization(currentCO);
					}
					
					if(mode == 2){
						currentCO = UtilityMethods.performStandardCheck(currentCO);
					}
					
					// set the current analysis so you can get it back later
					setEditorPanes(currentCO);	
				}
				else{
					ErrorMessage.giveErrorMessage("Unable to perform codon optimization.");
				}
			}
		});
		add(goButton, gbc_goButton);
		
		// set to transparent so you don't have to worry about the background
		sequencePanel.setOpaque(false);
		protocolPanel.setOpaque(false);
		//structurePanel.setOpaque(false);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		
		// add sequnce analysis view
		tabbedPane.addTab("Sequence", sequencePanel);
		//tabbedPane.addTab("RNA Structure", structurePanel);
		tabbedPane.addTab("Protocol", protocolPanel);
					
		GridBagConstraints gbc_tabbedPane = new GridBagConstraints();
		gbc_tabbedPane.insets = new Insets(0, 0, 0, 5);
		gbc_tabbedPane.gridwidth = 9;
		gbc_tabbedPane.fill = GridBagConstraints.BOTH;
		gbc_tabbedPane.gridx = 0;
		gbc_tabbedPane.gridy = 1;
		add(tabbedPane, gbc_tabbedPane);
		
	}