Skip to content

Commit db00214

Browse files
author
Joott
committed
Add topX method to quant group filters
1 parent d9345b1 commit db00214

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/ProteomIQon/DTO.fs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ module Common =
292292
type GroupFilter =
293293
| Tukey of float
294294
| Stdev of float
295+
| TopX of int
295296

296297

297298
module GroupFilter =
@@ -310,7 +311,14 @@ module Common =
310311
let mean = Seq.mean values
311312
let stdev = Seq.stDev values
312313
(fun v -> v <= (mean+stdev*threshold) && v >= (mean-stdev*threshold)
313-
)
314+
)
315+
| TopX count ->
316+
fun (values:seq<float>) ->
317+
let topX =
318+
values
319+
|> Seq.sortDescending
320+
|> Seq.take count
321+
fun v -> topX |> Seq.contains v
314322

315323

316324
module LabeledProteinQuantification =

0 commit comments

Comments
 (0)