docs: def run_amylpred2(self, seq, outdir, run_amylmuts=False):
          """Run all methods on the AMYLPRED2 web server for an amino acid sequence and gather results.
  
          Result files are cached in ``/path/to/outdir/AMYLPRED2_results``.
  
          Args:
              seq (str): Amino acid sequence as a string
              outdir (str): Directory to where output files should be saved
              run_amylmuts (bool): If AMYLMUTS method should be run, default False
  
          Returns:
              dict: Result for each method run
  
          """
          outdir_amylpred = op.join(outdir, 'AMYLPRED2_results')
          if not op.exists(outdir_amylpred):
              os.mkdir(outdir_amylpred)
  
          url = "http://aias.biol.uoa.gr/AMYLPRED2/login.php"
          cj = CookieJar()
          opener = build_opener(HTTPCookieProcessor(cj))
          formdata = {"email": self.email, "password": self.password}
          data_encoded = urlencode(formdata)
          data_encoded = data_encoded.encode('ASCII')
          response = opener.open(url, data_encoded)
  
          # AMYLMUTS is most time consuming and generates a slightly different result every submission
          methods = ['AGGRESCAN', 'NETCSSP', 'PAFIG', 'APD', 'AMYLPATTERN',
                     'SECSTR', 'BSC', 'WALTZ', 'CONFENERGY', 'TANGO']
  
          if run_amylmuts:
              methods.append('AMYLMUTS')
  
          output = {}
          timeCounts = 0
  
          for met in methods:
              # First check if there is an existing results file
              existing_results = glob.glob(op.join(outdir_amylpred, '*_{}.txt'.format(met)))
              if existing_results:
                  results_file = existing_results[0]
              else:
                  values = {'seq_data': seq, 'method': met}
                  data = urlencode(values)
                  data = data.encode('ASCII')
                  url_input = "http://aias.biol.uoa.gr/cgi-bin/AMYLPRED2/amylpred2.pl"
                  response = opener.open(url_input, data)
                  result = str(response.read())
                  ind = str.find(result, 'Job ID')
                  result2 = result[ind:ind + 50]
                  ind1 = str.find(result2, ':')
                  ind2 = str.find(result2, '<BR>')
                  job_id = result2[ind1 + 2:ind2]
  
                  # Waiting for the calculation to complete
                  url_result = 'http://aias.biol.uoa.gr/AMYLPRED2/tmp/' + job_id + '.txt'
                  print(url_result)
                  print("Waiting for %s results" % met, end='.')
                  while True:
                      result = urlopen(url_result).read()
                      if not result:
                          time.sleep(1)
                          timeCounts += 1
                          print('.', end='')
                      else:
                          response = requests.get(url_result)
                          break
                  results_file = op.join(outdir_amylpred, "{}_{}.txt".format(url_result.split('/')[-1].strip('.txt'), met))
                  with open(results_file, "wb") as handle:
                      for data in response.iter_content():
                          handle.write(data)
                  print("")
  
              method, hits = self.parse_method_results(results_file, met)
              # if method.lower() == met.lower():
              output[met] = hits
              # elif method == 'Beta-strand contiguity' and met == 'BSC':
              # output[met]=hits
              # elif method == 'Hexapeptide Conf. Energy' and met == 'CONFENERGY':
          if timeCounts != 0:
              print("Time spent: %d seconds" % timeCounts)
          return output