Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nonspecific search engine bug fix and unit test #2453

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ private Tuple<int, PeptideWithSetModifications> Accepts(List<Product> fragments,
updatedMods.Add(key, mod.Value);
}
}
if (terminalMod != null)
if (terminalMod != null && !updatedMods.Keys.Contains(startResidue - 1))
{
updatedMods.Add(startResidue - 1, terminalMod);
}
Expand Down
23 changes: 23 additions & 0 deletions MetaMorpheus/Test/SearchEngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,29 @@ public static void TestNonSpecificEnzymeSearchEngineSingleN()
Assert.That(allPsmsArray[0].BaseSequence, Is.EqualTo("QQQGGGG"));
}

[Test]
public static void TestNonSpecificEnzymeSearchEngine()
{
var myTomlPath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\NonSpecificSearchToml.toml");
var searchTaskLoaded = Toml.ReadFile<SearchTask>(myTomlPath, MetaMorpheusTask.tomlConfig);
string outputFolder = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\NonSpecificSearchTest");
Directory.CreateDirectory(outputFolder);
string myFile = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\TaGe_SA_A549_3_snip.mzML");
string myDatabase = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\bosTaurusEnamPruned.xml");

var engineToml = new EverythingRunnerEngine(new List<(string, MetaMorpheusTask)> { ("SearchTOML", searchTaskLoaded) }, new List<string> { myFile }, new List<DbForTask> { new DbForTask(myDatabase, false) }, outputFolder);
engineToml.Run();

string psmFile = Path.Combine(outputFolder, @"SearchTOML\AllPSMs.psmtsv");

List<PsmFromTsv> parsedPsms = PsmTsvReader.ReadTsv(psmFile, out var warnings);

Assert.That(parsedPsms.Count, Is.EqualTo(38)); //total psm count

Directory.Delete(outputFolder, true);

}


[Test]
public static void TestNonSpecificEnzymeSearchEngineSingleNLowCID()
Expand Down
6 changes: 6 additions & 0 deletions MetaMorpheus/Test/Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@
<None Update="SlicedSearchTaskConfig.toml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="TestData\bosTaurusEnamPruned.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="TestData\customBCZ.toml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -325,6 +328,9 @@
<None Update="TestData\myPrositLib.msp">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="TestData\NonSpecificSearchToml.toml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="TestData\noSAreaderTest.psmtsv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
100 changes: 100 additions & 0 deletions MetaMorpheus/Test/TestData/NonSpecificSearchToml.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
TaskType = "Search"

[SearchParameters]
DisposeOfFileWhenDone = true
DoParsimony = true
ModPeptidesAreDifferent = false
NoOneHitWonders = false
MatchBetweenRuns = false
Normalize = false
QuantifyPpmTol = 5.0
DoHistogramAnalysis = false
SearchTarget = true
DecoyType = "Reverse"
MassDiffAcceptorType = "OneMM"
WritePrunedDatabase = true
KeepAllUniprotMods = true
DoLocalizationAnalysis = false
DoLabelFreeQuantification = false
UseSharedPeptidesForLFQ = false
DoMultiplexQuantification = false
MultiplexModId = "TMT10"
DoSpectralRecovery = false
SearchType = "NonSpecific"
LocalFdrCategories = ["FullySpecific", "SemiSpecific", "NonSpecific"]
MaxFragmentSize = 10800.0
MinAllowedInternalFragmentLength = 0
HistogramBinTolInDaltons = 0.003
MaximumMassThatFragmentIonScoreIsDoubled = 0.0
WriteMzId = true
WritePepXml = false
WriteHighQValuePsms = true
WriteDecoys = true
WriteContaminants = true
WriteIndividualFiles = true
WriteSpectralLibrary = false
UpdateSpectralLibrary = false
CompressIndividualFiles = false
TCAmbiguity = "RemoveContaminant"
IncludeModMotifInMzid = false

[SearchParameters.ModsToWriteSelection]
'N-linked glycosylation' = 3
'O-linked glycosylation' = 3
'Other glycosylation' = 3
'Common Biological' = 3
'Less Common' = 3
Metal = 3
'2+ nucleotide substitution' = 3
'1 nucleotide substitution' = 3
UniProt = 2

[CommonParameters]
TaskDescriptor = "SearchTask"
MaxThreadsToUsePerFile = 63
ListOfModsFixed = ""
ListOfModsVariable = "Common Variable\tOxidation on M"
DoPrecursorDeconvolution = true
UseProvidedPrecursorInfo = true
DeconvolutionMaxAssumedChargeState = 12
TotalPartitions = 1
ProductMassTolerance = "±20.0000 PPM"
PrecursorMassTolerance = "±15.0000 PPM"
AddCompIons = true
QValueThreshold = 0.01
PepQValueThreshold = 1.0
ScoreCutoff = 5.0
QValueCutoffForPepCalculation = 0.005
ReportAllAmbiguity = true
NumberOfPeaksToKeepPerWindow = 200
MinimumAllowedIntensityRatioToBasePeak = 0.01
NormalizePeaksAccrossAllWindows = false
TrimMs1Peaks = false
TrimMsMsPeaks = true
CustomIons = []
AssumeOrphanPeaksAreZ1Fragments = true
MaxHeterozygousVariants = 4
MinVariantDepth = 1
AddTruncations = false
DissociationType = "HCD"
SeparationType = "HPLC"
MS2ChildScanDissociationType = "Unknown"
MS3ChildScanDissociationType = "Unknown"
UseMostAbundantPrecursorIntensity = true

[CommonParameters.DigestionParams]
InitiatorMethionineBehavior = "Variable"
MaxMissedCleavages = 35
MaxModificationIsoforms = 1024
SearchModeType = "None"
FragmentationTerminus = "C"
SpecificProtease = "singleC"
GeneratehUnlabeledProteinsForSilac = true
KeepNGlycopeptide = false
KeepOGlycopeptide = false
Protease = "singleC"
MinPeptideLength = 7
MaxPeptideLength = 36
MaxModsForPeptide = 2

[[FileSpecificParameters]]
Loading
Loading