Ejemplo n.º 1
0
        public FoldChangeDataSet(ICollection <double> abundances, ICollection <int> features, ICollection <int> runs, ICollection <int> subjects, ICollection <bool> subjectControls)
        {
            Abundances      = ImmutableList.ValueOf(abundances);
            Runs            = ImmutableList.ValueOf(runs);
            Features        = ImmutableList.ValueOf(features);
            Subjects        = ImmutableList.ValueOf(subjects);
            SubjectControls = ImmutableList.ValueOf(subjectControls);

            if (abundances.Count != features.Count || abundances.Count != subjects.Count || abundances.Count != Runs.Count)
            {
                throw new ArgumentException("Wrong number of rows"); // Not L10N
            }
            if (abundances.Count == 0)
            {
                FeatureCount = 0;
                SubjectCount = 0;
                RunCount     = 0;
            }
            else
            {
                if (features.Min() < 0 || Runs.Min() < 0 || subjects.Min() < 0)
                {
                    throw new ArgumentException("Cannot be negative"); // Not L10N
                }
                FeatureCount = Features.Max() + 1;
                SubjectCount = Subjects.Max() + 1;
                RunCount     = Runs.Max() + 1;
            }
            if (subjectControls.Count != SubjectCount)
            {
                throw new ArgumentException("Wrong number of subjects"); // Not L10N
            }
        }
Ejemplo n.º 2
0
        private void ShrinkActions()
        {
            Verifying = true;
            Shrinking = false;
            Reporting = false;
            BreakRun  = false;

            Failed = false;
            var failingSpec = FailingSpec;
            var exception   = Exception;

            var max     = Runs.Max();
            var current = 0;

            while (current <= max)
            {
                Failed      = false;
                TempMemory  = new TempMemory();
                FailingSpec = failingSpec;
                Exception   = exception;

                foreach (var run in Runs.ToList())
                {
                    RunNumber = run;
                    if (run != current)
                    {
                        Runner(this);
                    }
                    if (BreakRun)
                    {
                        break;
                    }
                }
                if (Failed && !BreakRun)
                {
                    Runs.Remove(current);
                }
                current++;
            }

            Failed      = true;
            FailingSpec = failingSpec;
            Exception   = exception;
        }