Exemple #1
0
        public void TestColumnsFromResultsTables()
        {
            SrmDocument srmDocument = ResultsUtil.DeserializeDocument("silac_1_to_4.sky", GetType());

            using (Database database = new Database())
            {
                database.AddSrmDocument(srmDocument);
                SimpleReport report = new SimpleReport
                {
                    Columns = new[]
                    {
                        new ReportColumn(typeof(DbTransitionResult),
                                         "PrecursorResult", "PeptideResult", "ProteinResult", "ReplicateName"),
                        new ReportColumn(typeof(DbTransition), "Precursor", "Peptide", "Protein", "Name"),
                        new ReportColumn(typeof(DbTransition), "Precursor", "Peptide", "Sequence"),
                        new ReportColumn(typeof(DbTransitionResult), "Area"),
                    },
                };
                ColumnSet columnSet = ColumnSet.GetTransitionsColumnSet(database.GetSchema());
                TreeView  treeView  = new TreeView();
                treeView.Nodes.AddRange(columnSet.GetTreeNodes().ToArray());
                List <NodeData> columnInfos;
                columnSet.GetColumnInfos(report, treeView, out columnInfos);
                Assert.AreEqual(report.Columns.Count, columnInfos.Count);
                SimpleReport reportCompare = (SimpleReport)columnSet.GetReport(columnInfos, null);
                Assert.IsTrue(ArrayUtil.EqualsDeep(report.Columns, reportCompare.Columns));
            }
        }
Exemple #2
0
        public Report GetReport()
        {
            bool replicate    = cbxPivotReplicate.Enabled && cbxPivotReplicate.Checked;
            bool isotopeLabel = cbxPivotIsotopeLabel.Enabled && cbxPivotIsotopeLabel.Checked;

            PivotType pivotType = null;

            if (replicate && isotopeLabel)
            {
                pivotType = PivotType.REPLICATE_ISOTOPE_LABEL;
            }
            else if (replicate)
            {
                pivotType = PivotType.REPLICATE;
            }
            else if (isotopeLabel)
            {
                pivotType = PivotType.ISOTOPE_LABEL;
            }
            return(_columnSet.GetReport(_columns, pivotType));
        }