Beispiel #1
0
        /// <summary>
        /// Comparing allele1 and allele2 with dbsnp reference allele to suggest the action for adjustment.
        /// </summary>
        /// <returns></returns>
        public StrandAction SuggestAction()
        {
            StrandAction result;

            if (this.Allele2[0] == this.DbsnpRefAllele)
            {
                result = StrandAction.None;
            }
            else if (this.Allele1 == this.DbsnpRefAllele)
            {
                result = StrandAction.Switch;
            }
            else if (SequenceUtils.GetComplementAllele(this.Allele2[0]) == this.DbsnpRefAllele)
            {
                result = StrandAction.Flip;
            }
            else if (SequenceUtils.GetComplementAllele(this.Allele1) == this.DbsnpRefAllele)
            {
                result = StrandAction.FlipSwitch;
            }
            else
            {
                result = StrandAction.Unknown;
            }
            return(result);
        }
Beispiel #2
0
        public bool IsSourceAllelesMatchedWithG1000()
        {
            if (this.G1000Allele1 == ' ')
            {
                return(false);
            }

            var comp1 = SequenceUtils.GetComplementAllele(this.G1000Allele1);
            var comp2 = SequenceUtils.GetComplementAllele(this.G1000Allele2);

            var plat1 = Allele1;
            var plat2 = Allele2[0];

            if (plat1 == this.G1000Allele1 && plat2 == this.G1000Allele2)
            {
                return(true);
            }

            if (plat1 == this.G1000Allele2 && plat2 == this.G1000Allele1)
            {
                return(true);
            }

            if (plat1 == comp1 && plat2 == comp2)
            {
                return(true);
            }

            if (plat1 == comp2 && plat2 == comp1)
            {
                return(true);
            }

            return(false);
        }
        public SingleNucleotidePolymorphism GetNotGsnapMismatch(string querySequence)
        {
            if (this.NumberOfMismatch == 0)
            {
                return(null);
            }

            var isPositiveStrand = this.Strand == '+';
            var m = mismatch.Match(this.MismatchPositions);

            if (!m.Success)
            {
                return(null);
            }

            var seq         = isPositiveStrand ? querySequence : SequenceUtils.GetReversedSequence(querySequence);
            var pos         = int.Parse(m.Groups[1].Value);
            var detectedChr = seq[pos];

            var chr = m.Groups[2].Value.First();

            chr = isPositiveStrand ? chr : SequenceUtils.GetComplementAllele(chr);

            return(new SingleNucleotidePolymorphism(pos, chr, detectedChr));
        }
Beispiel #4
0
        public bool IsPlatformAllelesMatchedWithDatabase()
        {
            if (this.G1000Allele1 == ' ')
            {
                return(false);
            }

            var comp1 = SequenceUtils.GetComplementAllele(this.G1000Allele1);
            var comp2 = SequenceUtils.GetComplementAllele(this.G1000Allele2);

            foreach (var plat in Platforms.Values)
            {
                var plat1 = plat.Allele1.First();
                var plat2 = plat.Allele2.First();

                if (plat1 == this.G1000Allele1 && plat2 == this.G1000Allele2)
                {
                    continue;
                }

                if (plat1 == this.G1000Allele2 && plat2 == this.G1000Allele1)
                {
                    continue;
                }

                if (plat1 == comp1 && plat2 == comp2)
                {
                    continue;
                }

                if (plat1 == comp2 && plat2 == comp1)
                {
                    continue;
                }

                return(false);
            }

            return(true);
        }
Beispiel #5
0
        public bool IsCompementary()
        {
            var comp2 = SequenceUtils.GetComplementAllele(this.G1000Allele2);

            return(this.G1000Allele1 == comp2);
        }