code: def parse_gc_dist(self, f):
      
      # Get the sample name from the parent parent directory
      # Typical path: <sample name>/raw_data_qualimapReport/mapped_reads_gc-content_distribution.txt
      s_name = self.get_s_name(f)
  
      d = dict()
      reference_species = None
      reference_d = dict()
      avg_gc = 0
      for l in f['f']:
          if l.startswith('#'):
              sections = l.strip("\n").split("\t", 3)
              if len(sections) > 2:
                  reference_species = sections[2]
              continue
          sections = l.strip("\n").split("\t", 3)
          gc = int(round(float(sections[0])))
          content = float(sections[1])
          avg_gc += gc * content
          d[gc] = content
          if len(sections) > 2:
              reference_content = float(sections[2])
              reference_d[gc] = reference_content
  
      # Add average GC to the general stats table
      self.general_stats_data[s_name]['avg_gc'] = avg_gc
  
      # Save results
      if s_name in self.qualimap_bamqc_gc_content_dist:
          log.debug("Duplicate Mapped Reads GC content distribution sample name found! Overwriting: {}".format(s_name))
      self.qualimap_bamqc_gc_content_dist[s_name] = d
      if reference_species and reference_species not in self.qualimap_bamqc_gc_by_species:
          self.qualimap_bamqc_gc_by_species[reference_species] = reference_d
      self.add_data_source(f, s_name=s_name, section='mapped_gc_distribution')
docs: Parse the contents of the Qualimap BamQC Mapped Reads GC content distribution file