public static KeepPredictorTargetPairs GetInstance(string predSparseCommaTargSparseOrEmpty) { KeepPredictorTargetPairs keepTest = new KeepPredictorTargetPairs(); if (predSparseCommaTargSparseOrEmpty == "") { keepTest._predictorToTarget = null; } else { string[] predSparseAndTargSparse = predSparseCommaTargSparseOrEmpty.Split(','); Dictionary <string, Dictionary <string, SufficientStatistics> > predSparseAsDict = ModelTester.LoadSparseFileInMemory(predSparseAndTargSparse[0]); Dictionary <string, Dictionary <string, SufficientStatistics> > targSparseAsDict = ModelTester.LoadSparseFileInMemory(predSparseAndTargSparse[1]); Dictionary <string, string> predictorToTarget = new Dictionary <string, string>(); foreach (KeyValuePair <string, string> predAndTarget in SpecialFunctions.EnumerateTwo(predSparseAsDict.Keys, targSparseAsDict.Keys)) { predictorToTarget.Add(predAndTarget.Key, predAndTarget.Value); } keepTest._predictorToTarget = predictorToTarget; } return(keepTest); }
new public static KeepTest <Dictionary <string, string> > GetInstance(string inputDirectory, string binarySeqFileName, string hlaFileName, string keepTestName, int merSize, Dictionary <int, string> pidToCaseName) { //!!!would be nice of classes could parse themselves if (keepTestName.StartsWith(KeepEndOfGag.Prefix)) { bool keepIt = bool.Parse(keepTestName.Substring(KeepEndOfGag.Prefix.Length)); return(KeepEndOfGag.GetInstance(keepIt)); } else if (keepTestName.StartsWith(K1.Prefix)) { int k1 = int.Parse(keepTestName.Substring(K1.Prefix.Length)); return(K1.GetInstance(k1)); } //else if (keepTestName.StartsWith(K2.Prefix)) //{ // int k2 = int.Parse(keepTestName.Substring(K2.Prefix.Length)); // return K2.GetInstance(k2); //} else if (keepTestName.StartsWith(KeepNonOverlappingAA.Prefix)) { return(KeepNonOverlappingAA.GetInstance()); } else if (keepTestName.StartsWith(KeepGene.Prefix)) { string geneRange = keepTestName.Substring(KeepGene.Prefix.Length); return(KeepGene.GetInstance(geneRange)); } else if (keepTestName.StartsWith(KeepSpecificRows.Prefix)) { return(KeepSpecificRows.GetInstance(keepTestName.Substring(KeepSpecificRows.Prefix.Length))); } else if (keepTestName.StartsWith(KeepSpecificRow.Prefix)) { return(KeepSpecificRow.GetInstance(keepTestName.Substring(KeepSpecificRow.Prefix.Length))); } else if (keepTestName.StartsWith(KeepSpecificGenes.Prefix)) { return(KeepSpecificGenes.GetInstance(keepTestName.Substring(KeepSpecificGenes.Prefix.Length))); } else if (keepTestName.StartsWith(KeepOneOfAAPair.Prefix)) { return(KeepOneOfAAPair.GetInstance()); } else if (keepTestName.StartsWith(KeepAllButSamePosition.Prefix)) { return(KeepAllButSamePosition.GetInstance()); } else if (keepTestName.StartsWith(KeepAllButSameDeletion.Prefix)) { return(KeepAllButSameDeletion.GetInstance()); } else if (keepTestName.StartsWith(KeepNonTrivialRows.Prefix)) { return(new KeepNonTrivialRows()); } else if (keepTestName.StartsWith(KeepTestTemp.Prefix)) { return(KeepTestTemp.GetInstance()); } //else if (keepTestName.StartsWith(KeepPollockOneDirection.Prefix)) //{ // return KeepPollockOneDirection.GetInstance(keepTestName.Substring(KeepPollockOneDirection.Prefix.Length)); //} //else if (keepTestName.StartsWith(KeepFisherOneDirection.Prefix)) //{ // return KeepFisherOneDirection.GetInstance(keepTestName.Substring(KeepFisherOneDirection.Prefix.Length)); //} else if (keepTestName.StartsWith(KeepNonRare.Prefix)) { return(KeepNonRare.GetInstance(keepTestName.Substring(KeepNonRare.Prefix.Length))); } else if (keepTestName.StartsWith(KeepPredictorTargetPairs.Prefix)) { return(KeepPredictorTargetPairs.GetInstance(keepTestName.Substring(KeepPredictorTargetPairs.Prefix.Length))); } else if (keepTestName.StartsWith("JointGagPolTest")) { return(And <Dictionary <string, string> > .GetInstance( //KeepRandom<Dictionary<string,string>>.GetInstance(0, 0.001), // how do we make it the same when we count and when we really run through it? KeepOneOfAAPair.GetInstance(), KeepNonOverlappingAA.GetInstance(), KeepSpecificGenes.GetInstance(keepTestName.Substring("JointGagPolTest".Length)))); } else { return(KeepTest <TRow> .GetInstance(inputDirectory, binarySeqFileName, null, keepTestName, merSize, pidToCaseName)); } }