code: def batchccn(args):
      
      p = OptionParser(batchccn.__doc__)
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      csvfile, = args
      mm = MakeManager()
      pf = op.basename(csvfile).split(".")[0]
      mkdir(pf)
  
      header = next(open(csvfile))
      header = None if header.strip().endswith(".bam") else "infer"
      logging.debug("Header={}".format(header))
      df = pd.read_csv(csvfile, header=header)
      cmd = "perl /mnt/software/ccn_gcn_hg38_script/ccn_gcn_hg38.pl"
      cmd += " -n {} -b {}"
      cmd += " -o {} -r hg38".format(pf)
      for i, (sample_key, bam) in df.iterrows():
          cmdi = cmd.format(sample_key, bam)
          outfile = "{}/{}/{}.ccn".format(pf, sample_key, sample_key)
          mm.add(csvfile, outfile, cmdi)
      mm.write()
docs: %prog batchccn test.csv
  
      Run CCN script in batch. Write makefile.