예제 #1
0
        protected OptimizationParameterList FindBestParams(string peptide,
                                                           Set <Hla> candidateHlaSet,
                                                           Set <Hla> hlaWithLinkZero,
                                                           Dictionary <string, Set <Hla> > patientList,
                                                           //Dictionary<string, Dictionary<string,double>> reactTable,
                                                           out double score)
        {
            //SpecialFunctions.CheckCondition(false, "Regression test this to be sure that switch to new optimization method didn't change anything important - cmk 5/1/2006");
            Set <Hla> knownHlaSet = KnownTable(peptide);

            TrueCollection trueCollection = TrueCollection.GetInstance(candidateHlaSet, knownHlaSet);

            OptimizationParameterList qmrrParamsThisPeptide = CreateQmrrParamsStartForTheseCandidateHlas(trueCollection.CreateHlaAssignmentAsSet(), hlaWithLinkZero);
            //OptimizationParameterList qmrrParamsThisPeptide = CreateQmrrParamsX(causePrior, leakProbability, trueCollection.CreateHlaAssignmentAsSet());


            ModelLikelihoodFactories   modelLikelihoodFactories            = ModelLikelihoodFactories.GetInstanceLinkPerHla(qmrrParamsThisPeptide, trueCollection.CreateHlaAssignmentAsSet());
            QmrrPartialModelCollection singletonQmrrPartialModelCollection =
                QmrrPartialModelCollection.GetInstance(
                    peptide,
                    modelLikelihoodFactories,
                    qmrrParamsThisPeptide,
                    patientList,
                    ReactTableUnfiltered,
                    _knownTable,
                    HlaFactory.Name         //!!!would it be better to pass the actual factory???
                    );
            BestSoFar <double, TrueCollection> bestSoFar = BestSoFar <double, TrueCollection> .GetInstance(SpecialFunctions.DoubleGreaterThan);

            bestSoFar.Compare(double.NegativeInfinity, trueCollection);
            Dictionary <string, BestSoFar <double, TrueCollection> > peptideToBestHlaAssignmentSoFar = new Dictionary <string, BestSoFar <double, TrueCollection> >();

            peptideToBestHlaAssignmentSoFar.Add(peptide, bestSoFar);

            QmrrlModelMissingParametersCollection aQmrrlModelMissingParametersCollection
                = QmrrlModelMissingParametersCollection.GetInstance(modelLikelihoodFactories, singletonQmrrPartialModelCollection, peptideToBestHlaAssignmentSoFar);


            OptimizationParameterList qmrrParamsEnd = aQmrrlModelMissingParametersCollection.FindBestParams(qmrrParamsThisPeptide, out score);

            return(qmrrParamsEnd);
        }
 public override bool Remove(T item)
 {
     return(TrueCollection.Remove(item));
 }
 public override void Clear()
 {
     TrueCollection.Clear();
 }
 public override void Add(T item)
 {
     TrueCollection.Add(item);
 }