private void button1_Click(object sender, EventArgs e) { if (!File.Exists(textBoxInputDB.Text)) { MessageBox.Show("Database not found"); return; } if (textBoxRegex.Text.Length == 0) { MessageBox.Show("Please enter a tag"); return; } Console.WriteLine("Parsing: " + textBoxInputDB.Text); PatternTools.FastaParser.FastaFileParser parser = new PatternTools.FastaParser.FastaFileParser(); parser.ParseFile(new StreamReader(textBoxInputDB.Text), false, PatternTools.FastaParser.DBTypes.IDSpaceDescription); int itemsRemoved = parser.MyItems.RemoveAll(a => a.SequenceIdentifier.StartsWith(textBoxRegex.Text)); Console.WriteLine("Items removed: " + itemsRemoved); if (saveFileDialog1.ShowDialog() != System.Windows.Forms.DialogResult.Cancel) { parser.SaveDB(saveFileDialog1.FileName); } MessageBox.Show("Done"); }
static void Main(string[] args) { SEPRPackage.Parameters myParams = new SEPRPackage.Parameters(); myParams.LoadFromFile(@"seproParams.seprms"); myParams.SeachResultDirectoy = @""; myParams.AlternativeProteinDB = @""; PatternTools.SQTParser.SQTParser sqtParser = new PatternTools.SQTParser.SQTParser(@"sqtFileName"); PatternTools.FastaParser.FastaFileParser fastaParser = new PatternTools.FastaParser.FastaFileParser(); fastaParser.ParseFile(new System.IO.StreamReader(myParams.AlternativeProteinDB), false, PatternTools.FastaParser.DBTypes.IDSpaceDescription); SEProcessor.SEProConn seproConn = new SEProcessor.SEProConn(myParams, sqtParser.Scans, fastaParser, true, false); seproConn.myResults.Save("mySEProPckg.sepr"); }