Beispiel #1
0
        private AlleleCategory CalculateType()
        {
            if (!String.IsNullOrEmpty(ReferenceAllele) &&
                !String.IsNullOrEmpty(AlternateAllele))
            {
                if (ReferenceAllele.ToLower() == AlternateAllele.ToLower())
                {
                    return(AlleleCategory.Reference);
                }

                if (AlternateAllele == ".")
                {
                    return(AlleleCategory.Reference);
                }

                if (ReferenceAllele.Length == AlternateAllele.Length)
                {
                    return(AlternateAllele.Length == 1 ? AlleleCategory.Snv : AlleleCategory.Mnv);
                }
                else
                {
                    if (ReferenceAllele.Length == 1)
                    {
                        return(AlleleCategory.Insertion);
                    }
                    else if (AlternateAllele.Length == 1)
                    {
                        return(AlleleCategory.Deletion);
                    }
                }
            }

            return(AlleleCategory.Unsupported);
        }
Beispiel #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = RsId.GetHashCode();
         hashCode = (hashCode * 397) ^ (ReferenceAllele?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (AlternateAllele?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Beispiel #3
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Start.GetHashCode() ^ Chromosome.GetHashCode();
                hashCode = (hashCode * 397) ^ (AlternateAllele?.GetHashCode() ?? 0);

                return(hashCode);
            }
        }
Beispiel #4
0
        public override int GetHashCode()
        {
            var hashCode = Start.GetHashCode() ^ ReferenceName.GetHashCode();

            hashCode = (hashCode * 397) ^ End.GetHashCode();
            hashCode = (hashCode * 397) ^ VariantType.GetHashCode();
            hashCode = (hashCode * 397) ^ Source.GetHashCode();
            hashCode = (hashCode * 397) ^ AlternateAllele.GetHashCode();

            return(hashCode);
        }
Beispiel #5
0
        public override int GetHashCode()
        {
            // ReSharper disable NonReadonlyMemberInGetHashCode
            var hashCode = Start.GetHashCode() ^ Chromosome.GetHashCode();

            hashCode = (hashCode * 397) ^ (AlternateAllele?.GetHashCode() ?? 0);
            hashCode = (hashCode * 397) ^ (AnnotationType?.GetHashCode() ?? 0);
            // ReSharper restore NonReadonlyMemberInGetHashCode

            return(hashCode);
        }
Beispiel #6
0
        public override bool Equals(object other)
        {
            if (!(other is GnomadItem otherItem))
            {
                return(false);
            }

            // Return true if the fields match:
            return(Equals(Chromosome, otherItem.Chromosome) &&
                   Start == otherItem.Start &&
                   AlternateAllele.Equals(otherItem.AlternateAllele));
        }
Beispiel #7
0
 public override bool Equals(object obj)
 {
     if (!(obj is ClinVarItem item))
     {
         return(false);
     }
     return(Chromosome == item.Chromosome &&
            Start == item.Start &&
            Id.Equals(item.Id) &&
            ReferenceAllele.Equals(item.ReferenceAllele) &&
            AlternateAllele.Equals(item.AlternateAllele));
 }
Beispiel #8
0
        public override bool Equals(object other)
        {
            if (!(other is CustomItem otherItem))
            {
                return(false);
            }

            return(Chromosome.Equals(otherItem.Chromosome) &&
                   Start.Equals(otherItem.Start) &&
                   ReferenceAllele.Equals(otherItem.ReferenceAllele) &&
                   AlternateAllele.Equals(otherItem.AlternateAllele) &&
                   AnnotationType.Equals(otherItem.AnnotationType));
        }
Beispiel #9
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Chromosome?.GetHashCode() ?? 0;
                hashCode = (hashCode * 397) ^ Start;
                hashCode = (hashCode * 397) ^ (Id?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (ReferenceAllele?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (AlternateAllele?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (Gene?.GetHashCode() ?? 0);

                return(hashCode);
            }
        }
Beispiel #10
0
        public override bool Equals(object other)
        {
            // If parameter is null return false.

            // if other cannot be cast into OneKGenItem, return false
            if (!(other is EvsItem otherItem))
            {
                return(false);
            }

            // Return true if the fields match:
            return(Equals(Chromosome, otherItem.Chromosome) &&
                   Start == otherItem.Start &&
                   AlternateAllele.Equals(otherItem.AlternateAllele)
                   );
        }
Beispiel #11
0
        public override bool Equals(object other)
        {
            // If parameter is null return false.

            if (!(other is DbSnpItem otherItem))
            {
                return(false);
            }

            // Return true if the fields match:
            return(Equals(Chromosome, otherItem.Chromosome) &&
                   Start == otherItem.Start &&
                   RsId == otherItem.RsId &&
                   string.Equals(ReferenceAllele, otherItem.ReferenceAllele) &&
                   AlternateAllele.Equals(otherItem.AlternateAllele));
        }
Beispiel #12
0
        public override int GetHashCode()
        {
            // ReSharper disable NonReadonlyMemberInGetHashCode
            var hashCode = Start.GetHashCode();

            if (Chromosome != null)
            {
                hashCode ^= Chromosome.GetHashCode();
            }
            if (Id != null)
            {
                hashCode ^= Id.GetHashCode();
            }
            if (AlternateAllele != null)
            {
                hashCode ^= AlternateAllele.GetHashCode();
            }
            if (ReferenceAllele != null)
            {
                hashCode ^= ReferenceAllele.GetHashCode();
            }
            // ReSharper restore NonReadonlyMemberInGetHashCode
            return(hashCode);
        }