Skip to content

Commit

Permalink
bioinfo: added Idr
Browse files Browse the repository at this point in the history
  • Loading branch information
pveber committed Jul 18, 2019
1 parent f87634e commit 0f51f4b
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
60 changes: 60 additions & 0 deletions lib/bioinfo/bistro_bioinfo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2761,3 +2761,63 @@ module Picardtools = struct
]
]
end

module Idr = struct
type 'a format = NarrowPeak | BroadPeak | Bed | Gff

let narrowPeak = NarrowPeak
let broadPeak = BroadPeak
let bed = Bed
let gff = Gff

type 'a output = [`idr_output of 'a]

let string_of_file_format = function
| NarrowPeak -> "narrowPeak"
| BroadPeak -> "broadPeak"
| Bed -> "bed"
| Gff -> "gff"

let file_format x = string (string_of_file_format x)

let string_of_merge_method = function
| `sum -> "sum"
| `avg -> "avg"
| `min -> "min"
| `max -> "max"

let merge_method x = string (string_of_merge_method x)

let token_of_rank r =
string (
match r with
| `signal -> "signal.value"
| `pvalue -> "p.value"
| `qvalue -> "q.value"
)

let img = [ docker_image ~account:"pveber" ~name:"idr" ~tag:"2.0.3" () ]

let idr
~input_file_type ?idr_threshold ?soft_idr_threshold
?peak_merge_method ?rank ?random_seed ?peak_list
sample1 sample2 =
Workflow.shell ~descr:"Idr.idr" [
mkdir_p dest ;
cmd "idr" ~img [
opt "--input-file-type" file_format input_file_type ;
opt "--output-file" (fun x -> x) (dest // "items.tsv") ;
option (opt "--idr-threshold" float) idr_threshold ;
option (opt "--soft-idr-threshold" float) soft_idr_threshold ;
option (opt "--peak-merge-method" merge_method) peak_merge_method ;
option (opt "--rank" token_of_rank) rank ;
option (opt "--random-seed" int) random_seed ;
option (opt "--peak-list" dep) peak_list ;
string "--plot" ;
opt "--samples" (list ~sep:" " dep) [ sample1 ; sample2 ] ;
]
]

let items x = Workflow.select x [ "items.tsv" ]
let figure x = Workflow.select x [ "items.tsv.png" ]
end
25 changes: 25 additions & 0 deletions lib/bioinfo/bistro_bioinfo.mli
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,31 @@ module Macs2 : sig
val broad_peaks : broad_output pworkflow -> broad_peaks pworkflow
end

module Idr : sig
type 'a format

val narrowPeak : Macs2.narrow_peaks format
val broadPeak : Macs2.broad_peaks format
val bed : bed3 format
val gff : gff format

type 'a output = [`idr_output of 'a]

val idr :
input_file_type:'a format ->
?idr_threshold:float ->
?soft_idr_threshold:float ->
?peak_merge_method:[ `sum | `avg | `min | `max] ->
?rank:[ `signal | `pvalue | `qvalue ] ->
?random_seed:int ->
?peak_list:'a pworkflow ->
'a pworkflow ->
'a pworkflow ->
'a output dworkflow

val items : 'a output dworkflow -> 'a pworkflow
val figure : _ output dworkflow -> png pworkflow
end

module Meme_suite : sig
class type meme_output = object
Expand Down

0 comments on commit 0f51f4b

Please sign in to comment.