internal void AddProteinGroup(ProteinGroup pg) { if (ProteinGroups == null) { ProteinGroups = new List <ProteinGroup>(); } ProteinGroups.Add(pg); }
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)); }
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))); }
public int CompareTo(ProteinGroup other) { return(Compare(this, other)); }
public static int CompareIncreasing(ProteinGroup pg1, ProteinGroup pg2) { return(Compare(pg1, pg2, 1)); }