Examples of CvTerm


Examples of com.compomics.util.pride.CvTerm

        // add species
        if (speciesJComboBox.getSelectedIndex() > 0
                && speciesJComboBox.getSelectedIndex() < speciesJComboBox.getItemCount() - 1) {

            if (!((String) speciesJComboBox.getSelectedItem()).equalsIgnoreCase(comboboxSeparator)) {
                cvTerms.add(new CvTerm(
                        "NEWT",
                        speciesMap.get((String) speciesJComboBox.getSelectedItem()),
                        (String) speciesJComboBox.getSelectedItem(),
                        null));
            }
        }

        // add tissue type
        if (tissueJComboBox.getSelectedIndex() > 0
                && tissueJComboBox.getSelectedIndex() < tissueJComboBox.getItemCount() - 1) {

            if (!((String) tissueJComboBox.getSelectedItem()).equalsIgnoreCase(comboboxSeparator)) {
                cvTerms.add(new CvTerm(
                        "BTO",
                        tissueMap.get((String) tissueJComboBox.getSelectedItem()),
                        (String) tissueJComboBox.getSelectedItem(),
                        null));
            }
        }

        // add cell type
        if (cellTypeJComboBox.getSelectedIndex() > 0
                && cellTypeJComboBox.getSelectedIndex() < cellTypeJComboBox.getItemCount() - 1) {

            if (!((String) cellTypeJComboBox.getSelectedItem()).equalsIgnoreCase(comboboxSeparator)) {
                cvTerms.add(new CvTerm(
                        "CL",
                        cellTypeMap.get((String) cellTypeJComboBox.getSelectedItem()),
                        (String) cellTypeJComboBox.getSelectedItem(),
                        null));
            }
        }

        // add additional cv terms
        for (int i = 0; i < sampleCvTermsJTable.getRowCount(); i++) {
            cvTerms.add(new CvTerm(
                    (String) sampleCvTermsJTable.getValueAt(i, 1),
                    (String) sampleCvTermsJTable.getValueAt(i, 2),
                    (String) sampleCvTermsJTable.getValueAt(i, 3),
                    (String) sampleCvTermsJTable.getValueAt(i, 4)));
        }
View Full Code Here

Examples of com.compomics.util.pride.CvTerm

                        // additional peptide id parameters
                        br.write(getCurrentTabSpace() + "<additional>" + System.getProperty("line.separator"));
                        tabCounter++;
                        br.write(getCurrentTabSpace() + "<userParam name=\"Spectrum File\" value=\"" + Spectrum.getSpectrumFile(spectrumKey) + "\" />" + System.getProperty("line.separator"));
                        writeCvTerm(new CvTerm("PSI-MS", "MS:1000796", "Spectrum Title", "" + StringEscapeUtils.escapeHtml4(Spectrum.getSpectrumTitle(spectrumKey))));
                        br.write(getCurrentTabSpace() + "<userParam name=\"Protein Inference\" value=\"" + peptideProteins + "\" />" + System.getProperty("line.separator"));
                        br.write(getCurrentTabSpace() + "<userParam name=\"Peptide Confidence\" value=\"" + Util.roundDouble(peptideProbabilities.getPeptideConfidence(), CONFIDENCE_DECIMALS) + "\" />" + System.getProperty("line.separator"));
                        confidenceThreshold = peptideTargetDecoyMap.getTargetDecoyMap(peptideTargetDecoyMap.getCorrectedKey(peptideProbabilities.getSpecificMapKey())).getTargetDecoyResults().getConfidenceLimit();
                        br.write(getCurrentTabSpace() + "<userParam name=\"Peptide Confidence Threshold\" value=\"" + Util.roundDouble(confidenceThreshold, CONFIDENCE_DECIMALS) + "\" />" + System.getProperty("line.separator"));
                        MatchValidationLevel matchValidationLevel = peptideProbabilities.getMatchValidationLevel();
                        if (matchValidationLevel == MatchValidationLevel.doubtful && !peptideProbabilities.getReasonDoubtful().equals("")) {
                            br.write(getCurrentTabSpace() + "<userParam name=\"Peptide Validation\" value=\"" + matchValidationLevel + " (" + StringEscapeUtils.escapeHtml4(peptideProbabilities.getReasonDoubtful()) + ")" + "\" />" + System.getProperty("line.separator"));
                        } else {
                            br.write(getCurrentTabSpace() + "<userParam name=\"Peptide Validation\" value=\"" + matchValidationLevel + "\" />" + System.getProperty("line.separator"));
                        }
                        br.write(getCurrentTabSpace() + "<userParam name=\"PSM Confidence\" value=\"" + Util.roundDouble(psmProbabilities.getPsmConfidence(), CONFIDENCE_DECIMALS) + "\" />" + System.getProperty("line.separator"));
                        Integer charge = new Integer(psmProbabilities.getSpecificMapKey());
                        String fileName = Spectrum.getSpectrumFile(spectrumKey);
                        confidenceThreshold = psmTargetDecoyMap.getTargetDecoyMap(charge, fileName).getTargetDecoyResults().getConfidenceLimit();
                        br.write(getCurrentTabSpace() + "<userParam name=\"PSM Confidence Threshold\" value=\"" + Util.roundDouble(confidenceThreshold, CONFIDENCE_DECIMALS) + "\" />" + System.getProperty("line.separator"));
                        matchValidationLevel = psmProbabilities.getMatchValidationLevel();
                        if (matchValidationLevel == MatchValidationLevel.doubtful && !psmProbabilities.getReasonDoubtful().equals("")) {
                            br.write(getCurrentTabSpace() + "<userParam name=\"PSM Validation\" value=\"" + matchValidationLevel + " (" + StringEscapeUtils.escapeHtml4(psmProbabilities.getReasonDoubtful()) + ")" + "\" />" + System.getProperty("line.separator"));
                        } else {
                            br.write(getCurrentTabSpace() + "<userParam name=\"PSM Validation\" value=\"" + matchValidationLevel + "\" />" + System.getProperty("line.separator"));
                        }

                        writeCvTerm(new CvTerm("PSI-MS", "MS:1000041", "Charge State", "" + bestAssumption.getIdentificationCharge().value)); // @TODO: is 2+ etc supported?
                        //br.write(getCurrentTabSpace() + "<userParam name=\"Identified Charge\" value=\"" + bestAssumption.getIdentificationCharge().value + "\" />" + System.getProperty("line.separator"));

                        // search engine specific parameters
                        ArrayList<Integer> searchEngines = new ArrayList<Integer>(eValues.keySet());
                        Collections.sort(searchEngines);

                        // add the search engine e-values
                        ArrayList<Integer> algorithms = new ArrayList<Integer>(eValues.keySet());
                        Collections.sort(algorithms);
                        for (int tempAdvocate : algorithms) {
                            double eValue = eValues.get(tempAdvocate);
                            if (tempAdvocate == Advocate.msgf.getIndex()) {
                                writeCvTerm(new CvTerm("PSI-MS", "MS:1002052", "MS-GF:SpecEValue", Double.toString(eValue)));
                            } else if (tempAdvocate == Advocate.mascot.getIndex()) {
                                writeCvTerm(new CvTerm("PSI-MS", "MS:1001172", "Mascot:expectation value", Double.toString(eValue)));
                            } else if (tempAdvocate == Advocate.omssa.getIndex()) {
                                writeCvTerm(new CvTerm("PSI-MS", "MS:1001328", "OMSSA:evalue", Double.toString(eValue)));
                            } else if (tempAdvocate == Advocate.xtandem.getIndex()) {
                                writeCvTerm(new CvTerm("PSI-MS", "MS:1001330", "X!Tandem:expect", Double.toString(eValue)));
                            } else if (tempAdvocate == Advocate.comet.getIndex()) {
                                writeCvTerm(new CvTerm("PSI-MS", "MS:1002257", "Comet:expectation value", Double.toString(eValue)));
                            } else {
                                br.write(getCurrentTabSpace() + "<userParam name=\"" + Advocate.getAdvocate(tempAdvocate).getName()
                                        + " e-value\" value=\"" + eValue + "\" />" + System.getProperty("line.separator"))// @TODO: add cv params for the other new advocates
                            }
                           
                            // @TODO: add scores for MyriMatch!

                            // @TODO: add generic e-value for user algorithms?
                        }

                        // add the additional search engine scores
                        if (mascotScore != null) {
                            writeCvTerm(new CvTerm("PSI-MS", "MS:1001171", "Mascot:score", "" + mascotScore));
                        }
                        if (msAmandaScore != null) {
                            writeCvTerm(new CvTerm("PSI-MS", "MS:1002319", "Amanda:AmandaScore", "" + msAmandaScore));
                        }

                        // @TODO: add additional scores for OMSSA and X!Tandem as well
                        // "MS:1001329", "OMSSA:pvalue"
                        // "PRIDE:0000182","X|Tandem Z score"
                        // "MS:1001331", "X!Tandem:hyperscore"
                        // PTM scoring
                        if (dScore.length() > 0) {
                            br.write(getCurrentTabSpace() + "<userParam name=\"PTM D-score\" value=\"" + dScore + "\" />" + System.getProperty("line.separator"));
                        }
                        if (ptmScoringPreferences.isProbabilitsticScoreCalculation() && probabilisticScore.length() > 0) {
                            br.write(getCurrentTabSpace() + "<userParam name=\"PTM "
                                    + ptmScoringPreferences.getSelectedProbabilisticScore().getName()
                                    + "\" value=\"" + probabilisticScore + "\" />" + System.getProperty("line.separator"));
                        }
                        tabCounter--;
                        br.write(getCurrentTabSpace() + "</additional>" + System.getProperty("line.separator"));
                        tabCounter--;
                        br.write(getCurrentTabSpace() + "</PeptideItem>" + System.getProperty("line.separator"));
                    }
                }

                // additional protein id parameters
                br.write(getCurrentTabSpace() + "<additional>" + System.getProperty("line.separator"));
                tabCounter++;
                if (ProteinMatch.isDecoy(proteinKey)) {
                    br.write(getCurrentTabSpace() + "<userParam name=\"Decoy\" value=\"1\" />" + System.getProperty("line.separator"));
                } else {
                    br.write(getCurrentTabSpace() + "<userParam name=\"Decoy\" value=\"0\" />" + System.getProperty("line.separator"));
                }
                try {
                    if (spectrumCountingPreferences.getSelectedMethod() == SpectrumCountingPreferences.SpectralCountingMethod.EMPAI) {
                        writeCvTerm(new CvTerm("PSI-MS", "MS:1001905", "emPAI value", "" + identificationFeaturesGenerator.getSpectrumCounting(proteinKey)));
                    } else {
                        br.write(getCurrentTabSpace() + "<userParam name=\"NSAF+\" value=\""
                                + identificationFeaturesGenerator.getSpectrumCounting(proteinKey) + "\" />" + System.getProperty("line.separator"));
                    }
                } catch (Exception e) {
View Full Code Here

Examples of com.compomics.util.pride.CvTerm

    private void writeFragmentIon(IonMatch ionMatch) throws IOException {

        // @TODO: to add neutral losses with more than one loss we need to create new CV terms!!
        // @TODO: to add phospho neutral losses we need to create new CV terms!!
        // @TODO: implement reporter ions! (required cv terms not found)
        CvTerm fragmentIonTerm = ionMatch.ion.getPrideCvTerm();

        if (fragmentIonTerm != null) {
            if (ionMatch.ion.getType() == IonType.PEPTIDE_FRAGMENT_ION
                    || ionMatch.ion.getType() == IonType.IMMONIUM_ION
                    || ionMatch.ion.getType() == IonType.PRECURSOR_ION
View Full Code Here

Examples of com.compomics.util.pride.CvTerm

            ModificationMatch modMatch = peptide.getModificationMatches().get(i);
            String modName = modMatch.getTheoreticPtm();
            PTM ptm = ptmFactory.getPTM(modName);

            CvTerm cvTerm = ptmToPrideMap.getCVTerm(modName);

            if (cvTerm == null) {
                cvTerm = PtmToPrideMap.getDefaultCVTerm(ptm.getName());
            }

            String cvTermName;
            String ptmMass;

            if (cvTerm == null) {
                cvTermName = modName;
                ptmMass = "" + ptm.getMass();
            } else {
                cvTermName = cvTerm.getName();
                ptmMass = cvTerm.getValue();

                // two extra tests to guard against problems with the cv terms, better to have a valid ptm than no ptm at all...
                if (cvTermName == null) {
                    cvTermName = modName;
                }
                if (ptmMass == null) {
                    ptmMass = "" + ptm.getMass();
                }
            }

            // get the modification location
            int modLocation = modMatch.getModificationSite();

            // have to handle terminal ptms separatly
            if (ptm.isNTerm()) {
                modLocation = 0;
            } else if (ptm.isCTerm()) {
                modLocation = peptide.getSequence().length() + 1;
            }

            br.write(getCurrentTabSpace() + "<ModLocation>" + modLocation + "</ModLocation>" + System.getProperty("line.separator"));

            if (cvTerm == null) {
                br.write(getCurrentTabSpace() + "<ModAccession>" + cvTermName + "</ModAccession>" + System.getProperty("line.separator"));
                br.write(getCurrentTabSpace() + "<ModDatabase>" + "PSI-MS" + "</ModDatabase>" + System.getProperty("line.separator"));
            } else {
                br.write(getCurrentTabSpace() + "<ModAccession>" + cvTerm.getAccession() + "</ModAccession>" + System.getProperty("line.separator"));
                br.write(getCurrentTabSpace() + "<ModDatabase>" + "UNIMOD" + "</ModDatabase>" + System.getProperty("line.separator"));
            }

            br.write(getCurrentTabSpace() + "<ModMonoDelta>" + ptmMass + "</ModMonoDelta>" + System.getProperty("line.separator"));

            br.write(getCurrentTabSpace() + "<additional>" + System.getProperty("line.separator"));
            tabCounter++;
            if (cvTerm == null) {
                br.write(getCurrentTabSpace() + "<cvParam cvLabel=\"MS\" accession=\"MS:1001460\" name=\"" + cvTermName + "\" value=\"" + ptmMass + "\" />" + System.getProperty("line.separator"));
            } else {
                br.write(getCurrentTabSpace() + "<cvParam cvLabel=\"UNIMOD\" accession=\"" + cvTerm.getAccession() + "\" name=\"" + cvTermName + "\" value=\"" + ptmMass + "\" />" + System.getProperty("line.separator"));
            }
            tabCounter--;
            br.write(getCurrentTabSpace() + "</additional>" + System.getProperty("line.separator"));

            tabCounter--;
View Full Code Here

Examples of com.compomics.util.pride.CvTerm

    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed

        ArrayList<CvTerm> cvTerms = new ArrayList<CvTerm>();

        for (int i = 0; i < protocolCvTermsJTable.getRowCount(); i++) {
            cvTerms.add(new CvTerm(
                    (String) protocolCvTermsJTable.getValueAt(i, 1),
                    (String) protocolCvTermsJTable.getValueAt(i, 2),
                    (String) protocolCvTermsJTable.getValueAt(i, 3),
                    (String) protocolCvTermsJTable.getValueAt(i, 4)));
        }
View Full Code Here

Examples of com.compomics.util.pride.CvTerm

    private void okJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okJButtonActionPerformed

        ArrayList<CvTerm> cvTerms = new ArrayList<CvTerm>();

        for (int i = 0; i < analyzerCvTermsJTable.getRowCount(); i++) {
            cvTerms.add(new CvTerm(
                    (String) analyzerCvTermsJTable.getValueAt(i, 1),
                    (String) analyzerCvTermsJTable.getValueAt(i, 2),
                    (String) analyzerCvTermsJTable.getValueAt(i, 3),
                    (String) analyzerCvTermsJTable.getValueAt(i, 4)));
        }

        String tempSource = instrumentSourceJTextField.getText();
        String termSource = tempSource.substring(0, tempSource.lastIndexOf("[") - 1);
        String accessionSource = tempSource.substring(tempSource.lastIndexOf("[") + 1, tempSource.lastIndexOf("]"));
        String ontologySource = ProjectExportDialog.getOntologyFromCvTerm(accessionSource);

        String tempDetector = instrumentDetectorJTextField.getText();
        String termDetector = tempDetector.substring(0, tempDetector.lastIndexOf("[") - 1);
        String accessionDetector = tempDetector.substring(tempDetector.lastIndexOf("[") + 1, tempDetector.lastIndexOf("]"));
        String ontologyDetector = ProjectExportDialog.getOntologyFromCvTerm(accessionDetector);

        prideExportDialog.setInstrument(new Instrument(nameJTextField.getText(),
                new CvTerm(ontologySource, accessionSource, termSource, null),
                new CvTerm(ontologyDetector, accessionDetector, termDetector, null),
                cvTerms));
        dispose();
    }//GEN-LAST:event_okJButtonActionPerformed
View Full Code Here

Examples of org.sbml.jsbml.CVTerm

   *
   * @see org.sbml.jsbml.util.Filter#accepts(java.lang.Object)
   */
  public boolean accepts(Object o) {
    if (o instanceof CVTerm) {
      CVTerm cvt = (CVTerm) o;
      if (qualifier != null) {
        if (cvt.isBiologicalQualifier()
            && (cvt.getBiologicalQualifierType() == qualifier)) {
          return pattern != null ? cvt.filterResources(pattern)
              .size() > 0 : true;
        } else if (cvt.isModelQualifier()
            && cvt.getModelQualifierType() == qualifier) {
          return pattern != null ? cvt.filterResources(pattern)
              .size() > 0 : true;
        }
      } else if (pattern != null) {
        return cvt.filterResources(pattern).size() > 0;
      }
    } else if (o instanceof SBase) {
      SBase sbase = (SBase) o;
      if (qualifier != null) {
        if (pattern != null) {
View Full Code Here

Examples of org.sbml.jsbml.CVTerm

    Compartment c = model.createCompartment("c");
    c.setSize(4.3);
    c.setSBOTerm(SBO.getPhysicalCompartment());

    Species s1 = model.createSpecies("s1", c);
    s1.addCVTerm(new CVTerm(CVTerm.Type.BIOLOGICAL_QUALIFIER,
        Qualifier.BQB_IS, "urn:miriam:kegg.compound:C12345"));
    s1.setValue(23.7);
    model.removeSpecies(s1);

    try {
View Full Code Here

Examples of org.sbml.jsbml.CVTerm

    Species s1 = model.createSpecies("s1", model.createCompartment("c1"));
    s1.setMetaId("meta_" + s1.getId());
    // Not necessary anymore.
    // s1.getAnnotation().addRDFAnnotationNamespace("bqbiol", "",
    // "http://biomodels.net/biology-qualifiers/");
    s1.addCVTerm(new CVTerm(CVTerm.Type.BIOLOGICAL_QUALIFIER,
        CVTerm.Qualifier.BQB_HAS_PART, "urn:miriam:obo.chebi:CHEBI:15422"));
    System.out.println("==================================");
    new SBMLWriter().write(doc, System.out);
    new JTreeOfSBML(doc);
  }
View Full Code Here

Examples of org.sbml.jsbml.CVTerm

      // This parser can parse only model Miriam qualifiers. This element should not have attributes or namespace declarations.
      // Creates a new CVTerm and
      // sets the qualifierType and modelQualifierType of this CVTerm. Then, adds the
      // initialised CVTerm to annotation.
      if (modelQualifierMap.containsKey(elementName) && !hasNamespaces && !hasAttributes) {
        CVTerm cvTerm = new CVTerm();
        cvTerm.setQualifierType(Type.MODEL_QUALIFIER);
        cvTerm.setModelQualifierType(modelQualifierMap.get(elementName));
       
        annotation.addCVTerm(cvTerm);
        return cvTerm;
      }
      else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.