code: def _load_genetic_map(filename):
          
          try:
              genetic_map = {}
  
              with tarfile.open(filename, "r") as tar:
                  # http://stackoverflow.com/a/2018576
                  for member in tar.getmembers():
                      if "genetic_map" in member.name:
                          df = pd.read_csv(tar.extractfile(member), sep="\t")
                          df = df.rename(
                              columns={
                                  "Position(bp)": "pos",
                                  "Rate(cM/Mb)": "rate",
                                  "Map(cM)": "map",
                              }
                          )
                          del df["Chromosome"]
                          start_pos = member.name.index("chr") + 3
                          end_pos = member.name.index(".")
                          genetic_map[member.name[start_pos:end_pos]] = df
  
              # X chrom consists of X PAR regions and X non-PAR region
              genetic_map["X"] = pd.concat(
                  [genetic_map["X_par1"], genetic_map["X"], genetic_map["X_par2"]]
              )
              del genetic_map["X_par1"]
              del genetic_map["X_par2"]
  
              return genetic_map
          except Exception as err:
              print(err)
              return None
docs: Load genetic map (e.g. HapMapII).
  
          Parameters
          ----------
          filename : str
              path to compressed archive with genetic map data
  
          Returns
          -------
          genetic_map : dict
              dict of pandas.DataFrame genetic maps if loading was successful, else None
  
          Notes
          -----
          Keys of returned dict are chromosomes and values are the corresponding genetic map.