public void TestWriteAccessDb(string path, int numberConsensus, int numberProteins, int numberEvidences) { var writer = new AccessTargetDatabaseWriter(); var options = new Options(); var database = new TargetDatabase(); var evidenceCount = 1; for (var i = 1; i <= numberConsensus; i++) { var target = new ConsensusTarget { Id = i }; for (var k = 1; k <= numberProteins; k++) { var protein = new ProteinInformation { ProteinName = "Access_Test" + k, CleavageState = clsPeptideCleavageStateCalculator.ePeptideCleavageStateConstants.Full, TerminusState = clsPeptideCleavageStateCalculator.ePeptideTerminusStateConstants.ProteinNTerminus }; protein.Consensus.Add(target); for (var j = 1; j <= numberEvidences; j++) { var evidence = new Evidence { AnalysisId = j, Charge = 1, Id = evidenceCount, CleanPeptide = "MIKEDEGAN" + evidenceCount, Sequence = "BIGBIRD" + evidenceCount, Mz = 405, Scan = evidenceCount++, PeptideInfo = new TargetPeptideInfo() }; evidence.AddProtein(protein); target.AddEvidence(evidence); } target.AddProtein(protein); target.CalculateStatistics(); } target.TheoreticalMonoIsotopicMass = 100.0; target.AverageNet = .6; target.PredictedNet = .7; database.ConsensusTargets.Add(target); } if (File.Exists(GetTestSuiteDataPath(path))) { File.Delete(GetTestSuiteDataPath(path)); } writer.Write(database, options, GetTestSuiteDataPath(path)); }
public void TestWriteDatabase(string path, int numberOfTargets, int numberOfEvidences) { var reader = new SqLiteTargetDatabaseWriter(); var options = new Options(); var database = new TargetDatabase(); var proteinCount = 1; var evidenceCount = 1; for (var i = 1; i <= numberOfTargets; i++) { var target = new ConsensusTarget { Id = i }; var protein = new ProteinInformation { ProteinName = "SO_Test" + proteinCount++, CleavageState = clsPeptideCleavageStateCalculator.ePeptideCleavageStateConstants.Full, TerminusState = clsPeptideCleavageStateCalculator.ePeptideTerminusStateConstants.ProteinNTerminus, }; protein.Consensus.Add(target); for (var j = 1; j <= numberOfEvidences; j++) { var evidence = new Evidence { AnalysisId = j, Charge = 1, Id = evidenceCount, CleanPeptide = "MIKEDEGAN" + evidenceCount, Sequence = "BIGBIRD" + evidenceCount, Mz = 405, Scan = evidenceCount++, PeptideInfo = new TargetPeptideInfo() }; evidence.AddProtein(protein); target.AddEvidence(evidence); } target.AddProtein(protein); target.CalculateStatistics(); database.ConsensusTargets.Add(target); } reader.Write(database, options, GetTestSuiteDataPath(path)); }