text stringlengths 12 786k |
|---|
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 , lis... |
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 li... |
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 ... |
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... |
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 ... |
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 : ho... |
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 . ... |
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 ( :... |
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 ) ) ... |
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 ... |
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 ... |
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 ( ... |
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 b... |
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 ... |
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 ... |
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 ... |
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 = ... |
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 " ) ... |
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... |
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 " bcf... |
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 " ... |
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_d... |
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 =... |
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_... |
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_p... |
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 . ... |
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 " pa... |
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 . ... |
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 " (... |
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 ( ... |
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 ... |
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_impo... |
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... |
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 . ... |
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_foun... |
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 Ppr... |
let phrase_buffer = Buffer . create 1024 |
let first_line = ref true |
let got_eof = ref false |
let read_input_default prompt buffer len = output_string stdout prompt ; flush stdout ; let i = ref 0 in try while true do if ! i >= len then raise Exit ; let c = input_char stdin in Bytes . set buffer ! i c ; Buffer . add_char phrase_buffer c ; incr i ; if c = ' \ n ' then raise Exit ; d... |
let read_interactive_input = ref read_input_default |
let refill_lexbuf buffer len = if ! got_eof then ( got_eof := false ; 0 ) else begin let prompt = if ! Clflags . noprompt then " " else if ! first_line then " # " else if ! Clflags . nopromptcont then " " else if Lexer . in_comment ( ) then " * " else " " in first_line := ... |
let set_paths ( ) = let expand = Misc . expand_directory Config . standard_library in let current_load_path = Load_path . get_paths ( ) in let load_path = List . concat [ [ " " ] ; List . map expand ( List . rev ! Compenv . first_include_dirs ) ; List . map expand ( List... |
let initialize_toplevel_env ( ) = toplevel_env := Compmisc . initial_env ( ) " caml_sys_modify_argv " |
let override_sys_argv new_argv = caml_sys_modify_argv new_argv ; Arg . current := 0 |
type directive_fun = | Directive_none of ( unit -> unit ) | Directive_string of ( string -> unit ) | Directive_int of ( int -> unit ) | Directive_ident of ( Longident . t -> unit ) | Directive_bool of ( bool -> unit ) |
type directive_info = { section : string ; doc : string ; } |
let directive_table = ( Hashtbl . create 23 : ( string , directive_fun ) Hashtbl . t ) |
let directive_info_table = ( Hashtbl . create 23 : ( string , directive_info ) Hashtbl . t ) |
let add_directive name dir_fun dir_info = Hashtbl . add directive_table name dir_fun ; Hashtbl . add directive_info_table name dir_info |
let get_directive name = Hashtbl . find_opt directive_table name |
let get_directive_info name = Hashtbl . find_opt directive_info_table name |
let all_directive_names ( ) = Hashtbl . fold ( fun dir _ acc -> dir :: acc ) directive_table [ ] |
let try_run_directive ppf dir_name pdir_arg = begin match get_directive dir_name with | None -> fprintf ppf " Unknown directive ` % s ' . " dir_name ; let directives = all_directive_names ( ) in Misc . did_you_mean ppf ( fun ( ) -> Misc . spellcheck directives dir_name ) ; fprintf pp... |
let section_run = " Loading code " |
let section_env = " Environment queries " |
let section_options = " Compiler options " |
let order_of_sections = ( [ section_general ; section_run ; section_env ; ] , [ section_print ; section_trace ; section_options ; section_undocumented ; ] ) |
let dir_quit ( ) = exit 0 |
let _ = add_directive " quit " ( Directive_none dir_quit ) { section = section_general ; doc = " Exit the toplevel . " ; } |
let dir_directory s = let d = expand_directory Config . standard_library s in Dll . add_path [ d ] ; let dir = Load_path . Dir . create d in Load_path . add dir ; toplevel_env := Stdlib . String . Set . fold ( fun name env -> Env . add_persistent_structure ( Ident . create_persisten... |
let _ = add_directive " directory " ( Directive_string dir_directory ) { section = section_run ; doc = " Add the given directory to search path for source and compiled \ files . " ; } |
let dir_remove_directory s = let d = expand_directory Config . standard_library s in let keep id = match Load_path . find_uncap ( Ident . name id ^ " . cmi " ) with | exception Not_found -> true | fn -> Filename . dirname fn <> d in toplevel_env := Env . filter_non_loaded_persistent keep ... |
let _ = add_directive " remove_directory " ( Directive_string dir_remove_directory ) { section = section_run ; doc = " Remove the given directory from the search path . " ; } |
let dir_cd s = Sys . chdir s |
let _ = add_directive " cd " ( Directive_string dir_cd ) { section = section_run ; doc = " Change the current working directory . " ; } |
let check_consistency ppf filename cu = try Env . import_crcs ~ source : filename cu . cu_imports with Persistent_env . Consistbl . Inconsistency ( name , user , auth ) -> fprintf ppf " [ @< hv 0 > The files % s @ and % s @ \ disagree over interface % s ] . " @@ user auth name ; ... |
let load_compunit ic filename ppf compunit = check_consistency ppf filename compunit ; seek_in ic compunit . cu_pos ; let code_size = compunit . cu_codesize + 8 in let code = LongString . create code_size in LongString . input_bytes_into code ic compunit . cu_codesize ; LongString . set code comp... |
let rec load_file recursive ppf name = let filename = try Some ( Load_path . find name ) with Not_found -> None in match filename with | None -> fprintf ppf " Cannot find file % s . . " @ name ; false | Some filename -> let ic = open_in_bin filename in Misc . try_finally ~ always ( : fun... |
let dir_load ppf name = ignore ( load_file false ppf name ) |
let _ = add_directive " load " ( Directive_string ( dir_load std_out ) ) { section = section_run ; doc = " Load in memory a bytecode object , produced by ocamlc . " ; } |
let dir_load_rec ppf name = ignore ( load_file true ppf name ) |
let _ = add_directive " load_rec " ( Directive_string ( dir_load_rec std_out ) ) { section = section_run ; doc = " As # load , but loads dependencies recursively . " ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.