From e1ebb4eb5b44119d1408669533c154cd840ca828 Mon Sep 17 00:00:00 2001 From: Garrett Stevens Date: Mon, 21 Oct 2024 16:27:16 +0000 Subject: [PATCH 01/10] bug: filter conflicting keys when adding jb config --- .../apollo-shared/src/Changes/ImportJBrowseConfigChange.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/apollo-shared/src/Changes/ImportJBrowseConfigChange.ts b/packages/apollo-shared/src/Changes/ImportJBrowseConfigChange.ts index c8eec77e2..3e60d28af 100644 --- a/packages/apollo-shared/src/Changes/ImportJBrowseConfigChange.ts +++ b/packages/apollo-shared/src/Changes/ImportJBrowseConfigChange.ts @@ -39,7 +39,8 @@ export interface SerializedImportJBrowseConfigChange { } export function filterJBrowseConfig(config: JBrowseConfig): JBrowseConfig { - const { assemblies, internetAccounts, plugins, tracks, ...rest } = config + const { __v, _id, assemblies, internetAccounts, plugins, tracks, ...rest } = + config const filteredAssemblies = assemblies?.filter( (a) => a.sequence.adapter.type !== 'ApolloSequenceAdapter', ) From e1215f642c1af973925bc1cd50b6fd4c2032fe17 Mon Sep 17 00:00:00 2001 From: Garrett Stevens Date: Mon, 21 Oct 2024 16:56:22 +0000 Subject: [PATCH 02/10] Make input files args not flags in CLI --- .github/workflows/reload_demo_data.yml | 4 +- packages/apollo-cli/README.md | 38 +++++++++++-------- .../src/commands/assembly/add-from-fasta.ts | 5 +-- .../src/commands/assembly/add-from-gff.ts | 6 +-- packages/apollo-cli/src/commands/config.ts | 3 +- .../apollo-cli/src/commands/feature/import.ts | 20 +++++----- .../apollo-cli/src/commands/file/upload.ts | 26 +++++++------ .../src/commands/refseq/add-alias.ts | 20 +++++----- packages/website/docs/cli/assembly.md | 2 +- packages/website/docs/cli/feature.md | 12 +++--- packages/website/docs/cli/file.md | 12 +++--- packages/website/docs/cli/refseq.md | 12 +++--- 12 files changed, 87 insertions(+), 73 deletions(-) diff --git a/.github/workflows/reload_demo_data.yml b/.github/workflows/reload_demo_data.yml index f5fa4a1e6..807d047d2 100644 --- a/.github/workflows/reload_demo_data.yml +++ b/.github/workflows/reload_demo_data.yml @@ -102,10 +102,10 @@ jobs: apollo feature \ import \ - --input-file /data/schistosoma_haematobium.TD2_PRJEB44434.WBPS19.annotations.genes.gff3 \ + /data/schistosoma_haematobium.TD2_PRJEB44434.WBPS19.annotations.genes.gff3 \ --assembly 'Schistosoma haematobium' apollo feature \ import \ - --input-file /data/schistosoma_mansoni.PRJEA36577.WBPS19.annotations.genes.gff3 \ + /data/schistosoma_mansoni.PRJEA36577.WBPS19.annotations.genes.gff3 \ --assembly 'Schistosoma mansoni' diff --git a/packages/apollo-cli/README.md b/packages/apollo-cli/README.md index 74bd15ece..a413133e0 100644 --- a/packages/apollo-cli/README.md +++ b/packages/apollo-cli/README.md @@ -47,18 +47,18 @@ USAGE - [`apollo feature edit-type`](#apollo-feature-edit-type) - [`apollo feature get`](#apollo-feature-get) - [`apollo feature get-id`](#apollo-feature-get-id) -- [`apollo feature import`](#apollo-feature-import) +- [`apollo feature import INPUT-FILE`](#apollo-feature-import-input-file) - [`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 file upload INPUT-FILE`](#apollo-file-upload-input-file) - [`apollo help [COMMANDS]`](#apollo-help-commands) - [`apollo jbrowse get-config`](#apollo-jbrowse-get-config) - [`apollo jbrowse set-config INPUTFILE`](#apollo-jbrowse-set-config-inputfile) - [`apollo login`](#apollo-login) - [`apollo logout`](#apollo-logout) -- [`apollo refseq add-alias`](#apollo-refseq-add-alias) +- [`apollo refseq add-alias INPUT-FILE`](#apollo-refseq-add-alias-input-file) - [`apollo refseq get`](#apollo-refseq-get) - [`apollo status`](#apollo-status) - [`apollo user get`](#apollo-user-get) @@ -137,7 +137,7 @@ DESCRIPTION EXAMPLES Import sequences and features: - $ apollo assembly add-from-gff -i genome.gff -a myAssembly + $ apollo assembly add-from-gff genome.gff -a myAssembly Import sequences only: @@ -674,18 +674,20 @@ EXAMPLES _See code: [src/commands/feature/get-id.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/get-id.ts)_ -## `apollo feature import` +## `apollo feature import INPUT-FILE` Import features from local gff file ``` USAGE - $ apollo feature import -i -a [--profile ] [--config-file ] [-d] + $ apollo feature import INPUT-FILE -a [--profile ] [--config-file ] [-d] + +ARGUMENTS + INPUT-FILE Input gff file 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 file --config-file= Use this config file (mostly for testing) --profile= Use credentials from this profile @@ -697,7 +699,7 @@ DESCRIPTION EXAMPLES Delete features in myAssembly and then import features.gff3: - $ apollo feature import -d -i features.gff3 -a myAssembly + $ apollo feature import features.gff3 -d -a myAssembly ``` _See code: @@ -836,18 +838,20 @@ EXAMPLES _See code: [src/commands/file/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/file/get.ts)_ -## `apollo file upload` +## `apollo file upload INPUT-FILE` Upload a local file to the Apollo server ``` USAGE - $ apollo file upload -i [--profile ] [--config-file ] [-t + $ apollo file upload INPUT-FILE [--profile ] [--config-file ] [-t text/x-fasta|text/x-gff3|application/x-bgzip-fasta|text/x-fai|application/x-gzi] [-z | -d] +ARGUMENTS + INPUT-FILE Local file to upload + FLAGS -d, --decompressed Override autodetection and instruct that input is decompressed - -i, --input-file= (required) Local file to upload -t, --type=