diff --git a/netbone/__init__.py b/netbone/__init__.py index 2bd9d8a08c605490ad5201b9c5ee765a2d55b5e5..512ff1fcc3e635615778d11f090be83cea5e12aa 100644 --- a/netbone/__init__.py +++ b/netbone/__init__.py @@ -26,6 +26,7 @@ from netbone.structural.mlam import mlam from netbone.structural.gspar import gspar from netbone.structural.degree import degree from netbone.structural.betweenness import betweenness +from netbone.structural.mad import mad # from netbone.statistical.correlation_and_statistic import correlation_and_statistic from netbone.filters import threshold_filter, fraction_filter diff --git a/netbone/compare.py b/netbone/compare.py index bf04168cc7f2ceb42b159e97d6236af702a22750..bd631f6cc9022424ce208ff5fa59afa253a7cf2c 100644 --- a/netbone/compare.py +++ b/netbone/compare.py @@ -97,7 +97,7 @@ class Compare: raise Exception('Please enter the filter values.') cons = [] if consent == False: - for backbon in self.backbones: + for backbone in self.backbones: cons.append(False) consent = cons diff --git a/netbone/structural/global_threshold.py b/netbone/structural/global_threshold.py index bf3da7ea2c19c3b39743dc0fa3d69424752ed1c5..2a4d151d9ddb8f67afa819cc8465b392b92b8193 100644 --- a/netbone/structural/global_threshold.py +++ b/netbone/structural/global_threshold.py @@ -7,15 +7,11 @@ from netbone.filters import fraction_filter, threshold_filter def global_threshold(data): if isinstance(data, DataFrame): - table = data.copy() + g = nx.from_pandas_edgelist(data, edge_attr=edge_properties(data)) elif isinstance(data, Graph): - table = nx.to_pandas_edgelist(data) + g = data.copy() else: print("data should be a panads dataframe or nx graph") return - table['score'] = table['weight'] - - g = nx.from_pandas_edgelist(table, edge_attr=edge_properties(table)) - - return Backbone(g, method_name="Global Threshold Filter", property_name="score", ascending=False, compatible_filters=[fraction_filter, threshold_filter], filter_on='Edges') \ No newline at end of file + return Backbone(g, method_name="Global Threshold Filter", property_name="weight", ascending=False, compatible_filters=[fraction_filter, threshold_filter], filter_on='Edges') \ No newline at end of file