예제 #1
0
        static public QmrrPartialModel GetInstance(ModelLikelihoodFactories modelLikelihoodFactories,
                                                   string peptide,
                                                   Dictionary <string, double> patientToAnyReaction,
                                                   Set <Hla> knownHlaSet,
                                                   Dictionary <string, Set <Hla> > patientList,
                                                   OptimizationParameterList qmrrParamsStart
                                                   )
        {
            QmrrPartialModel aQmrrPartialModel = new QmrrPartialModel();

            aQmrrPartialModel.QmrrParamsStart      = qmrrParamsStart;
            aQmrrPartialModel.Peptide              = peptide;
            aQmrrPartialModel.PatientToAnyReaction = patientToAnyReaction;
            aQmrrPartialModel.PatientList          = patientList;
            aQmrrPartialModel.KnownHlaSet          = knownHlaSet;
            aQmrrPartialModel.CreateHlaList();
            aQmrrPartialModel.CreateSwitchableHlasWithRespondingPatients();
            aQmrrPartialModel.ModelLikelihoodFactories = modelLikelihoodFactories;
            if (modelLikelihoodFactories != null)
            {
                aQmrrPartialModel.LogLikelihoodOfCompleteModelConditionedOnKnownHlas = modelLikelihoodFactories.PartialModelDelegateFactory(aQmrrPartialModel);
            }
            else
            {
                aQmrrPartialModel.LogLikelihoodOfCompleteModelConditionedOnKnownHlas = null;
            }
            return(aQmrrPartialModel);
        }
        public static QmrrModelAllPeptides GetInstance(ModelLikelihoodFactories modelLikelihoodFactories, string datasetName, OptimizationParameterList qmrrParamsStart, double depth, string hlaFactoryName)
        {
            QmrrModelAllPeptides aQmrrModelAllPeptides = new QmrrModelAllPeptides();

            aQmrrModelAllPeptides.QmrrPartialModelCollection  = QmrrPartialModelCollection.GetInstance(modelLikelihoodFactories, datasetName, qmrrParamsStart, hlaFactoryName);
            aQmrrModelAllPeptides.BestParamsAndHlaAssignments = BestParamsAndHlaAssignments.GetInstance(modelLikelihoodFactories, qmrrParamsStart, aQmrrModelAllPeptides.QmrrPartialModelCollection, depth);
            aQmrrModelAllPeptides.ModelLikelihoodFactories    = modelLikelihoodFactories;
            return(aQmrrModelAllPeptides);
        }
        internal static QmrrlModelMissingParameters GetInstance(ModelLikelihoodFactories modelLikelihoodFactories, QmrrPartialModel qmrrPartialModel, BestSoFar <double, TrueCollection> bestSoFar)
        {
            QmrrlModelMissingParameters aQmrrlModelMissingParameters = new QmrrlModelMissingParameters();

            aQmrrlModelMissingParameters.QmrrPartialModel         = qmrrPartialModel;
            aQmrrlModelMissingParameters.TrueCollection           = bestSoFar.Champ;
            aQmrrlModelMissingParameters.ModelLikelihoodFactories = modelLikelihoodFactories;
            aQmrrlModelMissingParameters.LogLikelihoodOfCompleteModelConditionedOnKnownHlas = modelLikelihoodFactories.MissingParametersDelegateFactory(qmrrPartialModel, bestSoFar.Champ);
            return(aQmrrlModelMissingParameters);
        }
예제 #4
0
        //private BestParamsAndHlaAssignments(OptimizationParameterList qmrrParamsStart)
        //{
        //    QmrrParamsStart = qmrrParamsStart;
        //    CreateBestParamsSoFar();
        //    PeptideToBestHlaAssignmentSoFar = null;
        //}

        public static BestParamsAndHlaAssignments GetInstance(ModelLikelihoodFactories modelLikelihoodFactories, OptimizationParameterList qmrrParamsStart, QmrrPartialModelCollection qmrrPartialModelCollection, double depth)
        {
            BestParamsAndHlaAssignments aBestParamsAndHlaAssignments = new BestParamsAndHlaAssignments();

            aBestParamsAndHlaAssignments.QmrrParamsStart = qmrrParamsStart;
            aBestParamsAndHlaAssignments.CreateBestParamsSoFar();
            aBestParamsAndHlaAssignments.ModelLikelihoodFactories = modelLikelihoodFactories;
            aBestParamsAndHlaAssignments.SearchForBestParamsAndHlaAssignments(qmrrPartialModelCollection, depth);
            return(aBestParamsAndHlaAssignments);
        }
        public static QmrrlModelMissingParametersCollection GetInstance(ModelLikelihoodFactories modelLikelihoodFactories, QmrrPartialModelCollection qmrrPartialModelCollection, Dictionary <string, BestSoFar <double, TrueCollection> > PeptideToBestHlaAssignmentSoFar)
        {
            QmrrlModelMissingParametersCollection aQmrrlModelMissingParametersCollection = new QmrrlModelMissingParametersCollection();

            foreach (QmrrPartialModel qmrrPartialModel in qmrrPartialModelCollection)
            {
                QmrrlModelMissingParameters aQmrrlModelMissingParameters = QmrrlModelMissingParameters.GetInstance(modelLikelihoodFactories, qmrrPartialModel, PeptideToBestHlaAssignmentSoFar[qmrrPartialModel.Peptide]);
                aQmrrlModelMissingParametersCollection.Collection.Add(aQmrrlModelMissingParameters);
            }
            aQmrrlModelMissingParametersCollection.GridSearch = GridSearch.GetInstance("Grid");
            return(aQmrrlModelMissingParametersCollection);
        }
예제 #6
0
        static public QmrrPartialModelCollection GetInstance(ModelLikelihoodFactories modelLikelihoodFactories, string datasetName, OptimizationParameterList qmrrParams, string hlaFactoryName)
        {
            QmrrPartialModelCollection aQmrrPartialModelCollection = new QmrrPartialModelCollection();

            aQmrrPartialModelCollection.HlaFactory = Qmrr.HlaFactory.GetFactory(hlaFactoryName);

            aQmrrPartialModelCollection.OptimizationParameterList = qmrrParams;
            aQmrrPartialModelCollection.SetFileNames(datasetName);
            aQmrrPartialModelCollection.ReadTables();
            aQmrrPartialModelCollection.ModelLikelihoodFactories = modelLikelihoodFactories;
            aQmrrPartialModelCollection.CreateList();
            return(aQmrrPartialModelCollection);
        }
        public static QmrrModelMissingAssignment GetInstance(ModelLikelihoodFactories modelLikelihoodFactories, QmrrPartialModel qmrrPartialModel, OptimizationParameterList qmrrParams)
        {
            QmrrModelMissingAssignment aQmrrModelMissingAssignment = new QmrrModelMissingAssignment();

            aQmrrModelMissingAssignment.QmrrPartialModel          = qmrrPartialModel;
            aQmrrModelMissingAssignment.OptimizationParameterList = qmrrParams;
            aQmrrModelMissingAssignment.KnownHlaSet = qmrrPartialModel.KnownHlaSet;
            aQmrrModelMissingAssignment.SwitchableHlasOfRespondingPatients = qmrrPartialModel.SwitchableHlasOfRespondingPatients;
            aQmrrModelMissingAssignment.ModelLikelihoodFactories           = modelLikelihoodFactories;
            aQmrrModelMissingAssignment.LogLikelihoodOfCompleteModelConditionedOnKnownHlas = modelLikelihoodFactories.MissingAssignmentDelegateFactory(qmrrPartialModel, qmrrParams);
            return(aQmrrModelMissingAssignment);
            //SetOfAllHlasCount = qmrrPartialModel.HlaList.Count;
        }
예제 #8
0
        public static QmrrPartialModelCollection GetInstance(string peptide,
                                                             ModelLikelihoodFactories modelLikelihoodFactories,
                                                             OptimizationParameterList qmrrParamsStart,
                                                             Dictionary <string, Set <Hla> > patientList,
                                                             Dictionary <string, Dictionary <string, double> > reactTable,
                                                             Dictionary <string, Set <Hla> > knownTable,
                                                             string hlaFactoryName
                                                             )
        {
            QmrrPartialModelCollection aQmrrPartialModelCollection = new QmrrPartialModelCollection();

            aQmrrPartialModelCollection.HlaFactory = Qmrr.HlaFactory.GetFactory(hlaFactoryName);
            aQmrrPartialModelCollection.OptimizationParameterList = qmrrParamsStart;
            aQmrrPartialModelCollection.SetFileNamesToNull();
            aQmrrPartialModelCollection.PeptideList = new List <string>(new string[] { peptide });
            aQmrrPartialModelCollection.PatientList = patientList;
            aQmrrPartialModelCollection.ReactTable  = reactTable;
            aQmrrPartialModelCollection._knownTable = knownTable;
            aQmrrPartialModelCollection.ModelLikelihoodFactories = modelLikelihoodFactories;
            aQmrrPartialModelCollection.CreateList();
            return(aQmrrPartialModelCollection);
        }