TRTools
TRTools copied to clipboard
mergeSTR: support space-separated file list (which in turn allows for globs etc)?
right now, mergeSTR splits the file list by itself. however, argparse can take a list of items (including what is expanded out from a glob, like *.vcf.gz
in the following way:
req_group.add_argument("--vcfs", help="...", type=str, nargs="+", required=True)
Then, this will pre-split VCFs by whitespace and let someone run something like
mergeSTR --vcfs *.vcf.gz --out something
You could keep backwards compatibility even with comma-separated arguments by doing something like this, although it's a bit janky and prevents filenames with commas in them (which mergeSTR already does)
filenames = args.vcfs[0].split(",") if len(args.vcfs) == 1 else args.vcfs