code: def subset_main(args):
      
  
      # Read in each of the command line arguments
      rid = _read_arg(args.rid)
      cid = _read_arg(args.cid)
      exclude_rid = _read_arg(args.exclude_rid)
      exclude_cid = _read_arg(args.exclude_cid)
  
      # If GCT, use subset_gctoo
      if args.in_path.endswith(".gct"):
  
          in_gct = parse_gct.parse(args.in_path)
          out_gct = sg.subset_gctoo(in_gct, rid=rid, cid=cid,
                                   exclude_rid=exclude_rid,
                                   exclude_cid=exclude_cid)
  
      # If GCTx, use parse_gctx
      else:
  
          if (exclude_rid is not None) or (exclude_cid is not None):
              msg = "exclude_{rid,cid} args not currently supported for parse_gctx."
              raise(Exception(msg))
  
          logger.info("Using hyperslab selection functionality of parse_gctx...")
          out_gct = parse_gctx.parse(args.in_path, rid=rid, cid=cid)
  
      # Write the output gct
      if args.out_type == "gctx":
          wgx.write(out_gct, args.out_name)
      else:
          wg.write(out_gct, args.out_name, data_null="NaN", metadata_null="NA", filler_null="NA")
docs: Separate method from main() in order to make testing easier and to
      enable command-line access.