Show a header with the total coverage and coverage table
 @return [Array<String>]
338039
def show_coverage
      unless @project.nil?
        line = "## Code coverage\n"
        line << total_coverage_markdown
        line << modified_files_coverage_table
        line << '> Powered by [Slather](https://github.com/SlatherOrg/slather)'
        markdown line
      end
    end
33534
def coverage_path
      @coverage_path ||= begin
        coverage_path = File.expand_path(coverage_dir, root)
        FileUtils.mkdir_p coverage_path
        coverage_path
      end
    end
741118
def report_sections(self):
    
    # Append to self.sections list

    if len(self.qualimap_bamqc_coverage_hist) > 0:
        # Chew back on histogram to prevent long flat tail
        # (find a sensible max x - lose 1% of longest tail)
        max_x = 0
        total_bases_by_sample = dict()
        for s_name, d in self.qualimap_bamqc_coverage_hist.items():
            total_bases_by_sample[s_name] = sum(d.values())
            cumulative = 0
            for count in sorted(d.keys(), reverse=True):
                cumulative += d[count]
                if cumulative / total_bases_by_sample[s_name] > 0.01:
                    max_x = max(max_x, count)
                    break

        rates_within_threshs = dict()
        for s_name, hist in self.qualimap_bamqc_coverage_hist.items():
            total = total_bases_by_sample[s_name]
            # Make a range of depths that isn't stupidly huge for high coverage expts
            depth_range = list(range(0, max_x + 1, math.ceil(float(max_x)/400.0) if max_x > 0 else 1))
            # Check that we have our specified coverages in the list
            for c in self.covs:
                if int(c) not in depth_range:
                    depth_range.append(int(c))
            # Calculate the coverage rates for this range of coverages
            rates_within_threshs[s_name] = _calculate_bases_within_thresholds(hist, total, depth_range)
            # Add requested coverage levels to the General Statistics table
            for c in self.covs:
                if int(c) in rates_within_threshs[s_name]:
                    self.general_stats_data[s_name]['{}_x_pc'.format(c)] = rates_within_threshs[s_name][int(c)]
                else:
                    self.general_stats_data[s_name]['{}_x_pc'.format(c)] = 0

        # Section 1 - BamQC Coverage Histogram
        coverage_histogram_helptext = '''
        For a set of DNA or RNA reads mapped to a reference sequence, such as a genome
        or transcriptome, the depth of coverage at a given base position is the number
        of high-quality reads that map to the reference at that position
        (<a href="https://doi.org/10.1038/nrg3642" target="_blank">Sims et al. 2014</a>).

        QualiMap groups the bases of a reference sequence by their depth of coverage
        (*0&#215;, 1&#215;, &#8230;, N&#215;*), then plots the number of bases of the
        reference (y-axis) at each level of coverage depth (x-axis). This plot shows
        the frequency of coverage depths relative to the reference sequence for each
        read dataset, which provides an indirect measure of the level and variation of
        coverage depth in the corresponding sequenced sample.

        If reads are randomly distributed across the reference sequence, this plot
        should resemble a Poisson distribution (<a href="https://doi.org/10.1016/0888-7543(88)90007-9"
        target="_blank">Lander & Waterman 1988</a>), with a peak indicating approximate
        depth of coverage, and more uniform coverage depth being reflected in a narrower
        spread. The optimal level of coverage depth depends on the aims of the
        experiment, though it should at minimum be sufficiently high to adequately
        address the biological question; greater uniformity of coverage is generally
        desirable, because it increases breadth of coverage for a given depth of
        coverage, allowing equivalent results to be achieved at a lower sequencing depth
        (<a href="https://doi.org/10.1002/gepi.20575" target="_blank">Sampson
        et al. 2011</a>; <a href="https://doi.org/10.1038/nrg3642" target="_blank">Sims
        et al. 2014</a>). However, it is difficult to achieve uniform coverage
        depth in practice, due to biases introduced during sample preparation
        (<a href="https://doi.org/10.1016/j.yexcr.2014.01.008" target="_blank">van
        Dijk et al. 2014</a>), sequencing (<a href="https://doi.org/10.1186/gb-2013-14-5-r51"
        target="_blank">Ross et al. 2013</a>) and read mapping
        (<a href="https://doi.org/10.1038/nrg3642" target="_blank">Sims et al. 2014</a>).

        This plot may include a small peak for regions of the reference sequence with
        zero depth of coverage. Such regions may be absent from the given sample (due
        to a deletion or structural rearrangement), present in the sample but not
        successfully sequenced (due to bias in sequencing or preparation), or sequenced
        but not successfully mapped to the reference (due to the choice of mapping
        algorithm, the presence of repeat sequences, or mismatches caused by variants
        or sequencing errors). Related factors cause most datasets to contain some
        unmapped reads (<a href="https://doi.org/10.1038/nrg3642" target="_blank">Sims
        et al. 2014</a>).'''
        self.add_section (
            name = 'Coverage histogram',
            anchor = 'qualimap-coverage-histogram',
            description = 'Distribution of the number of locations in the reference genome with a given depth of coverage.',
            helptext = coverage_histogram_helptext,
            plot = linegraph.plot(self.qualimap_bamqc_coverage_hist, {
                'id': 'qualimap_coverage_histogram',
                'title': 'Qualimap BamQC: Coverage histogram',
                'ylab': 'Genome bin counts',
                'xlab': 'Coverage (X)',
                'ymin': 0,
                'xmin': 0,
                'xmax': max_x,
                'xDecimals': False,
                'tt_label': '<b>{point.x}X</b>: {point.y}',
            })
        )
        # Section 2 - BamQC cumulative coverage genome fraction
        genome_fraction_helptext = '''
        For a set of DNA or RNA reads mapped to a reference sequence, such as a genome
        or transcriptome, the depth of coverage at a given base position is the number
        of high-quality reads that map to the reference at that position, while the
        breadth of coverage is the fraction of the reference sequence to which reads
        have been mapped with at least a given depth of coverage
        (<a href="https://doi.org/10.1038/nrg3642" target="_blank">Sims et al. 2014</a>).

        Defining coverage breadth in terms of coverage depth is useful, because
        sequencing experiments typically require a specific minimum depth of coverage
        over the region of interest (<a href="https://doi.org/10.1038/nrg3642"
        target="_blank">Sims et al. 2014</a>), so the extent of the reference sequence
        that is amenable to analysis is constrained to lie within regions that have
        sufficient depth. With inadequate sequencing breadth, it can be difficult to
        distinguish the absence of a biological feature (such as a gene) from a lack
        of data (<a href="https://doi.org/10.1101/gr.7050807" target="_blank">Green 2007</a>).

        For increasing coverage depths (*1&#215;, 2&#215;, &#8230;, N&#215;*),
        QualiMap calculates coverage breadth as the percentage of the reference
        sequence that is covered by at least that number of reads, then plots
        coverage breadth (y-axis) against coverage depth (x-axis). This plot
        shows the relationship between sequencing depth and breadth for each read
        dataset, which can be used to gauge, for example, the likely effect of a
        minimum depth filter on the fraction of a genome available for analysis.'''
        self.add_section (
            name = 'Cumulative genome coverage',
            anchor = 'qualimap-cumulative-genome-fraction-coverage',
            description = 'Percentage of the reference genome with at least the given depth of coverage.',
            helptext = genome_fraction_helptext,
            plot = linegraph.plot(rates_within_threshs, {
                'id': 'qualimap_genome_fraction',
                'title': 'Qualimap BamQC: Genome fraction covered by at least X reads',
                'ylab': 'Fraction of reference (%)',
                'xlab': 'Coverage (X)',
                'ymax': 100,
                'ymin': 0,
                'xmin': 0,
                'xmax': max_x,
                'xDecimals': False,
                'tt_label': '<b>{point.x}X</b>: {point.y:.2f}%',
            })
        )

    # Section 3 - Insert size histogram
    if len(self.qualimap_bamqc_insert_size_hist) > 0:
        insert_size_helptext = '''
        To overcome limitations in the length of DNA or RNA sequencing reads,
        many sequencing instruments can produce two or more shorter reads from
        one longer fragment in which the relative position of reads is
        approximately known, such as paired-end or mate-pair reads
        (<a href="https://doi.org/10.1146/annurev-anchem-062012-092628"
        target="_blank">Mardis 2013</a>). Such techniques can extend the reach
        of sequencing technology, allowing for more accurate placement of reads
        (<a href="https://doi.org/10.1146/annurev-genom-090413-025358"
        target="_blank">Reinert et al. 2015</a>) and better resolution of repeat
        regions (<a href="https://doi.org/10.1146/annurev-genom-090413-025358"
        target="_blank">Reinert et al. 2015</a>), as well as detection of
        structural variation (<a href="https://doi.org/10.1038/nrg2958"
        target="_blank">Alkan et al. 2011</a>) and chimeric transcripts
        (<a href="https://doi.org/10.1073/pnas.0904720106"
        target="_blank">Maher et al. 2009</a>).

        All these methods assume that the approximate size of an insert is known.
        (Insert size can be defined as the length in bases of a sequenced DNA or
        RNA fragment, excluding technical sequences such as adapters, which are
        typically removed before alignment.) This plot allows for that assumption
        to be assessed. With the set of mapped fragments for a given sample, QualiMap
        groups the fragments by insert size, then plots the frequency of mapped
        fragments (y-axis) over a range of insert sizes (x-axis). In an ideal case,
        the distribution of fragment sizes for a sequencing library would culminate
        in a single peak indicating average insert size, with a narrow spread
        indicating highly consistent fragment lengths.

        QualiMap calculates insert sizes as follows: for each fragment in which
        every read mapped successfully to the same reference sequence, it
        extracts the insert size from the `TLEN` field of the leftmost read
        (see the <a href="http://qualimap.bioinfo.cipf.es/doc_html/index.html"
        target="_blank">Qualimap 2 documentation</a>), where the `TLEN` (or
        'observed Template LENgth') field contains 'the number of bases from the
        leftmost mapped base to the rightmost mapped base'
        (<a href="https://samtools.github.io/hts-specs/" target="_blank">SAM
        format specification</a>). Note that because it is defined in terms of
        alignment to a reference sequence, the value of the `TLEN` field may
        differ from the insert size due to factors such as alignment clipping,
        alignment errors, or structural variation or splicing in a gap between
        reads from the same fragment.'''
        self.add_section (
            name = 'Insert size histogram',
            anchor = 'qualimap-insert-size-histogram',
            description = 'Distribution of estimated insert sizes of mapped reads.',
            helptext = insert_size_helptext,
            plot = linegraph.plot(self.qualimap_bamqc_insert_size_hist, {
                'id': 'qualimap_insert_size',
                'title': 'Qualimap BamQC: Insert size histogram',
                'ylab': 'Fraction of reads',
                'xlab': 'Insert Size (bp)',
                'ymin': 0,
                'xmin': 0,
                'tt_label': '<b>{point.x} bp</b>: {point.y}',
            })
        )

    # Section 4 - GC-content distribution
    if len(self.qualimap_bamqc_gc_content_dist) > 0:
        gc_content_helptext = '''
        GC bias is the difference between the guanine-cytosine content
        (GC-content) of a set of sequencing reads and the GC-content of the DNA
        or RNA in the original sample. It is a well-known issue with sequencing
        systems, and may be introduced by PCR amplification, among other factors
        (<a href="https://doi.org/10.1093/nar/gks001" target="_blank">Benjamini
        & Speed 2012</a>; <a href="https://doi.org/10.1186/gb-2013-14-5-r51"
        target="_blank">Ross et al. 2013</a>).

        QualiMap calculates the GC-content of individual mapped reads, then
        groups those reads by their GC-content (*1%, 2%, &#8230;, 100%*), and
        plots the frequency of mapped reads (y-axis) at each level of GC-content
        (x-axis). This plot shows the GC-content distribution of mapped reads
        for each read dataset, which should ideally resemble that of the
        original sample. It can be useful to display the GC-content distribution
        of an appropriate reference sequence for comparison, and QualiMap has an
        option to do this (see the <a href="http://qualimap.bioinfo.cipf.es/doc_html/index.html"
        target="_blank">Qualimap 2 documentation</a>).'''
        extra_series = []
        for i, (species_name, species_data) in enumerate(sorted(self.qualimap_bamqc_gc_by_species.items())):
            extra_series.append({
                'name': species_name,
                'data': list(species_data.items()),
                'dashStyle': 'Dash',
                'lineWidth': 1,
                'color': ['#000000', '#E89191'][i % 2],
            })
        if len(self.qualimap_bamqc_gc_content_dist) == 1:
            desc = 'The solid line represents the distribution of GC content of mapped reads for the sample.'
        else:
            desc = 'Each solid line represents the distribution of GC content of mapped reads for a given sample.'
        lg_config = {
            'id': 'qualimap_gc_content',
            'title': 'Qualimap BamQC: GC content distribution',
            'ylab': 'Fraction of reads',
            'xlab': 'GC content (%)',
            'ymin': 0,
            'xmin': 0,
            'xmax': 100,
            'tt_label': '<b>{point.x}%</b>: {point.y:.3f}'
        }
        if len(extra_series) == 1:
            desc += ' The dotted line represents a pre-calculated GC distribution for the reference genome.'
            lg_config['extra_series'] = extra_series
        elif len(extra_series) > 1:
            desc += ' Each dotted line represents a pre-calculated GC distribution for a specific reference genome.'
            lg_config['extra_series'] = extra_series

        self.add_section (
            name = 'GC content distribution',
            anchor = 'qualimap-gc-distribution',
            description = desc,
            helptext = gc_content_helptext,
            plot = linegraph.plot(self.qualimap_bamqc_gc_content_dist, lg_config)
        )
300391
public function renderTable()
    {
        $header = $this->tableHeaders();
        
        $content = H::table($header, $this->getTableAttributes());
        return $content;
    }
115783
public Content getSummaryTableHeader(String[] header, String scope) {
        Content tr = new HtmlTree(HtmlTag.TR);
        int size = header.length;
        Content tableHeader;
        if (size == 1) {
            tableHeader = new StringContent(header[0]);
            tr.addContent(HtmlTree.TH(HtmlStyle.colOne, scope, tableHeader));
            return tr;
        }
        for (int i = 0; i < size; i++) {
            tableHeader = new StringContent(header[i]);
            if(i == 0)
                tr.addContent(HtmlTree.TH(HtmlStyle.colFirst, scope, tableHeader));
            else if(i == (size - 1))
                tr.addContent(HtmlTree.TH(HtmlStyle.colLast, scope, tableHeader));
            else
                tr.addContent(HtmlTree.TH(scope, tableHeader));
        }
        return tr;
    }
340733
def report(coverage_path, sticky: true)
      if File.exist? coverage_path
        coverage_json = JSON.parse(File.read(coverage_path), symbolize_names: true)
        metrics = coverage_json[:metrics]
        percentage = metrics[:covered_percent]
        lines = metrics[:covered_lines]
        total_lines = metrics[:total_lines]

        formatted_percentage = format('%.02f', percentage)
        message("Code coverage is now at #{formatted_percentage}% (#{lines}/#{total_lines} lines)", sticky: sticky)
      else
        fail('Code coverage data not found')
      end
    end
335275
public function getAvailableHtmlHeadEntrySet()
    {
        $set = parent::getAvailableHtmlHeadEntrySet();

        foreach ($this->children as $child_widget) {
            $set->addEntrySet($child_widget->getAvailableHtmlHeadEntrySet());
        }

        return $set;
    }
1031926
def list
      begin
        @header = [["", ""]]
        # @header = [[set_color("Item", :white), set_color("Total", :white)], [set_color("=================", :white), set_color("=====", :white)]]
        @green = []
        @yellow = []
        @yellow2 = []
        @green2 = []
        @red = []
        @red2 = []
        read_file.each do |key, value|
          if value['total'] > value['min']
            @green += [[key.titlecase,value['total'], value['total']-value['min']]]
          elsif value['total'] == value['min']
            @yellow += [[key.titlecase,value['total'], value['total']-value['min']]]
          else
            @red += [[key.titlecase,value['total'], value['total']-value['min']]]
          end
        end
        @green.sort_by! { |a,b,c| c }
        @yellow.sort_by! { |a,b,c| c }
        @red.sort_by! { |a,b,c| c }
        @green.reverse!
        @yellow.reverse!
        @red.reverse!
        @green.each { |a,b| @green2 += [[set_color(a, :green), set_color(b, :green)]] }
        @yellow.each { |a,b| @yellow2 += [[set_color(a, :yellow), set_color(b, :yellow)]] }
        @red.each { |a,b| @red2 += [[set_color(a, :red), set_color(b, :red)]] }
        print_table(@header + @green2 + @yellow2 + @red2,{indent: 2})
      rescue Exception => e
        puts "Inventory empty"
      end
    end
441860
def show
      @report = Krikri::QAReport.find(params[:id])
      @type = params[:type] == 'count' ? :count : :field

      respond_to do |format|
        format.html
        format.csv { render text: @report.send("#{@type}_csv".to_sym).to_csv }
      end
    end
652560
def header_output(self):
        '''
        '''
        result = []
        for key in self.keys():
            result.append(key + '=' + self.get(key).value)
        return '; '.join(result)
754855
private function getTableHeaders(): array
    {
        $result = [];
        foreach ($this->getDisplayColumns() as $column) {
            $label = $column;
            if (array_key_exists($label, $this->searchableFields)) {
                $label = $this->searchableFields[$label]['label'];
            }

            list($fieldModel, ) = pluginSplit($column);
            if (array_key_exists($fieldModel, $this->associationLabels)) {
                $label .= ' (' . $this->associationLabels[$fieldModel] . ')';
            }

            $result[] = $label;
        }

        return $result;
    }
404427
public function getHtmlHeader(): string
  {
    $ret = Html::generateTag('tr', ['class' => [OverviewTable::$class, 'header']]);
    foreach ($this->slatJoints as $factory)
    {
      $ret .= $factory->getHtmlColumnHeader();
    }
    $ret .= '<th class="error"></th>';
    $ret .= '</tr>';

    if ($this->filter)
    {
      $ret .= Html::generateTag('tr', ['class' => [OverviewTable::$class, 'filter']]);
      foreach ($this->slatJoints as $factory)
      {
        $ret .= $factory->getHtmlColumnFilter();
      }
      $ret .= '<th class="error"></th>';
      $ret .= '</tr>';
    }

    return $ret;
  }
160101
def columns_indeces_to_drop columns
      result = []
      headers = @table[0]
      headers.each_with_index do |header, i|
        result << i unless columns.include? header
      end
      result
    end
1183925
def calculate_header
            headers = []
            height = 0
            @current_groups.each do |field, current_value|
                identifier_field = @sections[:groups][field.to_sym][:settings][:identifier_field] || nil
                value = (!@record.class.reflect_on_association(field).nil? and !identifier_field.nil?) ? @record.send(field.to_sym).send(identifier_field) : @record.send(field)

                if value != current_value
                    reset_groups_values field

                    headers << field.to_sym
                    height += @sections[:groups][field.to_sym][:settings][:height] + @sections[:groups][field.to_sym][:settings][:posY]

                    @current_groups[field] = value
                end
            end unless @current_groups.empty?

            [headers, height]
        end
1303349
def build_header_output
      output = []

      @header.each do |line|
        _data = []
        line.each do |h|
          _data << {:value => h, :color => @style[:header]}
        end
        output << _data
      end
      output
    end
1293796
public List<String> getHeader() {
		if (false == config.containsHeader) {
			throw new IllegalStateException("No header available - header parsing is disabled");
		}
		if (lineNo == 0) {
			throw new IllegalStateException("No header available - call nextRow() first");
		}
		return header.fields;
	}
12867
def show_headers
      mail = with_email_locale { mail_and_body.first }
      render partial: 'rails_email_preview/emails/headers', locals: {mail: mail}
    end