Skip to content

Commit 9b1b239

Browse files
committed
Update tests
1 parent 68e9906 commit 9b1b239

File tree

6 files changed

+35
-6
lines changed

6 files changed

+35
-6
lines changed

tests/test_annotation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class AnnotationTestCase(unittest.TestCase):
1717

1818
def setUp(self):
1919

20-
self.df = combine_peaklist_matrix(to_test_data("peaklist_lcms_pos_theoretical.txt"), to_test_data("dataMatrix_theoretical.txt"))
20+
self.df = combine_peaklist_matrix(to_test_data("peaklist_lcms_pos_theoretical.txt"), to_test_data("dataMatrix_lcms_theoretical.txt"))
2121
self.path, f = os.path.split(os.path.dirname(os.path.abspath(__file__)))
2222

2323
self.lib_isotopes = read_isotopes(os.path.join(self.path, "beams", "data", "isotopes.txt"), "pos")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
mz sample01 sample02 sample03 sample04 sample05 sample06 sample07 sample08 sample09 sample10 sample11 sample12 sample13 sample14 sample15 sample16 sample17 sample18 sample19 sample20 sample21 sample22 sample23 sample24 sample25 sample26 sample27 sample28 sample29 sample30 sample31 sample32 sample33 sample34 sample35 sample36 sample37 sample38 sample39 sample40 sample41 sample42 sample43 sample44 sample45 sample46 sample47 sample48 sample49 sample50
2+
126.9792044 1348.35 1468.50 1348.35 1441.80 1361.70 1428.45 1428.45 1468.50 1455.15 1388.40 1468.50 1468.50 1388.40 1375.05 1428.45 1348.35 1428.45 1428.45 1441.80 1428.45 1375.05 1428.45 1415.10 1468.50 1361.70 1348.35 1388.40 1415.10 1415.10 1361.70 1428.45 1401.75 1428.45 1441.80 1375.05 1468.50 1455.15 1455.15 1388.40 1348.35 1428.45 1468.50 1375.05 1375.05 1415.10 1401.75 1361.70 1361.70 1468.50 1455.15
3+
135.0288014 2606.04 2581.91 2654.30 2606.04 2654.30 2485.39 2509.52 2606.04 2606.04 2654.30 2654.30 2630.17 2557.78 2630.17 2437.13 2606.04 2630.17 2581.91 2606.04 2533.65 2581.91 2581.91 2557.78 2485.39 2485.39 2581.91 2630.17 2509.52 2606.04 2606.04 2461.26 2533.65 2485.39 2485.39 2557.78 2437.13 2630.17 2509.52 2606.04 2533.65 2533.65 2437.13 2630.17 2654.30 2630.17 2485.39 2485.39 2606.04 2461.26 2557.78
4+
139.0001814 3796.58 3907.16 3944.02 3944.02 3870.30 3796.58 3833.44 3907.16 4017.74 3980.88 3907.16 3944.02 3944.02 3796.58 3980.88 3759.72 3870.30 3759.72 3944.02 3870.30 4054.60 4017.74 3796.58 3833.44 4017.74 3833.44 3759.72 3870.30 4054.60 3907.16 3833.44 3980.88 3722.86 3944.02 3870.30 3944.02 3759.72 3907.16 3796.58 3944.02 3944.02 3980.88 3759.72 3722.86 3833.44 3796.58 3907.16 3796.58 3796.58 3833.44
5+
147.0288014 2268.06 2400.18 2268.06 2290.08 2246.04 2312.10 2422.20 2268.06 2246.04 2422.20 2422.20 2224.02 2290.08 2378.16 2400.18 2268.06 2356.14 2290.08 2246.04 2422.20 2422.20 2378.16 2378.16 2290.08 2400.18 2400.18 2334.12 2400.18 2246.04 2312.10 2422.20 2224.02 2400.18 2246.04 2356.14 2268.06 2334.12 2400.18 2290.08 2268.06 2400.18 2400.18 2268.06 2400.18 2400.18 2312.10 2268.06 2334.12 2334.12 2400.18
6+
154.9950964 2296.90 2430.70 2274.60 2319.20 2252.30 2296.90 2252.30 2453.00 2453.00 2252.30 2453.00 2274.60 2408.40 2319.20 2363.80 2430.70 2408.40 2252.30 2341.50 2408.40 2453.00 2319.20 2386.10 2408.40 2341.50 2363.80 2341.50 2296.90 2319.20 2408.40 2386.10 2363.80 2319.20 2252.30 2252.30 2341.50 2453.00 2274.60 2363.80 2341.50 2341.50 2252.30 2252.30 2453.00 2319.20 2430.70 2319.20 2430.70 2319.20 2430.70
7+
156.9897694 1363.74 1457.33 1377.11 1363.74 1417.22 1350.37 1443.96 1417.22 1457.33 1457.33 1430.59 1443.96 1377.11 1443.96 1377.11 1470.70 1403.85 1430.59 1443.96 1363.74 1417.22 1457.33 1470.70 1363.74 1363.74 1457.33 1417.22 1377.11 1403.85 1443.96 1417.22 1377.11 1417.22 1350.37 1443.96 1377.11 1350.37 1350.37 1403.85 1417.22 1377.11 1470.70 1470.70 1350.37 1350.37 1443.96 1443.96 1430.59 1377.11 1363.74
8+
168.9896544 515.00 515.00 525.00 550.00 510.00 505.00 520.00 515.00 525.00 545.00 515.00 525.00 525.00 530.00 540.00 520.00 520.00 510.00 525.00 520.00 540.00 510.00 550.00 520.00 510.00 520.00 505.00 525.00 550.00 530.00 510.00 530.00 510.00 525.00 505.00 510.00 530.00 525.00 510.00 550.00 525.00 545.00 545.00 515.00 520.00 520.00 550.00 520.00 540.00 505.00
9+
336.9720324 1030.00 1030.00 1050.00 1100.00 1020.00 1010.00 1040.00 1030.00 1050.00 1090.00 1030.00 1050.00 1050.00 1060.00 1080.00 1040.00 1040.00 1020.00 1050.00 1040.00 1080.00 1020.00 1100.00 1040.00 1020.00 1040.00 1010.00 1050.00 1100.00 1060.00 1020.00 1060.00 1020.00 1050.00 1010.00 1020.00 1060.00 1050.00 1020.00 1100.00 1050.00 1090.00 1090.00 1030.00 1040.00 1040.00 1100.00 1040.00 1080.00 1010.00
10+
504.9544104 386.25 386.25 393.75 412.50 382.50 378.75 390.00 386.25 393.75 408.75 386.25 393.75 393.75 397.50 405.00 390.00 390.00 382.50 393.75 390.00 405.00 382.50 412.50 390.00 382.50 390.00 378.75 393.75 412.50 397.50 382.50 397.50 382.50 393.75 378.75 382.50 397.50 393.75 382.50 412.50 393.75 408.75 408.75 386.25 390.00 390.00 412.50 390.00 405.00 378.75
11+
197.0056614 5160.61 5160.61 4919.46 4967.69 4919.46 5112.38 5208.84 5112.38 5160.61 5160.61 5015.92 5257.07 5112.38 5208.84 5064.15 4871.23 5305.30 5112.38 5160.61 5160.61 5112.38 4871.23 4919.46 5160.61 5015.92 5257.07 5015.92 4967.69 4967.69 5305.30 4967.69 5160.61 5208.84 4967.69 5112.38 5305.30 4967.69 5208.84 5015.92 5160.61 5208.84 4919.46 5257.07 4967.69 4871.23 5160.61 5112.38 4967.69 5257.07 5305.30
12+
213.0005764 974.65 1013.25 984.30 1061.50 1061.50 974.65 1032.55 1032.55 1051.85 1042.20 1022.90 1061.50 1003.60 984.30 1051.85 1003.60 1042.20 1013.25 984.30 1061.50 1061.50 993.95 1003.60 1042.20 1003.60 1051.85 984.30 1013.25 1051.85 984.30 1042.20 1032.55 974.65 1051.85 1013.25 984.30 993.95 1003.60 1042.20 974.65 1003.60 984.30 1032.55 1032.55 1051.85 993.95 1061.50 1042.20 984.30 1042.20
13+
215.0162264 3859.80 3786.28 3970.08 3823.04 4006.84 3823.04 3970.08 4006.84 3859.80 3896.56 3749.52 3749.52 3786.28 3970.08 3823.04 3859.80 3970.08 3933.32 3970.08 3823.04 3970.08 3896.56 3823.04 3712.76 4006.84 3712.76 3970.08 3823.04 4006.84 3896.56 3823.04 3896.56 3970.08 3786.28 3712.76 3712.76 3970.08 3859.80 3933.32 3786.28 3786.28 3786.28 3970.08 3712.76 3749.52 3712.76 4006.84 4043.60 3859.80 3933.32
14+
230.9901644 1929.90 1893.14 1985.04 1911.52 2003.42 1911.52 1985.04 2003.42 1929.90 1948.28 1874.76 1874.76 1893.14 1985.04 1911.52 1929.90 1985.04 1966.66 1985.04 1911.52 1985.04 1948.28 1911.52 1856.38 2003.42 1856.38 1985.04 1911.52 2003.42 1948.28 1911.52 1948.28 1985.04 1893.14 1856.38 1856.38 1985.04 1929.90 1966.66 1893.14 1893.14 1893.14 1985.04 1856.38 1874.76 1856.38 2003.42 2021.80 1929.90 1966.66
15+
426.0522504 1144.50 1155.40 1199.00 1122.70 1155.40 1133.60 1122.70 1188.10 1111.80 1144.50 1133.60 1133.60 1166.30 1166.30 1144.50 1166.30 1122.70 1166.30 1155.40 1177.20 1155.40 1144.50 1199.00 1177.20 1100.90 1133.60 1177.20 1144.50 1177.20 1177.20 1122.70 1100.90 1177.20 1177.20 1166.30 1111.80 1177.20 1199.00 1144.50 1122.70 1100.90 1111.80 1122.70 1188.10 1144.50 1111.80 1144.50 1199.00 1177.20 1155.40
16+
492.0604104 1080.00 1100.00 1090.00 1060.00 1100.00 1070.00 1090.00 1030.00 1080.00 1050.00 1070.00 1060.00 1040.00 1100.00 1080.00 1100.00 1100.00 1090.00 1020.00 1060.00 1050.00 1080.00 1020.00 1060.00 1100.00 1040.00 1040.00 1030.00 1020.00 1030.00 1060.00 1010.00 1100.00 1030.00 1090.00 1090.00 1060.00 1050.00 1060.00 1060.00 1090.00 1060.00 1080.00 1080.00 1080.00 1030.00 1070.00 1040.00 1060.00 1060.00
17+
493.0637654 166.41 169.49 167.95 163.33 169.49 164.87 167.95 158.71 166.41 161.79 164.87 163.33 160.25 169.49 166.41 169.49 169.49 167.95 157.16 163.33 161.79 166.41 157.16 163.33 169.49 160.25 160.25 158.71 157.16 158.71 163.33 155.62 169.49 158.71 167.95 167.95 163.33 161.79 163.33 163.33 167.95 163.33 166.41 166.41 166.41 158.71 164.87 160.25 163.33 163.33
18+
550.0658904 4766.30 4506.32 4419.66 4549.65 4722.97 4376.33 4462.99 4419.66 4549.65 4636.31 4376.33 4679.64 4722.97 4376.33 4549.65 4679.64 4376.33 4722.97 4679.64 4462.99 4766.30 4766.30 4766.30 4419.66 4506.32 4636.31 4419.66 4766.30 4419.66 4592.98 4506.32 4766.30 4462.99 4419.66 4549.65 4766.30 4679.64 4419.66 4766.30 4549.65 4592.98 4376.33 4419.66 4419.66 4592.98 4549.65 4766.30 4636.31 4636.31 4462.99
File renamed without changes.

tests/test_grouping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class GroupFeaturesTestCase(unittest.TestCase):
1212

1313
def setUp(self):
14-
self.df = combine_peaklist_matrix(to_test_data("peaklist_lcms_pos_theoretical.txt"), to_test_data("dataMatrix_theoretical.txt"))
14+
self.df = combine_peaklist_matrix(to_test_data("peaklist_lcms_pos_theoretical.txt"), to_test_data("dataMatrix_lcms_theoretical.txt"))
1515

1616
def test_group_features(self):
1717
fn_sql = "results_pearson.sqlite"

tests/test_in_out.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,28 +55,39 @@ def test_read_peaklist(self):
5555
self.assertEqual(self.df_peaklist["intensity"].iloc[-1], 4549.65)
5656

5757
def test_combine_peaklist_matrix(self):
58-
df = combine_peaklist_matrix(to_test_data("peaklist_lcms_pos_theoretical.txt"), to_test_data("dataMatrix_theoretical.txt"))
58+
df = combine_peaklist_matrix(to_test_data("peaklist_lcms_pos_theoretical.txt"), to_test_data("dataMatrix_lcms_theoretical.txt"))
5959

6060
self.assertEqual(df["name"].iloc[0], "M127T60")
6161
self.assertEqual(df["name"].iloc[-1], "M550T200")
6262

6363
self.assertEqual(df["mz"].iloc[0], 126.9792044)
64-
self.assertEqual(df["mz"].iloc[-1], np.float64(550.0658904))
64+
self.assertEqual(df["mz"].iloc[-1], 550.0658904)
6565

6666
self.assertEqual(df["rt"].iloc[0], 60)
6767
self.assertEqual(df["rt"].iloc[-1], 200)
6868

6969
self.assertEqual(df["intensity"].iloc[0], 1421.775)
7070
self.assertEqual(df["intensity"].iloc[-1], 4549.65)
7171

72+
df = combine_peaklist_matrix(to_test_data("peaklist_dims_pos_theoretical.txt"), to_test_data("dataMatrix_dims_theoretical.txt"))
73+
74+
self.assertEqual(df["name"].iloc[0], "126_9792044")
75+
self.assertEqual(df["name"].iloc[-1], "550_0658904")
76+
77+
self.assertEqual(df["mz"].iloc[0], 126.9792044)
78+
self.assertEqual(df["mz"].iloc[-1], 550.0658904)
79+
80+
self.assertEqual(df["intensity"].iloc[0], 1421.78)
81+
self.assertEqual(df["intensity"].iloc[-1], 4549.65)
82+
7283
def test_read_xset_matrix(self):
7384
df = read_xset_matrix(to_test_data("xset_matrix.txt"), "sample01")
7485

7586
self.assertEqual(df["name"].iloc[0], "M127T60")
7687
self.assertEqual(df["name"].iloc[-1], "M550T200")
7788

7889
np.testing.assert_almost_equal(df["mz"].iloc[0], 126.9792044, 8)
79-
np.testing.assert_almost_equal(df["mz"].iloc[-1], np.float64(550.0658904), 8)
90+
np.testing.assert_almost_equal(df["mz"].iloc[-1], 550.0658904, 8)
8091

8192
self.assertEqual(df["rt"].iloc[0], 60)
8293
self.assertEqual(df["rt"].iloc[-1], 200)

tests/test_statistics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class StatisticsTestCase(unittest.TestCase):
1515

1616
def setUp(self):
17-
self.df = combine_peaklist_matrix(to_test_data("peaklist_lcms_pos_theoretical.txt"), to_test_data("dataMatrix_theoretical.txt"))
17+
self.df = combine_peaklist_matrix(to_test_data("peaklist_lcms_pos_theoretical.txt"), to_test_data("dataMatrix_lcms_theoretical.txt"))
1818

1919
def test_correlation_coefficients(self):
2020
df_coeffs_comp = pd.DataFrame({"name_a": ["M169T120", "M169T120", "M337T121", "M215T170", "M492T190"],

0 commit comments

Comments
 (0)