TRTools icon indicating copy to clipboard operation
TRTools copied to clipboard

mergeSTR: support space-separated file list (which in turn allows for globs etc)?

Open davidlougheed opened this issue 3 years ago • 0 comments

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

davidlougheed avatar May 04 '21 18:05 davidlougheed