public void TestChaoChao(string specFilePath) { var methodName = MethodBase.GetCurrentMethod().Name; TestUtils.ShowStarting(methodName); if (!File.Exists(specFilePath)) { Assert.Ignore(@"Skipping test {0} since file not found: {1}", methodName, specFilePath); } const string dbFilePath = @"D:\Research\Data\ChaoChao\database\H_sapiens_Uniprot_SPROT_2013-05-01_withContam.fasta"; if (!File.Exists(dbFilePath)) { Assert.Ignore(@"Skipping test {0} since file not found: {1}", methodName, dbFilePath); } const string outputDir = @"D:\Research\Data\ChaoChao\Ic\"; // Configure amino acid set //var carbamidomethylC = new SearchModification(Modification.Carbamidomethylation, 'C', SequenceLocation.Everywhere, true); //var oxM = new SearchModification(Modification.Oxidation, 'M', SequenceLocation.Everywhere, false); //var acetylN = new SearchModification(Modification.Acetylation, '*', SequenceLocation.ProteinNTerm, false); //var pyroGluQ = new SearchModification(Modification.PyroGluQ, 'Q', SequenceLocation.Everywhere, false); //var deamdN = new SearchModification(Modification.Deamidation, 'N', SequenceLocation.Everywhere, false); //var deamdQ = new SearchModification(Modification.Deamidation, 'Q', SequenceLocation.Everywhere, false); const int numMaxModsPerProtein = 0; var searchModifications = new List<SearchModification> { //carbamidomethylC, //acetylN, //oxM }; var aaSet = new AminoAcidSet(searchModifications, numMaxModsPerProtein); bool? tda = true; // true: target & decoy, false: target, null: decoy const int minSequenceLength = 7; // 7 const int maxSequenceLength = 150; // 1000 const int minPrecursorIonCharge = 1; // 3 const int maxPrecursorIonCharge = 30; // 67 const int minProductIonCharge = 1; // 1 const int maxProductIonCharge = 15; // 15 const double precursorIonTolerancePpm = 10; const double productIonTolerancePpm = 10; const double corrThreshold = 0.7; var bottomUpLauncher = new IcBottomUpLauncher( specFilePath, dbFilePath, outputDir, aaSet, null) { MinSequenceLength = minSequenceLength, MaxSequenceLength = maxSequenceLength, MinPrecursorIonCharge = minPrecursorIonCharge, MaxPrecursorIonCharge = maxPrecursorIonCharge, MinProductIonCharge = minProductIonCharge, MaxProductIonCharge = maxProductIonCharge, PrecursorIonTolerancePpm = precursorIonTolerancePpm, ProductIonTolerancePpm = productIonTolerancePpm, RunTargetDecoyAnalysisBool = tda, NumTolerableTermini = 0 }; bottomUpLauncher.RunSearch(corrThreshold); }
private static void Main(string[] args) { var handle = Process.GetCurrentProcess().MainWindowHandle; SetConsoleMode(handle, EnableExtendedFlags); if (args.Length % 2 != 0) { PrintUsageInfo("The number of arguments must be even."); return; } // initialize parameters var paramDic = new Dictionary<string, string> { {"-s", null}, {"-d", null}, {"-o", null}, {"-e", "1"}, {"-ntt", "2"}, {"-mod", null}, {"-t", "10"}, {"-f", "10"}, {"-tda", "0"}, {"-minLength", "6"}, {"-maxLength", "40"}, {"-minCharge", "1"}, {"-maxCharge", "4"}, {"-minFragCharge", "1"}, {"-maxFragCharge", "3"} }; for (var i = 0; i < args.Length / 2; i++) { var key = args[2 * i]; var value = args[2 * i + 1]; if (!paramDic.ContainsKey(key)) { PrintUsageInfo("Invalid parameter: " + key); return; } paramDic[key] = value; } var parameters = new BottomUpInputParameters(); var message = parameters.Parse(paramDic); if (message != null) { PrintUsageInfo(message); return; } Console.WriteLine(Name + " " + Version); parameters.Display(); parameters.Write(); foreach (string specFilePath in parameters.SpecFilePaths) { var bottomUpLauncher = new IcBottomUpLauncher( specFilePath, parameters.DatabaseFilePath, parameters.OutputDir, parameters.AminoAcidSet, parameters.Enzyme) { MinSequenceLength = parameters.MinSequenceLength, MaxSequenceLength = parameters.MaxSequenceLength, MinPrecursorIonCharge = parameters.MinPrecursorIonCharge, MaxPrecursorIonCharge = parameters.MaxPrecursorIonCharge, MinProductIonCharge = parameters.MinProductIonCharge, MaxProductIonCharge = parameters.MaxProductIonCharge, PrecursorIonTolerancePpm = parameters.PrecursorIonTolerancePpm, ProductIonTolerancePpm = parameters.ProductIonTolerancePpm, //RunTargetDecoyAnalysisBool = parameters.TdaBool, RunTargetDecoyAnalysis = parameters.Tda, NumTolerableTermini = parameters.NumTolerableTermini, }; bottomUpLauncher.RunSearch(CorrThreshold); } }
public void TestBottomUpSearch(string specFilePath, string dbFilePath, string outputDir, AminoAcidSet aaSet, bool? tda, int ntt, double corrThreshold = 0.3) { var methodName = MethodBase.GetCurrentMethod().Name; TestUtils.ShowStarting(methodName); // Search parameters const int minSequenceLength = 6; // 7 const int maxSequenceLength = 40; // 1000 const int minPrecursorIonCharge = 1; // 3 const int maxPrecursorIonCharge = 4; // 67 const int minProductIonCharge = 1; // 1 const int maxProductIonCharge = 2; // 15 const int precursorIonTolerancePpm = 10; const int productIonTolerancePpm = 10; var enzyme = Enzyme.Trypsin; var bottomUpLauncher = new IcBottomUpLauncher( specFilePath, dbFilePath, outputDir, aaSet, enzyme) { MinSequenceLength = minSequenceLength, MaxSequenceLength = maxSequenceLength, MinPrecursorIonCharge = minPrecursorIonCharge, MaxPrecursorIonCharge = maxPrecursorIonCharge, MinProductIonCharge = minProductIonCharge, MaxProductIonCharge = maxProductIonCharge, PrecursorIonTolerancePpm = precursorIonTolerancePpm, ProductIonTolerancePpm = productIonTolerancePpm, RunTargetDecoyAnalysisBool = tda, NumTolerableTermini = ntt }; bottomUpLauncher.RunSearch(corrThreshold); //topDownLauncher.RunIntactProteinSearch(); }