Package: fetch-tool
Microbiome Informatics ENA fetch toolSet of tools which allows you to fetch RAW read and assembly files from the European Nucleotide Archive (ENA).How to set up your development environmentWe recommend you to useminiconda|condato manage the environment.Clone the repo and install the requirements.$ git clone git@github.com:EBI-Metagenomics/fetch_tool.git
$ cd fetch_tool
$ # activate anv (conda activate xxx)
$ pip install -r requirements-dev.txtPre-commit hooksSetup the gitpre-commit hook:pre-commitinstallWhy?pre-commit will run a set of pre-configured tools before allowing you to commit files. You can find the currently configure hooks and configurations in.pre-commit-config.yamlTestsThis repo usespytest.It requires the aspera cli installed in the default location (install-aspera.shwith no parameters).To run the test suite:pytestInstall fetch toolUsing Conda$condacreate-q-nfetch_toolpython=3.8
$condaactivatefetch_toolInstall from Pypi$pipinstallfetch-toolInstall from the git repo$pipinstallgit+ssh://git@github.com/EBI-Metagenomics/fetch_tool.gitConfiguration fileSetup the configuration file, the templatefetchdata-config-template.jsonfor the configuration file.The required fields are:For Asperaaspera_bin (the path to ascp, usually in the aspera installation under /cli/bin)aspera_cert (the path to the ascp provided cert, usually in the aspera installation under /cli/etc/asperaweb_id_dsa.openssh)To pull private ENA dataena_api_userena_api_passwordInstall AsperaInstallRun theinstall-aspera.shcommand here, it has only one optional parameter (the installation folder)../installpath/to/installation-i-wantOtherwise it will install it in $PWD/aspera-cliFetch read files (amplicon and WGS data)Usage$fetch-read-tool-h
usage:fetch-read-tool[-h][-pPROJECTS[PROJECTS...]|-lPROJECT_LIST][-dDIR][-v][--version][-f][--ignore-errors][--private][-i][-cCONFIG_FILE][--fix-desc-file][-ruRUNS[RUNS...]|--run-listRUN_LIST]optionalarguments:-h,--helpshowthishelpmessageandexit-pPROJECTS[PROJECTS...],--projectsPROJECTS[PROJECTS...]Whitespaceseparatedlistofprojectaccession(s)-lPROJECT_LIST,--project-listPROJECT_LISTFilecontainingline-separatedprojectlist-dDIR,--dirDIRBasedirectoryfordownloads-v,--verboseVerbose--versionVersion-f,--forceIgnoredownloaderrorsandforcere-downloadallfiles--ignore-errorsIgnoredownloaderrorsandcontinue--privateUsewhenfetchingprivatedata-i,--interactiveinteractivemode-allowsyoutoskipfaileddownloads.-cCONFIG_FILE,--config-fileCONFIG_FILEAlternativeconfigfile--fix-desc-fileFixedrunsinprojectdescriptionfile-ruRUNS[RUNS...],--runsRUNS[RUNS...]Runaccession(s),whitespaceseparated.Usetodownloadonlycertainprojectruns--run-listRUN_LISTFilecontainingline-separatedrunaccessionsExampleDownload amplicon study:$fetch-read-tool-pSRP062869-cfetchdata-config-local.json-v-d/home/<user>/temp/Fetch assembly filesUsagefetch-assembly-tool -h
usage: fetch-assembly-tool [-h] [-p PROJECTS [PROJECTS ...] | -l PROJECT_LIST] [-d DIR] [-v] [--version] [-f] [--ignore-errors] [--private] [-i] [-c CONFIG_FILE] [--fix-desc-file]
                           [-as ASSEMBLIES [ASSEMBLIES ...]] [--assembly-type {primary metagenome,binned metagenome,metatranscriptome}] [--assembly-list ASSEMBLY_LIST]

optional arguments:
  -h, --help            show this help message and exit
  -p PROJECTS [PROJECTS ...], --projects PROJECTS [PROJECTS ...]
                        Whitespace separated list of project accession(s)
  -l PROJECT_LIST, --project-list PROJECT_LIST
                        File containing line-separated project list
  -d DIR, --dir DIR     Base directory for downloads
  -v, --verbose         Verbose
  --version             Version
  -f, --force           Ignore download errors and force re-download all files
  --ignore-errors       Ignore download errors and continue
  --private             Use when fetching private data
  -i, --interactive     interactive mode - allows you to skip failed downloads.
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        Alternative config file
  --fix-desc-file       Fixed runs in project description file
  -as ASSEMBLIES [ASSEMBLIES ...], --assemblies ASSEMBLIES [ASSEMBLIES ...]
                        Assembly ERZ accession(s), whitespace separated. Use to download only certain project assemblies
  --assembly-type {primary metagenome,binned metagenome,metatranscriptome}
                        Assembly type
  --assembly-list ASSEMBLY_LIST
                        File containing line-separated assembly accessionsExampleDownload assembly study:$fetch-assembly-tool-pERP111288-cfetchdata-config-local.json-v-d/home/<user>/temp/