Пример #1
0
        public static IReadOnlyList <ChemicalWithData> GetSet(Dictionary <string, string> Modelinfo, TbScale ScaleDeclaration, String Set)
        {
            List <ChemicalWithData> SetList = new List <ChemicalWithData>();

            var setup = new BridgeSetup(false);

            //setup.AddAllJarsClassPath(@"B:\ToolboxAddinExamples\lib");

            setup.AddAllJarsClassPath(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location));
            Bridge.CreateJVM(setup);
            Bridge.RegisterAssembly(typeof(ChemicalinSet).Assembly);
            java.util.List list = ChemicalinSet.getDataset(Modelinfo["tag"], Set);

            if (list.size() == 0)
            {
                return(SetList);
            }

            for (int i = 0; i < list.size(); i++)
            {
                TbData        Mockdescriptordata = new TbData(new TbUnit(TbScale.EmptyRatioScale.FamilyGroup, TbScale.EmptyRatioScale.BaseUnit), new double?());
                ChemicalinSet cur_Chemical       = (ChemicalinSet)list.get(i);
                TbData        cur_exp            = (TbData)Utilities.ConvertData(cur_Chemical.getExperimental(), ScaleDeclaration, Modelinfo);
                SetList.Add(new ChemicalWithData(cur_Chemical.getCAS(), new[] { "N.A." }, cur_Chemical.getSmiles(),
                                                 new TbDescribedData[] { new TbDescribedData(Mockdescriptordata, null) },
                                                 new TbDescribedData(cur_exp, null)));
            }
            return(SetList);
        }
Пример #2
0
        //works only with a training set
        public static TbQsarStatistics M4RatioModelStatistics(String tag)
        {
            //Not Working
            var setup = new BridgeSetup(false);

            //setup.AddAllJarsClassPath(@"B:\ToolboxAddinExamples\lib");
            setup.AddAllJarsClassPath(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location));
            Bridge.CreateJVM(setup);
            Bridge.RegisterAssembly(typeof(ChemicalinSet).Assembly);
            int nMolTrain = ChemicalinSet.getnMolTrain(tag);
            int nMolTest  = ChemicalinSet.getnMolTest(tag);

            return(new TbQsarStatistics(nMolTrain, nMolTrain, nMolTest, nMolTest));
        }