code: def noclip(args):
      
      p = OptionParser(noclip.__doc__)
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      bamfile, = args
      noclipbam = bamfile.replace(".bam", ".noclip.bam")
      cmd = "samtools view -h {} | awk -F '\t' '($6 !~ /H|S/)'".format(bamfile)
      cmd += " | samtools view -@ 4 -b -o {}".format(noclipbam)
      sh(cmd)
  
      sh("samtools index {}".format(noclipbam))
docs: %prog noclip bamfile
  
      Remove clipped reads from BAM.