예제 #1
0
int main()
{
  // Insert of two features into a map and iterate over the features.
  FeatureMap map;

  Feature feature;
  feature.setRT(15.0);
  feature.setMZ(571.3);
  map.push_back(feature); //append feature 1
  feature.setRT(23.3);
  feature.setMZ(1311.3);
  map.push_back(feature); //append feature 2

  // Iteration over FeatureMap
  for (auto it = map.begin(); it != map.end(); ++it)
  {
    cout << it->getRT() << " - " << it->getMZ() << endl;
  }

  // Calculate and output the ranges
  map.updateRanges();
  cout << "Int: " << map.getMinInt() << " - " << map.getMaxInt() << endl;
  cout << "RT:  " << map.getMin()[0] << " - " << map.getMax()[0] << endl;
  cout << "m/z: " << map.getMin()[1] << " - " << map.getMax()[1] << endl;

  // ... and many more
  return 0;
} //end of main
예제 #2
0
Int main()
{
  FeatureMap map;

  Feature feature;
  feature.setRT(15.0);
  feature.setMZ(571.3);
  map.push_back(feature); //append feature 1
  feature.setRT(23.3);
  feature.setMZ(1311.3);
  map.push_back(feature); //append feature 2


  for (FeatureMap::Iterator it = map.begin(); it != map.end(); ++it)
  {
    cout << it->getRT() << " - " << it->getMZ() << endl;
  }

  return 0;
} //end of main
예제 #3
0
파일: Main.cpp 프로젝트: OpenMS/OpenMS
int main(int argc, char * argv[])
{

  FeatureMap fm;
  Feature feature;
  fm.push_back(feature);
  std::string s = ExampleLibraryFile::printSomething();
  std::cout << "From external lib: " << s << "\n";
  std::cout << "All good and well!\n";

  return 0;
}
 void SeedListGenerator::convertSeedList(const SeedList& seeds,
                                         FeatureMap& features)
 {
   features.clear(true); // "true" should really be a default value here...
   Size counter = 0;
   for (SeedList::const_iterator seed_it = seeds.begin();
        seed_it != seeds.end(); ++seed_it, ++counter)
   {
     Feature feature;
     feature.setRT(seed_it->getX());
     feature.setMZ(seed_it->getY());
     feature.setUniqueId(counter);
     features.push_back(feature);
   }
   // // assign unique ids:
   // features.applyMemberFunction(&UniqueIdInterface::setUniqueId);
 }
  void run_(OpenSwath::SpectrumAccessPtr input,
    FeatureMap & output, TargetedExpType& transition_exp, bool force)
  {
    MRMTransitionGroupPicker trgroup_picker;
    Param picker_param = getParam_().copy("algorithm:", true);
    trgroup_picker.setParameters(picker_param);

    MRMGroupMapper m;
    m.doMap(input, transition_exp);
    if (!m.allAssaysHaveChromatograms() && !force)
    {
      throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
                                       "Not all assays could be mapped to chromatograms");
    }

    // Iterating over all the assays
    for (MRMGroupMapper::AssayMapT::iterator assay_it = m.assay_map.begin(); assay_it != m.assay_map.end(); ++assay_it)
    {
      String id = assay_it->first;

      // Create new transition group if there is none for this peptide
      MRMTransitionGroupType transition_group;
      m.getTransitionGroup(input, transition_group, id);

      // Process the transition_group
      trgroup_picker.pickTransitionGroup(transition_group);

      // Add to output
      for (Size i = 0; i < transition_group.getFeatures().size(); i++)
      {
        MRMFeature mrmfeature = transition_group.getFeatures()[i];
        // Prepare the subordinates for the mrmfeature (process all current
        // features and then append all precursor subordinate features)
        std::vector<Feature> allFeatures = mrmfeature.getFeatures();
        for (std::vector<Feature>::iterator f_it = allFeatures.begin(); f_it != allFeatures.end(); ++f_it)
        {
          f_it->getConvexHulls().clear();
          f_it->ensureUniqueId();
        }
        mrmfeature.setSubordinates(allFeatures); // add all the subfeatures as subordinates
        output.push_back(mrmfeature);
      }
    }
  }