-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconftest.py
108 lines (94 loc) · 2.97 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import pandas as pd
import pytest
from snakemake.io import Namedlist
@pytest.fixture
def config():
"""
dict containing configuration data for run
"""
res = {
"genome-build": "grch100",
"genomes": {
"grch99": {"confident-regions": {"reg1": "file1", "reg2": "file2"}},
"grch100": {
"confident-regions": {"reg3": "file3", "reg4": "file4"},
"stratification-regions": {
"ftp": "ftp://target",
"dir": "ftpdir",
"all-stratifications": "vWhatever.all-stratifications.tsv",
"region-labels": "fake-file.tsv",
"region-inclusions": {"*": ".*", "name1": ".*", "name2": ".*"},
},
},
},
}
return res
@pytest.fixture
def label_df():
"""
pandas DataFrame of mapping between GA4GH-style stratification
set names and their plaintext, human-legible descriptions
"""
res = pd.DataFrame(
{
"name": ["*", "name1", "name2", "name3"],
"label": ["everybody", "some1", "some2", "some3"],
}
).set_index("name", drop=False)
return res
@pytest.fixture
def manifest_comparisons():
"""
pandas DataFrame of configured requested comparisons
between experimental and reference datasets
"""
res = pd.DataFrame(
{
"experimental_dataset": ["exp1", "exp1", "exp2", "exp2"],
"reference_dataset": ["ref1", "ref2", "ref1", "ref2"],
"report": ["comp2", "comp2,comp1", "comp3", "comp3,comp1"],
}
)
return res
@pytest.fixture
def manifest_experiment():
"""
pandas DataFrame of configured experimental vcf files
with replicate and unique identifier
"""
res = pd.DataFrame(
{
"happy-bedfiles-for-stratification": 3,
"experimental_dataset": ["exp1", "exp2", "exp3"],
"replicate": ["rep1", "rep1", "rep2"],
"vcf": ["dummy/path1.vcf.gz", "dummy/path2.vcf.gz", "path/to/exp_filename.vcf.gz"],
}
).set_index("experimental_dataset", drop=False)
return res
@pytest.fixture
def manifest_reference():
"""
pandas DataFrame of configured reference vcf files
with unique identifier
"""
res = pd.DataFrame(
{
"reference_dataset": ["ref1", "ref2", "ref3"],
"vcf": ["dummy/path3.vcf.gz", "path/to/ref_filename.vcf.gz", "dummy/path4.vcf.gz"],
}
).set_index("reference_dataset", drop=False)
return res
@pytest.fixture
def wildcards_for_report():
"""
Namedlist containing wildcards present in
Rmd report generation rule
"""
return Namedlist(fromdict={"comparison": "comp2", "region": "back1"})
@pytest.fixture
def wildcards_comparison():
"""
Namedlist containing wildcards present for
a rule that needs to map from unique identifier to vcf
"""
return Namedlist(fromdict={"reference": "ref2", "experimental": "exp3"})