当前位置: 首页>>代码示例>>C++>>正文


C++ AASequence类代码示例

本文整理汇总了C++中AASequence的典型用法代码示例。如果您正苦于以下问题:C++ AASequence类的具体用法?C++ AASequence怎么用?C++ AASequence使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AASequence类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getWeight

 double WeightWrapper::getWeight(const AASequence & aa) const
 {
   if (weight_mode_ == WeightWrapper::MONO)
     return aa.getMonoWeight();
   else
     return aa.getAverageWeight();
 }
开发者ID:BioinformaticsArchive,项目名称:OpenMS,代码行数:7,代码来源:WeightWrapper.cpp

示例2: main

int main()
{
  // construct a AASequence object, query a residue
  // and output some of its properties
  AASequence aas = AASequence::fromString("DECIANGER");
  cout << aas[2].getName() << " "
       << aas[2].getFormula().toString() << " "
       << aas[2].getModificationName() << " "
       << aas[2].getMonoWeight() << endl;
  
  // find a modification in ModificationsDB
  // and output some of its properties
  // getInstance() returns a pointer to a ModsDB instance
  ResidueModification mod = ModificationsDB::getInstance()->getModification("Carbamidomethyl (C)");
  cout << mod.getOrigin() << " "
       << mod.getFullId() << " "
       << mod.getDiffMonoMass() << " "
       << mod.getMonoMass() << endl;
  
  // set the modification on a residue of a peptide
  // and output some of its properties (the formula and mass have changed)
  // in this case ModificationsDB is used in the background
  // to relate the name of the mod to its attributes
  aas.setModification(2, "Carbamidomethyl (C)");
  cout << aas[2].getName() << " "
   	<< aas[2].getFormula().toString() << " "
   	<< aas[2].getModificationName() << " "
   	<< aas[2].getMonoWeight() << endl;

  return 0;
} //end of main
开发者ID:OpenMS,项目名称:OpenMS,代码行数:31,代码来源:Tutorial_ResidueModification.cpp

示例3: mergeFeatures_

  Feature ICPLLabeler::mergeFeatures_(Feature& feature_to_merge, const AASequence& labeled_feature_sequence, Map<String, Feature>& feature_index) const
  {
    // merge with feature from first map (if it exists)
    if (feature_index.count(labeled_feature_sequence.toString()) != 0)
    {
      // we only merge abundance and use feature from first map
      Feature new_f = feature_index[labeled_feature_sequence.toString()];

      new_f.setMetaValue(getChannelIntensityName(1), new_f.getIntensity());
      new_f.setMetaValue(getChannelIntensityName(2), feature_to_merge.getIntensity());
      new_f.setIntensity(new_f.getIntensity() + feature_to_merge.getIntensity());

      mergeProteinAccessions_(new_f, feature_to_merge);

      // remove feature from index
      feature_index.erase(labeled_feature_sequence.toString());

      return new_f;
    }
    else
    {
      // simply add feature from second channel, since we have no corresponding feature in the first channel
      return feature_to_merge;
    }
  }
开发者ID:BioinformaticsArchive,项目名称:OpenMS,代码行数:25,代码来源:ICPLLabeler.cpp

示例4: getUnmodifiedAASequence_

 String ICPLLabeler::getUnmodifiedAASequence_(const Feature& feature, const String& label) const
 {
   AASequence unmodified = feature.getPeptideIdentifications()[0].getHits()[0].getSequence();
   if (unmodified.getNTerminalModification() == label)
   {
     unmodified.setNTerminalModification(""); // remove terminal modification, if it is the channel specific one
   }
   return unmodified.toString();
 }
开发者ID:BioinformaticsArchive,项目名称:OpenMS,代码行数:9,代码来源:ICPLLabeler.cpp

示例5: getModifiedStringFromAASequence_

 String CompNovoIdentificationBase::getModifiedStringFromAASequence_(const AASequence & sequence)
 {
   String seq;
   for (AASequence::ConstIterator it = sequence.begin(); it != sequence.end(); ++it)
   {
     if (residue_to_name_.has(&*it))
     {
       seq += residue_to_name_[&*it];
     }
     else
     {
       seq += it->getOneLetterCode();
     }
   }
   return seq;
 }
开发者ID:aiche,项目名称:open-ms-mirror,代码行数:16,代码来源:CompNovoIdentificationBase.C

示例6: getModifString_

  String IBSpectraFile::getModifString_(const AASequence& sequence)
  {
    String modif = sequence.getNTerminalModification();
    for (AASequence::ConstIterator aa_it = sequence.begin();
         aa_it != sequence.end();
         ++aa_it)
    {
      modif += ":" + aa_it->getModification();
    }
    if (sequence.getCTerminalModification() != "")
    {
      modif += ":" + sequence.getCTerminalModification();
    }

    return modif;
  }
开发者ID:chahuistle,项目名称:OpenMS,代码行数:16,代码来源:IBSpectraFile.cpp

示例7: digest

  void EnzymaticDigestion::digest(const AASequence& protein, vector<AASequence>& output) const
  {
    // initialization
    output.clear();
    // naive cleavage sites
    Size missed_cleavages = missed_cleavages_;
    std::vector<Size> pep_positions = tokenize_(protein.toUnmodifiedString());
    Size count = pep_positions.size();
    Size begin = pep_positions[0];
    for (Size i = 1; i < count; ++i)
    {
      output.push_back(protein.getSubsequence(begin, pep_positions[i] - begin));
      begin = pep_positions[i];
    }
    output.push_back(protein.getSubsequence(begin, protein.size() - begin));

    // missed cleavages
    if (pep_positions.size() > 0 && missed_cleavages_ != 0) // there is at least one cleavage site!
    {
      // generate fragments with missed cleavages
      for (Size i = 1; ((i <= missed_cleavages) && (count > i)); ++i)
      {
        begin = pep_positions[0];
        for (Size j = 1; j < count - i; ++j)
        {
          output.push_back(protein.getSubsequence(begin, pep_positions[j + i] - begin));
          begin = pep_positions[j];
        }
        output.push_back(protein.getSubsequence(begin, protein.size() - begin));
      }
    }
  }
开发者ID:hroest,项目名称:OpenMS,代码行数:32,代码来源:EnzymaticDigestion.cpp

示例8: addLabelToProteinHits_

  void ICPLLabeler::addLabelToProteinHits_(SimTypes::FeatureMapSim& features, const String& label) const
  {
    // check if proteinIdentification exists before accessing it
    if (features.getProteinIdentifications().empty())
      return;

    for (std::vector<ProteinHit>::iterator protein_hit = features.getProteinIdentifications()[0].getHits().begin();
         protein_hit != features.getProteinIdentifications()[0].getHits().end();
         ++protein_hit)
    {
      AASequence aa = AASequence::fromString(protein_hit->getSequence());
      // modify only if the term is accessible
      if (aa.getNTerminalModification() == "")
      {
        aa.setNTerminalModification(label);
        protein_hit->setSequence(aa.toString());
      }
    }
  }
开发者ID:BioinformaticsArchive,项目名称:OpenMS,代码行数:19,代码来源:ICPLLabeler.cpp

示例9: peptideCount

  Size ProteaseDigestion::peptideCount(const AASequence& protein)
  {
    // For unspecific cleavage every cutting position may be skipped. Thus, we get (n + 1) \choose 2 products.
    if (enzyme_->getName() == UnspecificCleavage) 
    {
      return (protein.size() + 1) * protein.size() / 2;
    };

    std::vector<int> pep_positions = tokenize_(protein.toUnmodifiedString());
    Size count = pep_positions.size();
    // missed cleavages
    Size sum = count;
    for (Size i = 1; i < count; ++i)
    {
      if (i > missed_cleavages_) break;
      sum += count - i;
    }
    return sum;
  }
开发者ID:OpenMS,项目名称:OpenMS,代码行数:19,代码来源:ProteaseDigestion.cpp

示例10: addIsotopeCluster_

 void TheoreticalSpectrumGenerator::addIsotopeCluster_(RichPeakSpectrum & spectrum, const AASequence & ion, Residue::ResidueType res_type, Int charge, double intensity) const
 {
   double pos = ion.getMonoWeight(res_type, charge) / (double)charge;
   RichPeak1D p;
   IsotopeDistribution dist = ion.getFormula(res_type, charge).getIsotopeDistribution(max_isotope_);
   UInt j(0);
   for (IsotopeDistribution::ConstIterator it = dist.begin(); it != dist.end(); ++it, ++j)
   {
     // TODO: this is usually dominated by 13C-12C mass shift which deviates a bit from neutron mass
     p.setMZ((double)(pos + (double)j * Constants::NEUTRON_MASS_U) / (double)charge); 
     p.setIntensity(intensity * it->second);
     if (add_metainfo_ && j == 0)
     {
       String ion_name = String(residueTypeToIonLetter_(res_type)) + String(ion.size()) + String(charge, '+');
       p.setMetaValue("IonName", ion_name);
     }
     spectrum.push_back(p);
   }
 }
开发者ID:chahuistle,项目名称:OpenMS,代码行数:19,代码来源:TheoreticalSpectrumGenerator.cpp

示例11: isValidProduct

 bool ProteaseDigestion::isValidProduct(const AASequence& protein,
                                        int pep_pos,
                                        int pep_length,
                                        bool ignore_missed_cleavages,
                                        bool allow_nterm_protein_cleavage,
                                        bool allow_random_asp_pro_cleavage) const
 {
   String seq = protein.toUnmodifiedString();
   return isValidProduct_(seq, pep_pos, pep_length, ignore_missed_cleavages, allow_nterm_protein_cleavage, allow_random_asp_pro_cleavage);
 }
开发者ID:OpenMS,项目名称:OpenMS,代码行数:10,代码来源:ProteaseDigestion.cpp

示例12:

 vector<Size> AScore::getSites_(const AASequence& without_phospho) const
 {
   vector<Size> tupel;
   String unmodified = without_phospho.toUnmodifiedString();
   for (Size i = 0; i < unmodified.size(); ++i)
   {
     if (unmodified[i] == 'Y' || unmodified[i] == 'T' || unmodified[i] == 'S')
     {
       tupel.push_back(i);
     }
   }
   return tupel;
 }
开发者ID:hroest,项目名称:OpenMS,代码行数:13,代码来源:AScore.cpp

示例13: peptideCount

 Size EnzymaticDigestion::peptideCount(const AASequence& protein)
 {
   std::vector<Size> pep_positions = tokenize_(protein.toUnmodifiedString());
   Size count = pep_positions.size();
   // missed cleavages
   Size sum = count;
   for (Size i = 1; i < count; ++i)
   {
     if (i > missed_cleavages_) break;
     sum += count - i;
   }
   return sum;
 }
开发者ID:hroest,项目名称:OpenMS,代码行数:13,代码来源:EnzymaticDigestion.cpp

示例14: compareChargeStates_

 void ConsensusIDAlgorithm::compareChargeStates_(Int& recorded_charge, 
                                                 Int new_charge,
                                                 const AASequence& peptide)
 {
   if (recorded_charge == 0) // update recorded charge
   {
     recorded_charge = new_charge;
   }
   else if ((new_charge != 0) && (recorded_charge != new_charge))
   { // maybe TODO: calculate correct charge from prec. m/z and peptide mass?
     String msg = "Conflicting charge states found for peptide '" +
       peptide.toString() + "': " + String(recorded_charge) + ", " + 
       String(new_charge);
     throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, 
                                   msg, String(new_charge));
   }
 }
开发者ID:OpenMS,项目名称:OpenMS,代码行数:17,代码来源:ConsensusIDAlgorithm.cpp

示例15: applyLabelToProteinHit_

void SILACLabeler::applyLabelToProteinHit_(SimTypes::FeatureMapSim& channel, const String& arginine_label, const String& lysine_label) const
{
    for (std::vector<ProteinHit>::iterator protein_hit = channel.getProteinIdentifications()[0].getHits().begin();
            protein_hit != channel.getProteinIdentifications()[0].getHits().end();
            ++protein_hit)
    {
        AASequence aa = AASequence::fromString(protein_hit->getSequence());

        for (AASequence::Iterator residue = aa.begin(); residue != aa.end(); ++residue)
        {
            if (*residue == 'R')
            {
                aa.setModification(residue - aa.begin(), arginine_label);
            }
            else if (*residue == 'K')
            {
                aa.setModification(residue - aa.begin(), lysine_label);
            }
        }
        protein_hit->setSequence(aa.toString());
    }
}
开发者ID:isabell-bludau,项目名称:OpenMS,代码行数:22,代码来源:SILACLabeler.cpp


注:本文中的AASequence类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。