예제 #1
0
 public double GetTracerPercent(TracerFormula tracerFormula)
 {
     if (_maxTracerCount == 0)
     {
         return(0);
     }
     return(100.0 * tracerFormula.Dictionary.Values.Sum() / _maxTracerCount);
 }
예제 #2
0
        public Molecule MoleculeFromTracerFormula(TracerFormula tracerFormula)
        {
            Molecule result = _aminoAcidFormulas.GetFormula(Sequence);

            foreach (var entry in tracerFormula)
            {
                var tracerDef = _tracerDefs[entry.Key];
                result = result.SetElementCount(
                    tracerDef.TraceeSymbol, result.GetElementCount(tracerDef.TraceeSymbol) - entry.Value);
                result = result.SetElementCount(tracerDef.Name, entry.Value);
            }
            return(result);
        }
예제 #3
0
 private MassDistribution GetMassDistribution(TracerFormula tracerFormula)
 {
     lock (_massDistributions)
     {
         MassDistribution massDistribution;
         if (_massDistributions.TryGetValue(tracerFormula, out massDistribution))
         {
             return(massDistribution);
         }
         var molecule = MoleculeFromTracerFormula(tracerFormula);
         massDistribution = _aminoAcidFormulas.GetMassDistribution(molecule, 0);
         _massDistributions.Add(tracerFormula, massDistribution);
         return(massDistribution);
     }
 }