let default ~run_program ~host ~install_path ~(files:netmhc_file_locations) () =
let netmhc_mj = guess_major_version files.netmhc in
let is_old_netmhc =
match netmhc_mj with
| Some v -> (int_of_string (Char.escaped v)) < 4
| None -> true
in
let netmhc_env = guess_env_setup ~install_path files.netmhc in
let older_netmhc =
default_netmhc_install ~run_program ~host ~install_path
~tool_file_loc:files.netmhc ~binary_name:"netMHC"
~example_data_file:(Some "SLA-10401/bl50/synlist")
~env_setup:(
[ `GENERIC ("/usr/local/bin/python2.5", "`which python`") ]
@ netmhc_env
)
~data_folder_name:"net"
~data_folder_dest:"etc"
in
let newer_netmhc =
default_netmhc_install ~run_program ~host ~install_path
~tool_file_loc:files.netmhc ~binary_name:"netMHC"
~example_data_file:(Some "version")
~env_setup:netmhc_env
~data_folder_name:"data"
~data_folder_dest:"."
in
let netmhc_install_func =
if is_old_netmhc then older_netmhc else newer_netmhc
in
let (netmhc, netmhc_path, netmhc_install) = netmhc_install_func () in
let (netmhcpan, netmhcpan_path, netmhcpan_install) =
default_netmhc_install ~run_program ~host ~install_path
~tool_file_loc:files.netmhcpan ~binary_name:"netMHCpan"
~example_data_file:(Some "version")
~env_setup:(guess_env_setup ~install_path files.netmhcpan) ()
in
let (pickpocket, pickpocket_path, pickpocket_install) =
default_netmhc_install ~run_program ~host ~install_path
~tool_file_loc:files.pickpocket ~binary_name:"PickPocket"
~example_data_file:None
~env_setup:(guess_env_setup ~install_path files.pickpocket) ()
in
let cons_env =
[`ENV ("NETMHC_env", netmhc_path);
`ENV ("NETMHCpan_env", netmhcpan_path);
`ENV ("PICKPOCKET_env", pickpocket_path);
] @
(guess_env_setup
~home_env:"NCHOME" ~install_path files.netmhccons
)
in
let (netmhccons, _, _) =
default_netmhc_install ~run_program ~host ~install_path
~tool_file_loc:files.netmhccons ~binary_name:"netMHCcons"
~example_data_file:(Some "BLOSUM50")
~env_setup:cons_env
~depends:[netmhc_install; netmhcpan_install; pickpocket_install]
()
in
Machine.Tool.Kit.of_list [netmhc; netmhcpan; pickpocket; netmhccons]