|
4 | 4 | from AMDirT.validate import run_validation |
5 | 5 | from AMDirT.viewer import run_app |
6 | 6 | from AMDirT.convert import run_convert |
7 | | -from AMDirT.core import get_json_path |
| 7 | +from AMDirT.core import get_json_path, get_amdir_tags, get_latest_tag |
8 | 8 | from AMDirT.autofill import run_autofill |
9 | 9 | from AMDirT.merge import merge_new_df |
| 10 | +from AMDirT.download import download as download_amdir |
10 | 11 | from json import load |
11 | 12 |
|
12 | 13 |
|
@@ -294,5 +295,45 @@ def merge(ctx, no_args_is_help=True, **kwargs): |
294 | 295 | merge_new_df(**kwargs, **ctx.obj) |
295 | 296 |
|
296 | 297 |
|
| 298 | +@cli.command() |
| 299 | +@click.option( |
| 300 | + "-t", |
| 301 | + "--table", |
| 302 | + help="AncientMetagenomeDir table to download", |
| 303 | + type=click.Choice(get_table_list()), |
| 304 | + default="ancientmetagenome-hostassociated", |
| 305 | + show_default=True, |
| 306 | +) |
| 307 | +@click.option( |
| 308 | + "-y", |
| 309 | + "--table_type", |
| 310 | + help="Type of table to download", |
| 311 | + type=click.Choice(["samples", "libraries"]), |
| 312 | + default="samples", |
| 313 | + show_default=True, |
| 314 | +) |
| 315 | +@click.option( |
| 316 | + "-r", |
| 317 | + "--release", |
| 318 | + help="Release tag to download", |
| 319 | + type=click.Choice(get_amdir_tags()), |
| 320 | + default=get_latest_tag(get_amdir_tags()), |
| 321 | + show_default=True, |
| 322 | +) |
| 323 | +@click.option( |
| 324 | + "-o", |
| 325 | + "--output", |
| 326 | + help="Output directory", |
| 327 | + type=click.Path(writable=True), |
| 328 | + default=".", |
| 329 | + show_default=True, |
| 330 | +) |
| 331 | +def download(no_args_is_help=True, **kwargs): |
| 332 | + """\b |
| 333 | + Download a table from the AMDirT repository |
| 334 | + """ |
| 335 | + download_amdir(**kwargs) |
| 336 | + |
| 337 | + |
297 | 338 | if __name__ == "__main__": |
298 | 339 | cli() |
0 commit comments