-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
import os | ||
|
||
|
||
# Parse command line arguments | ||
parser = argparse.ArgumentParser(description='Run kGWASflow') | ||
parser.add_argument('-c', '--config-file', default='config/config.yaml', help='Path to the config.yaml file (default: config.yaml)') | ||
# parser.add_argument('--output', type=str, help='Path to output directory') | ||
parser.add_argument('-t', '--threads', type=int, default=1, help='Number of threads') | ||
parser.add_argument('--conda-frontend', type=str, default='conda', help='Conda frontend to use') | ||
parser.add_argument('-n', '--dryrun', action='store_true', help='Dry run', required=False) | ||
parser.add_argument('--samples', type=str, help='Path to samples.tsv file', required=False) | ||
parser.add_argument('--phenotypes', type=str, help='Path to phenos.tsv file', required=False) | ||
parser.add_argument('-r', '--generate-report', action='store_true', help='create an HTML report', required=False) | ||
parser.add_argument('-v', '--verbose', action='store_true', help='Increase output verbosity', required=False) | ||
args = parser.parse_args() | ||
|
||
# if config file is not specified, use the default config file | ||
if args.config_file is None: | ||
args.config_file = 'config/config.yaml' | ||
|
||
# Define the command to run snakemake | ||
cmd = f'snakemake --use-conda --conda-frontend {args.conda_frontend} --cores {args.threads} --rerun-triggers mtime --rerun-incomplete --configfile {args.config_file}' | ||
|
||
if args.dryrun: | ||
cmd += ' --dryrun' | ||
|
||
# Add the --report flag if specified | ||
if args.generate_report: | ||
if args.dryrun: | ||
cmd += ' --report kGWASflow-report.html' | ||
if not args.dryrun: | ||
cmd += ' --dryrun --report kGWASflow-report.html' | ||
|
||
if args.verbose: | ||
cmd += ' --verbose' | ||
|
||
if __name__ == "__main__": | ||
# Run the command | ||
os.system(cmd) |