Skip to content

Commit f3743db

Browse files
committed
Merge branch 'Enhancement-ImprovedSnakemakeFunctionality' of https://github.com/clemente-lab/mmeds-meta into Enhancement-ImprovedSnakemakeFunctionality
2 parents baf9f64 + c12a32d commit f3743db

3 files changed

Lines changed: 17 additions & 13 deletions

File tree

mmeds/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,10 @@
437437
TEST_CODE_LEFSE = 'lefsetable'
438438
TEST_FORMAT_HUMANN_MAPPING = str(TEST_PATH / 'test_qiime_mapping_file_format_to_humann.tsv')
439439
TEST_FORMAT_HUMANN_TABLE = str(TEST_PATH / 'test_BRITE_pathways_stratified_format_to_humann.tsv')
440-
TEST_FORMAT_HUMANN_RESULT = str(TEST_PATH / 'test_taxa_table_L7_format_to_lefse.tsv')
440+
TEST_FORMAT_HUMANN_RESULT = str(TEST_PATH / 'test_formatted_humann_table.tsv')
441441
TEST_FORMAT_LEFSE_MAPPING = str(TEST_PATH / 'test_qiime_mapping_file_format_to_lefse.tsv')
442442
TEST_FORMAT_LEFSE_TABLE = str(TEST_PATH / 'test_taxa_table_L7_format_to_lefse.tsv')
443-
TEST_FORMAT_LEFSE_RESULT = str(TEST_PATH / 'test_taxa_table_L7_format_to_lefse.tsv')
443+
TEST_FORMAT_LEFSE_RESULT = str(TEST_PATH / 'test_formatted_lefse_table.tsv')
444444
TEST_MIXS = str(TEST_PATH / 'test_MIxS.tsv')
445445
TEST_MIXS_MMEDS = str(TEST_PATH / 'MIxS_metadata.tsv')
446446
TEST_OTU = str(TEST_PATH / 'test_otu_table.txt')

mmeds/tests/unit/test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ def setup_tests(tests):
4646
'Test_Single_Short',
4747
testing,
4848
fig.TEST_CODE_SHORT))
49+
test_setup.append((fig.TEST_SUBJECT_SHORT,
50+
'human',
51+
fig.TEST_SPECIMEN_PAIRED,
52+
fig.TEST_USER,
53+
'Test_Paired',
54+
testing,
55+
fig.TEST_CODE_PAIRED))
4956
if 'tools' in tests or 'analysis' in tests:
50-
test_setup.append((fig.TEST_SUBJECT_SHORT,
51-
'human',
52-
fig.TEST_SPECIMEN_PAIRED,
53-
fig.TEST_USER,
54-
'Test_Paired',
55-
testing,
56-
fig.TEST_CODE_PAIRED))
5757
test_setup.append((fig.TEST_SUBJECT_SHORT,
5858
'human',
5959
fig.TEST_SPECIMEN_DEMUXED,

mmeds/tests/unit/test_util.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,9 @@ def test_q_metadata_concat_and_split(self):
293293
entries = {'Test_Single_Short': ['L6S93', 'L6S95'],
294294
'Test_Paired': ['L6S98', 'L6S99']}
295295
paths = {'Test_Single_Short':
296-
'/home/runner/mmeds_server_data/studies/testuser_Test_Single_Short_0/full_metadata.tsv',
296+
Path(fig.DATABASE_DIR) / "studies" / "testuser_Test_Single_Short_0" / "full_metadata.tsv",
297297
'Test_Paired':
298-
'/home/runner/mmeds_server_data/studies/testuser_Test_Paired_0/full_metadata.tsv'}
298+
Path(fig.DATABASE_DIR) / "studies" / "testuser_Test_Paired_0" / "full_metadata.tsv"}
299299

300300
df = util.concatenate_metadata_subsets(entries, paths)
301301
subj_df, spec_df = util.split_metadata(df, 'human', new_study_name="New_Test_Study")
@@ -313,7 +313,6 @@ def test_r_format_to_lefse(self):
313313
# Assert created file is equal to test example
314314
self.assertTrue(filecmp.cmp(test_true_result, test_out_result, shallow=False))
315315

316-
317316
def test_s_format_to_humann(self):
318317
""" Test converting to format readable for humann_barplot functions """
319318
tmpdir = Path(gettempdir())
@@ -322,7 +321,12 @@ def test_s_format_to_humann(self):
322321
test_true_result = fig.TEST_FORMAT_HUMANN_RESULT
323322
test_out_result = tmpdir / "test_humann_format_out.tsv"
324323

325-
util.format_table_to_humann(test_table, test_map, ["Stage", "MASLDstatus"], test_out_result, True, True)
324+
util.format_table_to_humann(test_table, test_map, ["MASLDstatus", "Stage"], test_out_result, True, True)
325+
326+
with open(test_out_result, "r") as f1, open(test_true_result, "r") as f2:
327+
for r1, r2 in zip(f1, f2):
328+
if r1 != r2:
329+
print(f"{r1}\nIS NOT EQUAL TO\n{r2}")
326330

327331
# Assert created file is equal to test example
328332
self.assertTrue(filecmp.cmp(test_true_result, test_out_result, shallow=False))

0 commit comments

Comments
 (0)