@@ -46,7 +46,7 @@ test_that("Observation proportions", {
46
46
47
47
result <- calc_obs_props(x , " tax_data" , cols = 4 : 6 )
48
48
expect_equal(col_subset , colnames(result )[- 1 ])
49
-
49
+
50
50
result <- calc_obs_props(x , " tax_data" ,
51
51
cols = startsWith(colnames(x $ data $ tax_data ), " 70001" ))
52
52
expect_equal(colnames(x $ data $ tax_data )[startsWith(colnames(x $ data $ tax_data ), " 70001" )],
@@ -58,12 +58,12 @@ test_that("Observation proportions", {
58
58
59
59
# Inlcuding specific columns in output
60
60
result <- calc_obs_props(x , " tax_data" , cols = col_subset ,
61
- other_cols = 2 : 3 )
61
+ other_cols = 2 : 3 )
62
62
expect_true(all(c(" otu_id" , " lineage" ) %in% colnames(result )))
63
63
64
64
# Rename output columns
65
65
result <- calc_obs_props(x , " tax_data" , cols = col_subset ,
66
- out_names = c(" a" , " b" , " c" ))
66
+ out_names = c(" a" , " b" , " c" ))
67
67
expect_equal(colnames(result ), c(" taxon_id" , " a" , " b" , " c" ))
68
68
69
69
})
@@ -77,7 +77,7 @@ test_that("Summing counts per taxon", {
77
77
# Calculate the taxon abundance for a subset of columns
78
78
expect_equal(calc_taxon_abund(x , " tax_data" , cols = 4 : 5 ),
79
79
calc_taxon_abund(x , " tax_data" , cols = c(" 700035949" , " 700097855" )))
80
-
80
+
81
81
# Calculate the taxon abundance for groups of columns (e.g. treatments)
82
82
# Note that we do not need to use the "cols" option for this since all
83
83
# numeric columns are samples in this dataset. If there were numeric columns
@@ -108,8 +108,8 @@ test_that("Comparing groups of samples", {
108
108
109
109
# Calculate difference between groups
110
110
expect_warning(x $ data $ diff_table <- compare_treatments(x , dataset = " tax_table" ,
111
- cols = hmp_samples $ sample_id ,
112
- groups = hmp_samples $ body_site ))
111
+ cols = hmp_samples $ sample_id ,
112
+ groups = hmp_samples $ body_site ))
113
113
expect_equal(nrow(x $ data $ diff_table ),
114
114
ncol(combn(length(unique(hmp_samples $ body_site )), 2 )) * nrow(x $ data $ tax_table ))
115
115
0 commit comments