494c8eca414b05627815a00ec6c5563fb83e2a5c,anvio/scgtaxonomyops.py,SCGTaxonomyEstimator,get_consensus_taxonomy,#SCGTaxonomyEstimator#Any#,433
Before Change
max_frequency = tax_hash_df.frequency.max()
tax_hash_df_most_frequent = tax_hash_df[tax_hash_df.frequency == max_frequency]
if len(tax_hash_df_most_frequent.index) == 1:
// if there is only a single winner, we"re golden
winner_tax_hash = tax_hash_df_most_frequent.tax_hash[0]
else:
// if there are competing hashes, we need to be more careful to decide
// which taxonomic level should we use to cut things off.
raise ConfigError("You"ve hit some uncharted area")
// get the consensus hit based on the winner hash
consensus_hit = df[df.tax_hash == winner_tax_hash].head(1)
// turn it into a Python dict before returning
consensus_hit = consensus_hit.to_dict("records")[0]
After Change
// if there are competing hashes, we need to be more careful to decide
// which taxonomic level should we use to cut things off.
consensus_hit = {}
for level in self.levels_of_taxonomy[::-1]:
if len(df[level].unique()) > 1:
consensus_hit[level] = None
else:
consensus_hit[level] = df[level].unique()[0]
return consensus_hit
def print_scg_taxonomy_hits_in_splits(self, hits, bin_name=None):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: merenlab/anvio
Commit Name: 494c8eca414b05627815a00ec6c5563fb83e2a5c
Time: 2019-10-08
Author: a.murat.eren@gmail.com
File Name: anvio/scgtaxonomyops.py
Class Name: SCGTaxonomyEstimator
Method Name: get_consensus_taxonomy
Project Name: deepmipt/DeepPavlov
Commit Name: 5390c650dadd1e86b6c43543ac0ed384e8ebfc4d
Time: 2018-05-15
Author: yoptar@gmail.com
File Name: deeppavlov/core/models/keras_model.py
Class Name: KerasModel
Method Name: save
Project Name: merenlab/anvio
Commit Name: 612101fcd9c9ac4077281860041e1a8cb92e5401
Time: 2019-10-17
Author: alon.shaiber@gmail.com
File Name: anvio/dbops.py
Class Name:
Method Name: add_items_order_to_db