Exemple #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
            }
        }