From 21da08cd47b339ee27164dc791e3c4e1c1501b4d Mon Sep 17 00:00:00 2001 From: Olivier Labayle Date: Fri, 12 Jan 2024 18:14:47 +0000 Subject: [PATCH] update syntax for interaction --- src/tmle_inputs/allele_independent_estimands.jl | 6 +++--- test/data/interaction_config.yaml | 2 +- test/tmle_inputs/allele_independent_estimands.jl | 10 +++++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/tmle_inputs/allele_independent_estimands.jl b/src/tmle_inputs/allele_independent_estimands.jl index 3c891e5..7507734 100644 --- a/src/tmle_inputs/allele_independent_estimands.jl +++ b/src/tmle_inputs/allele_independent_estimands.jl @@ -37,7 +37,7 @@ function generate_treatments_combinations(treatments_lists, orders) return sort(treatment_combinations) end -function generate_interactions!(batch_saver, dataset, variants_config, outcomes, confounders; +function generate_iates!(batch_saver, dataset, variants_config, outcomes, confounders; extra_treatments=[], outcome_extra_covariates=[], positivity_constraint=0., @@ -101,9 +101,9 @@ function allele_independent_estimands(parsed_args) # Estimands for estimand_type in config["estimands"] - if estimand_type == "interactions" + if estimand_type == "IATE" orders = config["orders"] - generate_interactions!(batch_saver, dataset, variants_config, outcomes, confounders; + generate_iates!(batch_saver, dataset, variants_config, outcomes, confounders; extra_treatments=extra_treatments, outcome_extra_covariates=outcome_extra_covariates, positivity_constraint=positivity_constraint, diff --git a/test/data/interaction_config.yaml b/test/data/interaction_config.yaml index c735346..e47807b 100644 --- a/test/data/interaction_config.yaml +++ b/test/data/interaction_config.yaml @@ -1,6 +1,6 @@ orders: [2, 3] estimands: - - interactions + - IATE variants: TF1: bQTLs: diff --git a/test/tmle_inputs/allele_independent_estimands.jl b/test/tmle_inputs/allele_independent_estimands.jl index aa69d41..10f4b1d 100644 --- a/test/tmle_inputs/allele_independent_estimands.jl +++ b/test/tmle_inputs/allele_independent_estimands.jl @@ -15,7 +15,15 @@ include(joinpath(TESTDIR, "tmle_inputs", "test_utils.jl")) [:RSID_1, :RSID_2], [:RSID_3, :RSID_4], [:RSID_5], - ] + ] + order_1 = TargeneCore.generate_treatments_combinations(treatments_list, [1]) + @test order_1 == [ + (:RSID_1,), + (:RSID_2,), + (:RSID_3,), + (:RSID_4,), + (:RSID_5,) + ] order_2 = TargeneCore.generate_treatments_combinations(treatments_list, [2]) @test order_2 == [ (:RSID_1, :RSID_3),