Exemple #1
0
        private void doTraining(CreatePredictorVM vm, IEnumerable <PDBFile> trainingFiles, IDictionary <string, IDictionary <Residue, bool> > referenceInterface, IDictionary <string, IDictionary <string, ProteinGraph> > graphs)
        {
            var Feature = new AverageHydrophobicityFeature();

            var values = new LinkedList <AgO <double, ResidueNode> >();

            foreach (var trainingFile in trainingFiles)
            {
                var req = new RequestRasa(trainingFile);
                req.RequestInDefaultContext();
                var rasa = req.Rasavalues;
                foreach (var entry in graphs[trainingFile.Name])
                {
                    Feature.Compute(entry.Value);
                    //values.AddRange(entry.Value.Nodes.Select(node => new AgO<double, ResidueNode>(Feature.ValueOf(node.Data.Residue) * rasa[node.Data.Residue], node.D
//)));
                }
            }

            Max = values.Max(v => v.Data1);

            //var intervals = values.DivideByScoreAequidistant(val => val.Data1, vm.DivisionIntervals);
            //var pts = new LinkedList<AgO<double, double>>();
            //for (int i = 0; i < intervals.Length; i++)
            //{
            //    var interval = intervals[i];
            //    var pt = new AgO<double, double>();
            //    pt.Data1 = ((double)i + 1) / intervals.Length;
            //    var iface = (interval.Sum(val => referenceInterface[val.Data2.Residue.PDB.Name][val.Data2.Residue] ? 1.0 : 0.0));
            //    pt.Data2 = iface / interval.Count();
            //    pts.Add(pt);
            //}
            //ValueFunction = new StepFunction(pts);
        }
Exemple #2
0
        private void doTraining(CreatePredictorVM vm, IEnumerable <PDBFile> trainingFiles, IDictionary <string, IDictionary <Residue, bool> > referenceInterface, IDictionary <string, IDictionary <string, ProteinGraph> > graphs)
        {
            var Feature = new AverageHydrophobicityFeature();

            var values = new LinkedList <AgO <double, ResidueNode> >();

            foreach (var trainingFile in trainingFiles)
            {
                var req = new RequestRasa(trainingFile);
                req.RequestInDefaultContext();
                var rasa = req.Rasavalues;
                foreach (var entry in graphs[trainingFile.Name])
                {
                    Feature.Compute(entry.Value);
                    //values.AddRange(entry.Value.Nodes.Select(node => new AgO<double, ResidueNode>(Feature.ValueOf(node.Data.Residue) * rasa[node.Data.Residue], node)));
                }
            }

            Max = values.Max(v => v.Data1);
        }
Exemple #3
0
 public RasaAverageHydrophobicityPredictor(CreatePredictorVM vm)
 {
     Threshold = vm.Threshold;
     logic     = new PredictionLogic(doPrediction, doTraining);
     this.Name(vm.Name);
 }
Exemple #4
0
 public static void Train(this IHas <IPredictionLogic> logicHolder, CreatePredictorVM vm, IEnumerable <PDBFile> trainingFiles, IDictionary <string, IDictionary <Residue, bool> > referenceInterface, IDictionary <string, IDictionary <string, ProteinGraph> > graphs)
 {
     logicHolder.Logic.Train(vm, trainingFiles, referenceInterface, graphs);
 }
Exemple #5
0
 public void Train(CreatePredictorVM vm, IEnumerable <PDBFile> trainingFiles, IDictionary <string, IDictionary <Residue, bool> > referenceInterface, IDictionary <string, IDictionary <string, ProteinGraph> > graphs)
 {
     TrainingAction(vm, trainingFiles, referenceInterface, graphs);
     TrainingPDBs.AddRange(trainingFiles.Select(file => file.Name));
 }
Exemple #6
0
 public CreatePredictor(CreatePredictorVM vm)
 {
     ViewModel = vm;
 }