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
        private Dictionary <string, Dictionary <Residue, bool> > doPrediction(PDBFile file, IDictionary <string, ProteinGraph> graphs)
        {
            var dict    = new Dictionary <string, Dictionary <Residue, bool> >();
            var Feature = new AverageHydrophobicityFeature();
            var req     = new RequestRasa(file);

            req.RequestInDefaultContext();
            var rasa = req.Rasavalues;

            foreach (var graph in graphs)
            {
                Feature.Compute(graph.Value);

                var predDict = new Dictionary <Residue, bool>();
                dict.Add(graph.Key, predDict);

                foreach (var node in graph.Value.Nodes)
                {
                    predDict.Add(node.Data.Residue, (Feature.ValueOf(node.Data.Residue) * rasa[node.Data.Residue]) / Max >= Threshold);
                }
            }
            return(dict);
        }