• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Param.Parameters类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BasicLib.Param.Parameters的典型用法代码示例。如果您正苦于以下问题:C# Parameters类的具体用法?C# Parameters怎么用?C# Parameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Parameters类属于BasicLib.Param命名空间,在下文中一共展示了Parameters类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Init

 public void Init(Parameters parameters1, float paramNameWidth, int totalWidth)
 {
     Parameters = parameters1;
     int nrows = Parameters.GroupCount;
     parameterGroupPanels = new ParameterGroupPanel[nrows];
     tableLayoutPanel = new TableLayoutPanel();
     SuspendLayout();
     tableLayoutPanel.ColumnCount = 1;
     tableLayoutPanel.ColumnStyles.Clear();
     tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
     tableLayoutPanel.Dock = DockStyle.None;
     tableLayoutPanel.Location = new Point(0, 0);
     tableLayoutPanel.Name = "tableLayoutPanel";
     tableLayoutPanel.RowCount = nrows + 1;
     tableLayoutPanel.RowStyles.Clear();
     float totalHeight = 0;
     for (int i = 0; i < nrows; i++){
         float h = parameters1.GetGroup(i).Height + 26;
         tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize, h));
         totalHeight += h + 6;
     }
     tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
     tableLayoutPanel.Size = new Size(totalWidth, (int) totalHeight);
     tableLayoutPanel.TabIndex = 0;
     for (int i = 0; i < nrows; i++){
         AddParameterGroup(parameters1.GetGroup(i), i, paramNameWidth, totalWidth);
     }
     AutoScaleDimensions = new SizeF(6F, 13F);
     AutoScaleMode = AutoScaleMode.Font;
     Controls.Clear();
     Controls.Add(tableLayoutPanel);
     Name = "ParameterPanel";
     Size = new Size(totalWidth, (int) totalHeight);
     ResumeLayout(true);
 }
开发者ID:neuhauser,项目名称:compbio-base,代码行数:35,代码来源:ParameterPanel.cs


示例2: BoolWithSubParams

 public BoolWithSubParams(string name, bool value)
     : base(name)
 {
     Value = value;
     Default = value;
     SubParamsFalse = new Parameters();
     SubParamsTrue = new Parameters();
 }
开发者ID:neuhauser,项目名称:compbio-base,代码行数:8,代码来源:BoolWithSubParams.cs


示例3: AddIntSubParams

 private static void AddIntSubParams(ICollection<IntParam> result, Parameters sp)
 {
     foreach (Parameter p in sp.GetAllParameters()){
         if (p is IntParam){
             result.Add((IntParam) p);
         } else if (p is ParameterWithSubParams){
             AddIntSubParams(result, ((ParameterWithSubParams) p).GetSubParameters());
         }
     }
 }
开发者ID:neuhauser,项目名称:compbio-base,代码行数:10,代码来源:ParameterWithSubParams.cs


示例4: FilterRows

 public static void FilterRows(IMatrixData mdata, Parameters parameters, int[] rows)
 {
     bool reduceMatrix = GetReduceMatrix(parameters);
     if (reduceMatrix){
         mdata.ExtractExpressionRows(rows);
     } else{
         Array.Sort(rows);
         string[][] col = new string[mdata.RowCount][];
         for (int i = 0; i < col.Length; i++){
             bool contains = Array.BinarySearch(rows, i) >= 0;
             col[i] = contains ? new[]{"Keep"} : new[]{"Discard"};
         }
         mdata.AddCategoryColumn("Filter", "", col);
     }
 }
开发者ID:BAngermann,项目名称:perseus-plugins,代码行数:15,代码来源:PerseusPluginUtils.cs


示例5: FilterColumns

 public static void FilterColumns(IMatrixData mdata, Parameters parameters, int[] cols)
 {
     bool reduceMatrix = GetReduceMatrix(parameters);
     if (reduceMatrix){
         mdata.ExtractExpressionColumns(cols);
     } else{
         Array.Sort(cols);
         string[][] row = new string[mdata.ExpressionColumnCount][];
         for (int i = 0; i < row.Length; i++){
             bool contains = Array.BinarySearch(cols, i) >= 0;
             row[i] = contains ? new[]{"Keep"} : new[]{"Discard"};
         }
         mdata.AddCategoryRow("Filter", "", row);
     }
 }
开发者ID:BAngermann,项目名称:perseus-plugins,代码行数:15,代码来源:PerseusPluginUtils.cs


示例6: ParameterForm

        public ParameterForm(Parameters parameters, string title, string helpDescription, string helpOutput,
			IList<string> helpSuppls)
        {
            InitializeComponent();
            parameterPanel1.Init(parameters);
            string text = "";
            if (!string.IsNullOrEmpty(helpDescription)){
                text += "\n\nDescription:\n " + helpDescription;
            }
            if (!string.IsNullOrEmpty(helpOutput)){
                text += "\n\nOutput:\n " + helpOutput;
            }
            if (helpSuppls != null){
                for (int i = 0; i < helpSuppls.Count; i++){
                    if (!string.IsNullOrEmpty(helpSuppls[i])){
                        text += "\n\nSuppl. table " + (i + 1) + ":\n " + helpSuppls[i];
                    }
                }
            }
            helpTextBox.Text = text;
            Text = title;
        }
开发者ID:neuhauser,项目名称:compbio-base,代码行数:22,代码来源:ParameterForm.cs


示例7: ProcessData

 public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables, ProcessInfo processInfo)
 {
     float value = (float) param.GetDoubleParam("Value").Value;
     ReplaceMissingsByVal(value, mdata);
 }
开发者ID:BAngermann,项目名称:perseus-plugins,代码行数:5,代码来源:ReplaceMissingByConstant.cs


示例8: ProcessData

        public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables,
			ref IDocumentData[] documents, ProcessInfo processInfo)
        {
            SingleChoiceWithSubParams access = param.GetSingleChoiceWithSubParams("Matrix access");
            bool rows = access.Value == 0;
            int groupInd;
            if (rows){
                groupInd = access.GetSubParameters().GetSingleChoiceParam("Grouping").Value - 1;
            } else{
                groupInd = -1;
            }
            int what = param.GetSingleChoiceParam("Subtract what").Value;
            if (groupInd < 0){
                SubtractValues(rows, GetFunc(what), mdata, processInfo.NumThreads);
            } else{
                string[][] catRow = mdata.GetCategoryRowAt(groupInd);
                foreach (string[] t in catRow){
                    if (t.Length > 1){
                        processInfo.ErrString = "The groups are overlapping.";
                        return;
                    }
                }
                SubtractGroups(mdata, catRow, GetFunc(what));
            }
        }
开发者ID:neuhauser,项目名称:perseus-plugins,代码行数:25,代码来源:Subtract.cs


示例9: ProcessData

        public void ProcessData(IMatrixData data, Parameters param, ref IMatrixData[] supplTables,
			ref IDocumentData[] documents, ProcessInfo processInfo)
        {
            bool falseAreIndicated = param.GetSingleChoiceParam("Indicated are").Value == 0;
            int catCol = param.GetSingleChoiceParam("In column").Value;
            string word = param.GetStringParam("Indicator").Value;
            int[] scoreColumns = param.GetMultiChoiceParam("Scores").Value;
            if (scoreColumns.Length == 0){
                processInfo.ErrString = "Please specify at least one column with scores.";
                return;
            }
            bool largeIsGood = param.GetBoolParam("Large values are good").Value;
            int[] showColumns = param.GetMultiChoiceParam("Display quantity").Value;
            if (showColumns.Length == 0){
                processInfo.ErrString = "Please select at least one quantity to display";
                return;
            }
            bool[] indCol = GetIndicatorColumn(falseAreIndicated, catCol, word, data);
            List<string> expColNames = new List<string>();
            List<float[]> expCols = new List<float[]>();
            foreach (int scoreColumn in scoreColumns){
                double[] vals = scoreColumn < data.NumericColumnCount
                    ? data.NumericColumns[scoreColumn]
                    : ArrayUtils.ToDoubles(data.GetExpressionColumn(scoreColumn - data.NumericColumnCount));
                string name = scoreColumn < data.NumericColumnCount
                    ? data.NumericColumnNames[scoreColumn] : data.ExpressionColumnNames[scoreColumn - data.NumericColumnCount];
                int[] order = GetOrder(vals, largeIsGood);
                CalcCurve(ArrayUtils.SubArray(indCol, order), showColumns, name, expCols, expColNames);
            }
            float[,] expData = ToMatrix(expCols);
            data.SetData(data.Name, expColNames, expData, new List<string>(), new List<string[]>(), new List<string>(),
                new List<string[][]>(), new List<string>(), new List<double[]>(), new List<string>(), new List<double[][]>());
        }
开发者ID:neuhauser,项目名称:perseus-plugins,代码行数:33,代码来源:PerformanceCurves.cs


示例10: AnalyzeData

 public IAnalysisResult AnalyzeData(IMatrixData mdata, Parameters param, ProcessInfo processInfo)
 {
     return new SelectRowsManuallyResult(mdata);
 }
开发者ID:neuhauser,项目名称:perseus-plugins,代码行数:4,代码来源:SelectRowsManually.cs


示例11: GetMaxThreads

 public int GetMaxThreads(Parameters parameters)
 {
     return int.MaxValue;
 }
开发者ID:neuhauser,项目名称:perseus-plugins,代码行数:4,代码来源:Subtract.cs


示例12: GetReduceMatrix

 private static bool GetReduceMatrix(Parameters parameters)
 {
     return parameters.GetSingleChoiceParam("Filter mode").Value == 0;
 }
开发者ID:BAngermann,项目名称:perseus-plugins,代码行数:4,代码来源:PerseusPluginUtils.cs


示例13: ProcessData

 public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables, ProcessInfo processInfo)
 {
     double width = param.GetDoubleParam("Width").Value;
     double shift = param.GetDoubleParam("Down shift").Value;
     bool separateColumns = param.GetSingleChoiceParam("Mode").Value == 0;
     if (separateColumns){
         ReplaceMissingsByGaussianByColumn(width, shift, mdata);
     } else{
         ReplaceMissingsByGaussianWholeMatrix(width, shift, mdata);
     }
 }
开发者ID:BAngermann,项目名称:perseus-plugins,代码行数:11,代码来源:ReplaceMissingFromGaussian.cs


示例14: ProcessDataCreate

 private static void ProcessDataCreate(IMatrixData mdata, Parameters param)
 {
     string name = param.GetStringParam("Row name").Value;
     double[] groupCol = new double[mdata.ExpressionColumnCount];
     for (int i = 0; i < mdata.ExpressionColumnCount; i++){
         string ename = mdata.ExpressionColumnNames[i];
         double value = param.GetDoubleParam(ename).Value;
         groupCol[i] = value;
     }
     mdata.AddNumericRow(name, name, groupCol);
 }
开发者ID:neuhauser,项目名称:perseus-plugins,代码行数:11,代码来源:CreateNumericalAnnotRow.cs


示例15: ProcessData

 public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables, ProcessInfo processInfo)
 {
     int numQuantiles = param.GetIntParam("Number of quantiles").Value;
     int[] colInds = param.GetMultiChoiceParam("Columns").Value;
     foreach (int colInd in colInds){
         float[] vals = mdata.GetExpressionColumn(colInd);
         List<int> v = new List<int>();
         for (int i = 0; i < vals.Length; i++){
             if (!float.IsNaN(vals[i])){
                 v.Add(i);
             }
         }
         int[] o = v.ToArray();
         vals = ArrayUtils.SubArray(vals, o);
         int[] q = ArrayUtils.Order(vals);
         o = ArrayUtils.SubArray(o, q);
         string[][] catCol = new string[mdata.RowCount][];
         for (int i = 0; i < catCol.Length; i++){
             catCol[i] = new[]{"missing"};
         }
         for (int i = 0; i < o.Length; i++){
             int catVal = (i*numQuantiles)/o.Length + 1;
             catCol[o[i]] = new[]{"Q" + catVal};
         }
         string name = mdata.ExpressionColumnNames[colInd] + "_q";
         string desc = "The column " + mdata.ExpressionColumnNames[colInd] + " has been divided into " + numQuantiles +
             " quantiles.";
         mdata.AddCategoryColumn(name, desc, catCol);
     }
 }
开发者ID:BAngermann,项目名称:perseus-plugins,代码行数:30,代码来源:Quantiles.cs


示例16: GetEditParameters

 public Parameters GetEditParameters(IMatrixData mdata)
 {
     Parameters[] subParams = new Parameters[mdata.NumericRowCount];
     for (int i = 0; i < subParams.Length; i++){
         subParams[i] = GetEditParameters(mdata, i);
     }
     List<Parameter> par = new List<Parameter>{
         new SingleChoiceWithSubParams("Numerical row")
         {Values = mdata.NumericRowNames, SubParams = subParams, Help = "Select the numerical row that should be edited."}
     };
     return new Parameters(par);
 }
开发者ID:neuhauser,项目名称:perseus-plugins,代码行数:12,代码来源:CreateNumericalAnnotRow.cs


示例17: ProcessData

        public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables,
			ref IDocumentData[] documents, ProcessInfo processInfo)
        {
            SingleChoiceWithSubParams scwsp = param.GetSingleChoiceWithSubParams("Action");
            Parameters spar = scwsp.GetSubParameters();
            switch (scwsp.Value){
                case 0:
                    ProcessDataCreate(mdata, spar);
                    break;
                case 1:
                    ProcessDataEdit(mdata, spar);
                    break;
                case 2:
                    ProcessDataRename(mdata, spar);
                    break;
                case 3:
                    ProcessDataDelete(mdata, spar);
                    break;
            }
        }
开发者ID:neuhauser,项目名称:perseus-plugins,代码行数:20,代码来源:CreateNumericalAnnotRow.cs


示例18: ProcessData

 public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables, ProcessInfo processInfo)
 {
     int colIndex = param.GetSingleChoiceParam("Control column").Value;
     if (colIndex < mdata.ExpressionColumnCount){
         DivideByColumn(mdata, colIndex);
     } else{
         DivideByColumnNum(mdata, colIndex - mdata.ExpressionColumnCount);
     }
 }
开发者ID:BAngermann,项目名称:perseus-plugins,代码行数:9,代码来源:DivisionByColumn.cs


示例19: ProcessData

        public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables,
			ref IDocumentData[] documents, ProcessInfo processInfo)
        {
            int[] cols = param.GetMultiChoiceParam("Columns").Value;
            int truncIndex = param.GetSingleChoiceParam("Use for truncation").Value;
            TestTruncation truncation = truncIndex == 0
                ? TestTruncation.Pvalue : (truncIndex == 1 ? TestTruncation.BenjaminiHochberg : TestTruncation.PermutationBased);
            double threshold = param.GetDoubleParam("Threshold value").Value;
            int sideInd = param.GetSingleChoiceParam("Side").Value;
            TestSide side;
            switch (sideInd){
                case 0:
                    side = TestSide.Both;
                    break;
                case 1:
                    side = TestSide.Left;
                    break;
                case 2:
                    side = TestSide.Right;
                    break;
                default:
                    throw new Exception("Never get here.");
            }
            foreach (int col in cols){
                float[] r = mdata.GetExpressionColumn(col);
                double[] pvals = CalcSignificanceA(r, side);
                string[][] fdr;
                switch (truncation){
                    case TestTruncation.Pvalue:
                        fdr = PerseusPluginUtils.CalcPvalueSignificance(pvals, threshold);
                        break;
                    case TestTruncation.BenjaminiHochberg:
                        fdr = PerseusPluginUtils.CalcBenjaminiHochbergFdr(pvals, threshold);
                        break;
                    default:
                        throw new Exception("Never get here.");
                }
                mdata.AddNumericColumn(mdata.ExpressionColumnNames[col] + " Significance A", "", pvals);
                mdata.AddCategoryColumn(mdata.ExpressionColumnNames[col] + " A significant", "", fdr);
            }
        }
开发者ID:neuhauser,项目名称:perseus-plugins,代码行数:41,代码来源:SignificanceA.cs


示例20: ProcessData

        public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables,
			ref IDocumentData[] documents, ProcessInfo processInfo)
        {
            if (!mdata.HasQuality){
                processInfo.ErrString = "No quality data loaded.";
                return;
            }
            double threshold = param.GetDoubleParam("Threshold").Value;
            for (int i = 0; i < mdata.RowCount; i++){
                for (int j = 0; j < mdata.ExpressionColumnCount; j++){
                    float value = mdata.QualityValues[i, j];
                    if (mdata.QualityBiggerIsBetter){
                        if (value < threshold){
                            mdata[i, j] = float.NaN;
                        }
                    } else{
                        if (value > threshold){
                            mdata[i, j] = float.NaN;
                        }
                    }
                }
            }
        }
开发者ID:neuhauser,项目名称:perseus-plugins,代码行数:23,代码来源:FilterQuality.cs



注:本文中的BasicLib.Param.Parameters类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Runtime.Tree类代码示例发布时间:2022-05-24
下一篇:
C# Base.BasicMouseEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap