protected override Parameters AddParameters(INetworkData ndata)
        {
            Boolean undirected = CheckDataUndirected(ndata);
            Boolean connected  = CheckDataConnected(ndata);
            var     valuesList = new List <String>()
            {
                "Network \t Density", "Network \t Average node connectivity", "Network \t Node connectivity", "Network \t Edge connectivity", "Network \t Diameter", "Network \t Radius", "Node \t Degree", "Node \t Out-degree", "Node \t Degree centrality", "Node \t In-degree centrality", "Node \t Out-degree centrality", "Node \t Closeness centrality", "Node \t Betweenness centrality", "Node \t Average neighbor degree", "Node \t Clustering coefficient", "Edge \t Betweenness centrality"
            };

            string[]   values        = UpdateParameterPropertyValues(valuesList, undirected, connected);
            string[]   directedOrNot = { undirected ? "Undirected" : "Directed" };
            Parameters parameters    = new Parameters();

            parameters.AddParameterGroup(new Parameter[] { new MultiChoiceParam("Properties", new int[0] {
                })
                                                           {
                                                               Values = values,
                                                               Help   = "Please select here the properties that should be calculated."
                                                           } }, "", false);
            parameters.AddParameterGroup(new Parameter[] { new SingleChoiceParam("Graph type")
                                                           {
                                                               Values  = directedOrNot,
                                                               Visible = false,
                                                           } }, "", false);
            return(parameters);
        }
        /// <summary>
        /// Create the parameters for the GUI with default of 'Code file' and 'Executable'. Includes buttons
        /// for preview downloads of 'Parameters' for development purposes.
        /// Overwrite this function to provide custom parameters.
        /// </summary>
        public virtual Parameters GetParameters(ref string errString)
        {
            Parameters parameters = new Parameters();

            parameters.AddParameterGroup(SpecificParameters(ref errString), "Specific", false);
            var parametersPreviewButton = Utils.ParametersPreviewButton(parameters);

            parameters.AddParameterGroup(new Parameter[] { ExecutableParam(), parametersPreviewButton }, "Generic", false);
            return(parameters);
        }
Exemple #3
0
        /// <summary>
        /// Create the parameters for the GUI with default of specific 'Code file' parameter and generic 'Executable'.
        /// Includes buttons /// for preview downloads of 'Data' and 'Parameters' for development purposes.
        /// Overwrite <see cref="SpecificParameters"/> to add specific parameter. Overwrite this function for full control.
        /// </summary>
        /// <param name="mdata"></param>
        /// <param name="errString"></param>
        /// <returns></returns>
        public virtual Parameters GetParameters(IMatrixData mdata, ref string errString)
        {
            Parameters parameters = new Parameters();

            parameters.AddParameterGroup(SpecificParameters(mdata, ref errString), "specific", false);
            var previewButton           = Utils.DataPreviewButton(mdata);
            var parametersPreviewButton = Utils.ParametersPreviewButton(parameters);

            parameters.AddParameterGroup(new Parameter[] { ExecutableParam(), previewButton, parametersPreviewButton }, "generic", false);
            return(parameters);
        }
Exemple #4
0
        public void TestGroupedParameters()
        {
            Parameters parameters = new Parameters();

            parameters.AddParameterGroup(new Parameter[] { new StringParam("myname", "myvalue") }, "grp1", false);
            parameters.AddParameterGroup(new Parameter[] { new IntParam("some int", 42) }, "grp2", true);
            Parameters parameters2 = parameters.ToXmlAndBack();

            Assert.AreEqual("myvalue", parameters2.GetSubGroupAt(0).GetParam <string>("myname").Value);
            Assert.AreEqual(42, parameters.GetSubGroupAt(1).GetParam <int>("some int").Value);
            Assert.AreEqual("myvalue", parameters2.GetParam <string>("myname").Value);
        }
        public Parameters GetParameters(INetworkData ndata, ref string errString)
        {
            Parameters parameters = AddParameters(ndata);

            parameters.AddParameterGroup(new Parameter[] { new FileParam(CodeLabel)
                                                           {
                                                               Filter = CodeFilter
                                                           } }, "specific", false);
            parameters.AddParameterGroup(new Parameter[] { new FileParam(InterpreterLabel)
                                                           {
                                                               Filter = InterpreterFilter
                                                           } }, "generic", false);
            return(parameters);
        }
Exemple #6
0
        public virtual Parameters GetParameters(IMatrixData mdata, ref string errString)
        {
            Parameters parameters = new Parameters
                                    (
                PECAParameters.GetWorkingDir()
                                    );

            parameters.AddParameterGroup(PECAParameters.GetAboutData(), "About Data", false);

            parameters.AddParameterGroup(PECAParameters.SelectData(mdata), "Select Data", true);

            parameters.AddParameterGroup(PECAParameters.GetMCMCParams(), "MCMC Parameters", false);


            return(parameters);
        }
        /// <summary>
        /// Create the parameters for the GUI with default of generic 'Executable', 'Code file' and 'Additional arguments' parameters.
        /// Includes buttons for preview downloads of 'Data' and 'Parameters' for development purposes.
        /// Overwrite <see cref="SpecificParameters"/> to add specific parameter. Overwrite this function for full control.
        /// </summary>
        public virtual Parameters GetParameters(IMatrixData data, ref string errString)
        {
            Parameters parameters         = new Parameters();
            var        specificParameters = SpecificParameters(data, ref errString);

            if (!string.IsNullOrEmpty(errString))
            {
                return(null);
            }
            parameters.AddParameterGroup(specificParameters, "Specific", false);
            var previewButton           = Utils.DataPreviewButton(data);
            var parametersPreviewButton = Utils.ParametersPreviewButton(parameters);

            parameters.AddParameterGroup(new Parameter[] { ExecutableParam(), previewButton, parametersPreviewButton }, "Generic", false);
            return(parameters);
        }
Exemple #8
0
        //public string HelpOutput { get; }

        //public string[] HelpSupplTables { get; }

        //public int NumSupplTables { get; }

        //public string[] HelpDocuments { get; }

        //public int NumDocuments { get; }

        public override Parameters GetParameters(IMatrixData mdata, ref string errString)
        {
            Parameters parameters = new Parameters
                                    (
                PECAParameters.GetWorkingDir()
                                    );

            parameters.AddParameterGroup(PECAParameters.GetAboutData(), "About Data", false);

            parameters.AddParameterGroup(PECAParameters.GetFeatures(), "Features", false);

            parameters.AddParameterGroup(PECAParameters.GetModule(), PECAParameters.network + " Info", false);

            parameters.AddParameterGroup(PECAParameters.SelectConditionalData(mdata), "Select Data", true);

            parameters.AddParameterGroup(PECAParameters.GetMCMCParams(), "MCMC Parameters", false);


            return(parameters);
        }
        //public string HelpOutput { get; }

        //public string[] HelpSupplTables { get; }

        //public int NumSupplTables { get; }

        //public string[] HelpDocuments { get; }

        //public int NumDocuments { get; }

        public override Parameters GetParameters(IMatrixData mdata, ref string errString)
        {
            string[] expSeriesNames = new string[] { PECAParameters.pecaRSeries1, PECAParameters.pecaRSeries2 };
            string[] expSeriesHelp  = new string[] { "mRNA Data", "'artificial' protein expressions" };

            Parameters parameters = new Parameters
                                    (
                PECAParameters.GetWorkingDir()
                                    );

            parameters.AddParameterGroup(PECAParameters.GetAboutDataWithTP(), "About Data", false);

            parameters.AddParameterGroup(PECAParameters.GetFeatures(), "Features", false);

            parameters.AddParameterGroup(PECAParameters.GetConditionalModule(), "Gene Set Analysis", false);

            parameters.AddParameterGroup(PECAParameters.SelectMultipleData(mdata, expSeriesNames, expSeriesHelp), "Select Data", true);

            parameters.AddParameterGroup(PECAParameters.GetMCMCParams(), "MCMC Parameters", false);

            return(parameters);
        }
Exemple #10
0
        //public string HelpOutput { get; }

        //public string[] HelpSupplTables { get; }

        //public int NumSupplTables { get; }

        //public string[] HelpDocuments { get; }

        //public int NumDocuments { get; }

        public override Parameters GetParameters(IMatrixData mdata, ref string errString)
        {
            string[] expSeriesNames = new string[] { PECAParameters.pecaPSSeries1, PECAParameters.pecaPSSeries2, PECAParameters.pecaPSSeries3 };
            string[] expSeriesHelp  = new string[] { "mRNA Data", "the channel representing degradation of pre-existing proteins", "the channel representing synthesis of new proteins" };


            Parameters parameters = new Parameters
                                    (
                PECAParameters.GetWorkingDir()
                                    );

            parameters.AddParameterGroup(PECAParameters.GetAboutDataWithTP(), "About Data", false);

            parameters.AddParameterGroup(PECAParameters.GetFeatures(), "Features", false);

            parameters.AddParameterGroup(PECAParameters.GetConditionalModule(), "Gene Set Analysis", false);

            parameters.AddParameterGroup(PECAParameters.SelectMultipleData(mdata, expSeriesNames, expSeriesHelp), "Select Data", true);

            parameters.AddParameterGroup(PECAParameters.GetMCMCParams(), "MCMC Parameters", false);

            return(parameters);
        }
 public void TestGroupedParameters()
 {
     var parameters = new Parameters();
     parameters.AddParameterGroup(new Parameter[] {new StringParam("myname", "myvalue")}, "grp1", false);
     parameters.AddParameterGroup(new Parameter[] {new IntParam("some int", 42)}, "grp2", true);
     var parameters2 = parameters.ToXmlAndBack();
     Assert.AreEqual("myvalue", parameters2.GetSubGroupAt(0).GetParam<string>("myname").Value);
     Assert.AreEqual(42, parameters.GetSubGroupAt(1).GetParam<int>("some int").Value);
     Assert.AreEqual("myvalue", parameters2.GetParam<string>("myname").Value);
 }