-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_SampleSheet.py
75 lines (62 loc) · 2.93 KB
/
test_SampleSheet.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
from SampleSheet import SampleSheet, convert_SI_barcodes
import pytest
def test_mixed_10X_barcodes():
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/MICHELLE_0543_10X_MIXED.csv")
ss_list = x.split_sample_sheet()
if "OverrideCycles" in ss_list[1].df_ss_header.astype(str):
assert(False)
print(ss_list[2].df_ss_header)
def test_only_10XSI_barcodes():
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/SampleSheet_10X_SI.csv")
print("Calling split sample sheet.")
ss_list = x.split_sample_sheet()
print("After split sample sheet.")
print(ss_list[0].df_ss_data.to_string())
assert(len(ss_list) == 1)
def test_read_10X_sample_sheet():
samplesheet = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/SampleSheet_10X_SI.csv")
corrected = convert_SI_barcodes(samplesheet)
print(corrected.df_ss_data.to_string())
assert(len(corrected.df_ss_data) == 16)
def test_read_empty_sample_sheet():
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/empty_sample_sheet.csv")
print("Success")
def test_read_blank_sample_sheet():
with pytest.raises(Exception):
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/blank_sample_sheet.csv")
def test_read_SE_sample_sheet():
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/SampleSheet_PEPE.csv")
print("Success")
def test_WGS_only_not_split():
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/DIANA_0434.csv")
ss_list = x.split_sample_sheet()
assert(len(ss_list) == 1)
def test_barcode_read_lengths():
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/SampleSheet.csv")
assert (x.read_lengths[0] == 151)
assert (x.read_lengths[1] == 151)
def test_recipe_set():
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/SampleSheet.csv")
assert ("DLP" in x.recipe_set)
def test_barcode_list():
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/SampleSheet.csv")
assert ("AAGGACATAACCCCGT" in x.barcode_list)
def test_split():
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/SampleSheet_DLP.csv")
ss_list = x.split_sample_sheet()
path0 = ss_list[0].path
path1 = ss_list[1].path
path2 = ss_list[2].path
path3 = ss_list[3].path
assert(path0.endswith("_REFERENCE.csv"))
assert(path1.endswith(".csv"))
assert(path2.endswith("DLP.csv") or path3.endswith("_DLP.csv"))
assert("Lane" in ss_list[2].df_ss_data.columns)
assert(path2.endswith("10X.csv") or path3.endswith("_10X.csv"))
assert(len(ss_list) == 4)
# Test when a sample sheet is only DLP lane information is removed and it is demuxed with "NoLaneSplitting" option in the sample sheet
def test_only_DLP_split():
x = SampleSheet("/home/runner/work/igo-demux/igo-demux/test/MICHELLE_420_ONLY_DLP.csv")
ss_list = x.split_sample_sheet()
assert(len(ss_list) == 1)
assert("Lane" in ss_list[0].df_ss_data.columns)