text stringlengths 0 601k |
|---|
let trace = ref false |
let t_int parameters x = if Remanent_parameters . get_trace parameters || ! trace then Loggers . fprintf ( Remanent_parameters . get_logger parameters ) " % i " x |
let t_string parameters x = if Remanent_parameters . get_trace parameters || ! trace then Loggers . fprintf ( Remanent_parameters . get_logger parameters ) " % s " x |
let comp_pair ( a , b ) ( x , y ) = match ( a < x , a = x , b < y ) with true , _ , _ -> ( - 1 ) |
let rec list_it f l b = match l with t :: q -> list_it f q ( f t b ) |
let rec true_map x y = |
let max_of_list parameters error list = match list with | [ ] -> Exception . warn parameters error __POS__ Exit None | t :: q -> error , Some ( List . fold_left max t q ) |
let sum_list list = List . fold_left ( fun a b -> a + b ) 0 list |
let rec member x l = match l with [ ] -> false | a :: b -> if a = x then true else member x b ; ; |
let rec member2 x l = match l with [ ] -> false ( | a , _ ) :: b -> if a = x then true else member2 x b ; ; |
let rec all_differents liste = match liste with a :: b -> if ( member a b ) then false else ( all_differents b ) | [ ] -> true ; ; |
let rec dolist l a = match l with t :: q -> ( dolist q ( t a ) ) | [ ] -> a ; ; |
let concat liste1 liste2 = let rec aux liste1 liste2 = match liste1 with a :: b -> aux b ( a :: liste2 ) | [ ] -> liste2 in aux ( rev liste1 ) liste2 ; ; |
let applati liste = let rec aux1 l rep = match l with a :: b -> aux1 b ( a :: rep ) | [ ] -> rep in let rec aux2 l rep = match l with a :: b -> aux2 b ( aux1 a rep ) | [ ] -> rep in rev ( aux2 liste [ ] ) ; ; |
let rec forall p l = match l with a :: b -> if ( p a ) then ( forall p b ) else false | [ ] -> true ; ; |
let rec correspondance parameters error ancien nouveau x = match ancien , nouveau with | a :: _ , p :: _ when a = x -> error , Some p | _ :: b , _ :: q -> correspondance parameters error b q x | [ ] , [ ] -> error , Some x | _ -> Exception . warn parameters error __POS__ Exit None |
let transfert parameters error ancien nouveau liste = let rec aux parameters error l = match l with [ ] -> error , [ ] | a :: b -> let error , h = correspondance parameters error ancien nouveau a in let error , tl = aux parameters error b in error , h :: tl in aux parameters error liste ; ; |
let tr parameters error ancien nouveau id = match ( transfert parameters error ancien nouveau [ id ] ) with error , [ res ] -> error , res | error , _ -> Exception . warn parameters error __POS__ Exit None |
let paire_of_list liste1 liste2 rep = let rec aux1 x l2 rep = match l2 with a :: b -> aux1 x b ( ( x , a ) :: rep ) | [ ] -> rep in let rec aux2 l1 l2 rep = match l1 with a :: b -> aux2 b l2 ( aux1 a l2 rep ) | [ ] -> rep in aux2 liste1 liste2 rep ; ; |
let produit_predicat p i j = match i , j with ( a , b ) , ( c , d ) -> ( ( p a c ) || ( ( a = c ) && ( p b d ) ) ) ; ; |
let union_list p liste1 liste2 = let rec aux liste1 liste2 sol = match liste1 , liste2 with a :: b , t :: q when a = t -> aux b q ( t :: sol ) | a :: b , t :: _q when ( p a t ) -> aux b liste2 ( a :: sol ) | _a :: _b , t :: q -> aux liste1 q ( t :: sol ) | a :: b , [ ] -> aux b [ ] ( a :: sol ) | [ ] , a :: b -> aux b ... |
let intersec_list p liste1 liste2 = let rec aux liste1 liste2 sol = match liste1 , liste2 with a :: b , t :: q -> if ( a = t ) then aux b q ( a :: sol ) else ( if ( p a t ) then aux b liste2 sol else aux liste1 q sol ) | _ -> ( rev sol ) in aux liste1 liste2 [ ] |
let ajoute t liste = let rec aux liste rep = match liste with a :: b -> aux b ( ( concat t a ) :: rep ) | [ ] -> rep in aux ( rev liste ) [ ] |
let flat_map f l = let rec aux l rep = match l with a :: b -> aux b ( ( f a ) @ rep ) | [ ] -> rep in aux ( rev l ) [ ] |
let flat_map_zip f l = let rec aux l rep1 rep2 = match l with a :: b -> let ( c , d ) = f a in aux b ( c @ rep1 ) ( d @ rep2 ) | [ ] -> rep1 , rep2 in aux ( rev l ) [ ] [ ] |
let produit_list liste1 liste2 = flat_map ( fun x -> ajoute x liste2 ) liste1 |
let rec mix_list liste = match liste with [ ] -> [ [ ] ] | t :: q -> produit_list t ( mix_list q ) |
let insert_list p x liste1 = let rec vide reste fait = match reste with a :: b -> vide b ( a :: fait ) [ ] | -> fait in let rec aux reste vue = match reste with a :: b -> if ( p a x ) then ( aux b ( a :: vue ) ) else ( vide ( x :: vue ) reste ) | [ ] -> vide ( x :: vue ) [ ] in aux liste1 [ ] |
let list_of_table h = let liste = ref [ ] in ( Hashtbl . iter ( fun a -> fun b ( -> liste ( := a , b ) ( ::! liste ) ) ) h ; ! liste ) |
let copy_table h = let rep = Hashtbl . create 1 in ( Hashtbl . iter ( fun a -> fun b ( -> Hashtbl . add rep a b ) ) h ; rep ) |
let insert_sort p l k = let rec aux l rep = match l with | t :: q when ( p t k ) -> aux q ( t :: rep ) | t :: _q when t = k -> concat ( List . rev rep ) l | _ -> concat ( List . rev rep ) ( k :: l ) in aux l [ ] |
let merge p l k = let rec aux l1 l2 rep = match l1 , l2 with t :: q , a :: _b when p t a -> aux q l2 ( t :: rep ) | t :: q , a :: b when p a t -> aux ( t :: q ) b ( a :: rep ) | t :: q , _a :: b -> aux q b ( t :: rep ) | t :: q , [ ] -> aux q l2 ( t :: rep ) | [ ] , a :: b -> aux l1 b ( a :: rep ) | _ -> ( List . rev r... |
let sub_list p l k = let rec aux l rep = match l with t :: q when t = k -> concat ( List . rev rep ) q in aux l [ ] |
let vide f l = let rec aux l rep = match l with t :: q when ( f t ) -> aux q rep | t :: q -> aux q ( t :: rep ) | _ -> ( List . rev rep ) in aux l [ ] |
let filtre f l = vide ( fun x -> not ( f x ) ) l |
let rev l = let rec aux res sol = match res with [ ] -> sol | a :: b -> aux b ( a :: sol ) |
let flap_map parameters error f l = let n = Working_list_imperative . make ( Remanent_parameters . get_empty_hashtbl_size parameters ) in let rec aux l = match l with t :: q -> ( Working_list_imperative . push ( f t ) n ; aux q ) | [ ] -> ( ) in List . iter aux l ; error , Working_list_imperative . list n |
let map_list ( f ' : a ' -> b ) ( l ' : a list ) = let rec aux ( l ' : a list ) ( rep ' : b list ) = match l with [ ] -> rep | a :: b -> ( try ( let r = ( f a ) in ( aux b ( r :: rep ) ) ) with _ -> ( aux b rep ) ) in aux ( List . rev l ) [ ] ; ; |
let compte_list parameters error l = let a = Hashtbl . create ( Remanent_parameters . get_empty_hashtbl_size parameters ) in let get x = try ( Hashtbl . find a x ) with _ -> 0 in let inc x = let rep = get x in ( Hashtbl . remove a x ; List . iter ( fun x -> inc x ) l ; error , list_of_table a ; ; |
let fst_option x = match x with | Some ( x , _ ) -> Some x | _ -> None |
let snd_option x = match x with | Some ( _ , x ) -> Some x | _ -> None |
let escape_label_in_dot s = Str . global_substitute ( Str . regexp " [ " ] " ) \\\\\\\ |
let make_id_compatible_with_dot_format parameters error string = let tab = Remanent_parameters . get_make_labels_compatible_with_dot parameters in let rec aux pos l = if pos < 0 then l else let char = String . get string pos in match Remanent_parameters_sig . CharMap . find_option char tab with | Some liste_char -> | N... |
let sorted_parts_of_list n list = let list = List . sort ( fun a b -> compare b a ) list in let rec aux k list suffix output = if k = 0 then suffix :: output else match list with | h :: t -> | [ ] -> output in aux n list [ ] [ ] |
let sort_list key parameter error list = let error , refined_list = List . fold_left ( fun ( error , refined_list ) a -> let error , key = key parameter error a in error , ( key , a ) :: refined_list ) ( error , [ ] ) list in let refined_sorted_list = List . sort ( fun ( a , _ ) ( b , _ ) -> compare b a ) refined_list ... |
let generic_installation ( ~ run_program : Machine . Make_fun . t ) ~ host ~ install_path ~ install_program ~ witness ~ url ? unarchived_directory ( ? archive_is_directory = true ) tool_name = let archive = Filename . basename url in let archive_kind = if Filename . check_suffix url " bz2 " then ` Tar " j " else if Fil... |
let git_installation ( ~ run_program : Machine . Make_fun . t ) ~ host ~ install_path ~ install_program ~ witness ~ repository ~ recursive tool = let open KEDSL in let recursive = if recursive then " -- recursive " else " " in let version = ( Option . value_exn tool . Machine . Tool . Definition . version ~ msg " : Git... |
module Installable_tool = struct let noop = KEDSL . Program . sh " echo Nothing - done - here " type t = { tool_definition : Tool_def . t ; url : string ; install_program : path : string -> KEDSL . Program . t ; init_program : path : string -> KEDSL . Program . t ; witness : host : KEDSL . Host . t -> path : string -> ... |
module Git_installable_tool = struct let noop = KEDSL . Program . sh " echo Nothing - done - here " type t = { tool_definition : Tool_def . t ; repository : string ; recursive : bool ; install_program : path : string -> KEDSL . Program . t ; init_program : path : string -> KEDSL . Program . t ; witness : host : KEDSL .... |
let add_to_dollar_path ~ path = KEDSL . Program . shf " export PATH =% s :$ PATH " path |
let make_and_copy_bin bin = fun ~ path -> KEDSL . Program . ( sh " make " && shf " cp % s % s " bin path ) |
let witness_file bin = fun ~ host ~ path -> let p = KEDSL . single_file ~ host ( path // bin ) in object method is_done = p # is_done end |
let witness_list l = fun ~ host ~ path -> KEDSL . list_of_files ~ host ( List . map l ~ f ( : fun bin -> path // bin ) ) |> fun p -> object method is_done = p # is_done end |
let bwa = Installable_tool . make Machine . Tool . Default . bwa ~ url " : http :// downloads . sourceforge . net / project / bio - bwa / bwa - 0 . 7 . 10 . tar . bz2 " ~ install_program ( : make_and_copy_bin " bwa " ) ~ init_program : add_to_dollar_path ~ witness ( : witness_file " bwa " ) |
let freebayes = Git_installable_tool . make Machine . Tool . Default . freebayes ~ repository " : https :// github . com / ekg / freebayes . git " ~ recursive : true ~ install_program ( : fun ~ path -> KEDSL . Program . ( sh " make " && shf " cp - r bin % s " path ) ) ~ init_program ( : fun ~ path -> KEDSL . Program . ... |
let delly2 = Installable_tool . make Machine . Tool . Default . delly2 ~ url " : https :// github . com / dellytools / delly / releases / download / v0 . 7 . 7 / delly_v0 . 7 . 7_parallel_linux_x86_64bit " ~ install_program ( : fun ~ path -> KEDSL . Program . ( sh " mv delly_v0 . 7 . 7_parallel_linux_x86_64bit delly2 "... |
let sambamba = Installable_tool . make Machine . Tool . Default . sambamba ~ archive_is_directory : false ~ url " : https :// github . com / lomereiter / sambamba / releases / download / v0 . 6 . 5 / sambamba_v0 . 6 . 5_linux . tar . bz2 " ~ init_program : add_to_dollar_path ~ witness ( : witness_file " sambamba_v0 . 6... |
let stringtie = Installable_tool . make Machine . Tool . Default . stringtie ~ url " : https :// github . com / gpertea / stringtie / archive / v1 . 2 . 2 . tar . gz " ~ install_program ( : make_and_copy_bin " stringtie " ) ~ init_program : add_to_dollar_path ~ witness ( : witness_file " stringtie " ) |
let vcftools = Installable_tool . make Machine . Tool . Default . vcftools ~ url " : http :// downloads . sourceforge . net / project /\ vcftools / vcftools_0 . 1 . 12b . tar . gz " ~ install_program ( : fun ~ path -> KEDSL . Program . ( sh " make " && shf " cp - r bin % s " path && shf " cp - r lib / perl5 / site_perl... |
let bedtools = Installable_tool . make Machine . Tool . Default . bedtools ~ url " : https :// github . com / arq5x / bedtools2 /\ archive / v2 . 23 . 0 . tar . gz " ~ install_program ( : fun ~ path -> KEDSL . Program . ( sh " make " && shf " cp - r bin % s " path ) ) ~ init_program ( : fun ~ path -> KEDSL . Program . ... |
let mosaik = let url = " https :// mosaik - aligner . googlecode . com / files / MOSAIK - 2 . 2 . 3 - source . tar " in Installable_tool . make Machine . Tool . Default . mosaik ~ url ~ unarchived_directory " : MOSAIK " * ~ init_program ( : fun ~ path -> KEDSL . Program . ( shf " export PATH =% s :$ PATH " path && shf ... |
let star = let url = " https :// github . com / alexdobin / STAR / archive / STAR_2 . 4 . 1d . tar . gz " in let star_binary = " STAR " in let star_binary_path = sprintf " bin / Linux_x86_64 /% s " star_binary in Installable_tool . make ~ url Machine . Tool . Default . star ~ init_program : add_to_dollar_path ~ unarchi... |
let hisat tool = let open KEDSL in let url , hisat_binary = let open Machine . Tool . Default in match tool with | one when one = hisat -> " http :// ccb . jhu . edu / software / hisat / downloads / hisat - 0 . 1 . 6 - beta - Linux_x86_64 . zip " , " hisat " | two when two = hisat2 -> " ftp :// ftp . ccb . jhu . edu / ... |
let kallisto = let url = " https :// github . com / pachterlab / kallisto / releases / download \ / v0 . 42 . 3 / kallisto_linux - v0 . 42 . 3 . tar . gz " in Installable_tool . make Machine . Tool . Default . kallisto ~ url ~ witness ( : witness_file " kallisto " ) ~ install_program : KEDSL . Program . ( fun ~ path ->... |
let samtools = let url = " https :// github . com / samtools / samtools / releases / download / 1 . 4 /\ samtools - 1 . 4 . tar . bz2 " in let samtools = " samtools " in let htslib = [ " bgzip " ; " tabix " ] in let install_program ~ path = let open KEDSL . Program in sh " make " && shf " cp % s % s " samtools path && ... |
let bcftools = let url = " https :// github . com / samtools / bcftools / releases / download / 1 . 4 /\ bcftools - 1 . 4 . tar . bz2 " in let install_program ~ path = let open KEDSL . Program in sh " make " && shf " cp bcftools % s " path in let witness = witness_file " bcftools " in Installable_tool . make Machine . ... |
let cufflinks = let url = " http :// cole - trapnell - lab . github . io / cufflinks / assets / downloads /\ cufflinks - 2 . 2 . 1 . Linux_x86_64 . tar . gz " in let witness = witness_file " cufflinks " in let install_program ~ path = KEDSL . Program . ( shf " cp * % s " path ) in Installable_tool . make Machine . Tool... |
let somaticsniper = let url = let deb_file = " somatic - sniper1 . 0 . 3_1 . 0 . 3_amd64 . deb " in sprintf " http :// apt . genome . wustl . edu / ubuntu / pool / main / s / somatic - sniper1 . 0 . 3 /% s " deb_file in let binary = " somaticsniper " in let binary_in_deb = " usr / bin / bam - somaticsniper1 . 0 . 3 " i... |
let varscan = let url = " http :// downloads . sourceforge . net / project / varscan / VarScan . v2 . 3 . 5 . jar " in let jar = " VarScan . v2 . 3 . 5 . jar " in let witness = witness_file jar in let init_program ~ path = KEDSL . Program . ( shf " export VARSCAN_JAR =% s /% s " path jar ) in Installable_tool . make Ma... |
let get_broad_jar = Workflow_utilities . Download . get_tool_file ~ identifier " : broad - jar " |
let mutect_tool ( ~ run_program : Machine . Make_fun . t ) ~ host ~ install_tools_path loc = let tool = Machine . Tool . Default . mutect in let open KEDSL in let install_path = install_tools_path // Tool_def . to_directory_name tool in let conda_env = Conda . ( setup_environment ~ python_version ` : Python_2 ~ base_pa... |
let gatk_tool ( ~ run_program : Machine . Make_fun . t ) ~ host ~ install_tools_path loc = let tool = Machine . Tool . Default . gatk in let open KEDSL in let install_path = install_tools_path // Tool_def . to_directory_name tool in let ensure = get_broad_jar ~ run_program ~ host ~ install_path loc in Machine . Tool . ... |
let strelka = let url = " ftp :// strelka :% 27 % 27 @ ftp . illumina . com / v1 - branch / v1 . 0 . 14 /\ strelka_workflow - 1 . 0 . 14 . tar . gz " in let strelka_bin = " usr " // " bin " in let witness = witness_file @@ strelka_bin // " configureStrelkaWorkflow . pl " in let install_program ~ path = KEDSL . Program ... |
let virmid = let url = " http :// downloads . sourceforge . net / project / virmid / virmid - 1 . 1 . 1 . tar . gz " in let jar = " Virmid - 1 . 1 . 1 " // " Virmid . jar " in let init_program ~ path = KEDSL . Program . ( shf " export VIRMID_JAR =% s /% s " path jar ) in Installable_tool . make Machine . Tool . Default... |
let muse = let url = " http :// bioinformatics . mdanderson . org / Software / MuSE / MuSEv1 . 0b " in let binary = " MuSEv1 . 0b " in let install_program ~ path = KEDSL . Program . ( shf " chmod + x % s /% s " path binary ) in let init_program ~ path = KEDSL . Program . ( shf " export muse_bin =% s /% s " path binary ... |
let fastqc = let url = " http :// www . bioinformatics . babraham . ac . uk / projects / fastqc / fastqc_v0 . 11 . 5 . zip " in let binary = " fastqc " in let binary_path path = path // binary in let init_program ~ path = KEDSL . Program . ( shf " export FASTQC_BIN =% s " ( binary_path path ) ) in Installable_tool . ma... |
let default_tool_location msg ( ) : Workflow_utilities . Download . tool_file_location = ` Fail ( sprintf " No location provided for % s " msg ) |
let default_netmhc_config ( ) = Netmhc . ( create_netmhc_config ~ netmhc_loc ( : default_tool_location " NetMHC " ( ) ) ~ netmhcpan_loc ( : default_tool_location " NetMHCpan " ( ) ) ~ pickpocket_loc ( : default_tool_location " PickPocket " ( ) ) ~ netmhccons_loc ( : default_tool_location " NetMHCcons " ( ) ) ( ) ) |
let default_toolkit ~ run_program ~ host ~ install_tools_path ( ? mutect_jar_location = default_tool_location " Mutect " ) ( ? gatk_jar_location = default_tool_location " GATK " ) ( ? netmhc_config = default_netmhc_config ) ( ) = let install installable = Installable_tool . render ~ host installable ~ install_tools_pat... |
module Toploop : sig value print_location : Format . formatter -> Camlp4_import . Location . t -> unit ; value print_warning : Camlp4_import . Location . t -> Format . formatter -> Camlp4_import . Warnings . t -> unit ; value parse_toplevel_phrase : ref ( Lexing . lexbuf -> Camlp4_import . Parsetree . toplevel_phrase )... |
module Ast2pt = Camlp4 . Struct . Camlp4Ast2OCamlAst . Make Ast ; |
module Lexer = Camlp4 . Struct . Lexer . Make Token ; if Sys . interactive . val then Format . printf " \ tCamlp4 Parsing version % s \ n . " @ Camlp4_config . version else ( ) end ; let token_streams = ref [ ] in let cleanup lb = try token_streams . val := List . remove_assq lb token_streams . val with [ Not_found -> ... |
let parse_toplevel_phrase = ref Parse . toplevel_phrase |
let parse_use_file = ref Parse . use_file |
let parse_mod_use_file name lb = let modname = String . capitalize_ascii ( Filename . remove_extension ( Filename . basename name ) ) in let items = List . concat ( List . map ( function Ptop_def s -> s | Ptop_dir _ -> [ ] ) ( ! parse_use_file lb ) ) in [ Ptop_def [ Str . module_ ( Mb . mk ( Location . mknoloc ( Some m... |
let max_printer_depth = ref 100 |
let max_printer_steps = ref 300 |
let toplevel_env = ref Env . empty |
let backtrace = ref None |
module type EVAL_BASE = sig val eval_ident : Ident . t -> Obj . t end |
module MakeEvalPrinter ( E : EVAL_BASE ) = struct let rec eval_address = function | Env . Aident id -> E . eval_ident id | Env . Adot ( p , pos ) -> Obj . field ( eval_address p ) pos let eval_path find env path = match find path env with | addr -> eval_address addr | exception Not_found -> Misc . fatal_error ( " Canno... |
let toplevel_startup_hook = ref ( fun ( ) -> ( ) ) |
type event += | Startup | After_setup |
let hooks = ref [ ] |
let add_hook f = hooks := f :: ! hooks |
let ( ) = add_hook ( function | Startup -> ! toplevel_startup_hook ( ) | _ -> ( ) ) |
let run_hooks hook = List . iter ( fun f -> f hook ) ! hooks |
type evaluation_outcome = Result of Obj . t | Exception of exn |
let record_backtrace ( ) = if Printexc . backtrace_status ( ) then backtrace := Some ( Printexc . get_backtrace ( ) ) |
let preprocess_phrase ppf phr = let phr = match phr with | Ptop_def str -> let str = Pparse . apply_rewriters_str ~ restore : true ~ tool_name " : ocaml " str in Ptop_def str | phr -> phr in if ! Clflags . dump_parsetree then Printast . top_phrase ppf phr ; if ! Clflags . dump_source then Pprintast . top_phrase ppf phr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.