public static KeepTest <Dictionary <string, string> > GetInstance(string geneRanges)
        {
            List <KeepTest <Dictionary <string, string> > > geneList = new List <KeepTest <Dictionary <string, string> > >();

            string[] genes = geneRanges.Split(',');
            foreach (string gene in genes)
            {
                geneList.Add(KeepGene.GetInstance(gene));
            }

            return(Or <Dictionary <string, string> > .GetInstance(geneList));
        }
        public static KeepGene GetInstance(string geneRange)
        {
            KeepGene keepGene = new KeepGene();

            string[] fields = geneRange.Split('-');
            try
            {
                keepGene._start = int.Parse(fields[0]);
                keepGene._stop  = int.Parse(fields[1]);
            }
            catch
            {
                throw new FormatException(string.Format("Could not parse range {0}.", geneRange));
            }
            return(keepGene);
        }
 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));
     }
 }