-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from TARGENE/brh_data_source
Compatibility with custom dataset
- Loading branch information
Showing
21 changed files
with
652 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
params { | ||
PARAMETER_PLAN = "FROM_ACTORS" | ||
PARAMETER_FILE = "test/data/parameters/parameters.yaml" | ||
DECRYPTED_DATASET = "test/data/traits.csv" | ||
COHORT = "CUSTOM" | ||
BED_FILES = "test/data/unphased_bed/ukb_chr{1,2,3}.{bed,bim,fam}" | ||
BGEN_FILES = "test/data/unphased_bgen/ukb_chr{1,2,3}.{bgen,bgen.bgi,sample}" | ||
NB_PCS = 6 | ||
TRAITS_CONFIG = "test/data/ukbconfig_small.yaml" | ||
ESTIMATORFILE = "test/data/estimator.jl" | ||
NB_VAR_ESTIMATORS = 10 | ||
PVAL_THRESHOLD = 1 | ||
BQTLS = "test/data/actors/bqtls_multiple_TFs.csv" | ||
TRANS_ACTORS = "test/data/actors/eqtls_multiple_TFs.csv" | ||
ORDERS = "1,2" | ||
POSITIVITY_CONSTRAINT = 0.01 | ||
GRM_NSPLITS = 10 | ||
BATCH_SIZE = 400 | ||
MAX_PERMUTATION_TESTS = 100 | ||
MAF_MATCHING_RELTOL = 0.9 | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
5 44000000 51500000 r1 | ||
6 25000000 33500000 r2 | ||
8 8000000 12000000 r3 | ||
11 45000000 57000000 r4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
5 43999898 52204166 r1 | ||
6 24999772 33532223 r2 | ||
8 8142478 12142491 r3 | ||
11 44978449 57232526 r4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# "local" profile assumes singularity is installed | ||
args = length(ARGS) > 0 ? ARGS : ["-profile", "local", "-resume"] | ||
|
||
include("utils.jl") | ||
|
||
@testset "Test custom_from_actors.config" begin | ||
cmd = `nextflow run main.nf -c conf/ci_jobs/custom_from_actors.config $args` | ||
@info string("The following command will be run:\n", cmd) | ||
|
||
r = run(cmd) | ||
@test r.exitcode == 0 | ||
|
||
output = CSV.read(joinpath("results", "summary.csv"), DataFrame) | ||
dataset = DataFrame(Arrow.Table(joinpath("results", "tmle_inputs", "final.data.arrow"))) | ||
bQTLs = Symbol.(CSV.read(joinpath("test", "data", "actors", "bqtls.csv"), DataFrame).ID) | ||
|
||
@test names(output) == vcat(SUMMARY_COLUMNS, SIEVE_COLUMNS, ADJUTMENT_COL) | ||
# 2 bQTLs and 1 trans-actor | ||
@test Set(unique(output.TREATMENTS)) == Set(["1:238411180:T:C", "3:3502414:T:C", "1:238411180:T:C_&_2:14983:G:A", "3:3502414:T:C_&_2:14983:G:A"]) | ||
|
||
test_n_success_more_than_threshold(output, 20) | ||
|
||
# Here we test that the process generateIIDGenotypes has been run once for each chromosome | ||
n_chr_files = filter(x -> startswith(x, "LDpruned.filtered.ukb_chr"), readdir(joinpath("results","ld_pruned_chromosomes"))) | ||
# There should be 4 files for each chromosome | ||
@test length(n_chr_files) == 4*3 | ||
|
||
## Checking parameter files correspond to either bQTL only or bQTL/eQTL | ||
parameters_tf1 = parameters_from_yaml(joinpath("results", "parameters", "final.TF1.param_1.yaml")) | ||
parameters_tf2 = parameters_from_yaml(joinpath("results", "parameters", "final.TF2.param_1.yaml")) | ||
@test size(parameters_tf1, 1) == 296 | ||
@test size(parameters_tf2, 1) == 148 | ||
for Ψ in vcat(parameters_tf1, parameters_tf2) | ||
@test keys(Ψ.treatment)[1] ∈ bQTLs | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ID,TF | ||
"1:238411180:T:C",TF1 | ||
"3:3502414:T:C",TF2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ID,TF | ||
"2:14983:G:A",TF1 | ||
"2:14983:G:A",TF2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
5 44000000 51500000 r1 | ||
6 25000000 33500000 r2 | ||
8 8000000 12000000 r3 | ||
11 45000000 57000000 r4 | ||
11 45000000 57000000 r4 |
Oops, something went wrong.