Take the parsed stats from the Bismark reports and add them to the
        basic stats table at the top of the report
323461
def bismark_stats_table(self):
        

        headers = {
            'alignment': OrderedDict(),
            'dedup': OrderedDict(),
            'methextract': OrderedDict(),
            'bam2nuc': OrderedDict()
        }
        headers['methextract']['percent_cpg_meth'] = {
            'title': '% mCpG',
            'description': '% Cytosines methylated in CpG context',
            'max': 100,
            'min': 0,
            'suffix': '%',
            'scale': 'Greens'
        }
        headers['methextract']['percent_chg_meth'] = {
            'title': '% mCHG',
            'description': '% Cytosines methylated in CHG context',
            'max': 100,
            'min': 0,
            'suffix': '%',
            'scale': 'Oranges'
        }
        headers['methextract']['percent_chh_meth'] = {
            'title': '% mCHH',
            'description': '% Cytosines methylated in CHH context',
            'max': 100,
            'min': 0,
            'suffix': '%',
            'scale': 'Oranges'
        }
        headers['methextract']['total_c'] = {
            'title': "M C's",
            'description': 'Total number of C\'s analysed, in millions',
            'min': 0,
            'scale': 'Purples',
            'modify': lambda x: x / 1000000
        }
        headers['bam2nuc']['C_coverage'] = {
            'title': 'C Coverage',
            'description': 'Cyotosine Coverage',
            'min': 0,
            'suffix': 'X',
            'scale': 'Greens',
            'format': '{:,.2f}'
        }
        headers['dedup']['dup_reads_percent'] = {
            'title': '% Dups',
            'description': 'Percent Duplicated Alignments',
            'max': 100,
            'min': 0,
            'suffix': '%',
            'scale': 'RdYlGn-rev',
        }
        headers['dedup']['dedup_reads'] = {
            'title': '{} Unique'.format(config.read_count_prefix),
            'description': 'Deduplicated Alignments ({})'.format(config.read_count_desc),
            'min': 0,
            'scale': 'Greens',
            'modify': lambda x: x * config.read_count_multiplier,
            'shared_key': 'read_count',
            'hidden': True
        }
        headers['alignment']['aligned_reads'] = {
            'title': '{} Aligned'.format(config.read_count_prefix),
            'description': 'Total Aligned Sequences ({})'.format(config.read_count_desc),
            'min': 0,
            'scale': 'PuRd',
            'modify': lambda x: x * config.read_count_multiplier,
            'shared_key': 'read_count',
            'hidden': True
        }
        headers['alignment']['percent_aligned'] = {
            'title': '% Aligned',
            'description': 'Percent Aligned Sequences',
            'max': 100,
            'min': 0,
            'suffix': '%',
            'scale': 'YlGn'
        }

        self.general_stats_addcols(self.bismark_data['methextract'], headers['methextract'])
        self.general_stats_addcols(self.bismark_data['bam2nuc'], headers['bam2nuc'])
        self.general_stats_addcols(self.bismark_data['dedup'], headers['dedup'])
        self.general_stats_addcols(self.bismark_data['alignment'], headers['alignment'])
955113
def build_stats(counts):
    """"""
    stats = {
        'status': 0,
        'reportnum': counts['reportnum'],
        'title': counts['title'],
        'author': counts['auth_group'],
        'url': counts['url'],
        'doi': counts['doi'],
        'misc': counts['misc'],
    }
    stats_str = "%(status)s-%(reportnum)s-%(title)s-%(author)s-%(url)s-%(doi)s-%(misc)s" % stats
    stats["old_stats_str"] = stats_str
    stats["date"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    stats["version"] = version
    return stats
198339
def add_quality_score_vs_no_of_observations_section(self):
        

        sample_data = []
        data_labels = []
        for rt_type_name, rt_type in recal_table_type._asdict().items():
            sample_tables = self.gatk_base_recalibrator[rt_type]['quality_quantization_map']
            if len(sample_tables) == 0:
                continue

            sample_data.append({
                sample: {int(x): int(y) for x, y in zip(table['QualityScore'], table['Count'])}
                for sample, table in sample_tables.items()
            })

            sample_y_sums = {
                sample: sum(int(y) for y in table['Count'])
                for sample, table
                in sample_tables.items()
            }

            sample_data.append({
                sample: {
                    int(x): float(y) / sample_y_sums[sample]
                    for x, y in zip(table['QualityScore'], table['Count'])
                }
                for sample, table in sample_tables.items()
            })

            flat_proportions = [float(y) / sample_y_sums[sample]
                                for sample, table in sample_tables.items()
                                for y in table['Count']]
            prop_ymax = max(flat_proportions)
            data_labels.append({'name': "{} Count".format(rt_type_name.capitalize().replace('_', '-')),
                                'ylab': 'Count'})
            data_labels.append({'ymax': prop_ymax,
                                'name': "{} Percent".format(rt_type_name.capitalize().replace('_', '-')),
                                'ylab': 'Percent'})

        plot = linegraph.plot(
            sample_data,
            pconfig={
                'title': "Observed Quality Score Counts",
                'id': 'gatk-base-recalibrator-quality-score-vs-number-of-observations',
                'xlab': 'Observed Quality Score',
                'ylab': 'Count',
                'xDecimals': False,
                'data_labels': data_labels,
            })

        # Reported vs empirical quality scores
        self.add_section(
            name='Observed Quality Scores',
            description=(
                'This plot shows the distribution of base quality scores in each sample before and '
                'after base quality score recalibration (BQSR). Applying BQSR should broaden the '
                'distribution of base quality scores.'
            ),
            helptext=(
                'For more information see '
                '[the Broad\'s description of BQSR]'
                '(https://gatkforums.broadinstitute.org/gatk/discussion/44/base-quality-score-recalibration-bqsr)'
                '.'
            ),
            plot=plot,
        )
1232148
def parse_reports(parent_module):
    

    # get data
    data = collect_data(parent_module)

    # Filter to strip out ignored sample names
    data = parent_module.ignore_samples(data)

    # Reference data in parent module
    parent_module.picard_variantCalling_data = data

    if len(data) > 0:
        derive_data(data)

        # Write parsed data to a file
        parent_module.write_data_file(data, 'multiqc_picard_varientCalling')

        parent_module.general_stats_headers['DBSNP_TITV'] = {
            'title': 'TiTV ratio (known)',
            'description': "The Transition/Transversion ratio of the passing bi-allelic SNP calls made at SNP-database sites.",
            'min': 0,
            'scale': 'Blues',
            'shared_key': 'titv_ratio'
        }

        parent_module.general_stats_headers['NOVEL_TITV'] = {
            'title': 'TiTV ratio (novel)',
            'description': "The Transition/Transversion ratio of the passing bi-allelic SNP calls made at non-SNP-database sites.",
            'min': 0,
            'scale': 'Blues',
            'shared_key': 'titv_ratio'
        }

        parent_module.general_stats_headers['DBSNP_INS_DEL_RATIO'] = {
            'title': 'InDel ratio (known)',
            'description': "The Insertion / Deletion ratio of the passing bi-allelic SNP calls made at SNP-database sites.",
            'min': 0,
            'scale': 'Greens',
            'shared_key': 'indel_ratio',
            'hidden': True,
        }

        parent_module.general_stats_headers['NOVEL_INS_DEL_RATIO'] = {
            'title': 'InDel ratio (novel)',
            'description': "The Insertion / Deletion ratio of the passing bi-allelic SNP calls made at non-SNP-database sites.",
            'min': 0,
            'scale': 'Greens',
            'shared_key': 'indel_ratio',
            'hidden': True,
        }


        parent_module.general_stats_headers['total_called_variants_known'] = {
            'title': 'Called Variants (known)',
            'description': "Total counts of variants in SNP-database sites.",
            'shared_key': 'variant_count',
            'min': 0,
            'format': '{0:,.0f}',
            'hidden': True,
        }

        parent_module.general_stats_headers['total_called_variants_novel'] = {
            'title': 'Called Variants (novel)',
            'description': "Total counts of variants in non-SNP-database sites.",
            'shared_key': 'variant_count',
            'min': 0,
            'format': '{0:,.0f}',
            'hidden': True,
        }

        for s_name in data:
            if s_name not in parent_module.general_stats_data:
                parent_module.general_stats_data[s_name] = dict()
            parent_module.general_stats_data[s_name].update(data[s_name])


        # Variant Counts Bargraph
        parent_module.add_section(
            name='Variant Types',
            anchor='picard-variants-types',
            description='Variants that have been called, looking at variant types. Optionally filtered on label.',
            helptext="""
            Only passing variants are shown (i.e. non-filtered).\n
            SNPs are bi-allelic.\n
            Complex InDels are both an insertion and a deletion.
            """,
            plot=compare_variant_type_plot(data)
        )

        # Variant Counts Table
        parent_module.add_section(
            name='Variant Labels',
            anchor='picard-variants-labels',
            description='Variants that have been called, comparing with known variant sites.',
            helptext="""
            Only passing variants are shown (i.e. non-filtered).\n
            Variants contain bi-allelic SNPs, multi-allelic SNPs, simple and complex inserts and deletions.
            """,
            plot=compare_variants_label_plot(data)
        )

    return len(data)
404189
def merge_stats(self, other_col_counters):
        
        for column_name, _ in self._column_stats.items():
            self._column_stats[column_name] = self._column_stats[column_name] \
                .mergeStats(other_col_counters._column_stats[column_name])
        return self
806211
def make_statistics_information(info):
  """"""
  if not info.splits.total_num_examples:
    # That means that we have yet to calculate the statistics for this.
    return "None computed"

  stats = [(info.splits.total_num_examples, "ALL")]
  for split_name, split_info in info.splits.items():
    stats.append((split_info.num_examples, split_name.upper()))
  # Sort reverse on number of examples.
  stats.sort(reverse=True)
  stats = "\n".join([
      "{0:10} | {1:>10,}".format(name, num_exs) for (num_exs, name) in stats
  ])
  return STATISTICS_TABLE.format(split_statistics=stats)
402391
def add_stats_plot(self):
        """"""

        keys = OrderedDict()
        keys['species_a'] = {'color': '#437bb1', 'name': 'Species a'}
        keys['species_b'] = {'color': '#b1084c', 'name': 'Species b'}
        keys['ambiguous'] = {'color': '#333333', 'name': 'Ambiguous'}

        plot_config = {
            'id': "disambiguated_alignments",
            'title': "Disambiguate: Alignment Counts",
            'cpswitch_counts_label': "# Reads",
            'ylab': "# Reads"
        }

        self.add_section(
            plot=bargraph.plot(self.data, keys, plot_config)
        )
903611
def parse_reports(self):
    

    # Set up vars
    self.picard_GCbias_data = dict()
    self.picard_GCbiasSummary_data = dict()

    # Go through logs and find Metrics
    for f in self.find_log_files('picard/gcbias', filehandles=True):
        s_name = None
        gc_col = None
        cov_col = None
        for l in f['f']:
            # New log starting
            if 'GcBiasMetrics' in l and 'INPUT' in l:
                s_name = None

                # Pull sample name from input
                fn_search = re.search(r"INPUT(?:=|\s+)(\[?[^\s]+\]?)", l, flags=re.IGNORECASE)
                if fn_search:
                    s_name = os.path.basename(fn_search.group(1).strip('[]'))
                    s_name = self.clean_s_name(s_name, f['root'])

            if s_name is not None:
                if gc_col is not None and cov_col is not None :
                    try:
                        # Note that GC isn't always the first column.
                        s = l.strip("\n").split("\t")
                        self.picard_GCbias_data[s_name][ int(s[gc_col]) ] = float(s[cov_col])
                    except IndexError:
                        s_name = None
                        gc_col = None
                        cov_col = None

                if 'GcBiasDetailMetrics' in l and '## METRICS CLASS' in l:
                    if s_name in self.picard_GCbias_data:
                        log.debug("Duplicate sample name found in {}! Overwriting: {}".format(f['fn'], s_name))
                    self.add_data_source(f, s_name, section='GcBiasDetailMetrics')
                    self.picard_GCbias_data[s_name] = dict()
                    # Get header - find columns with the data we want
                    l = f['f'].readline()
                    s = l.strip("\n").split("\t")
                    gc_col = s.index('GC')
                    cov_col = s.index('NORMALIZED_COVERAGE')

                if 'GcBiasSummaryMetrics' in l and '## METRICS CLASS' in l:
                    if s_name in self.picard_GCbias_data:
                        log.debug("Duplicate sample name found in {}! Overwriting: {}".format(f['fn'], s_name))
                    self.add_data_source(f, s_name, section='GcBiasSummaryMetrics')
                    self.picard_GCbiasSummary_data[s_name] = dict()

                    keys = f['f'].readline().rstrip("\n").split("\t")
                    vals = f['f'].readline().rstrip("\n").split("\t")
                    for i, k in enumerate(keys):
                        try:
                            self.picard_GCbiasSummary_data[s_name][k] = float(vals[i])
                        except ValueError:
                            self.picard_GCbiasSummary_data[s_name][k] = vals[i]


        for s_name in list(self.picard_GCbias_data.keys()):
            if len(self.picard_GCbias_data[s_name]) == 0:
                self.picard_GCbias_data.pop(s_name, None)
                log.debug("Removing {} as no data parsed".format(s_name))

        for s_name in list(self.picard_GCbiasSummary_data.keys()):
            if len(self.picard_GCbiasSummary_data[s_name]) == 0:
                self.picard_GCbiasSummary_data.pop(s_name, None)
                log.debug("Removing {} as no data parsed".format(s_name))


    # Filter to strip out ignored sample names
    self.picard_GCbias_data = self.ignore_samples(self.picard_GCbias_data)

    if len(self.picard_GCbias_data) > 0:

        # Plot the graph

        pconfig = {
            'id': 'picard_gcbias_plot',
            'title': 'Picard: GC Coverage Bias',
            'ylab': 'Normalized Coverage',
            'xlab': '% GC',
            'xmin': 0,
            'xmax': 100,
            'xDecimals': False,
            'ymin': 0,
            'yCeiling': 10,
            'tt_label': '<b>{point.x} %GC</b>: {point.y:.2f}',
            'yPlotLines': [
                {'value': 1, 'color': '#999999', 'width': 2, 'dashStyle': 'LongDash'},
            ]
        }
        self.add_section (
            name = 'GC Coverage Bias',
            anchor = 'picard-gcbias',
            description = 'This plot shows bias in coverage across regions of the genome with varying GC content.'\
                ' A perfect library would be a flat line at <code>y = 1</code>.',
            plot = linegraph.plot(self.picard_GCbias_data, pconfig)
        )

    if len(self.picard_GCbiasSummary_data) > 0:
        # Write parsed summary data to a file
        self.write_data_file(self.picard_GCbiasSummary_data, 'multiqc_picard_gcbias')


    # Return the number of detected samples to the parent module
    return len(self.picard_GCbias_data)
145300
def set_stats(self, run_stats):
        
        self.stats = run_stats.copy()
        self.stats['files'] = ', '.join(self.stats['files'])
        self.stats['tot_files'] = len(run_stats['files'])
        self.stats['extra_tags'] = ', '.join(self.stats['extra_tags'])
794645
def add_stats(self, args):
        """"""
        bg_name, stats = args
        logger.debug("Stats: %s %s", bg_name, stats)
        
        for motif_id in stats.keys():
            if motif_id not in self.stats:
                self.stats[motif_id] = {}
        
            self.stats[motif_id][bg_name] = stats[motif_id]
639923
def insert_infocontent_data(germanet_db):
    '''
    
    '''
    gnet           = germanet.GermaNet(germanet_db)
    # use add one smoothing
    gn_counts      = defaultdict(lambda: 1.)
    total_count    = 1
    input_file     = gzip.open(os.path.join(os.path.dirname(__file__),
                                            WORD_COUNT_FILE))
    num_lines_read = 0
    num_lines      = 0
    for line in input_file:
        line       = line.decode('utf-8').strip().split('\t')
        num_lines += 1
        if len(line) != 3:
            continue
        count, pos, word = line
        num_lines_read += 1
        count           = int(count)
        synsets         = set(gnet.synsets(word, pos))
        if not synsets:
            continue
        # Although Resnik (1995) suggests dividing count by the number
        # of synsets, Patwardhan et al (2003) argue against doing
        # this.
        count = float(count) / len(synsets)
        for synset in synsets:
            total_count += count
            paths = synset.hypernym_paths
            scount = float(count) / len(paths)
            for path in paths:
                for ss in path:
                    gn_counts[ss._id] += scount
    print('Read {0} of {1} lines from count file.'.format(num_lines_read,
                                                          num_lines))
    print('Recorded counts for {0} synsets.'.format(len(gn_counts)))
    print('Total count is {0}'.format(total_count))
    input_file.close()
    # update all the synset records in GermaNet
    num_updates = 0
    for synset in germanet_db.synsets.find():
        synset['infocont'] = gn_counts[synset['_id']] / total_count
        germanet_db.synsets.save(synset)
        num_updates += 1
    print('Updated {0} synsets.'.format(num_updates))
852617
def _populate_basic_data(mfg_event, record):
  """"""
  # TODO:
  #   * Missing in proto: set run name from metadata.
  #   * `part_tags` field on proto is unused
  #   * `timings` field on proto is unused.
  #   * Handle arbitrary units as uom_code/uom_suffix.

  # Populate non-repeated fields.
  mfg_event.dut_serial = record.dut_id
  mfg_event.start_time_ms = record.start_time_millis
  mfg_event.end_time_ms = record.end_time_millis
  mfg_event.tester_name = record.station_id
  mfg_event.test_name = record.metadata.get('test_name') or record.station_id
  mfg_event.test_status = test_runs_converter.OUTCOME_MAP[record.outcome]
  mfg_event.operator_name = record.metadata.get('operator_name', '')
  mfg_event.test_version = str(record.metadata.get('test_version', ''))
  mfg_event.test_description = record.metadata.get('test_description', '')

  # Populate part_tags.
  mfg_event.part_tags.extend(record.metadata.get('part_tags', []))

  # Populate phases.
  for phase in record.phases:
    mfg_phase = mfg_event.phases.add()
    mfg_phase.name = phase.name
    mfg_phase.description = phase.codeinfo.sourcecode
    mfg_phase.timing.start_time_millis = phase.start_time_millis
    mfg_phase.timing.end_time_millis = phase.end_time_millis

  # Populate failure codes.
  for details in record.outcome_details:
    failure_code = mfg_event.failure_codes.add()
    failure_code.code = details.code
    failure_code.details = details.description

  # Populate test logs.
  for log_record in record.log_records:
    test_log = mfg_event.test_logs.add()
    test_log.timestamp_millis = log_record.timestamp_millis
    test_log.log_message = log_record.message
    test_log.logger_name = log_record.logger_name
    test_log.levelno = log_record.level
    if log_record.level <= logging.DEBUG:
      test_log.level = test_runs_pb2.TestRunLogMessage.DEBUG
    elif log_record.level <= logging.INFO:
      test_log.level = test_runs_pb2.TestRunLogMessage.INFO
    elif log_record.level <= logging.WARNING:
      test_log.level = test_runs_pb2.TestRunLogMessage.WARNING
    elif log_record.level <= logging.ERROR:
      test_log.level = test_runs_pb2.TestRunLogMessage.ERROR
    elif log_record.level <= logging.CRITICAL:
      test_log.level = test_runs_pb2.TestRunLogMessage.CRITICAL
    test_log.log_source = log_record.source
    test_log.lineno = log_record.lineno
1043879
private void addStatsForSplitType(
      SplitType splitType, long splitSize, long hostCount, long blockCount) {
    SplitTypeStats splitTypeStats = splitTypeStatsMap.get(splitType);
    if (splitTypeStats == null) {
      splitTypeStats = new SplitTypeStats();
      splitTypeStatsMap.put(splitType, splitTypeStats);
    }
    splitTypeStats.addSplit(splitSize, hostCount, blockCount);

    // Add all splits to the ALL split type
    if (splitType != SplitType.ALL) {
      addStatsForSplitType(SplitType.ALL, splitSize, hostCount, blockCount);
    }
  }
113777
protected void addSubreportsToGroups() {
        for (Integer groupNum : groupFooterSubreports.keySet()) {
            List<Subreport> list = groupFooterSubreports.get(groupNum);
            DJGroup group = report.getColumnsGroups().get(groupNum - 1);
            group.getFooterSubreports().addAll(list);
        }

        for (Integer groupNum : groupHeaderSubreports.keySet()) {
            List<Subreport> list = groupHeaderSubreports.get(groupNum);
            DJGroup group = report.getColumnsGroups().get(groupNum - 1);
            group.getHeaderSubreports().addAll(list);
        }

    }
1104377
def parse_reports(self):
    

    # Set up vars
    self.picard_baseDistributionByCycle_data = dict()
    self.picard_baseDistributionByCycle_samplestats = dict()

    # Go through logs and find Metrics
    base_dist_files = self.find_log_files('picard/basedistributionbycycle', filehandles=True)

    for f in base_dist_files:
        try:
            lines = iter(f['f'])

            # read through the header of the file to obtain the
            # sample name
            clean_fn = lambda n: self.clean_s_name(n, f['root'])
            s_name = read_sample_name(lines, clean_fn)
            assert s_name is not None

            # pull out the data
            data = read_base_distrib_data(lines)
            assert data is not None

            # data should be a hierarchical dict
            # data[read_end][cycle]
            assert not (set(data) - set([1, 2]))

            # set up the set of s_names
            if 2 in set(data):
                s_names = {
                    1:"%s_R1" % s_name,
                    2:"%s_R2" % s_name
                }
            else:
                s_names = { 1:s_name }

            previously_used = (
                set(s_names.values())&set(self.picard_baseDistributionByCycle_data)
            )

            if previously_used:
                for duped_name in previously_used:
                    log.debug(
                        "Duplicate sample name found in {}! "
                        "Overwriting: {}".format(f['fn'], duped_name)
                    )
            for name in s_names.values():
                self.add_data_source(f, name, section='BaseDistributionByCycle')

            for read_end in s_names:
                data_by_cycle = data[read_end]
                s_name = s_names[read_end]
                self.picard_baseDistributionByCycle_data[s_name] = data_by_cycle
                samplestats = {
                    'sum_pct_a':0,
                    'sum_pct_c':0,
                    'sum_pct_g':0,
                    'sum_pct_t':0,
                    'sum_pct_n':0,
                    'cycle_count':0,
                }
                self.picard_baseDistributionByCycle_samplestats[s_name] = samplestats
                for c, row in data_by_cycle.items():
                    pct_a, pct_c, pct_g, pct_t, pct_n = row
                    samplestats['sum_pct_a'] += pct_a
                    samplestats['sum_pct_c'] += pct_c
                    samplestats['sum_pct_g'] += pct_g
                    samplestats['sum_pct_t'] += pct_t
                    samplestats['sum_pct_n'] += pct_n
                samplestats['cycle_count'] += len(data_by_cycle.keys())
        except AssertionError:
            pass

    # Calculate summed mean values for all read orientations
    for s_name, v in self.picard_baseDistributionByCycle_samplestats.items():
        v['mean_pct_a'] = v['sum_pct_a'] / v['cycle_count']
        v['mean_pct_c'] = v['sum_pct_c'] / v['cycle_count']
        v['mean_pct_g'] = v['sum_pct_g'] / v['cycle_count']
        v['mean_pct_t'] = v['sum_pct_t'] / v['cycle_count']

    # Filter to strip out ignored sample names
    self.picard_baseDistributionByCycle_data = self.ignore_samples(self.picard_baseDistributionByCycle_data)

    if len(self.picard_baseDistributionByCycle_data) > 0:

        # Write parsed data to a file
        self.write_data_file(self.picard_baseDistributionByCycle_samplestats, 'multiqc_picard_baseContent')

        # Plot the data and add section
        pconfig = {
            'id': 'picard_base_distribution_by_cycle',
            'title': 'Picard: Base Distribution',
            'ylab': '%',
            'xlab': 'Cycle #',
            'xDecimals': False,
            'tt_label': '<b>cycle {point.x}</b>: {point.y:.2f} %',
            'ymax': 100,
            'ymin': 0,
            'data_labels': [
                {'name': '% Adenine', 'ylab': '% Adenine'},
                {'name': '% Cytosine', 'ylab': '% Cytosine'},
                {'name': '% Guanine', 'ylab': '% Guanine'},
                {'name': '% Thymine', 'ylab': '% Thymine'},
                {'name': '% Undetermined', 'ylab': '% Undetermined'},
            ]
        }

        # build list of linegraphs
        linegraph_data = [{}, {}, {}, {}, {}]
        for s_name, cycles in self.picard_baseDistributionByCycle_data.items():
            reformat_items = lambda n: {
                cycle : tup[n] for cycle, tup in cycles.items()
            }
            for lg, index in zip(linegraph_data, range(5)):
                lg[s_name] = reformat_items(index)

        self.add_section (
            name = 'Base Distribution',
            anchor = 'picard-base-distribution-by-cycle',
            description = 'Plot shows the distribution of bases by cycle.',
            plot = linegraph.plot(linegraph_data, pconfig)
        )


    # Return the number of detected samples to the parent module
    return len(self.picard_baseDistributionByCycle_data)
1228128
def add_summaries(self, step, *tags_and_values):
    """"""
    values = []
    to_print = []
    for tag, value in tags_and_values:
      values.append(tf.Summary.Value(tag=tag, simple_value=float(value)))
      to_print.append('%s=%g' % (tag, value))
    if self._summary_writer:
      summary = tf.Summary(value=values)
      event = tf.Event(wall_time=time.time(),
                       summary=summary,
                       step=int(step))
      self._summary_writer.add_event(event)
    print('[%d] %s' % (step, ', '.join(to_print)))
409014
function combineStatsAndIndexes(done, results) {
  var indexes = results.getIndexes;
  var stats = results.getIndexStats;
  var sizes = results.getIndexSizes;
  _.each(indexes, function(idx, i) {
    _.assign(indexes[i], stats[idx.name]);
    _.assign(indexes[i], sizes[idx.name]);
  });
  done(null, indexes);
}