diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b91fdce51..414d25902 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,14 +1,16 @@ -FROM mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye +FROM mcr.microsoft.com/devcontainers/javascript-node:24-bookworm # Install MongoDB command line tools - though mongo-database-tools not available on arm64 -ARG MONGO_TOOLS_VERSION=6.0 +ARG MONGO_TOOLS_VERSION=8.0 RUN . /etc/os-release \ && curl -sSL "https://www.mongodb.org/static/pgp/server-${MONGO_TOOLS_VERSION}.asc" | gpg --dearmor > /usr/share/keyrings/mongodb-archive-keyring.gpg \ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian ${VERSION_CODENAME}/mongodb-org/${MONGO_TOOLS_VERSION} main" | tee /etc/apt/sources.list.d/mongodb-org-${MONGO_TOOLS_VERSION}.list \ && apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get install -y mongodb-mongosh \ && if [ "$(dpkg --print-architecture)" = "amd64" ]; then apt-get install -y mongodb-database-tools; fi \ - && apt-get clean -y && rm -rf /var/lib/apt/lists/* + && apt-get clean -y && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /data/uploads \ + && chown -R ${USERNAME}:npm /data/uploads # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/compose.yml similarity index 90% rename from .devcontainer/docker-compose.yml rename to .devcontainer/compose.yml index 4e4d52d66..d9b0868e3 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/compose.yml @@ -7,6 +7,9 @@ services: dockerfile: Dockerfile volumes: - ../..:/workspaces:cached + - uploads:/data/uploads + environment: + FILE_UPLOAD_FOLDER: /data/uploads # Overrides default command so things don't shut down after the process ends. command: sleep infinity @@ -18,7 +21,7 @@ services: # (Adding the "ports" property to this file will not forward from a Codespace.) db: - image: mongo:latest + image: mongo:8 restart: unless-stopped volumes: - mongodb-data:/data/db @@ -34,3 +37,4 @@ services: volumes: mongodb-data: null + uploads: null diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9b7b28ae8..f1778bbc3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ // https://github.com/devcontainers/templates/tree/main/src/javascript-node-mongo { "name": "Apollo", - "dockerComposeFile": "docker-compose.yml", + "dockerComposeFile": "compose.yml", "service": "app", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", diff --git a/.github/workflows/cypress_debug.yml b/.github/workflows/cypress_debug.yml index 735679470..ba595f2dc 100644 --- a/.github/workflows/cypress_debug.yml +++ b/.github/workflows/cypress_debug.yml @@ -9,10 +9,10 @@ jobs: - name: Check out uses: actions/checkout@v4 - - name: Use Node.js 20.x + - name: Use Node.js 24.x uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 24 cache: yarn - name: Install diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5f0ab7631..89f44b2ed 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,10 +20,10 @@ jobs: steps: - name: Check out uses: actions/checkout@v4 - - name: Use Node.js 20.x + - name: Use Node.js 24.x uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 24 cache: yarn - name: Install if: inputs.environment == 'staging' @@ -31,7 +31,7 @@ jobs: - name: Build plugin if: inputs.environment == 'staging' run: | - yarn build + JB_NPM=false yarn build cp dist/jbrowse-plugin-apollo.umd.development.js dist/apollo.js working-directory: packages/jbrowse-plugin-apollo - name: Fetch plugin diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index aaab917fe..3e21b3048 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -12,22 +12,35 @@ jobs: steps: - name: Check out uses: actions/checkout@v4 - - name: Use Node.js 20.x + - name: Use Node.js 24.x uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 24 cache: yarn - name: Install run: yarn --immutable - # Have to build shared before linting so type-based lint rules can - # run correctly + # Have to build shared before linting so type-based lint rules can + # run correctly - name: Build shared run: yarn build working-directory: packages/apollo-shared - name: Lint codebase run: yarn eslint --max-warnings 0 - - name: Run Jest tests - run: yarn test + + # apollo-shared tests + - name: Build shared + run: yarn build + working-directory: packages/apollo-shared + - name: Run apollo-shared tests + run: yarn run test:ci + working-directory: packages/apollo-shared + + # jbrowse-plugin-apollo tests + - name: Run jbrowse-plugin-apollo tests + run: yarn run test:ci + working-directory: packages/jbrowse-plugin-apollo + + # Cypress tests - name: Get latest JBrowse run: yarn run jbrowse create --nightly .jbrowse working-directory: packages/jbrowse-plugin-apollo @@ -43,13 +56,16 @@ jobs: - name: Run Cypress tests run: yarn run test:e2e working-directory: packages/jbrowse-plugin-apollo + + # CLI tests - name: Start apollo run: | yarn --cwd packages/apollo-shared start & yarn --cwd packages/apollo-collaboration-server test:cli:start & - name: Run CLI tests - run: yarn test:cli + run: yarn run test:ci working-directory: packages/apollo-cli + # - name: Run docker tests # working-directory: packages/apollo-cli # run: python3 ./src/test/test_docker.py diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d4797b503..12c944cc2 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -14,10 +14,10 @@ jobs: steps: - name: Check out uses: actions/checkout@v4 - - name: Use Node.js 20.x + - name: Use Node.js 24.x uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 24 cache: yarn - name: Install run: yarn --immutable @@ -25,7 +25,7 @@ jobs: run: yarn build working-directory: packages/apollo-collaboration-server - name: Build plugin - run: yarn build + run: JB_NPM=false yarn build working-directory: packages/jbrowse-plugin-apollo lint: name: Lint @@ -33,10 +33,10 @@ jobs: steps: - name: Check out uses: actions/checkout@v4 - - name: Use Node.js 20.x + - name: Use Node.js 24.x uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 24 cache: yarn - name: Install run: yarn --immutable diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index e23a75144..72fdb2116 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -11,10 +11,10 @@ jobs: steps: - name: Check out uses: actions/checkout@v4 - - name: Use Node.js 20.x + - name: Use Node.js 24.x uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 24 cache: yarn - name: Install run: yarn --immutable diff --git a/.husky/pre-commit b/.husky/pre-commit index 5e08d62fe..508f69fa9 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1,3 @@ #!/usr/bin/env sh -yarn node .husky/pre-commit.js +yarn node .husky/pre-commit.cjs yarn lint-staged diff --git a/.husky/pre-commit.js b/.husky/pre-commit.cjs similarity index 100% rename from .husky/pre-commit.js rename to .husky/pre-commit.cjs diff --git a/.prettierrc.lint-staged.mjs b/.prettierrc.lint-staged.mjs index ec3e4318e..431902430 100644 --- a/.prettierrc.lint-staged.mjs +++ b/.prettierrc.lint-staged.mjs @@ -13,6 +13,7 @@ const config = { options: { parser: 'jsonc' }, }, ], + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment plugins: [packagejson], } diff --git a/eslint.config.mjs b/eslint.config.mjs index 2a8e98397..956fcaef0 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -33,18 +33,11 @@ export default [ pluginReact.configs.flat.recommended, // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access pluginJSXA11y.flatConfigs.recommended, - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access pluginCypress.configs.recommended, { languageOptions: { globals: { ...globals.browser, ...globals.node }, - parserOptions: { - projectService: { - allowDefaultProject: ['packages/jbrowse-plugin-apollo/*.js'], - }, - defaultProject: 'tsconfig.json', - tsconfigRootDir: import.meta.dirname, - }, + parserOptions: { projectService: true }, }, settings: { react: { version: 'detect' } }, // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment @@ -122,6 +115,7 @@ export default [ 'packages/website/src/**/*.{jsx,tsx}', ], plugins: { 'react-hooks': pluginReactHooks }, + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access rules: { ...pluginReactHooks.configs.recommended.rules }, }, // Don't enforce tsdoc syntax in JS files diff --git a/package.json b/package.json index f05511fa6..36232a66d 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "apollo3", "private": true, "description": "Monorepo containing Apollo front and back end code", + "type": "module", "workspaces": [ "packages/*" ], @@ -19,7 +20,7 @@ "devDependencies": { "@eslint/js": "^9.21.0", "@types/cross-spawn": "^6.0.6", - "@types/node": "^20.19.15", + "@types/node": "^24.10.9", "@types/semver": "^7", "@types/yargs": "^17.0.32", "@typescript-eslint/parser": "^8.25.0", diff --git a/packages/apollo-cli/README.md b/packages/apollo-cli/README.md index 18e82a90d..0fc4741bc 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.3.11 linux-x64 node-v24.6.0 +@apollo-annotation/cli/0.3.11 linux-x64 node-v24.13.0 $ apollo --help [COMMAND] USAGE $ apollo COMMAND @@ -29,972 +29,7 @@ USAGE -- [`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) -- [`apollo assembly sequence`](#apollo-assembly-sequence) -- [`apollo change get`](#apollo-change-get) -- [`apollo config [KEY] [VALUE]`](#apollo-config-key-value) -- [`apollo export gff3 ASSEMBLY`](#apollo-export-gff3-assembly) -- [`apollo feature add [FEATURE-JSON]`](#apollo-feature-add-feature-json) -- [`apollo feature add-child`](#apollo-feature-add-child) -- [`apollo feature check`](#apollo-feature-check) -- [`apollo feature copy`](#apollo-feature-copy) -- [`apollo feature delete`](#apollo-feature-delete) -- [`apollo feature edit`](#apollo-feature-edit) -- [`apollo feature edit-attribute`](#apollo-feature-edit-attribute) -- [`apollo feature edit-coords`](#apollo-feature-edit-coords) -- [`apollo feature edit-type`](#apollo-feature-edit-type) -- [`apollo feature get`](#apollo-feature-get) -- [`apollo feature get-id`](#apollo-feature-get-id) -- [`apollo feature get-indexed-id ID`](#apollo-feature-get-indexed-id-id) -- [`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 INPUT-FILE`](#apollo-file-upload-input-file) - [`apollo help [COMMANDS]`](#apollo-help-commands) -- [`apollo jbrowse desktop JBROWSEFILE`](#apollo-jbrowse-desktop-jbrowsefile) -- [`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 INPUT-FILE`](#apollo-refseq-add-alias-input-file) -- [`apollo refseq get`](#apollo-refseq-get) -- [`apollo status`](#apollo-status) -- [`apollo user get`](#apollo-user-get) - -## `apollo assembly add-from-fasta INPUT` - -Add a new assembly from fasta input - -``` -USAGE - $ apollo assembly add-from-fasta INPUT [--profile ] [--config-file ] [-a ] [-f] [-e] [--fai ] - [--gzi ] [-z | -d] - -ARGUMENTS - INPUT Input fasta file, local or remote, or id of a previously uploaded file. For local or remote files, it is - assumed the file is bgzip'd with `bgzip` and indexed with `samtools faidx`. The indexes are assumed to be at - .fai and .gzi unless the options --fai and --gzi are provided. A local file can be - uncompressed if the flag -e/--editable is set (but see below about using -e) - -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 - -e, --editable Instead of using indexed fasta lookup, the sequence is loaded into the Apollo database and - is editable. Use with caution, as editing the sequence often has unintended side effects. - -f, --force Delete existing assembly, if it exists - -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 a new assembly from fasta input - - Add new assembly. The input fasta may be: - * A local file bgzip'd and indexed. It can be uncompressed if the -e/--editable is set (but see description of -e) - * An external fasta file bgzip'd and indexed - * The id of a file previously uploaded to Apollo - -EXAMPLES - From local file assuming indexes genome.gz.fai and genome.gz.gzi are present: - - $ apollo assembly add-from-fasta genome.fa.gz -a myAssembly - - Local file with editable sequence does not require compression and indexing: - - $ apollo assembly add-from-fasta genome.fa -a myAssembly - - From external source assuming there are also indexes https://.../genome.fa.gz.fai and https://.../genome.fa.gz.gzi: - - $ apollo assembly add-from-fasta https://.../genome.fa.gz -a myAssembly -``` - -_See code: -[src/commands/assembly/add-from-fasta.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/assembly/add-from-fasta.ts)_ - -## `apollo assembly add-from-gff INPUT-FILE` - -Add new assembly from gff or gft file - -``` -USAGE - $ 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 - -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 - -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. - -EXAMPLES - Import sequences and features: - - $ apollo assembly add-from-gff genome.gff -a myAssembly - - Import sequences only: - - $ apollo assembly add-from-gff genome.gff -a myAssembly -o -``` - -_See code: -[src/commands/assembly/add-from-gff.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/assembly/add-from-gff.ts)_ - -## `apollo assembly check` - -Add, view, or delete checks to assembly - -``` -USAGE - $ apollo assembly check [--profile ] [--config-file ] [-a ] [-c ] [-d] - -FLAGS - -a, --assembly= Manage checks in this assembly - -c, --check=... Add these check names or IDs. If unset, print the checks set for assembly - -d, --delete Delete (instead of adding) checks - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -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`. - -EXAMPLES - View available check types: - - $ apollo assembly check - - View checks set for assembly hg19: - - $ apollo assembly check -a hg19 - - Add checks to assembly: - - $ apollo assembly check -a hg19 -c CDSCheck - - Delete checks from assembly: - - $ apollo assembly check -a hg19 -c CDSCheck --delete -``` - -_See code: -[src/commands/assembly/check.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/assembly/check.ts)_ - -## `apollo assembly delete` - -Delete assemblies - -``` -USAGE - $ apollo assembly delete -a [--profile ] [--config-file ] [-v] - -FLAGS - -a, --assembly=... (required) Assembly names or IDs to delete - -v, --verbose Print to stdout the array of assemblies deleted - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Delete assemblies - - Assemblies to delete may be names or IDs - -EXAMPLES - Delete multiple assemblies using name or ID: - - $ apollo assembly delete -a mouse 6605826fbd0eee691f83e73f -``` - -_See code: -[src/commands/assembly/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/assembly/delete.ts)_ - -## `apollo assembly get` - -Get available assemblies - -``` -USAGE - $ apollo assembly get [--profile ] [--config-file ] [-a ] - -FLAGS - -a, --assembly=... Get assemblies in this list of names or IDs - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Get available assemblies - - Print to stdout the list of assemblies in json format -``` - -_See code: -[src/commands/assembly/get.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/assembly/get.ts)_ - -## `apollo assembly sequence` - -Get reference sequence in fasta format - -``` -USAGE - $ apollo assembly sequence [--profile ] [--config-file ] [-a ] [-r ] [-s ] [-e - ] - -FLAGS - -a, --assembly= Find input reference sequence in this assembly - -e, --end= End coordinate - -r, --refseq= Reference sequence. If unset, get all sequences - -s, --start= [default: 1] Start coordinate (1-based) - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Get reference sequence in fasta format - - Return the reference sequence for a given assembly and coordinates - -EXAMPLES - Get all sequences in myAssembly: - - $ apollo assembly sequence -a myAssembly - - Get sequence in coordinates chr1:1..1000: - - $ apollo assembly sequence -a myAssembly -r chr1 -s 1 -e 1000 -``` - -_See code: -[src/commands/assembly/sequence.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/assembly/sequence.ts)_ - -## `apollo change get` - -Get list of changes - -``` -USAGE - $ apollo change get [--profile ] [--config-file ] [-a ] - -FLAGS - -a, --assembly=... Get changes only for these assembly names or IDs (but see description) - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -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. -``` - -_See code: -[src/commands/change/get.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/change/get.ts)_ - -## `apollo config [KEY] [VALUE]` - -Get or set apollo configuration options - -``` -USAGE - $ apollo config [KEY] [VALUE] [--profile ] [---file ] [--get-config-file] - -ARGUMENTS - KEY Name of configuration parameter - VALUE Parameter value - -FLAGS - --config-file= Use this config file (mostly for testing) - --get-config-file Return the path to the config file and exit (this file may not exist yet) - --profile= Profile to create or edit - -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: - - - 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 - - - accessToken: - Access token. Usually inserted by `apollo login` - - - rootPassword: - Password for root account. Only set this for "root" access type - -EXAMPLES - Interactive setup: - - $ apollo config - - Setup with key/value pairs: - - $ apollo config --profile admin address http://localhost:3999 - - Get current address for default profile: - - $ apollo config address -``` - -_See code: -[src/commands/config.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/config.ts)_ - -## `apollo export gff3 ASSEMBLY` - -Export the annotations for an assembly to stdout as gff3 - -``` -USAGE - $ apollo export gff3 ASSEMBLY [--profile ] [--config-file ] [--include-fasta] - -ARGUMENTS - ASSEMBLY Export annotations for this assembly name or id - -FLAGS - --config-file= Use this config file (mostly for testing) - --include-fasta Include fasta sequence in output - --profile= Use credentials from this profile - -DESCRIPTION - Export the annotations for an assembly to stdout as gff3 - -EXAMPLES - Export annotations for myAssembly: - - $ apollo export gff3 myAssembly > out.gff3 -``` - -_See code: -[src/commands/export/gff3.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/export/gff3.ts)_ - -## `apollo feature add [FEATURE-JSON]` - -Add one or more features to Apollo - -``` -USAGE - $ apollo feature add [FEATURE-JSON] [--profile ] [--config-file ] [-a ] [-r -s - -e -t ] [-F ] - -ARGUMENTS - FEATURE-JSON Inline JSON describing the feature(s) to add. Can also be provided via stdin. - -FLAGS - -F, --feature-json-file= File with JSON describing the feature(s) to add - -a, --assembly= Name or ID of target assembly. Not required if refseq is unique in the database - -e, --max= End position in target reference sequence - -r, --refSeq= Name or ID of target reference sequence - -s, --min= Start position in target reference sequence - -t, --type= Type of child feature - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Add one or more features to Apollo - - A single simple feature can be added using the --min, --max, etc. flags. - - To add multiple features, features with more details, or features with children, you can pass in JSON via argument or - stdin or use the --feature-json-file options. - - -EXAMPLES - Add a single feature by specifying its location and type - - $ apollo feature add --assembly hg19 --refSeq chr3 --min 1000 --max 5000 --type remark - - Add a single feature from inline JSON - - $ apollo feature add \ - '{"assembly":"","refseq":"","min":1,"max":100,"type":""}' - - Add mutilple features from stdin JSON - - echo '[{"assembly":"","refseq":"","min":1,"max":100,"type":""},{" \ - assembly":"","refseq":"","min":101,"max":200,"type":""}]' | \ - apollo feature add - - Add a feature with children from inline JSON - - $ apollo feature add '{"assembly":"","refseq":"","min":1,"max":100,"type":"","children":[{"min":1,"max":50,"type":""}]}' -``` - -_See code: -[src/commands/feature/add.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/add.ts)_ - -## `apollo feature add-child` - -Add a child feature (e.g. add an exon to an mRNA) - -``` -USAGE - $ apollo feature add-child -s -e -t [--profile ] [--config-file ] [-i ] - -FLAGS - -e, --end= (required) End coordinate of the child feature (1-based) - -i, --feature-id= [default: -] Add a child to this feature ID; use - to read it from stdin - -s, --start= (required) Start coordinate of the child feature (1-based) - -t, --type= (required) Type of child feature - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -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. - -EXAMPLES - Add an exon at genomic coordinates 10..20 to this feature ID: - - $ apollo feature add-child -i 660...73f -t exon -s 10 -e 20 -``` - -_See code: -[src/commands/feature/add-child.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/add-child.ts)_ - -## `apollo feature check` - -Get check results - -``` -USAGE - $ apollo feature check [--profile ] [--config-file ] [-i ] [-a ] - -FLAGS - -a, --assembly= Get checks for this assembly - -i, --feature-id=... Get checks for these feature identifiers - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -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 - -EXAMPLES - Get all check results in the database: - - $ apollo feature check - - Get check results for assembly hg19: - - $ apollo feature check -a hg19 -``` - -_See code: -[src/commands/feature/check.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/check.ts)_ - -## `apollo feature copy` - -Copy a feature to another location - -``` -USAGE - $ apollo feature copy -r -s [--profile ] [--config-file ] [-i ] [-a ] - -FLAGS - -a, --assembly= Name or ID of target assembly. Not required if refseq is unique in the database - -i, --feature-id= [default: -] Feature ID to copy to; use - to read it from stdin - -r, --refseq= (required) Name or ID of target reference sequence - -s, --start= (required) Start position in target reference sequence - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Copy a feature to another location - - 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: - - $ apollo feature copy -i 6605826fbd0eee691f83e73f -r chr1 -s 100 -a hg38 -``` - -_See code: -[src/commands/feature/copy.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/copy.ts)_ - -## `apollo feature delete` - -Delete one or more features by ID - -``` -USAGE - $ apollo feature delete [--profile ] [--config-file ] [-i ] [-f] [-n] - -FLAGS - -f, --force Ignore non-existing features - -i, --feature-id=... [default: -] Feature IDs to delete - -n, --dry-run Only show what would be delete - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -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. -``` - -_See code: -[src/commands/feature/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/delete.ts)_ - -## `apollo feature edit` - -Edit features using an appropiate json input - -``` -USAGE - $ apollo feature edit [--profile ] [--config-file ] [-j ] - -FLAGS - -j, --json-input= [default: -] Json string or json file or "-" to read json from stdin - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -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. - - 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", - "changedIds": [ - "6613f7d22c957525d631b1cc" - ], - "assembly": "6613f7d1360321540a11e5ed", - "featureId": "6613f7d22c957525d631b1cc", - "oldType": "BAC", - "newType": "G_quartet" - } - -EXAMPLES - Editing by passing a json to stdin: - - echo '{"typeName": ... "newType": "G_quartet"}' | apollo feature edit -j - -``` - -_See code: -[src/commands/feature/edit.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/edit.ts)_ - -## `apollo feature edit-attribute` - -Add, edit, or view a feature attribute - -``` -USAGE - $ apollo feature edit-attribute -a [--profile ] [--config-file ] [-i ] [-v ] [-d] - -FLAGS - -a, --attribute= (required) Attribute key to add or edit - -d, --delete Delete this attribute - -i, --feature-id= [default: -] Feature ID to edit or "-" to read it from stdin - -v, --value=... New attribute value. Separated mutliple values by space to them as a list. If unset return - current value - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -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 - -EXAMPLES - Add attribute "domains" with a list of values: - - $ apollo feature edit-attribute -i 66...3f -a domains -v ABC PLD - - Print values in "domains" as json array: - - $ apollo feature edit-attribute -i 66...3f -a domains - - Delete attribute "domains" - - $ apollo feature edit-attribute -i 66...3f -a domains -d -``` - -_See code: -[src/commands/feature/edit-attribute.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/edit-attribute.ts)_ - -## `apollo feature edit-coords` - -Edit feature start and/or end coordinates - -``` -USAGE - $ apollo feature edit-coords [--profile ] [--config-file ] [-i ] [-s ] [-e ] - -FLAGS - -e, --end= New end coordinate (1-based) - -i, --feature-id= [default: -] Feature ID to edit or "-" to read it from stdin - -s, --start= New start coordinate (1-based) - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -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` - -EXAMPLES - Edit start and end: - - $ apollo feature edit-coords -i abc...xyz -s 10 -e 1000 - - Edit end and leave start as it is: - - $ apollo feature edit-coords -i abc...xyz -e 2000 -``` - -_See code: -[src/commands/feature/edit-coords.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/edit-coords.ts)_ - -## `apollo feature edit-type` - -Edit or view feature type - -``` -USAGE - $ apollo feature edit-type [--profile ] [--config-file ] [-i ] [-t ] - -FLAGS - -i, --feature-id= [default: -] Feature ID to edit or "-" to read it from stdin - -t, --type= Assign feature to this type. If unset return the current type - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -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. -``` - -_See code: -[src/commands/feature/edit-type.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/edit-type.ts)_ - -## `apollo feature get` - -Get features in assembly, reference sequence or genomic window - -``` -USAGE - $ apollo feature get [--profile ] [--config-file ] [-a ] [-r ] [-s ] [-e - ] - -FLAGS - -a, --assembly= Find input reference sequence in this assembly - -e, --end= End coordinate - -r, --refseq= Reference sequence. If unset, query all sequences - -s, --start= [default: 1] Start coordinate (1-based) - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Get features in assembly, reference sequence or genomic window - -EXAMPLES - Get all features in myAssembly: - - $ 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: - - $ apollo feature get -a myAssembly -r chr1 -s 1 -e 1000 -``` - -_See code: -[src/commands/feature/get.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/get.ts)_ - -## `apollo feature get-id` - -Get features given their identifiers - -``` -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 - line) - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Get features given their identifiers - - Invalid identifiers or identifiers not found in the database will be silently ignored - -EXAMPLES - Get features for these identifiers: - - $ apollo feature get-id -i abc...zyz def...foo -``` - -_See code: -[src/commands/feature/get-id.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/get-id.ts)_ - -## `apollo feature get-indexed-id ID` - -Get features given an indexed identifier - -``` -USAGE - $ apollo feature get-indexed-id ID [--profile ] [--config-file ] [-a ] [--topLevel] - -ARGUMENTS - ID Indexed identifier to search for - -FLAGS - -a, --assembly=... Assembly names or IDs to search; use "-" to read it from stdin. If omitted search all - assemblies - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - --topLevel Return the top-level parent of the feature instead of the feature itself - -DESCRIPTION - Get features given an indexed identifier - - Get features that match a given indexed identifier, such as the ID of a feature from an imported GFF3 file - -EXAMPLES - Get features for this indexed identifier: - - $ apollo feature get-indexed-id -i abc...zyz def...foo -``` - -_See code: -[src/commands/feature/get-indexed-id.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/get-indexed-id.ts)_ - -## `apollo feature import INPUT-FILE` - -Import features from local gff file - -``` -USAGE - $ 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 - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Import features from local gff file - - By default, features are added to the existing ones. - -EXAMPLES - Delete features in myAssembly and then import features.gff3: - - $ apollo feature import features.gff3 -d -a myAssembly -``` - -_See code: -[src/commands/feature/import.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/packages/apollo-cli/src/commands/feature/import.ts)_ - -## `apollo feature search` - -Free text search for feature in one or more assemblies - -``` -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 - -t, --text= (required) Search for this text query - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Free text search for feature in one or more assemblies - - Return features matching a query string. This command searches only in: - - - Attribute *values* (not attribute names) - - Source field (which in fact is stored as an attribute) - - Feature type - - The search mode is: - - - Case insensitive - - Match only full words, but not necessarily the full value - - Common words are ignored. E.g. "the", "with" - - For example, given this feature: - - 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: - - - "someKey" - - "with" - - "Finger" - - "chr1" - - "0.987" - -EXAMPLES - Search "bac" in these assemblies: - - $ apollo feature search -a mm9 mm10 -t bac -``` - -_See code: -[src/commands/feature/search.ts](https://github.com/GMOD/Apollo3/blob/v0.3.11/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.3.11/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.3.11/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.3.11/packages/apollo-cli/src/commands/file/get.ts)_ - -## `apollo file upload INPUT-FILE` - -Upload a local file to the Apollo server - -``` -USAGE - $ 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 - -t, --type=