diff --git a/packages/apollo-cli/README.md b/packages/apollo-cli/README.md index 6939b54b..f0210c11 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.18 linux-x64 node-v20.14.0 +@apollo-annotation/cli/0.1.18 darwin-x64 node-v20.10.0 $ apollo --help [COMMAND] USAGE $ apollo COMMAND @@ -29,719 +29,7 @@ USAGE -- [`apollo assembly add-fasta`](#apollo-assembly-add-fasta) -- [`apollo assembly add-gff`](#apollo-assembly-add-gff) -- [`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 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 import`](#apollo-feature-import) -- [`apollo feature search`](#apollo-feature-search) - [`apollo help [COMMANDS]`](#apollo-help-commands) -- [`apollo login`](#apollo-login) -- [`apollo logout`](#apollo-logout) -- [`apollo refseq get`](#apollo-refseq-get) -- [`apollo status`](#apollo-status) -- [`apollo user get`](#apollo-user-get) - -## `apollo assembly add-fasta` - -Add new assembly from local or external fasta file - -``` -USAGE - $ apollo assembly add-fasta -i [--profile ] [--config-file ] [-a ] [-x ] [-f] - -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 fasta file - -x, --index= URL of the index. Required if input is an external source and ignored if input is a local - file - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Add new assembly from local or external fasta file - -EXAMPLES - From local file: - - $ apollo assembly add-fasta -i 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 -``` - -_See code: -[src/commands/assembly/add-fasta.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/assembly/add-fasta.ts)_ - -## `apollo assembly add-gff` - -Add new assembly from gff or gft file - -``` -USAGE - $ apollo assembly add-gff -i [--profile ] [--config-file ] [-a ] [-o] [-f] - -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 - -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-gff -i genome.gff -a myAssembly - - Import sequences only: - - $ apollo assembly add-gff -i genome.gff -a myAssembly -o -``` - -_See code: -[src/commands/assembly/add-gff.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/assembly/add-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.1.18/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.1.18/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.1.18/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.1.18/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.1.18/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` - - - rootCredentials.username: - Username of root account. Only set this for "root" access type - - - rootCredentials.password: - 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.1.18/packages/apollo-cli/src/commands/config.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 6605826fbd0eee691f83e73f -t exon -s 10 -e 20 -``` - -_See code: -[src/commands/feature/add-child.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/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.1.18/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. he 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.1.18/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.1.18/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.1.18/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.1.18/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.1.18/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.1.18/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.1.18/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.1.18/packages/apollo-cli/src/commands/feature/get-id.ts)_ - -## `apollo feature import` - -Import features from local gff file - -``` -USAGE - $ apollo feature import -i -a [--profile ] [--config-file ] [-d] - -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 - --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 -d -i features.gff3 -a myAssembly -``` - -_See code: -[src/commands/feature/import.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/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.1.18/packages/apollo-cli/src/commands/feature/search.ts)_ ## `apollo help [COMMANDS]` @@ -764,167 +52,4 @@ DESCRIPTION _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.8/src/commands/help.ts)_ -## `apollo login` - -Login to Apollo - -``` -USAGE - $ apollo login [--profile ] [--config-file ] [-a ] [-u ] [-p ] [-f] - [--port ] - -FLAGS - -a, --address= Address of Apollo server - -f, --force Force re-authentication even if user is already logged in - -p, --password= Password for - -u, --username= Username for root login - --config-file= Use this config file (mostly for testing) - --port= [default: 3000] Get token by listening to this port number (usually this is >= 1024 and < - 65536) - --profile= Use credentials from this profile - -DESCRIPTION - Login to Apollo - - Use the provided credentials to obtain and save the token to access Apollo. Once - the token for the given profile has been saved in the configuration file, users - do not normally need to execute this command again unless the token has expired. - To setup a new profile use "apollo config" - -EXAMPLES - The most basic and probably most typical usage is to login using the default - profile in configuration file: - - $ apollo login - - Login with a different profile: - - $ apollo login --profile my-profile -``` - -_See code: -[src/commands/login.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/login.ts)_ - -## `apollo logout` - -Logout of Apollo - -``` -USAGE - $ apollo logout [--profile ] [--config-file ] - -FLAGS - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Logout of Apollo - - Logout by removing the access token from the selected profile - -EXAMPLES - Logout default profile: - - $ apollo logout - - Logout selected profile - - $ apollo logout --profile my-profile -``` - -_See code: -[src/commands/logout.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/logout.ts)_ - -## `apollo refseq get` - -Get reference sequences - -``` -USAGE - $ apollo refseq get [--profile ] [--config-file ] [-a ] - -FLAGS - -a, --assembly=... Get reference sequences for these assembly names or IDs; use - to read it from stdin - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Get reference sequences - - Output the reference sequences in one or more assemblies in json format. This - command returns the sequence characteristics (e.g., name, ID, etc), not the DNA - sequences. Use `assembly sequence` for that. - -EXAMPLES - All sequences in the database: - - $ apollo refseq get - - Only sequences for these assemblies: - - $ apollo refseq get -a mm9 mm10 -``` - -_See code: -[src/commands/refseq/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/refseq/get.ts)_ - -## `apollo status` - -View authentication status - -``` -USAGE - $ apollo status [--profile ] [--config-file ] - -FLAGS - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - View authentication status - - This command returns ": Logged in" if the selected profile has an - access token and ": Logged out" otherwise. Note that this command does - not check the validity of the access token. -``` - -_See code: -[src/commands/status.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/status.ts)_ - -## `apollo user get` - -Get list of users - -``` -USAGE - $ apollo user get [--profile ] [--config-file ] [-u ] [-r ] - -FLAGS - -r, --role= Get users with this role - -u, --username= Find this username - --config-file= Use this config file (mostly for testing) - --profile= Use credentials from this profile - -DESCRIPTION - Get list of users - - If set, filters username and role must be both satisfied to return an entry - -EXAMPLES - By username: - - $ apollo user get -u Guest - - By role: - - $ apollo user get -r admin - - Use jq for more control: - - $ apollo user get | jq '.[] | select(.createdAt > "2024-03-18")' -``` - -_See code: -[src/commands/user/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/user/get.ts)_ - diff --git a/packages/apollo-cli/package.json b/packages/apollo-cli/package.json index 59fde333..6d54d258 100644 --- a/packages/apollo-cli/package.json +++ b/packages/apollo-cli/package.json @@ -50,6 +50,7 @@ "yaml": "^2.3.4" }, "devDependencies": { + "@apollo-annotation/shared": "workspace:^", "@istanbuljs/esm-loader-hook": "^0.2.0", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@oclif/test": "^3.1.3", diff --git a/packages/apollo-cli/src/commands/feature/import.ts b/packages/apollo-cli/src/commands/feature/import.ts index 1febf914..bf7e570f 100644 --- a/packages/apollo-cli/src/commands/feature/import.ts +++ b/packages/apollo-cli/src/commands/feature/import.ts @@ -1,5 +1,6 @@ import * as fs from 'node:fs' +import { type SerializedAddFeaturesFromFileChange } from '@apollo-annotation/shared' import { Flags } from '@oclif/core' import { Agent, RequestInit, fetch } from 'undici' @@ -69,7 +70,7 @@ export default class Import extends BaseCommand { 'text/x-gff3', ) - const body = { + const body: SerializedAddFeaturesFromFileChange = { typeName: 'AddFeaturesFromFileChange', assembly: assembly[0], fileId: uploadId, diff --git a/packages/jbrowse-plugin-apollo/cypress/data/go.json.gz b/packages/jbrowse-plugin-apollo/cypress/data/go.json.gz new file mode 100644 index 00000000..04a84ed6 Binary files /dev/null and b/packages/jbrowse-plugin-apollo/cypress/data/go.json.gz differ diff --git a/packages/jbrowse-plugin-apollo/cypress/e2e/editFeature.cy.ts b/packages/jbrowse-plugin-apollo/cypress/e2e/editFeature.cy.ts index a9ebe3b7..594e5d3a 100644 --- a/packages/jbrowse-plugin-apollo/cypress/e2e/editFeature.cy.ts +++ b/packages/jbrowse-plugin-apollo/cypress/e2e/editFeature.cy.ts @@ -1,5 +1,15 @@ describe('Different ways of editing features', () => { before(() => { + cy.deleteAssemblies() + cy.wrap( + window.indexedDB.databases().then((dbs) => { + for (const db of dbs) { + if (db.name) { + window.indexedDB.deleteDatabase(db.name) + } + } + }), + ) cy.addOntologies() }) diff --git a/packages/jbrowse-plugin-apollo/cypress/support/commands.ts b/packages/jbrowse-plugin-apollo/cypress/support/commands.ts index cd5f46fb..5c071376 100644 --- a/packages/jbrowse-plugin-apollo/cypress/support/commands.ts +++ b/packages/jbrowse-plugin-apollo/cypress/support/commands.ts @@ -1,3 +1,5 @@ +import { IDBPDatabase, openDB } from 'idb' + Cypress.Commands.add('loginAsGuest', () => { cy.visit('/?config=http://localhost:3999/jbrowse/config.json') cy.contains('Linear Genome View', { timeout: 10_000 }).click() @@ -16,6 +18,47 @@ Cypress.Commands.add('deleteAssemblies', () => { } }) +type OntologyKey = 'nodes' | 'edges' | 'meta' + +async function loadOntology( + ontologyGZip: Buffer, + name: string, + version: number, +) { + const blob = new Blob([ontologyGZip]) + const ds = new DecompressionStream('gzip') + const decompressedStream = blob.stream().pipeThrough(ds) + const ontologyBlob = await new Response(decompressedStream).blob() + const ontologyJSON = await ontologyBlob.text() + const ontologyData = JSON.parse(ontologyJSON) as Record< + OntologyKey, + unknown[] + > + await openDB(name, version, { + async upgrade(database: IDBPDatabase): Promise { + const meta = database.createObjectStore('meta') + await meta.add(ontologyData.meta[0], 'meta') + const nodes = database.createObjectStore('nodes', { keyPath: 'id' }) + nodes.createIndex('by-label', 'lbl') + nodes.createIndex('by-type', 'type') + nodes.createIndex('by-synonym', ['meta', 'synonyms', 'val']) + nodes.createIndex('full-text-words', 'fullTextWords', { + multiEntry: true, + }) + for (const node of ontologyData.nodes) { + await nodes.add(node) + } + const edges = database.createObjectStore('edges', { autoIncrement: true }) + edges.createIndex('by-subject', 'sub') + edges.createIndex('by-object', 'obj') + edges.createIndex('by-predicate', 'pred') + for (const edge of ontologyData.edges) { + await edges.add(edge) + } + }, + }) +} + Cypress.Commands.add('addOntologies', () => { cy.deleteMany({}, { collection: 'jbrowseconfigs' }) cy.insertOne( @@ -45,6 +88,12 @@ Cypress.Commands.add('addOntologies', () => { }, { collection: 'jbrowseconfigs' }, ) + cy.readFile('cypress/data/go.json.gz', null).then((goGZip: Buffer) => { + cy.wrap>( + loadOntology(goGZip, 'Apollo Ontology "Gene Ontology" "full"', 2), + { timeout: 120_000 }, + ) + }) }) Cypress.Commands.add('addAssemblyFromGff', (assemblyName, fin) => { diff --git a/packages/jbrowse-plugin-apollo/src/OntologyManager/index.ts b/packages/jbrowse-plugin-apollo/src/OntologyManager/index.ts index de6e0eba..3225c522 100644 --- a/packages/jbrowse-plugin-apollo/src/OntologyManager/index.ts +++ b/packages/jbrowse-plugin-apollo/src/OntologyManager/index.ts @@ -40,7 +40,7 @@ export const OntologyRecordType = types addDisposer( self, autorun(() => { - // this.initDataStore() + this.initDataStore() }), ) }, diff --git a/packages/jbrowse-plugin-apollo/src/session/ClientDataStore.ts b/packages/jbrowse-plugin-apollo/src/session/ClientDataStore.ts index ca7365cb..a6a91faa 100644 --- a/packages/jbrowse-plugin-apollo/src/session/ClientDataStore.ts +++ b/packages/jbrowse-plugin-apollo/src/session/ClientDataStore.ts @@ -142,7 +142,7 @@ export function clientDataStoreFactory( afterCreate() { addDisposer( self, - autorun((reaction) => { + autorun(() => { // Merge in the ontologies from our plugin configuration. // Ontologies of a given name that are already in the session // take precedence over the ontologies in the configuration. @@ -171,7 +171,6 @@ export function clientDataStoreFactory( } // TODO: add in any configured ontology prefixes that we don't already // have in the session (or hardcoded in the model) - reaction.dispose() }), ) }, diff --git a/yarn.lock b/yarn.lock index b986cbd2..87ca5549 100644 --- a/yarn.lock +++ b/yarn.lock @@ -119,6 +119,7 @@ __metadata: version: 0.0.0-use.local resolution: "@apollo-annotation/cli@workspace:packages/apollo-cli" dependencies: + "@apollo-annotation/shared": "workspace:^" "@inquirer/input": "npm:^1.2.14" "@inquirer/password": "npm:^1.1.14" "@inquirer/select": "npm:^1.3.1"