From 89ccf49549f3bd640f6470e170da5048f3815988 Mon Sep 17 00:00:00 2001 From: Garrett Stevens Date: Fri, 20 Sep 2024 19:47:48 -0600 Subject: [PATCH] Add ability for indexed sequence file to be uploaded and used in an assembly (#432) * Start implementing file upload|download|get * Add delete command and various small edits * Add FileCommand handling file operations * Handle default profile via undefined * Download file as stream * Handling of gzip input and bgzip'd & indexed fasta * CLI can upload and add assembly from gzip files (#405 and #407) * CLI can add assembly in non-editable mode with `--no-db` flag, i.e. without loading sequence to mongodb (#406). Only bgzip'd & indexed fasta file are supported, not plain fa/fai files. See tests in test.py: `testFeatureChecksIndexed`, `testFileUploadGzip`, `testAddAssemblyWithoutLoadingInMongo` * Fix linter * Formatting * Add description for file CLI topic * Deduplicate sequence fetching code * Reference File schema from Assembly schema * Rename commands * Remove -i option since file is positional * Rename option --no-db and some other fixes * Add additional type and make input arg required * Tmp commit * fix app start issue * fix lint * Tmp commit addressing https://github.com/GMOD/Apollo3/pull/432 Fix #424 * Tmp commit * This should address comments in https://github.com/GMOD/Apollo3/pull/432 But most likely there will be changes to clunky code * Temp commit to fix buffer * Fix filehandle type * Use files service to get filehandles * Fix fileId vs fileIds and other issues for https://github.com/GMOD/Apollo3/pull/432 All tests except those for chekcs passing * Allow fasta input to be gzip * Fixes after rebase * Move LocalFileGzip to collab server package * Match selector to other updated tests --------- Co-authored-by: dariober Co-authored-by: Shashank Budhanuru Ramaraju --- .github/workflows/reload_demo_data.yml | 4 +- docs/automated_setup.md | 8 +- packages/apollo-cli/README.md | 284 ++++++++++---- packages/apollo-cli/package.json | 14 +- .../src/commands/assembly/add-fasta.ts | 125 ------ .../src/commands/assembly/add-from-fasta.ts | 235 ++++++++++++ .../assembly/{add-gff.ts => add-from-gff.ts} | 54 ++- .../apollo-cli/src/commands/assembly/check.ts | 7 +- .../src/commands/assembly/delete.ts | 3 +- .../apollo-cli/src/commands/assembly/get.ts | 11 +- .../src/commands/assembly/sequence.ts | 6 +- .../apollo-cli/src/commands/change/get.ts | 16 +- packages/apollo-cli/src/commands/config.ts | 13 +- .../src/commands/feature/add-child.ts | 9 +- .../apollo-cli/src/commands/feature/check.ts | 6 +- .../apollo-cli/src/commands/feature/copy.ts | 7 +- .../apollo-cli/src/commands/feature/delete.ts | 6 +- .../src/commands/feature/edit-attribute.ts | 7 +- .../src/commands/feature/edit-coords.ts | 6 +- .../src/commands/feature/edit-type.ts | 6 +- .../apollo-cli/src/commands/feature/edit.ts | 7 +- .../apollo-cli/src/commands/feature/get-id.ts | 10 +- .../apollo-cli/src/commands/feature/get.ts | 4 +- .../apollo-cli/src/commands/feature/import.ts | 10 +- .../apollo-cli/src/commands/feature/search.ts | 10 +- .../apollo-cli/src/commands/file/delete.ts | 85 +++++ .../apollo-cli/src/commands/file/download.ts | 67 ++++ packages/apollo-cli/src/commands/file/get.ts | 54 +++ .../apollo-cli/src/commands/file/upload.ts | 113 ++++++ .../src/commands/jbrowse/get-config.ts | 7 +- .../src/commands/jbrowse/set-config.ts | 11 +- packages/apollo-cli/src/commands/login.ts | 15 +- packages/apollo-cli/src/commands/logout.ts | 7 +- .../src/commands/refseq/add-alias.ts | 6 +- .../apollo-cli/src/commands/refseq/get.ts | 18 +- packages/apollo-cli/src/commands/status.ts | 10 +- packages/apollo-cli/src/commands/user/get.ts | 7 +- packages/apollo-cli/src/fileCommand.ts | 107 ++++++ packages/apollo-cli/src/utils.ts | 125 ++---- packages/apollo-cli/test/test.py | 357 +++++++++++++++--- packages/apollo-cli/test/test_docker.py | 2 +- packages/apollo-cli/test_data/tiny.fasta.fai | 3 + packages/apollo-cli/test_data/tiny.fasta.gz | Bin 0 -> 279 bytes .../apollo-cli/test_data/tiny.fasta.gz.fai | 3 + .../apollo-cli/test_data/tiny.fasta.gz.gzi | Bin 0 -> 8 bytes packages/apollo-cli/test_data/tiny2.fasta.gz | Bin 0 -> 279 bytes .../src/checks/checks.module.ts | 4 +- .../src/checks/checks.service.ts | 69 +--- .../src/files/FileStorageEngine.ts | 1 + .../src/files/files.controller.ts | 5 + .../src/files/files.service.ts | 36 +- .../src/files/filesUtil.ts | 101 ++++- .../src/sequence/sequence.module.ts | 2 + .../src/sequence/sequence.service.ts | 43 +++ packages/apollo-common/package.json | 1 + packages/apollo-common/src/Operation.ts | 2 + .../apollo-schemas/src/assembly.schema.ts | 14 + packages/apollo-schemas/src/file.schema.ts | 18 +- .../AddAssemblyAndFeaturesFromFileChange.ts | 11 +- .../src/Changes/AddAssemblyFromFileChange.ts | 167 ++++++-- packages/apollo-shared/src/util.ts | 1 + .../src/components/AddAssembly.tsx | 2 +- packages/website/docs/cli/assembly.md | 63 ++-- packages/website/docs/cli/change.md | 9 +- packages/website/docs/cli/config.md | 7 +- packages/website/docs/cli/feature.md | 63 ++-- packages/website/docs/cli/file.md | 125 ++++++ packages/website/docs/cli/login.md | 10 +- packages/website/docs/cli/refseq.md | 12 +- packages/website/docs/cli/status.md | 5 +- packages/website/docs/cli/user.md | 2 +- yarn.lock | 1 + 72 files changed, 1881 insertions(+), 758 deletions(-) delete mode 100644 packages/apollo-cli/src/commands/assembly/add-fasta.ts create mode 100644 packages/apollo-cli/src/commands/assembly/add-from-fasta.ts rename packages/apollo-cli/src/commands/assembly/{add-gff.ts => add-from-gff.ts} (59%) create mode 100644 packages/apollo-cli/src/commands/file/delete.ts create mode 100644 packages/apollo-cli/src/commands/file/download.ts create mode 100644 packages/apollo-cli/src/commands/file/get.ts create mode 100644 packages/apollo-cli/src/commands/file/upload.ts create mode 100644 packages/apollo-cli/src/fileCommand.ts create mode 100644 packages/apollo-cli/test_data/tiny.fasta.fai create mode 100644 packages/apollo-cli/test_data/tiny.fasta.gz create mode 100644 packages/apollo-cli/test_data/tiny.fasta.gz.fai create mode 100644 packages/apollo-cli/test_data/tiny.fasta.gz.gzi create mode 100644 packages/apollo-cli/test_data/tiny2.fasta.gz create mode 100644 packages/website/docs/cli/file.md diff --git a/.github/workflows/reload_demo_data.yml b/.github/workflows/reload_demo_data.yml index 2d5c42f38..30de0ec58 100644 --- a/.github/workflows/reload_demo_data.yml +++ b/.github/workflows/reload_demo_data.yml @@ -84,8 +84,8 @@ jobs: apollo assembly get | apollo assembly delete -v -a - - apollo assembly add-fasta -i $demoDataDir/schistosoma_haematobium.TD2_PRJEB44434.WBPS19.genomic.fa -a schistosoma_haematobium -f - apollo assembly add-fasta -i $demoDataDir/schistosoma_mansoni.PRJEA36577.WBPS19.genomic.fa -a schistosoma_mansoni -f + apollo assembly add-from-fasta $demoDataDir/schistosoma_haematobium.TD2_PRJEB44434.WBPS19.genomic.fa -a schistosoma_haematobium -f + apollo assembly add-from-fasta $demoDataDir/schistosoma_mansoni.PRJEA36577.WBPS19.genomic.fa -a schistosoma_mansoni -f apollo feature import -i $demoDataDir/schistosoma_haematobium.TD2_PRJEB44434.WBPS19.annotations.gff3 -a schistosoma_haematobium -d apollo feature import -i $demoDataDir/schistosoma_mansoni.PRJEA36577.WBPS19.annotations.gff3 -a schistosoma_mansoni -d diff --git a/docs/automated_setup.md b/docs/automated_setup.md index 4a332157d..55e2480f0 100644 --- a/docs/automated_setup.md +++ b/docs/automated_setup.md @@ -22,9 +22,9 @@ wget https://ftp.ebi.ac.uk/pub/databases/wormbase/parasite/releases/WBPS19/speci gunzip *.gz -apollo assembly add-fasta ${P} -i schistosoma_haematobium.TD2_PRJEB44434.WBPS19.genomic.fa -a schistosoma_haematobium -f -apollo assembly add-fasta ${P} -i schistosoma_mansoni.PRJEA36577.WBPS19.genomic.fa -a schistosoma_mansoni -f +apollo assembly add-from-fasta ${P} schistosoma_haematobium.TD2_PRJEB44434.WBPS19.genomic.fa -a schistosoma_haematobium -f +apollo assembly add-from-fasta ${P} schistosoma_mansoni.PRJEA36577.WBPS19.genomic.fa -a schistosoma_mansoni -f -apollo feature import ${P} -i schistosoma_haematobium.TD2_PRJEB44434.WBPS19.annotations.gff3 -a schistosoma_haematobium -d -apollo feature import ${P} -i schistosoma_mansoni.PRJEA36577.WBPS19.annotations.gff3 -a schistosoma_mansoni -d +apollo feature import ${P} schistosoma_haematobium.TD2_PRJEB44434.WBPS19.annotations.gff3 -a schistosoma_haematobium -d +apollo feature import ${P} schistosoma_mansoni.PRJEA36577.WBPS19.annotations.gff3 -a schistosoma_mansoni -d ``` diff --git a/packages/apollo-cli/README.md b/packages/apollo-cli/README.md index 062837cab..40ce6ce60 100644 --- a/packages/apollo-cli/README.md +++ b/packages/apollo-cli/README.md @@ -16,7 +16,7 @@ $ npm install -g @apollo-annotation/cli $ apollo COMMAND running command... $ apollo (--version) -@apollo-annotation/cli/0.1.19 linux-x64 node-v20.13.0 +@apollo-annotation/cli/0.1.19 linux-x64 node-v20.17.0 $ apollo --help [COMMAND] USAGE $ apollo COMMAND @@ -29,8 +29,8 @@ USAGE -- [`apollo assembly add-fasta`](#apollo-assembly-add-fasta) -- [`apollo assembly add-gff`](#apollo-assembly-add-gff) +- [`apollo assembly add-from-fasta INPUT`](#apollo-assembly-add-from-fasta-input) +- [`apollo assembly add-from-gff INPUT-FILE`](#apollo-assembly-add-from-gff-input-file) - [`apollo assembly check`](#apollo-assembly-check) - [`apollo assembly delete`](#apollo-assembly-delete) - [`apollo assembly get`](#apollo-assembly-get) @@ -49,6 +49,10 @@ USAGE - [`apollo feature get-id`](#apollo-feature-get-id) - [`apollo feature import`](#apollo-feature-import) - [`apollo feature search`](#apollo-feature-search) +- [`apollo file delete`](#apollo-file-delete) +- [`apollo file download`](#apollo-file-download) +- [`apollo file get`](#apollo-file-get) +- [`apollo file upload`](#apollo-file-upload) - [`apollo help [COMMANDS]`](#apollo-help-commands) - [`apollo jbrowse get-config`](#apollo-jbrowse-get-config) - [`apollo jbrowse set-config INPUTFILE`](#apollo-jbrowse-set-config-inputfile) @@ -59,51 +63,68 @@ USAGE - [`apollo status`](#apollo-status) - [`apollo user get`](#apollo-user-get) -## `apollo assembly add-fasta` +## `apollo assembly add-from-fasta INPUT` -Add new assembly from local or external fasta file +Add a new assembly from fasta input ``` USAGE - $ apollo assembly add-fasta -i [--profile ] [--config-file ] [-a ] [-x ] [-f] + $ apollo assembly add-from-fasta INPUT [--profile ] [--config-file ] [-a ] [-x ] [-f] [-n] + [--fai ] [--gzi ] [-z | -d] + +ARGUMENTS + INPUT Input fasta file, local or remote, or id of a previously uploaded file FLAGS -a, --assembly= Name for this assembly. Use the file name if omitted + -d, --decompressed For local file input: Override autodetection and instruct that input is decompressed -f, --force Delete existing assembly, if it exists - -i, --input-file= (required) Input fasta file - -x, --index= URL of the index. Required if input is an external source and ignored if input is a local - file + -n, --not-editable The fasta sequence is not editable. Apollo will not load it into the database and instead + use the provided indexes to query it. This option assumes the fasta file is bgzip'd with + `bgzip` and indexed with `samtools faidx`. Indexes should be named .gzi and + .fai unless options --fai and --gzi are set + -x, --index= URL of the index. Required if input is an external source + -z, --gzip For local file input: Override autodetection and instruct that input is gzip compressed --config-file= Use this config file (mostly for testing) + --fai= Fasta index of the (not-editable) fasta file + --gzi= Gzi index of the (not-editable) fasta file --profile= Use credentials from this profile DESCRIPTION - Add new assembly from local or external fasta file + Add a new assembly from fasta input + + Add new assembly. The input fasta may be: + * A local file + * An external fasta file + * The id of a file previously uploaded to Apollo EXAMPLES From local file: - $ apollo assembly add-fasta -i genome.fa -a myAssembly + $ apollo assembly add-from-fasta genome.fa -a myAssembly From external source we also need the URL of the index: - $ apollo assembly add-fasta -i https://.../genome.fa -x https://.../genome.fa.fai -a myAssembly + $ apollo assembly add-from-fasta https://.../genome.fa -x https://.../genome.fa.fai -a myAssembly ``` _See code: -[src/commands/assembly/add-fasta.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/add-fasta.ts)_ +[src/commands/assembly/add-from-fasta.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/add-from-fasta.ts)_ -## `apollo assembly add-gff` +## `apollo assembly add-from-gff INPUT-FILE` Add new assembly from gff or gft file ``` USAGE - $ apollo assembly add-gff -i [--profile ] [--config-file ] [-a ] [-o] [-f] + $ apollo assembly add-from-gff INPUT-FILE [--profile ] [--config-file ] [-a ] [-o] [-f] + +ARGUMENTS + INPUT-FILE Input gff file FLAGS -a, --assembly= Name for this assembly. Use the file name if omitted -f, --force Delete existing assembly, if it exists - -i, --input-file= (required) Input gff or gtf file -o, --omit-features Do not import features, only upload the sequences --config-file= Use this config file (mostly for testing) --profile= Use credentials from this profile @@ -111,21 +132,20 @@ FLAGS DESCRIPTION Add new assembly from gff or gft file - The gff file is expected to contain sequences as per gff specifications. - Features are also imported by default. + The gff file is expected to contain sequences as per gff specifications. Features are also imported by default. EXAMPLES Import sequences and features: - $ apollo assembly add-gff -i genome.gff -a myAssembly + $ apollo assembly add-from-gff -i genome.gff -a myAssembly Import sequences only: - $ apollo assembly add-gff -i genome.gff -a myAssembly -o + $ apollo assembly add-from-gff genome.gff -a myAssembly -o ``` _See code: -[src/commands/assembly/add-gff.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/add-gff.ts)_ +[src/commands/assembly/add-from-gff.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/add-from-gff.ts)_ ## `apollo assembly check` @@ -145,9 +165,8 @@ FLAGS DESCRIPTION Add, view, or delete checks to assembly - Manage checks, i.e. the rules ensuring features in an assembly are plausible. - This command only sets the checks to apply, to retrieve features flagged by - these checks use `apollo feature check`. + Manage checks, i.e. the rules ensuring features in an assembly are plausible. This command only sets the checks to + apply, to retrieve features flagged by these checks use `apollo feature check`. EXAMPLES View available check types: @@ -271,10 +290,9 @@ FLAGS DESCRIPTION Get list of changes - Return the change log in json format. Note that when an assembly is deleted the - link between common name and ID is lost (it can still be recovered by inspecting - the change log but at present this task is left to the user). In such cases you - need to use the assembly ID. + Return the change log in json format. Note that when an assembly is deleted the link between common name and ID is + lost (it can still be recovered by inspecting the change log but at present this task is left to the user). In such + cases you need to use the assembly ID. ``` _See code: @@ -300,15 +318,14 @@ FLAGS DESCRIPTION Get or set apollo configuration options - Use this command to create or edit a user profile with credentials to access - Apollo. Configuration options are: + Use this command to create or edit a user profile with credentials to access Apollo. Configuration options are: - address: Address and port e.g http://localhost:3999 - accessType: - How to access Apollo. accessType is typically one of: google, microsoft, guest, - root. Allowed types depend on your Apollo setup + How to access Apollo. accessType is typically one of: google, microsoft, guest, root. Allowed types depend on your + Apollo setup - accessToken: Access token. Usually inserted by `apollo login` @@ -355,13 +372,13 @@ FLAGS DESCRIPTION Add a child feature (e.g. add an exon to an mRNA) - See the other commands under `apollo feature` to retrive the parent ID of - interest and to populate the child feature with attributes. + See the other commands under `apollo feature` to retrive the parent ID of interest and to populate the child feature + with attributes. EXAMPLES Add an exon at genomic coordinates 10..20 to this feature ID: - $ apollo feature add-child -i 6605826fbd0eee691f83e73f -t exon -s 10 -e 20 + $ apollo feature add-child -i 660...73f -t exon -s 10 -e 20 ``` _See code: @@ -384,9 +401,8 @@ FLAGS DESCRIPTION Get check results - Use this command to view which features fail checks along with the reason for - failing. Use `apollo assembly check` for managing which checks should be applied - to an assembly + Use this command to view which features fail checks along with the reason for failing.Use `apollo assembly check` for + managing which checks should be applied to an assembly EXAMPLES Get all check results in the database: @@ -420,9 +436,8 @@ FLAGS DESCRIPTION Copy a feature to another location - The feature may be copied to the same or to a different assembly. he destination - reference sequence may be selected by name only if unique in the database or by - name and assembly or by identifier. + The feature may be copied to the same or to a different assembly. The destination reference sequence may be selected + by name only if unique in the database or by name and assembly or by identifier. EXAMPLES Copy this feature ID to chr1:100 in assembly hg38: @@ -451,8 +466,7 @@ FLAGS DESCRIPTION Delete one or more features by ID - Note that deleting a child feature after deleting its parent will result in an - error unless you set -f/--force. + Note that deleting a child feature after deleting its parent will result in an error unless you set -f/--force. ``` _See code: @@ -474,12 +488,11 @@ FLAGS DESCRIPTION Edit features using an appropiate json input - Edit a feature by submitting a json input with all the required attributes for - Apollo to process it. This is a very low level command which most users probably - do not need. + Edit a feature by submitting a json input with all the required attributes for Apollo to process it. This is a very + low level command which most users probably do not need. - Input may be a json string or a json file and it may be an array of changes. - This is an example input for editing feature type: + Input may be a json string or a json file and it may be an array of changes. This is an example input for editing + feature type: { "typeName": "TypeChange", @@ -521,9 +534,8 @@ FLAGS DESCRIPTION Add, edit, or view a feature attribute - Be aware that there is no checking whether attributes names and values are - valid. For example, you can create non-unique ID attributes or you can set gene - ontology terms to non-existing terms + Be aware that there is no checking whether attributes names and values are valid. For example, you can create + non-unique ID attributes or you can set gene ontology terms to non-existing terms EXAMPLES Add attribute "domains" with a list of values: @@ -560,9 +572,8 @@ FLAGS DESCRIPTION Edit feature start and/or end coordinates - If editing a child feature that new coordinates must be within the parent's - coordinates. To get the identifier of the feature to edit consider using `apollo - feature get` or `apollo feature search` + If editing a child feature that new coordinates must be within the parent's coordinates.To get the identifier of the + feature to edit consider using `apollo feature get` or `apollo feature search` EXAMPLES Edit start and end: @@ -594,8 +605,8 @@ FLAGS DESCRIPTION Edit or view feature type - Feature type is column 3 in gff format. It must be a valid sequence ontology - term although but the valifdity of the new term is not checked. + Feature type is column 3 in gff format.It must be a valid sequence ontology term although but the valifdity of the new + term is not checked. ``` _See code: @@ -626,8 +637,8 @@ EXAMPLES $ apollo feature get -a myAssembly - Get features intersecting chr1:1..1000. You can omit the assembly name if there - are no other reference sequences named chr1: + Get features intersecting chr1:1..1000. You can omit the assembly name if there are no other reference sequences + named chr1: $ apollo feature get -a myAssembly -r chr1 -s 1 -e 1000 ``` @@ -644,8 +655,7 @@ USAGE $ apollo feature get-id [--profile ] [--config-file ] [-i ] FLAGS - -i, --feature-id=... [default: -] Retrieves feature with these IDs. Use - "-" to read IDs from stdin (one per + -i, --feature-id=... [default: -] Retrieves feature with these IDs. Use "-" to read IDs from stdin (one per line) --config-file= Use this config file (mostly for testing) --profile= Use credentials from this profile @@ -653,8 +663,7 @@ FLAGS DESCRIPTION Get features given their identifiers - Invalid identifiers or identifiers not found in the database will be silently - ignored + Invalid identifiers or identifiers not found in the database will be silently ignored EXAMPLES Get features for these identifiers: @@ -676,7 +685,7 @@ USAGE FLAGS -a, --assembly= (required) Import into this assembly name or assembly ID -d, --delete-existing Delete existing features before importing - -i, --input-file= (required) Input gff or gtf file + -i, --input-file= (required) Input gff file --config-file= Use this config file (mostly for testing) --profile= Use credentials from this profile @@ -703,8 +712,8 @@ USAGE $ apollo feature search -t [--profile ] [--config-file ] [-a ] FLAGS - -a, --assembly=... Assembly names or IDs to search; use "-" to read it from stdin. If omitted - search all assemblies + -a, --assembly=... Assembly names or IDs to search; use "-" to read it from stdin. If omitted search all + assemblies -t, --text= (required) Search for this text query --config-file= Use this config file (mostly for testing) --profile= Use credentials from this profile @@ -728,8 +737,7 @@ DESCRIPTION chr1 example SNP 10 30 0.987 . . "someKey=Fingerprint BAC with reads" - Queries "bac" or "mRNA" return the feature. Instead these queries will NOT - match: + Queries "bac" or "mRNA" return the feature. Instead these queries will NOT match: - "someKey" - "with" @@ -746,6 +754,123 @@ EXAMPLES _See code: [src/commands/feature/search.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/search.ts)_ +## `apollo file delete` + +Delete files from the Apollo server + +``` +USAGE + $ apollo file delete [--profile ] [--config-file ] [-i ] + +FLAGS + -i, --file-id=... [default: -] IDs of the files to delete + --config-file= Use this config file (mostly for testing) + --profile= Use credentials from this profile + +DESCRIPTION + Delete files from the Apollo server + + Deleted files are printed to stdout. See also `apollo file get` to list the files on the server + +EXAMPLES + Delete file multiple files: + + $ apollo file delete -i 123...abc xyz...789 +``` + +_See code: +[src/commands/file/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/file/delete.ts)_ + +## `apollo file download` + +Download a file from the Apollo server + +``` +USAGE + $ apollo file download [--profile ] [--config-file ] [-i ] [-o ] + +FLAGS + -i, --file-id= [default: -] ID of the file to download + -o, --output= Write output to this file or "-" for stdout. Default to the name of the uploaded file. + --config-file= Use this config file (mostly for testing) + --profile= Use credentials from this profile + +DESCRIPTION + Download a file from the Apollo server + + See also `apollo file get` to list the files on the server + +EXAMPLES + Download file with id xyz + + $ apollo file download -i xyz -o genome.fa +``` + +_See code: +[src/commands/file/download.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/file/download.ts)_ + +## `apollo file get` + +Get list of files uploaded to the Apollo server + +``` +USAGE + $ apollo file get [--profile ] [--config-file ] [-i ] + +FLAGS + -i, --file-id=... Get files matching this IDs + --config-file= Use this config file (mostly for testing) + --profile= Use credentials from this profile + +DESCRIPTION + Get list of files uploaded to the Apollo server + + Print to stdout the list of files in json format + +EXAMPLES + Get files by id: + + $ apollo file get -i xyz abc +``` + +_See code: +[src/commands/file/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/file/get.ts)_ + +## `apollo file upload` + +Upload a local file to the Apollo server + +``` +USAGE + $ apollo file upload -i [--profile ] [--config-file ] [-t + text/x-fasta|text/x-gff3|application/x-bgzip-fasta|text/x-fai|application/x-gzi] [-z | -d] + +FLAGS + -d, --decompressed Override autodetection and instruct that input is decompressed + -i, --input-file= (required) Local file to upload + -t, --type=