Ejemplo n.º 1
0
        public void TestModificationParams()
        {
            var methodName = MethodBase.GetCurrentMethod().Name;

            ShowStarting(methodName);

            var modifications   = new[] { Modification.Acetylation, Modification.Phosphorylation, Modification.Oxidation }; //, Modification.PyroGluQ };
            var modParams       = new ModificationParams(modifications, 3);
            int numCombinations = modParams.NumModificationCombinations;

            for (int modCombIndex = 0; modCombIndex < numCombinations; modCombIndex++)
            {
                var modCombination = modParams.GetModificationCombination(modCombIndex);
                Console.WriteLine("{0}: {1} {2} {3}", modCombIndex, modCombination, modCombination.Composition, modCombination.Composition.Mass);
            }

            Console.WriteLine(modParams.GetModificationCombinationIndex(8, 0));
            Console.WriteLine(modParams.GetModificationCombinationIndex(19, 1));
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Object hash code
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Name != null ? Name.GetHashCode() : 0;
         hashCode = (hashCode * 397) ^ (AnalysisSoftware != null ? AnalysisSoftware.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SearchType != null ? SearchType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^
                    (AdditionalSearchParams != null ? AdditionalSearchParams.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MassTables != null ? MassTables.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ModificationParams != null ? ModificationParams.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Enzymes != null ? Enzymes.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FragmentTolerances != null ? FragmentTolerances.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ParentTolerances != null ? ParentTolerances.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Threshold != null ? Threshold.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DatabaseFilters != null ? DatabaseFilters.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DatabaseTranslation != null ? DatabaseTranslation.GetHashCode() : 0);
         return hashCode;
     }
 }