public void AddItem(string key, ChipSeqItem item) { if (!_itemMap.ContainsKey(key)) { _itemMap[key] = new OverlappedChipSeqItem(); } _itemMap[key].Add(item); }
public double GetOverlapPercentage(ChipSeqItem another) { if (!this.GeneSymbol.Equals(another.GeneSymbol)) { return 0; } if (this.End < another.Start) { return 0; } if (this.Start > another.End) { return 0; } var oStart = Math.Max(this.Start, another.Start); var oEnd = Math.Min(this.End, another.End); var oLength = oEnd - oStart + 1; var minLen = Math.Min(this.Length, another.Length); return oLength * 1.0 / minLen; }
public double GetOverlapPercentage(ChipSeqItem another) { if (!this.GeneSymbol.Equals(another.GeneSymbol)) { return(0); } if (this.End < another.Start) { return(0); } if (this.Start > another.End) { return(0); } var oStart = Math.Max(this.Start, another.Start); var oEnd = Math.Min(this.End, another.End); var oLength = oEnd - oStart + 1; var minLen = Math.Min(this.Length, another.Length); return(oLength * 1.0 / minLen); }