diff --git a/Comonicon.toml b/Comonicon.toml index bd97f0f..19f0cb6 100644 --- a/Comonicon.toml +++ b/Comonicon.toml @@ -1,8 +1,20 @@ -name = "TargetedEstimation" +name = "fasttmle" [install] completion = true quiet = false optimize = 2 -[sysimg] \ No newline at end of file +[sysimg] +incremental=true +filter_stdlibs=false + +[sysimg.precompile] +execution_file = ["deps/execute.jl"] + +[application] +incremental=true +filter_stdlibs=false + +[application.precompile] +execution_file = ["deps/execute.jl"] \ No newline at end of file diff --git a/deps/execute.jl b/deps/execute.jl new file mode 100644 index 0000000..666bc56 --- /dev/null +++ b/deps/execute.jl @@ -0,0 +1,7 @@ +using TargetedEstimation + +TargetedEstimation.command_main(["-h"]) +TargetedEstimation.command_main(["tmle", "-h"]) +TargetedEstimation.command_main(["make-summary", "-h"]) +TargetedEstimation.command_main(["sieve-variance-plateau", "-h"]) + diff --git a/scripts/merge_summaries.jl b/scripts/merge_summaries.jl deleted file mode 100644 index 34fd604..0000000 --- a/scripts/merge_summaries.jl +++ /dev/null @@ -1,26 +0,0 @@ -using ArgParse -using TargetedEstimation - -function parse_commandline() - s = ArgParseSettings( - description = "Merge files outputs by tmle.jl and sieve_variance.jl in a single file.", - commands_are_required = false) - - @add_arg_table s begin - "tmle-prefix" - help = "Prefix to files output by tmle.jl" - required = true - "out" - help = "Output file to be generated" - required = true - "--sieve-prefix" - help = "Prefix to files output by sieve_variance.jl" - required = false - arg_type = String - end - - return parse_args(s) -end - -parsed_args = parse_commandline() -merge_csv_files(parsed_args) \ No newline at end of file diff --git a/scripts/sieve_variance.jl b/scripts/sieve_variance.jl deleted file mode 100644 index f6a551e..0000000 --- a/scripts/sieve_variance.jl +++ /dev/null @@ -1,41 +0,0 @@ -using TargetedEstimation -using ArgParse - -function parse_commandline() - s = ArgParseSettings(description="Compute the Sieve Variance Plateau estimate for each phenotype in the result file") - - @add_arg_table s begin - "prefix" - help = "Prefix to the .hdf5 files generated by the `tmle.jl` script" - arg_type = String - required = true - "grm-prefix" - arg_type = String - help = "Prefix of the aggregated GRM" - required = true - "out-prefix" - arg_type = String - help = "output filename" - required = true - "--nb-estimators", "-n" - arg_type = Int - help = "Number of variance estimators to compute" - default = 10 - "--max-tau", "-m" - arg_type = Float64 - help = "Maximum distance of individuals to take into account (maximum=2)"* - "It was witnessed that beyond 0.9, weird limit effects happen" - default = 0.8 - "--verbosity", "-v" - arg_type = Int - help = "Verbosity level" - default = 1 - end - - return parse_args(s) -end - - -parsed_args = parse_commandline() - -sieve_variance_plateau(parsed_args) diff --git a/scripts/tmle.jl b/scripts/tmle.jl deleted file mode 100644 index 40df722..0000000 --- a/scripts/tmle.jl +++ /dev/null @@ -1,70 +0,0 @@ -using ArgParse -using TargetedEstimation - -function parse_commandline() - s = ArgParseSettings( - description = "Targeted Learning Estimation", - commands_are_required = false, - version = "0.2", - add_version = true) - - @add_arg_table s begin - "dataset" - help = "Path to dataset file (.csv|.arrow)" - required = true - "estimands-config" - help = "A .yaml file listing all parameters to estimate." - required = true - "--estimators-config" - help = "A file (.jl) defining the estimators to be used." - arg_type= String - required = false - "--hdf5-out" - help = "Stores the results in a HDF5 file format (see also: --pval-threshold)." - arg_type = String - default = nothing - "--csv-out" - help = "Path to an output `.csv` file." - required = true - "--pval-threshold" - help = """In order to save disk space, only estimation results with a p-value lesser than - the threshold will have their influence curve saved. (default = 1., i.e. all influence curves are saved). - """ - default = 1. - arg_type = Float64 - "--sort-estimands" - help = "If estimands should be sorted to minimize memory usage, see also: cache-strategy." - default = false - arg_type = Bool - "--cache-strategy" - help = string("Nuisance functions are stored in the cache during estimation. The cache can be released from these", - " functions to limit memory consumption. There are currently 3 caching management strategies: ", - "'release_unusable' (default): Will release the cache from nuisance functions that won't be used in the future. ", - "'K': Will keep the cache size under K nuisance functions. ", - "'no_cache': Disables caching. ", - "Note that caching strategies are better used in conjunction with `--sort-estimands` to minimized memory usage." - ) - default = "release_unusable" - arg_type = String - "--chunksize" - help = "Results are appended to outfiles in chunks." - default = 100 - arg_type = Int - "--rng" - help = "Random seed" - default = 123 - arg_type = Int - "--verbosity", "-v" - help = "Verbosity level" - arg_type = Int - default = 1 - end - - return parse_args(s) -end - -parsed_args = parse_commandline() - -tmle_estimation(parsed_args) - -