text: # AUTOGENERATED! DO NOT EDIT! File to edit: 04_pipelines.ipynb (unless otherwise specified).
  
  __all__ = ['simple_reference']
  
  # Cell
  import os
  import sys
  import ftplib
  from cosmos.api import Cosmos
  from .recipes import recipe
  from .utils import get_args,get_paras
  from create_reference import defaults
  
  # Cell
  
  def simple_reference():
      args = get_args()
      with ftplib.FTP(defaults.ensembl_ftp) as ftp:
          ftp.login()
          paras = get_paras(args,ftp,defaults.ensembl_ftp)
  
  
      cosmos=Cosmos('sqlite:///{outdir}/sqlite.db'.format(outdir=args.outdir),
                    default_max_attempts=2)
      cosmos.initdb()
  
      workflow_name='fetchr_reference'
      def change_log_dir(task, log_dir='{outdir}/log'.format(outdir=args.outdir)):
          return os.path.abspath(os.path.join(log_dir, task.stage.name, str(task.uid)))
  
      workflow = cosmos.start(workflow_name,
                              skip_confirm=True,
                              primary_log_path='{outdir}/log/workflow.log'.format(outdir=args.outdir))
      recipe(workflow,paras,args)
      workflow.make_output_dirs()
      workflow.run(max_cores=args.thread, log_out_dir_func=change_log_dir)
      sys.exit(0 if workflow.successful else 1)