Example #1
0
 internal void AddProteinGroup(ProteinGroup pg)
 {
     if (ProteinGroups == null)
     {
         ProteinGroups = new List <ProteinGroup>();
     }
     ProteinGroups.Add(pg);
 }
Example #2
0
 public static int Compare(ProteinGroup pg1, ProteinGroup pg2, int direction)
 {
     direction = Math.Sign(direction);
     if (pg1 == null)
     {
         // If both x and y are null they are equal, otherwise y is greater
         return((pg2 == null) ? 0 : -direction);
     }
     // If y is null x is greater, otherwise compare their pscores
     return((pg2 == null) ? direction : direction *pg1.PScore.CompareTo(pg2.PScore));
 }
Example #3
0
 public bool Equals(ProteinGroup other)
 {
     if (ReferenceEquals(other, null))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (Count != other.Count)
     {
         return(false);
     }
     return(_proteins.All(prot => other._proteins.Contains(prot)));
 }
Example #4
0
 public int CompareTo(ProteinGroup other)
 {
     return(Compare(this, other));
 }
Example #5
0
 public static int CompareIncreasing(ProteinGroup pg1, ProteinGroup pg2)
 {
     return(Compare(pg1, pg2, 1));
 }