⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scoredialog.java

📁 Sequence alignement using different algorithms
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
            wholeMatrix.setScore('T', 'D', -1);
            wholeMatrix.setScore('T', 'C', 0);
            wholeMatrix.setScore('T', 'Q', -1);
            wholeMatrix.setScore('T', 'E', -1);
            wholeMatrix.setScore('T', 'G', -2);
            wholeMatrix.setScore('T', 'H', -1);
            wholeMatrix.setScore('T', 'I', -1);
            wholeMatrix.setScore('T', 'L', -2);
            wholeMatrix.setScore('T', 'K', -1);
            wholeMatrix.setScore('T', 'M', -1);
            wholeMatrix.setScore('T', 'F', -3);
            wholeMatrix.setScore('T', 'P', -1);
            wholeMatrix.setScore('T', 'S', 2);
            wholeMatrix.setScore('T', 'T', 5);
            wholeMatrix.setScore('W', 'A', -5);
            wholeMatrix.setScore('W', 'R', -4);
            wholeMatrix.setScore('W', 'N', -5);
            wholeMatrix.setScore('W', 'D', -7);
            wholeMatrix.setScore('W', 'C', -7);
            wholeMatrix.setScore('W', 'Q', -6);
            wholeMatrix.setScore('W', 'E', -7);
            wholeMatrix.setScore('W', 'G', -5);
            wholeMatrix.setScore('W', 'H', -1);
            wholeMatrix.setScore('W', 'I', -2);
            wholeMatrix.setScore('W', 'L', -1);
            wholeMatrix.setScore('W', 'K', -5);
            wholeMatrix.setScore('W', 'M', -4);
            wholeMatrix.setScore('W', 'F', 3);
            wholeMatrix.setScore('W', 'P', -5);
            wholeMatrix.setScore('W', 'S', -4);
            wholeMatrix.setScore('W', 'T', -6);
            wholeMatrix.setScore('W', 'W', 16);
            wholeMatrix.setScore('Y', 'A', -3);
            wholeMatrix.setScore('Y', 'R', -3);
            wholeMatrix.setScore('Y', 'N', -2);
            wholeMatrix.setScore('Y', 'D', -5);
            wholeMatrix.setScore('Y', 'C', -1);
            wholeMatrix.setScore('Y', 'Q', -4);
            wholeMatrix.setScore('Y', 'E', -3);
            wholeMatrix.setScore('Y', 'G', -5);
            wholeMatrix.setScore('Y', 'H', 3);
            wholeMatrix.setScore('Y', 'I', -2);
            wholeMatrix.setScore('Y', 'L', -1);
            wholeMatrix.setScore('Y', 'K', -3);
            wholeMatrix.setScore('Y', 'M', -2);
            wholeMatrix.setScore('Y', 'F', 6);
            wholeMatrix.setScore('Y', 'P', -6);
            wholeMatrix.setScore('Y', 'S', -2);
            wholeMatrix.setScore('Y', 'T', -3);
            wholeMatrix.setScore('Y', 'W', 4);
            wholeMatrix.setScore('Y', 'Y', 10);
            wholeMatrix.setScore('V', 'A', 0);
            wholeMatrix.setScore('V', 'R', -4);
            wholeMatrix.setScore('V', 'N', -4);
            wholeMatrix.setScore('V', 'D', -4);
            wholeMatrix.setScore('V', 'C', 1);
            wholeMatrix.setScore('V', 'Q', -3);
            wholeMatrix.setScore('V', 'E', -3);
            wholeMatrix.setScore('V', 'G', -5);
            wholeMatrix.setScore('V', 'H', -3);
            wholeMatrix.setScore('V', 'I', 4);
            wholeMatrix.setScore('V', 'L', 2);
            wholeMatrix.setScore('V', 'K', -3);
            wholeMatrix.setScore('V', 'M', 1);
            wholeMatrix.setScore('V', 'F', -1);
            wholeMatrix.setScore('V', 'P', -3);
            wholeMatrix.setScore('V', 'S', -2);
            wholeMatrix.setScore('V', 'T', 0);
            wholeMatrix.setScore('V', 'W', -5);
            wholeMatrix.setScore('V', 'Y', -3);
            wholeMatrix.setScore('V', 'V', 5);
            wholeMatrix.setScore('B', 'A', -1);
            wholeMatrix.setScore('B', 'R', -2);
            wholeMatrix.setScore('B', 'N', 5);
            wholeMatrix.setScore('B', 'D', 6);
            wholeMatrix.setScore('B', 'C', -4);
            wholeMatrix.setScore('B', 'Q', 0);
            wholeMatrix.setScore('B', 'E', 2);
            wholeMatrix.setScore('B', 'G', -1);
            wholeMatrix.setScore('B', 'H', 0);
            wholeMatrix.setScore('B', 'I', -5);
            wholeMatrix.setScore('B', 'L', -5);
            wholeMatrix.setScore('B', 'K', 0);
            wholeMatrix.setScore('B', 'M', -4);
            wholeMatrix.setScore('B', 'F', -6);
            wholeMatrix.setScore('B', 'P', -2);
            wholeMatrix.setScore('B', 'S', 1);
            wholeMatrix.setScore('B', 'T', 0);
            wholeMatrix.setScore('B', 'W', -6);
            wholeMatrix.setScore('B', 'Y', -3);
            wholeMatrix.setScore('B', 'V', -4);
            wholeMatrix.setScore('B', 'B', 5);
            wholeMatrix.setScore('Z', 'A', -1);
            wholeMatrix.setScore('Z', 'R', 0);
            wholeMatrix.setScore('Z', 'N', 0);
            wholeMatrix.setScore('Z', 'D', 3);
            wholeMatrix.setScore('Z', 'C', -5);
            wholeMatrix.setScore('Z', 'Q', 4);
            wholeMatrix.setScore('Z', 'E', 5);
            wholeMatrix.setScore('Z', 'G', -2);
            wholeMatrix.setScore('Z', 'H', 0);
            wholeMatrix.setScore('Z', 'I', -4);
            wholeMatrix.setScore('Z', 'L', -3);
            wholeMatrix.setScore('Z', 'K', 2);
            wholeMatrix.setScore('Z', 'M', -3);
            wholeMatrix.setScore('Z', 'F', -5);
            wholeMatrix.setScore('Z', 'P', -1);
            wholeMatrix.setScore('Z', 'S', 0);
            wholeMatrix.setScore('Z', 'T', -1);
            wholeMatrix.setScore('Z', 'W', -7);
            wholeMatrix.setScore('Z', 'Y', -4);
            wholeMatrix.setScore('Z', 'V', -3);
            wholeMatrix.setScore('Z', 'B', 2);
            wholeMatrix.setScore('Z', 'Z', 5);
            wholeMatrix.setScore('X', 'A', 0);
            wholeMatrix.setScore('X', 'R', 0);
            wholeMatrix.setScore('X', 'N', 0);
            wholeMatrix.setScore('X', 'D', 0);
            wholeMatrix.setScore('X', 'C', 0);
            wholeMatrix.setScore('X', 'Q', 0);
            wholeMatrix.setScore('X', 'E', 0);
            wholeMatrix.setScore('X', 'G', 0);
            wholeMatrix.setScore('X', 'H', 0);
            wholeMatrix.setScore('X', 'I', 0);
            wholeMatrix.setScore('X', 'L', 0);
            wholeMatrix.setScore('X', 'K', 0);
            wholeMatrix.setScore('X', 'M', 0);
            wholeMatrix.setScore('X', 'F', 0);
            wholeMatrix.setScore('X', 'P', 0);
            wholeMatrix.setScore('X', 'S', 0);
            wholeMatrix.setScore('X', 'T', 0);
            wholeMatrix.setScore('X', 'W', 0);
            wholeMatrix.setScore('X', 'Y', 0);
            wholeMatrix.setScore('X', 'V', 0);
            wholeMatrix.setScore('X', 'B', 0);
            wholeMatrix.setScore('X', 'Z', 0);
            wholeMatrix.setScore('X', 'X', 0);

            break;

         case SCOREMATRIX_PENALIZEMISMATCH:

            wholeMatrix = new ScoreHash();
            int i, j;
            char a, b;
            for (i = 0; i < m_alphabet.length(); ++i) {
               for (j = 0; j < i+1; ++j) {
                  //System.out.println("A: " + m_alphabet.charAt(j) +
                  //                   " - B: " + m_alphabet.charAt(i));

                  a = m_alphabet.charAt(j);
                  b = m_alphabet.charAt(i);

                  if (a == b) {
                     wholeMatrix.setScore(a, b, 1);
                  }
                  else {
                     wholeMatrix.setScore(a, b, -2);
                  }
               }
            }

            break;

      }

      this.fillCells(wholeMatrix);

   }

   protected void fillCells(ScoreHash sh) {
      //"GACT"
      //"GACT"

      int i, j;
      int count = 0;
      for (i = 0; i < m_alphabet.length(); ++i) {
         for (j = 0; j < i+1; ++j) {
            //System.out.println("A: " + m_alphabet.charAt(j) +
            //                   " - B: " + m_alphabet.charAt(i));
            m_jTxtValues[count++].setText(
                sh.getScore(m_alphabet.charAt(j),
                            m_alphabet.charAt(i)));
         }
      }

   }

   protected class ButtonListener
       implements ActionListener {

      public void actionPerformed(ActionEvent event) {
         // Perform the action indicated by a mouse click on a button.

         Object b = event.getSource(); // Get the component that was clicked.

         Object[] message = new Object[2];
         String title;
         JTextField stringField;

         String[] options;

         if (b == m_btnOk) {

            m_passedHash.clearScores();
            int i, j, val;
            int count = 0;
            for (i = 0; i < m_alphabet.length(); ++i) {
               for (j = 0; j < i+1; ++j) {
                  //System.out.println("A: " + m_alphabet.charAt(j) +
                  //                   " - B: " + m_alphabet.charAt(i) +
                  //                   " - Score: " + m_jTxtValues[count].getText());

                  try {
                     val = Integer.parseInt(m_jTxtValues[count].getText());
                  }
                  catch (NumberFormatException ex) {
                     val = 0;
                  }

                  m_passedHash.setScore(m_alphabet.charAt(j),
                                        m_alphabet.charAt(i),
                                        val);

                  count++;
               }
            }

            m_thisDialog.dispose();
         }
         else if (b == m_btnCancel) {
            m_thisDialog.dispose();
         }
      }
   }

   protected class ComboBoxListener
       implements ActionListener {

      public void actionPerformed(ActionEvent e) {

         // will be m_matrixSelection
         JComboBox cb = (JComboBox) e.getSource();

         switch (cb.getSelectedIndex()) {

            //String[] m_matrixData = {
            //    "Original", "Pam250", "Blosum62", "vtml160"};

            case 0:
               loadScoreMatrix(ScoreDialog.SCOREMATRIX_ORIGINAL);
               break;

            // PAM250
            case 1:
               loadScoreMatrix(ScoreDialog.SCOREMATRIX_PAM250);
               break;

            case 2:
               loadScoreMatrix(ScoreDialog.SCOREMATRIX_BLOSUM62);
               break;

            case 3:
               loadScoreMatrix(ScoreDialog.SCOREMATRIX_VTML160);
               break;

            case 4:
               loadScoreMatrix(ScoreDialog.SCOREMATRIX_PENALIZEMISMATCH);
               break;
         }

      }
   }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -