code: def _add_section_to_report(self, data):
      
  
      # Count samples that have errors and/or warnings
      pass_count = error_count = only_warning_count = 0
      for sample_data in data.values():
          if sample_data['file_validation_status'] == 'fail':
              error_count += 1
          elif sample_data['file_validation_status'] == 'warn':
              only_warning_count += 1
          else:
              pass_count += 1
  
      # Add overview note
      plot_html = []
      note_html = _generate_overview_note(
                          pass_count=pass_count,
                          only_warning_count=only_warning_count,
                          error_count=error_count,
                          total_count=len(data)
                      )
      plot_html.append(note_html)
  
      # Add the detailed table, but only if we have something to show
      if error_count or only_warning_count:
          table_html = _generate_detailed_table(data)
          plot_html.append(table_html)
  
      # Finally, add the html to the report as a section
      self.add_section(
              name='SAM/BAM File Validation',
              anchor='picard_validatesamfile',
              description=('This tool reports on the validity of a SAM or BAM '
                           'file relative to the SAM-format specification.'),
              helptext='''
              A detailed table is only shown if errors or warnings are found. Details about the errors and warnings are only shown if a `SUMMARY` report was parsed.
  
              For more information on the warnings, errors and possible fixes please read [this broadinstitute article](https://software.broadinstitute.org/gatk/documentation/article.php?id=7571).''',
              plot="\n".join(plot_html),
      )
docs: Adds found data to the report via several HTML generators