コード例 #1
0
 /**
  * Returns the description of an item.
  *
  * @param key the key of the item
  * @param itemType the type of the item
  * @return the description of an item
  * @throws SQLException thrown if an SQLException occurs
  * @throws ClassNotFoundException thrown if a ClassNotFoundException occurs
  * @throws IOException thrown if an IOException occurs
  * @throws InterruptedException thrown if an InterruptedException occurs
  */
 private String getItemDescription(String key, Type itemType)
     throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException,
         InterruptedException {
   Identification identification = peptideShakerGUI.getIdentification();
   switch (itemType) {
     case PROTEIN:
       ProteinMatch proteinMatch = identification.getProteinMatch(key);
       String mainMatch = proteinMatch.getMainMatch();
       String description = sequenceFactory.getHeader(mainMatch).getSimpleProteinDescription();
       String result = mainMatch;
       for (String accession : ProteinMatch.getAccessions(key)) {
         if (!accession.equals(mainMatch)) {
           if (!result.equals(mainMatch)) {
             result += ", ";
           }
           result += accession;
         }
       }
       result += " - " + description;
       return result;
     case PEPTIDE:
       PeptideMatch peptideMatch = identification.getPeptideMatch(key);
       return peptideShakerGUI
           .getDisplayFeaturesGenerator()
           .getTaggedPeptideSequence(peptideMatch, true, true, true);
     case SPECTRUM:
       return Spectrum.getSpectrumTitle(key) + " (" + Spectrum.getSpectrumFile(key) + ")";
     default:
       return "Unknown";
   }
 }
コード例 #2
0
ファイル: JumpToPanel.java プロジェクト: compomics/reporter
 /**
  * Returns the description of an item.
  *
  * @param key the key of the item
  * @param itemType the type of the item
  * @return the description of an item
  * @throws SQLException thrown if an SQLException occurs
  * @throws ClassNotFoundException thrown if a ClassNotFoundException occurs
  * @throws IOException thrown if an IOException occurs
  * @throws InterruptedException thrown if an InterruptedException occurs
  */
 private String getItemDescription(String key, Type itemType)
     throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException,
         InterruptedException {
   Identification identification = reporterGUI.getIdentification();
   switch (itemType) {
     case PROTEIN:
       ProteinMatch proteinMatch = identification.getProteinMatch(key);
       String mainMatch = proteinMatch.getMainMatch();
       String description = sequenceFactory.getHeader(mainMatch).getSimpleProteinDescription();
       String result = mainMatch;
       for (String accession : ProteinMatch.getAccessions(key)) {
         if (!accession.equals(mainMatch)) {
           if (!result.equals(mainMatch)) {
             result += ", ";
           }
           result += accession;
         }
       }
       result += " - " + description;
       return result;
     default:
       return "Unknown";
   }
 }
コード例 #3
0
  /**
   * Creates new form ProteinInferenceDialog.
   *
   * @param peptideShakerGUI
   * @param inspectedMatch
   * @param identification
   */
  public ProteinInferenceDialog(
      PeptideShakerGUI peptideShakerGUI, String inspectedMatch, Identification identification) {
    super(peptideShakerGUI, true);
    this.identification = identification;
    this.peptideShakerGUI = peptideShakerGUI;

    try {
      this.inspectedMatch = identification.getProteinMatch(inspectedMatch);
      previousMainMatch = this.inspectedMatch.getMainMatch();
    } catch (Exception e) {
      peptideShakerGUI.catchException(e);
      this.dispose();
    }

    accessions = new ArrayList(Arrays.asList(ProteinMatch.getAccessions(inspectedMatch)));

    for (String proteinAccession : accessions) {
      if (identification.getProteinIdentification().contains(proteinAccession)) {
        uniqueMatches.add(proteinAccession);
      }
    }

    for (String proteinKey : identification.getProteinIdentification()) {
      if (ProteinMatch.getNProteins(proteinKey) > 1
          && !associatedMatches.contains(proteinKey)
          && !proteinKey.equals(inspectedMatch)) {
        for (String proteinAccession : accessions) {
          if (proteinKey.contains(proteinAccession)) {
            associatedMatches.add(proteinKey);
            break;
          }
        }
      }
    }

    initComponents();

    // make sure that the scroll panes are see-through
    proteinMatchJScrollPane.getViewport().setOpaque(false);
    uniqueHitsJScrollPane.getViewport().setOpaque(false);
    relatedHitsJScrollPane.getViewport().setOpaque(false);

    groupClassJComboBox.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));

    PSParameter psParameter = new PSParameter();
    try {
      psParameter =
          (PSParameter) identification.getProteinMatchParameter(inspectedMatch, psParameter);
    } catch (Exception e) {
      peptideShakerGUI.catchException(e);
    }
    matchInfoLbl.setText(
        "[Score: "
            + Util.roundDouble(psParameter.getProteinScore(), 2)
            + ", Confidence: "
            + Util.roundDouble(psParameter.getProteinConfidence(), 2)
            + "]");

    // set up the table column properties
    setColumnProperies();

    // The index should be set in the design according to the PSParameter class static fields!
    groupClassJComboBox.setSelectedIndex(psParameter.getGroupClass());

    setLocationRelativeTo(peptideShakerGUI);
    setVisible(true);
  }