示例#1
0
void digestFeaturesMapSimVector_(FeatureMapSimVector& feature_maps)
{
  // digest here
  DigestSimulation digest_sim;
  Param p;
  p.setValue("model", "naive");
  p.setValue("model_naive:missed_cleavages", 0);
  digest_sim.setParameters(p);
  std::cout << digest_sim.getParameters() << std::endl;
  for(FeatureMapSimVector::iterator iter = feature_maps.begin() ; iter != feature_maps.end() ; ++iter)
  {
    digest_sim.digest((*iter));
  }
}
示例#2
0
FeatureMapSim BaseLabeler::mergeProteinIdentificationsMaps_(const FeatureMapSimVector & maps)
{
    // we do not have any features yet (or at least we ignore them), so simply iterate over the protein
    // identifications
    std::map<String, ProteinHit> prot_hits;
    Size channel_index = 1;
    for (FeatureMapSimVector::const_iterator maps_iterator = maps.begin(); maps_iterator != maps.end(); ++maps_iterator)
    {
        if (maps_iterator->getProteinIdentifications().size() == 0)
            continue;

        for (std::vector<ProteinHit>::const_iterator protein_hit = (*maps_iterator).getProteinIdentifications()[0].getHits().begin();
                protein_hit != (*maps_iterator).getProteinIdentifications()[0].getHits().end();
                ++protein_hit)
        {
            if (prot_hits.count((*protein_hit).getSequence())) // we already know this protein -- sum up abundances
            {
                SimIntensityType new_intensity = prot_hits[(*protein_hit).getSequence()].getMetaValue("intensity");

                // remember channel intensity
                prot_hits[(*protein_hit).getSequence()].setMetaValue("intensity_" + String(channel_index), new_intensity);

                new_intensity += static_cast<SimIntensityType>((*protein_hit).getMetaValue("intensity"));
                prot_hits[(*protein_hit).getSequence()].setMetaValue("intensity", new_intensity);
            }
            else // new protein hit .. remember
            {
                ProteinHit protHit(*protein_hit);
                protHit.setMetaValue("intensity_" + String(channel_index), protHit.getMetaValue("intensity"));
                prot_hits.insert(std::pair<String, ProteinHit>((*protein_hit).getSequence(), protHit));
            }
        }
        ++channel_index;
    }

    FeatureMapSim final_map;
    ProteinIdentification protIdent;

    for (std::map<String, ProteinHit>::iterator prot_hit_iter = prot_hits.begin(); prot_hit_iter != prot_hits.end(); ++prot_hit_iter)
    {
        protIdent.insertHit(prot_hit_iter->second);
    }
    std::vector<ProteinIdentification> protIdents;
    protIdents.push_back(protIdent);
    final_map.setProteinIdentifications(protIdents);

    return final_map;
}