You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3336a85
Browse filesBrowse the repository at this point in the historyBrowse files
match result |> List.tryFind (fun item -> groupProteins item = expected)with
311
+
| Some group -> group
312
+
| None -> failtestf "D18 observed group structure: %A" result
313
+
letp1= requireGroup (set ["P1"])
314
+
letp1p2= requireGroup (set ["P1";"P2"])
315
+
letp1p2p3= requireGroup (set ["P1";"P2";"P3"])
316
+
Expect.equal (Set.ofArray p1.PeptideSequence)(set ["pa";"pb";"pc"])"the singleton group receives every containing-source peptide"
317
+
Expect.equal (Set.ofArray p1p2.PeptideSequence)(set ["pb";"pc"])"the two-protein group receives every containing-source peptide"
318
+
Expect.equal (Set.ofArray p1p2p3.PeptideSequence)(set ["pc"])"the three-protein group receives its containing-source peptide"
319
+
// documented: Maximal keeps all groups intact and usage-Maximal assigns each group every peptide whose source set CONTAINS it - the nested construction makes each expected set distinct.
320
+
321
+
testCase "minimal integration collapses overlapping groups to their intersection"<|fun _ ->
322
+
letitems=
323
+
[
324
+
ProteinInference.createProteinClassItem [|"P1";"P2"|] classC1a "x"
match result |> List.tryFind (fun item -> groupProteins item = set ["P2"])with
337
+
| Some group -> result, group
338
+
| None -> failtestf "D19 observed group structure: %A" result
339
+
letresultA,groupA = run items
340
+
letresultB,groupB = run (List.rev items)
341
+
Expect.equal (Set.ofArray groupA.PeptideSequence)(set ["x";"y"])"the intersection group carries both overlapping peptides"
342
+
Expect.equal (Set.ofArray groupB.PeptideSequence)(set ["x";"y"])"reversing evidence order preserves the intersection group's peptides"
343
+
Expect.equal (resultA |> Seq.collect (fun item -> item.PeptideSequence)|> Set.ofSeq)(set ["x";"y"])"the first input order retains the union of peptides"
344
+
Expect.equal (resultB |> Seq.collect (fun item -> item.PeptideSequence)|> Set.ofSeq)(set ["x";"y"])"the reversed input order retains the union of peptides"
345
+
// parsimony: P2 alone explains both peptides, so minimal integration must report the intersection - and inference must not depend on evidence order.
346
+
347
+
testCase "usage Minimal assigns each group only its best-matching source evidence"<|fun _ ->
match result |> List.tryFind (fun item -> groupProteins item = expected)with
364
+
| Some group -> group
365
+
| None -> failtestf "D20 observed group structure: %A" result
366
+
letp1= requireGroup (set ["P1"])
367
+
letp1p2= requireGroup (set ["P1";"P2"])
368
+
letp1p2p3= requireGroup (set ["P1";"P2";"P3"])
369
+
Expect.equal (Set.ofArray p1.PeptideSequence)(set ["pa"])"the singleton group gets only its best-matching source evidence"
370
+
Expect.equal (Set.ofArray p1p2.PeptideSequence)(set ["pb"])"the two-protein group gets only its best-matching source evidence"
371
+
Expect.equal (Set.ofArray p1p2p3.PeptideSequence)(set ["pc"])"the three-protein group gets only its best-matching source evidence"
372
+
// documented: usage-Minimal restricts each group's candidates (sources containing the group) to those with the SMALLEST source set - for nested sources that is exactly the group's own evidence.
373
+
374
+
testCase "higher-confidence evidence classes are not displaced by overlapping lower classes"<|fun _ ->
| None -> failtestf "D21 observed group structure: %A" result
395
+
letgroupA= run items
396
+
letgroupB= run (List.rev items)
397
+
Expect.equal groupA.Class classC1a "the stronger C1a evidence class survives the first order"
398
+
Expect.equal groupB.Class classC1a "the stronger C1a evidence class survives the reversed order"
399
+
Expect.isTrue (Array.contains "strong" groupA.PeptideSequence)"the stronger peptide survives the first order"
400
+
Expect.isTrue (Array.contains "strong" groupB.PeptideSequence)"the stronger peptide survives the reversed order"
401
+
// evidence-class precedence: C1a outranks C2a, so overlapping weaker evidence must not overwrite or displace the stronger group's class or membership.
279
402
]
280
403
281
404
testList "FDR"[
@@ -302,6 +425,64 @@ let tests =
302
425
"no decoy wins gives zero estimated FDR"
303
426
// The standard decoy/target FDR estimate is hand-counted here as 1/2 and 0.
304
427
428
+
testCase "modified PSM sequences match unmodified reverse-digest peptides"<|fun _ ->
429
+
letm=
430
+
ProteinInference.createReverseProteinScores
431
+
[|("REV_P1",[|"MAGK"|])|]
432
+
(Map.ofList ["M[ox]AGK",9.0])
433
+
Expect.isTrue (m.ContainsKey "REV_P1")"the modified PSM matches the reverse-digest peptide after normalization"
434
+
Expect.equal (fst m.["REV_P1"])9.0"the normalized reverse protein receives the modified PSM score"
435
+
// the score map's keys are normalized with removeModification before matching, so a modified observation must still transfer its evidence to the base-sequence decoy peptide.
436
+
437
+
testCase "the best PSM score survives when all scores are negative"<|fun _ ->
Expect.equal accessionSets [|set ["P1";"P2"]; set ["P3";"P4"]|]"the two shortest proteins share MAYU's low length bin"
475
+
// MAYU's model conditions FDR on protein length: the two shortest must share the low bin - directly from the documented length stratification, no incidental fields locked.
476
+
477
+
// PENDING: with zero target wins, decoys/targets = 2/0 is IEEE Infinity; an FDR is a
478
+
// proportion and its conservative bounded value is 1.0 (the module's MAYU path already applies
479
+
// that bound).
480
+
ptestCase "the decoy/target ratio is a bounded FDR"<|fun _ ->
0 commit comments