code: def setop(args):
      
      from jcvi.utils.natsort import natsorted
  
      p = OptionParser(setop.__doc__)
      p.add_option("--column", default=0, type="int",
                   help="The column to extract, 0-based, -1 to disable [default: %default]")
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      statement, = args
      fa, op, fb = statement.split()
      assert op in ('|', '&', '-', '^')
  
      column = opts.column
      fa = SetFile(fa, column=column)
      fb = SetFile(fb, column=column)
  
      if op == '|':
          t = fa | fb
      elif op == '&':
          t = fa & fb
      elif op == '-':
          t = fa - fb
      elif op == '^':
          t = fa ^ fb
  
      for x in natsorted(t):
          print(x)
docs: %prog setop "fileA & fileB" > newfile
  
      Perform set operations, except on files. The files (fileA and fileB) contain
      list of ids. The operator is one of the four:
  
      |: union (elements found in either file)
      &: intersection (elements found in both)
      -: difference (elements in fileA but not in fileB)
      ^: symmetric difference (elementes found in either set but not both)
  
      Please quote the argument to avoid shell interpreting | and &.