testthat::test_that('ASV table can be cleaned with cleanASVs', {
testthat::expect_identical(
cleanASVs(data.frame('domain'=c('NA',
'A_1','A_1','A_1','A_1','A_1','A_1','A_1'),
'phylum'=c('',
'NA',
'B_2','B_2','B_2','B_2','B_2','B_2'),
'class'=c('Incertae_Sedis',
'NA','NA',
'C_3','C_3','C_3','C_3','C_3'),
'order'=c('D_4',
'NA','NA','NA',
'D_4','D_4','D_4','D_4'),
'family'=c('NA',
'NA','NA','NA','NA',
'E_5','E_5','E_5'),
'genus'=c('F_6',
'NA','NA','NA','NA','NA',
'F_6','F_6'),
'species'=c('G_7',
'NA','NA','NA',
'NA','NA','NA',
'G_7'),
row.names = c('NA;;Incertae_Sedis;D_4;NA;F_6;G_7',
'A_1;NA;NA;NA;NA;NA;NA',
'A_1;B_2;NA;NA;NA;NA;NA',
'A_1;B_2;C_3;NA;NA;NA;NA',
'A_1;B_2;C_3;D_4;NA;NA;NA',
'A_1;B_2;C_3;D_4;E_5;NA;NA',
'A_1;B_2;C_3;D_4;E_5;F_6;NA',
'A_1;B_2;C_3;D_4;E_5;F_6;G_7'))),
data.frame('domain'=c('unidentified_domain',
'A_1','A_1','A_1','A_1','A_1','A_1','A_1'),
'phylum'=c('unidentified_domain_phylum',
'd_A_1_phylum',
'B_2','B_2','B_2','B_2','B_2','B_2'),
'class'=c('unidentified_domain_class',
'd_A_1_class','p_B_2_class',
'C_3','C_3','C_3','C_3','C_3'),
'order'=c('D_4',
'd_A_1_order','p_B_2_order','c_C_3_order',
'D_4','D_4','D_4','D_4'),
'family'=c('o_D_4_family',
'd_A_1_family','p_B_2_family','c_C_3_family','o_D_4_family',
'E_5','E_5','E_5'),
'genus'=c('F_6',
'd_A_1_genus','p_B_2_genus','c_C_3_genus','o_D_4_genus','f_E_5_genus',
'F_6','F_6'),
'species'=c('F_6_G_7',
'd_A_1_species','p_B_2_species','c_C_3_species',
'o_D_4_species','f_E_5_species','g_F_6_species',
'F_6_G_7'),
row.names = c('NA;;Incertae_Sedis;D_4;NA;F_6;G_7',
'A_1;NA;NA;NA;NA;NA;NA',
'A_1;B_2;NA;NA;NA;NA;NA',
'A_1;B_2;C_3;NA;NA;NA;NA',
'A_1;B_2;C_3;D_4;NA;NA;NA',
'A_1;B_2;C_3;D_4;E_5;NA;NA',
'A_1;B_2;C_3;D_4;E_5;F_6;NA',
'A_1;B_2;C_3;D_4;E_5;F_6;G_7')))
})
testthat::test_that('ASV table can be made from prepended taxa names', {
invisible(capture.output(
testthat::expect_identical(makeASVtab(c('NA;;Incertae_Sedis;D_4;NA;F_6;G_7',
'k__A-1_k',
'A 1;p__B:2_p',
'A/1;B[_2;c__C]_3_c',
'A(1;B)_2;C_3;o__D_4_o',
'A_1;B_2;C_3;D_4;f__E_5_f',
'A_1;B_2;C_3;D_4;E_5;g__F_6_g',
'A_1;B_2;C_3;D_4;E_5;F_6;s__G_7_s')),
data.frame('domain'=c('unidentified_domain',
'A_1','A_1','A_1','A_1','A_1','A_1','A_1'),
'phylum'=c('unidentified_domain_phylum',
'd_A_1_phylum',
'B_2','B_2','B_2','B_2','B_2','B_2'),
'class'=c('unidentified_domain_class',
'd_A_1_class','p_B_2_class',
'C_3','C_3','C_3','C_3','C_3'),
'order'=c('D_4',
'd_A_1_order','p_B_2_order','c_C_3_order',
'D_4','D_4','D_4','D_4'),
'family'=c('o_D_4_family',
'd_A_1_family','p_B_2_family','c_C_3_family','o_D_4_family',
'E_5','E_5','E_5'),
'genus'=c('F_6',
'd_A_1_genus','p_B_2_genus','c_C_3_genus','o_D_4_genus','f_E_5_genus',
'F_6','F_6'),
'species'=c('F_6_G_7',
'd_A_1_species','p_B_2_species','c_C_3_species',
'o_D_4_species','f_E_5_species','g_F_6_species',
'F_6_G_7'),
row.names = c('NA;;Incertae_Sedis;D_4;NA;F_6;G_7',
'A_1;NA;NA;NA;NA;NA;NA',
'A_1;B_2;NA;NA;NA;NA;NA',
'A_1;B_2;C_3;NA;NA;NA;NA',
'A_1;B_2;C_3;D_4;NA;NA;NA',
'A_1;B_2;C_3;D_4;E_5;NA;NA',
'A_1;B_2;C_3;D_4;E_5;F_6;NA',
'A_1;B_2;C_3;D_4;E_5;F_6;G_7')))))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.