Пример #1
0
        public void GenerateWhatAndWhyWorksWithCnSample(bool isAlleleMatch, uint posStart, uint posEnd, uint endStart, uint endEnd,
                                                        bool isGtMatch, uint cn, MatchEnum matchResult, FailedReason reasonResult)
        {
            var originalVariant = GetOriginalCnvGtVariant();
            var otherVariant    =
                SetupBasicVariant(isAlleleMatch ? PrimaryContigAndInterval : PrimaryFailedContigAndInterval);

            otherVariant.SetupGet(v => v.PosInterval).Returns(ContigAndInterval.Create(PrimaryContig, posStart, posEnd));
            otherVariant.SetupGet(v => v.EndInterval).Returns(ContigAndInterval.Create(PrimaryContig, endStart, endEnd));
            var otherSample = new Mock <IWittyerGenotypedCopyNumberSample>();

            var gt = new Mock <IGenotypeInfo>();

            if (originalVariant.Sample is IWittyerGenotypedSample gtSample)
            {
                gt.Setup(g => g.Equals(gtSample.Gt)).Returns(isGtMatch);
            }

            otherSample.SetupGet(s => s.Gt).Returns(gt.Object);
            otherSample.SetupGet(s => s.Cn).Returns(cn);

            otherVariant.SetupGet(v => v.Sample).Returns(otherSample.Object);

            var actual = OverlappingUtils.GenerateWhatAndWhy(otherVariant.Object, new List <FailedReason>(),
                                                             originalVariant, OverlappingUtils.IsVariantAlleleMatch, false);

            Assert.Equal((matchResult, reasonResult), actual);
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InputCollectionFilter" /> class.
        /// </summary>
        /// <param name="input">Collection of strings to filter (required).</param>
        /// <param name="match">Match type (required) (default to MatchEnum.Any).</param>
        /// <param name="keywords">Keywords (separate multiple values with commas) (required).</param>
        public InputCollectionFilter(List <string> input = default(List <string>), MatchEnum match = MatchEnum.Any, string keywords = default(string))
        {
            // to ensure "input" is required (not null)
            if (input == null)
            {
                throw new InvalidDataException("input is a required property for InputCollectionFilter and cannot be null");
            }
            else
            {
                this.Input = input;
            }

            // to ensure "match" is required (not null)
            if (match == null)
            {
                throw new InvalidDataException("match is a required property for InputCollectionFilter and cannot be null");
            }
            else
            {
                this.Match = match;
            }

            // to ensure "keywords" is required (not null)
            if (keywords == null)
            {
                throw new InvalidDataException("keywords is a required property for InputCollectionFilter and cannot be null");
            }
            else
            {
                this.Keywords = keywords;
            }
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InputCollectionFilter" /> class.
 /// </summary>
 /// <param name="input">Collection of strings to filter (required).</param>
 /// <param name="match">Match type (required) (default to MatchEnum.Any).</param>
 /// <param name="keywords">Keywords (separate multiple values with commas) (required).</param>
 public InputCollectionFilter(List <string> input = default(List <string>), MatchEnum match = MatchEnum.Any, string keywords = default(string))
 {
     // to ensure "input" is required (not null)
     this.Input = input ?? throw new ArgumentNullException("input is a required property for InputCollectionFilter and cannot be null");
     this.Match = match;
     // to ensure "keywords" is required (not null)
     this.Keywords = keywords ?? throw new ArgumentNullException("keywords is a required property for InputCollectionFilter and cannot be null");
 }
Пример #4
0
 private OverlapAnnotation(uint who, MatchEnum what, [CanBeNull] IInterval <uint> wow, BorderDistance where,
                           FailedReason why)
 {
     Who   = who;
     What  = what;
     Wow   = wow;
     Where = where;
     Why   = why;
 }
Пример #5
0
 public Comparison(GranularityEnum granularity, MatchEnum matchType, long newPosition, string newData, long oldPosition, string oldData)
 {
     _granularity = granularity;
     _matchType   = matchType;
     _newPosition = newPosition;
     _newData     = newData;
     _oldPosition = OldPosition;
     _oldData     = oldData;
 }
Пример #6
0
        private static void BuildChartTree(earley.State chart, ref List<string> tree, ref string s, MatchEnum? match = null)
        {
            if (hasSChanged)
            {
                foreach (var term in chart.termsRight.termsRight.StringListAfterDot())
                    if (term != earley.DOT && term == s)
                        tree.Add(term);
            }
            else
            {
                foreach (var term in chart.termsRight.termsRight)
                    if (term != earley.DOT && term == s)
                        tree.Add(term);
            }

            if (chart.termsLeft == "S")
            {
                tree.Add(chart.termsLeft);
                collapse = true;
            }
            else
                s = chart.termsLeft;
        }
Пример #7
0
 public static OverlapAnnotation Create(uint who, MatchEnum what, [CanBeNull] IInterval <uint> wow,
                                        [NotNull] BorderDistance where, FailedReason why)
 => new OverlapAnnotation(who, what, wow, where, why);