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


            // 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):
Italian Trulli
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: NifTK/NiftyNet
Commit Name: baecce5a6fbe4576ca8348a93dc56f07e7ba84f6
Time: 2019-06-05
Author: ucabtmv@ucl.ac.uk
File Name: niftynet/contrib/csv_reader/csv_reader.py
Class Name: CSVReader
Method Name: _parse_csv


Project Name: dhlab-epfl/dhSegment
Commit Name: 0bc52fa5ea260e3c52f57cb7b217e54ee6cbaf40
Time: 2018-03-07
Author: sofia.oliveiraares@epfl.ch
File Name: doc_seg/post_processing/segmentation.py
Class Name:
Method Name: diva_post_processing_fn