Example #1
0
def test_unifrac_beta_diversity_clean_2():
    """test function to check that metadata and PC results were merged/both present in output"""
    unifrac_metadata_to_plot=unifrac_beta_diversity_clean('../data')
    if 'body-site' and 'PC1' in unifrac_metadata_to_plot.columns:
        result = 1
    else:
        result = 0
    assert result == 1, "dataframe merge issues: missing metadata OR PC1"
Example #2
0
def test_unifrac_beta_diversity_clean_4():
    """test function to check that beta diversity metric PCOA analyses are not identical"""
    bray_metadata_to_plot = bray_beta_diversity_clean('../data')
    unifrac_metadata_to_plot = unifrac_beta_diversity_clean('../data')
    false = bray_metadata_to_plot.iloc[1,
                                       9] == unifrac_metadata_to_plot.iloc[1,
                                                                           9]
    assert false == False, "bray curtis equals weighted unifrac"
Example #3
0
def test_unifrac_beta_diversity_clean_3():
    """test function to check that the metadata is the same between both beta diversity functions"""
    bray_metadata_to_plot=bray_beta_diversity_clean('../data')
    unifrac_metadata_to_plot=unifrac_beta_diversity_clean('../data')
    assert unifrac_metadata_to_plot['body-site'].all() == bray_metadata_to_plot['body-site'].all()
Example #4
0
def test_unifrac_beta_diversity_clean_1():
    """test function to check output is of type pandas dataframe"""
    unifrac_metadata_to_plot=unifrac_beta_diversity_clean('../data')
    assert isinstance(unifrac_metadata_to_plot,pd.core.frame.DataFrame),"not returning df"