@apollo-annotation/cli
Advanced tools
Comparing version 0.1.19 to 0.1.20
@@ -13,3 +13,3 @@ import { Command, Interfaces } from '@oclif/core'; | ||
private getConfig; | ||
getAccess(configFile: string | undefined, profileName: string | undefined): Promise<{ | ||
getAccess(): Promise<{ | ||
address: string; | ||
@@ -16,0 +16,0 @@ accessToken: string; |
@@ -35,7 +35,6 @@ import path from 'node:path'; | ||
} | ||
async getAccess(configFile, profileName) { | ||
async getAccess() { | ||
const { 'config-file': configFile, profile } = this.flags; | ||
const config = this.getConfig(configFile); | ||
if (profileName === undefined) { | ||
profileName = process.env.APOLLO_PROFILE ?? 'default'; | ||
} | ||
const profileName = process.env.APOLLO_PROFILE ?? profile ?? 'default'; | ||
return config.getAccess(profileName); | ||
@@ -42,0 +41,0 @@ } |
import { Flags } from '@oclif/core'; | ||
import { fetch } from 'undici'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { convertCheckNameToId, createFetchErrorMessage, getAssembly, idReader, localhostToAddress, wrapLines, } from '../../utils.js'; | ||
import { convertCheckNameToId, createFetchErrorMessage, getAssembly, idReader, localhostToAddress, } from '../../utils.js'; | ||
async function setChecks(address, accessToken, assembly, checkId) { | ||
@@ -57,4 +57,5 @@ const check = { | ||
static summary = 'Add, view, or delete checks to assembly'; | ||
static description = wrapLines('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`.'); | ||
static description = '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`.'; | ||
static examples = [ | ||
@@ -95,3 +96,3 @@ { | ||
const { flags } = await this.parse(Check); | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const checkTypes = await getCheckTypes(access.address, access.accessToken); | ||
@@ -105,7 +106,4 @@ if (flags.check === undefined && flags.assembly === undefined) { | ||
} | ||
const asm = idReader([flags.assembly]); | ||
const asm = await idReader([flags.assembly]); | ||
const assembly = await getAssembly(access.address, access.accessToken, asm[0]); | ||
if (Object.keys(assembly).length === 0) { | ||
this.error(`Assembly ${flags.assembly} not found`); | ||
} | ||
const currentChecks = getCheckTypesForAssembly(checkTypes, assembly); | ||
@@ -138,4 +136,6 @@ if (flags.check === undefined) { | ||
} | ||
await setChecks(access.address, access.accessToken, assembly['_id'], [...newChecks.values()]); | ||
await setChecks(access.address, access.accessToken, assembly._id, [ | ||
...newChecks.values(), | ||
]); | ||
} | ||
} |
import { Flags } from '@oclif/core'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { convertAssemblyNameToId, deleteAssembly, getAssembly, idReader, wrapLines, } from '../../utils.js'; | ||
import { convertAssemblyNameToId, deleteAssembly, getAssembly, idReader, } from '../../utils.js'; | ||
export default class Delete extends BaseCommand { | ||
static summary = 'Delete assemblies'; | ||
static description = wrapLines('Assemblies to delete may be names or IDs'); | ||
static description = 'Assemblies to delete may be names or IDs'; | ||
static examples = [ | ||
@@ -27,4 +27,4 @@ { | ||
const { flags } = await this.parse(Delete); | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const assembly = idReader(flags.assembly); | ||
const access = await this.getAccess(); | ||
const assembly = await idReader(flags.assembly); | ||
const deleteIds = await convertAssemblyNameToId(access.address, access.accessToken, assembly); | ||
@@ -31,0 +31,0 @@ let i = 0; |
import { Flags } from '@oclif/core'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { convertAssemblyNameToId, idReader, queryApollo, wrapLines, } from '../../utils.js'; | ||
import { convertAssemblyNameToId, idReader, queryApollo } from '../../utils.js'; | ||
export default class Get extends BaseCommand { | ||
static summary = 'Get available assemblies'; | ||
static description = wrapLines('Print to stdout the list of assemblies in json format'); | ||
static description = 'Print to stdout the list of assemblies in json format'; | ||
static flags = { | ||
@@ -16,7 +16,7 @@ assembly: Flags.string({ | ||
const { flags } = await this.parse(Get); | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const assemblies = await queryApollo(access.address, access.accessToken, 'assemblies'); | ||
let assemblyIds = []; | ||
if (flags.assembly !== undefined) { | ||
const assembly = idReader(flags.assembly); | ||
const assembly = await idReader(flags.assembly); | ||
assemblyIds = await convertAssemblyNameToId(access.address, access.accessToken, assembly); | ||
@@ -23,0 +23,0 @@ } |
@@ -5,3 +5,3 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, getRefseqId, idReader, localhostToAddress, queryApollo, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, getRefseqId, idReader, localhostToAddress, queryApollo, } from '../../utils.js'; | ||
async function getSequence(address, accessToken, refSeq, start, end) { | ||
@@ -31,3 +31,3 @@ const url = new URL(localhostToAddress(`${address}/sequence`)); | ||
static summary = 'Get reference sequence in fasta format'; | ||
static description = wrapLines('Return the reference sequence for a given assembly and coordinates'); | ||
static description = 'Return the reference sequence for a given assembly and coordinates'; | ||
static examples = [ | ||
@@ -68,7 +68,7 @@ { | ||
} | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
let assembly = undefined; | ||
if (flags.assembly !== undefined) { | ||
; | ||
[assembly] = idReader([flags.assembly]); | ||
[assembly] = await idReader([flags.assembly]); | ||
} | ||
@@ -75,0 +75,0 @@ let refseqIds = []; |
import { Flags } from '@oclif/core'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { convertAssemblyNameToId, idReader, queryApollo, wrapLines, } from '../../utils.js'; | ||
import { convertAssemblyNameToId, idReader, queryApollo } from '../../utils.js'; | ||
export default class Get extends BaseCommand { | ||
static summary = 'Get list of changes'; | ||
static description = wrapLines('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.'); | ||
static description = '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.'; | ||
static flags = { | ||
@@ -19,3 +19,3 @@ assembly: Flags.string({ | ||
const { flags } = await this.parse(Get); | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const changes = await queryApollo(access.address, access.accessToken, 'changes'); | ||
@@ -26,3 +26,3 @@ const json = (await changes.json()); | ||
keep = []; | ||
const assembly = idReader(flags.assembly); | ||
const assembly = await idReader(flags.assembly); | ||
const assemblyIds = await convertAssemblyNameToId(access.address, access.accessToken, assembly); | ||
@@ -29,0 +29,0 @@ for (const x of json) { |
@@ -10,9 +10,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ | ||
import { BaseCommand } from '../baseCommand.js'; | ||
import { createFetchErrorMessage, localhostToAddress, wrapLines, } from '../utils.js'; | ||
import { createFetchErrorMessage, localhostToAddress } from '../utils.js'; | ||
export default class ApolloConfig extends BaseCommand { | ||
static summary = 'Get or set apollo configuration options'; | ||
static description = wrapLines(`Use this command to create or edit a user profile with credentials to access Apollo. \ | ||
Configuration options are: | ||
static description = `Use this command to create or edit a user profile with credentials to access Apollo. Configuration options are: | ||
${optionDesc().join('\n\n')}`); | ||
${optionDesc().join('\n\n')}`; | ||
static args = { | ||
@@ -19,0 +18,0 @@ key: Args.string({ |
@@ -7,10 +7,11 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, getFeatureById, idReader, localhostToAddress, queryApollo, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, getFeatureById, idReader, localhostToAddress, queryApollo, } from '../../utils.js'; | ||
export default class Get extends BaseCommand { | ||
static summary = 'Add a child feature (e.g. add an exon to an mRNA)'; | ||
static description = wrapLines('See the other commands under `apollo feature` to retrive the parent ID of interest and to populate the child feature with attributes.'); | ||
static description = 'See the other commands under `apollo feature` \ | ||
to retrive the parent ID of interest and to populate the child feature with attributes.'; | ||
static examples = [ | ||
{ | ||
description: 'Add an exon at genomic coordinates 10..20 to this feature ID:', | ||
command: '<%= config.bin %> <%= command.id %> -i 6605826fbd0eee691f83e73f -t exon -s 10 -e 20', | ||
command: '<%= config.bin %> <%= command.id %> -i 660...73f -t exon -s 10 -e 20', | ||
}, | ||
@@ -48,3 +49,3 @@ ]; | ||
} | ||
const ff = idReader([flags['feature-id']]); | ||
const ff = await idReader([flags['feature-id']]); | ||
if (ff.length !== 1) { | ||
@@ -54,3 +55,3 @@ this.error(`Expected only one feature identifier. Got ${ff.length}`); | ||
const [featureId] = ff; | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const res = await getFeatureById(access.address, access.accessToken, featureId); | ||
@@ -57,0 +58,0 @@ if (!res.ok) { |
import { Flags } from '@oclif/core'; | ||
import { fetch } from 'undici'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { convertAssemblyNameToId, createFetchErrorMessage, idReader, localhostToAddress, queryApollo, wrapLines, } from '../../utils.js'; | ||
import { convertAssemblyNameToId, createFetchErrorMessage, idReader, localhostToAddress, queryApollo, } from '../../utils.js'; | ||
export default class Check extends BaseCommand { | ||
static summary = 'Get check results'; | ||
static description = wrapLines('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'); | ||
static description = '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'; | ||
static examples = [ | ||
@@ -32,6 +32,6 @@ { | ||
const { flags } = await this.parse(Check); | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
let keepFeatures = new Set(); | ||
if (flags['feature-id'] !== undefined) { | ||
keepFeatures = new Set(idReader(flags['feature-id'])); | ||
keepFeatures = new Set(await idReader(flags['feature-id'])); | ||
} | ||
@@ -79,3 +79,3 @@ const keepAsmId = await keepAssemblies(access.address, access.accessToken, flags.assembly); | ||
else { | ||
const ids = idReader([assembly]); | ||
const ids = await idReader([assembly]); | ||
keepAssembly = await convertAssemblyNameToId(address, accessToken, ids); | ||
@@ -82,0 +82,0 @@ } |
@@ -5,7 +5,8 @@ import { Flags } from '@oclif/core'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, getAssemblyFromRefseq, getFeatureById, getRefseqId, localhostToAddress, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, getAssemblyFromRefseq, getFeatureById, getRefseqId, localhostToAddress, } from '../../utils.js'; | ||
export default class Copy extends BaseCommand { | ||
static summary = 'Copy a feature to another location'; | ||
static description = wrapLines('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.'); | ||
static description = '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.'; | ||
static examples = [ | ||
@@ -44,3 +45,3 @@ { | ||
} | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const res = await getFeatureById(access.address, access.accessToken, flags['feature-id']); | ||
@@ -47,0 +48,0 @@ if (!res.ok) { |
import { Flags } from '@oclif/core'; | ||
import { fetch } from 'undici'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, getFeatureById, idReader, localhostToAddress, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, getFeatureById, idReader, localhostToAddress, } from '../../utils.js'; | ||
async function deleteFeature(address, accessToken, feature) { | ||
@@ -37,3 +37,3 @@ const changeJson = { | ||
static summary = 'Delete one or more features by ID'; | ||
static description = wrapLines('Note that deleting a child feature after deleting its parent will result in an error unless you set -f/--force.'); | ||
static description = 'Note that deleting a child feature after deleting its parent will result in an error unless you set -f/--force.'; | ||
static flags = { | ||
@@ -57,3 +57,3 @@ 'feature-id': Flags.string({ | ||
const { flags } = await this.parse(Delete); | ||
const tmpIds = idReader(flags['feature-id']); | ||
const tmpIds = await idReader(flags['feature-id']); | ||
const featureIds = new Set(); | ||
@@ -63,3 +63,3 @@ for (const x of tmpIds) { | ||
} | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
for (const featureId of featureIds) { | ||
@@ -66,0 +66,0 @@ const res = await getFeatureById(access.address, access.accessToken, featureId); |
import { Flags } from '@oclif/core'; | ||
import { fetch } from 'undici'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, getAssemblyFromRefseq, getFeatureById, idReader, localhostToAddress, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, getAssemblyFromRefseq, getFeatureById, idReader, localhostToAddress, } from '../../utils.js'; | ||
export default class EditAttibute extends BaseCommand { | ||
static summary = 'Add, edit, or view a feature attribute'; | ||
static description = wrapLines('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'); | ||
static description = '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'; | ||
static examples = [ | ||
@@ -49,3 +50,3 @@ { | ||
} | ||
const ff = idReader([flags['feature-id']]); | ||
const ff = await idReader([flags['feature-id']]); | ||
if (ff.length !== 1) { | ||
@@ -55,3 +56,3 @@ this.error(`Expected only one feature identifier. Got ${ff.length}`); | ||
const [featureId] = ff; | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const response = await getFeatureById(access.address, access.accessToken, featureId); | ||
@@ -58,0 +59,0 @@ if (!response.ok) { |
import { Flags } from '@oclif/core'; | ||
import { fetch } from 'undici'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, getAssemblyFromRefseq, getFeatureById, idReader, localhostToAddress, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, getAssemblyFromRefseq, getFeatureById, idReader, localhostToAddress, } from '../../utils.js'; | ||
export default class Get extends BaseCommand { | ||
static summary = 'Edit feature start and/or end coordinates'; | ||
static description = wrapLines("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`"); | ||
static description = "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`"; | ||
static examples = [ | ||
@@ -50,3 +50,3 @@ { | ||
} | ||
const ff = idReader([flags['feature-id']]); | ||
const ff = await idReader([flags['feature-id']]); | ||
if (ff.length !== 1) { | ||
@@ -56,3 +56,3 @@ this.error(`Expected only one feature identifier. Got ${ff.length}`); | ||
const [featureId] = ff; | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const res = await getFeatureById(access.address, access.accessToken, featureId); | ||
@@ -59,0 +59,0 @@ if (!res.ok) { |
import { Flags } from '@oclif/core'; | ||
import { fetch } from 'undici'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, getAssemblyFromRefseq, getFeatureById, idReader, localhostToAddress, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, getAssemblyFromRefseq, getFeatureById, idReader, localhostToAddress, } from '../../utils.js'; | ||
export default class Get extends BaseCommand { | ||
static summary = 'Edit or view feature type'; | ||
static description = wrapLines('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.'); | ||
static description = '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.'; | ||
static flags = { | ||
@@ -22,3 +22,3 @@ 'feature-id': Flags.string({ | ||
const { flags } = await this.parse(Get); | ||
const ff = idReader([flags['feature-id']]); | ||
const ff = await idReader([flags['feature-id']]); | ||
if (ff.length !== 1) { | ||
@@ -28,3 +28,3 @@ this.error(`Expected only one feature identifier. Got ${ff.length}`); | ||
const [featureId] = ff; | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const response = await getFeatureById(access.address, access.accessToken, featureId); | ||
@@ -31,0 +31,0 @@ if (!response.ok) { |
@@ -6,6 +6,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, localhostToAddress, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, localhostToAddress, readStdin, } from '../../utils.js'; | ||
export default class Get extends BaseCommand { | ||
static summary = 'Edit features using an appropiate json input'; | ||
static description = wrapLines(`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. | ||
static description = `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. | ||
@@ -23,3 +23,3 @@ 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: | ||
"newType": "G_quartet" | ||
}`); | ||
}`; | ||
static examples = [ | ||
@@ -42,3 +42,3 @@ { | ||
if (flags['json-input'] === '-') { | ||
jsonStr = fs.readFileSync(process.stdin.fd).toString(); | ||
jsonStr = await readStdin(); | ||
} | ||
@@ -52,3 +52,3 @@ else if (fs.existsSync(flags['json-input'])) { | ||
} | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
for (const change of json) { | ||
@@ -55,0 +55,0 @@ const str = JSON.stringify(change); |
import { Flags } from '@oclif/core'; | ||
import { fetch } from 'undici'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, idReader, localhostToAddress, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, idReader, localhostToAddress, } from '../../utils.js'; | ||
export default class Get extends BaseCommand { | ||
static summary = 'Get features given their identifiers'; | ||
static description = wrapLines('Invalid identifiers or identifiers not found in the database will be silently ignored'); | ||
static description = 'Invalid identifiers or identifiers not found in the database will be silently ignored'; | ||
static examples = [ | ||
@@ -17,3 +17,3 @@ { | ||
char: 'i', | ||
description: wrapLines('Retrieves feature with these IDs. Use "-" to read IDs from stdin (one per line)', 40), | ||
description: 'Retrieves feature with these IDs. Use "-" to read IDs from stdin (one per line)', | ||
multiple: true, | ||
@@ -25,4 +25,4 @@ default: ['-'], | ||
const { flags } = await this.parse(Get); | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
let ids = idReader(flags['feature-id']); | ||
const access = await this.getAccess(); | ||
let ids = await idReader(flags['feature-id']); | ||
ids = [...new Set(ids)]; | ||
@@ -29,0 +29,0 @@ const results = []; |
import { Flags } from '@oclif/core'; | ||
import { fetch } from 'undici'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, getRefseqId, localhostToAddress, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, getRefseqId, localhostToAddress, } from '../../utils.js'; | ||
export default class Get extends BaseCommand { | ||
@@ -13,3 +13,3 @@ static description = 'Get features in assembly, reference sequence or genomic window'; | ||
{ | ||
description: wrapLines('Get features intersecting chr1:1..1000. You can omit the assembly name if there are no other reference sequences named chr1:'), | ||
description: 'Get features intersecting chr1:1..1000. You can omit the assembly name if there are no other reference sequences named chr1:', | ||
command: '<%= config.bin %> <%= command.id %> -a myAssembly -r chr1 -s 1 -e 1000', | ||
@@ -43,3 +43,3 @@ }, | ||
} | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const refseqIds = await getRefseqId(access.address, access.accessToken, flags.refseq, flags.assembly); | ||
@@ -46,0 +46,0 @@ const results = []; |
@@ -1,3 +0,3 @@ | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
export default class Import extends BaseCommand<typeof Import> { | ||
import { FileCommand } from '../../fileCommand.js'; | ||
export default class Import extends FileCommand { | ||
static summary: string; | ||
@@ -4,0 +4,0 @@ static description: string; |
import * as fs from 'node:fs'; | ||
import { Flags } from '@oclif/core'; | ||
import { Agent, fetch } from 'undici'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { convertAssemblyNameToId, createFetchErrorMessage, localhostToAddress, uploadFile, } from '../../utils.js'; | ||
export default class Import extends BaseCommand { | ||
import { FileCommand } from '../../fileCommand.js'; | ||
import { convertAssemblyNameToId, createFetchErrorMessage, localhostToAddress, } from '../../utils.js'; | ||
export default class Import extends FileCommand { | ||
static summary = 'Import features from local gff file'; | ||
@@ -18,3 +18,3 @@ static description = 'By default, features are added to the existing ones.'; | ||
char: 'i', | ||
description: 'Input gff or gtf file', | ||
description: 'Input gff file', | ||
required: true, | ||
@@ -37,3 +37,3 @@ }), | ||
} | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const assembly = await convertAssemblyNameToId(access.address, access.accessToken, [flags.assembly]); | ||
@@ -43,3 +43,3 @@ if (assembly.length === 0) { | ||
} | ||
const uploadId = await uploadFile(access.address, access.accessToken, flags['input-file'], 'text/x-gff3'); | ||
const uploadId = await this.uploadFile(access.address, access.accessToken, flags['input-file'], 'text/x-gff3', false); | ||
const body = { | ||
@@ -46,0 +46,0 @@ typeName: 'AddFeaturesFromFileChange', |
@@ -5,3 +5,3 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { convertAssemblyNameToId, createFetchErrorMessage, idReader, localhostToAddress, queryApollo, wrapLines, } from '../../utils.js'; | ||
import { convertAssemblyNameToId, createFetchErrorMessage, idReader, localhostToAddress, queryApollo, } from '../../utils.js'; | ||
async function searchFeatures(address, accessToken, assemblies, term) { | ||
@@ -29,3 +29,3 @@ const url = new URL(localhostToAddress(`${address}/features/searchFeatures`)); | ||
static summary = 'Free text search for feature in one or more assemblies'; | ||
static description = wrapLines(`Return features matching a query string. This command searches only in: | ||
static description = `Return features matching a query string. This command searches only in: | ||
@@ -52,3 +52,3 @@ - Attribute *values* (not attribute names) | ||
- "chr1" | ||
- "0.987"`); | ||
- "0.987"`; | ||
static examples = [ | ||
@@ -69,3 +69,3 @@ { | ||
multiple: true, | ||
description: wrapLines('Assembly names or IDs to search; use "-" to read it from stdin. If omitted search all assemblies'), | ||
description: 'Assembly names or IDs to search; use "-" to read it from stdin. If omitted search all assemblies', | ||
}), | ||
@@ -75,3 +75,3 @@ }; | ||
const { flags } = await this.parse(Search); | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
let assemblyIds = []; | ||
@@ -85,3 +85,3 @@ if (flags.assembly === undefined) { | ||
else { | ||
const assembly = idReader(flags.assembly); | ||
const assembly = await idReader(flags.assembly); | ||
assemblyIds = await convertAssemblyNameToId(access.address, access.accessToken, assembly); | ||
@@ -88,0 +88,0 @@ } |
@@ -11,17 +11,17 @@ /* eslint-disable @typescript-eslint/require-await */ | ||
import { fetch } from 'undici'; | ||
import { ApolloConf } from '../ApolloConf.js'; | ||
import { ApolloConf, KEYS } from '../ApolloConf.js'; | ||
import { BaseCommand } from '../baseCommand.js'; | ||
import { basicCheckConfig, createFetchErrorMessage, getUserCredentials, localhostToAddress, waitFor, wrapLines, } from '../utils.js'; | ||
import { basicCheckConfig, createFetchErrorMessage, localhostToAddress, waitFor, } from '../utils.js'; | ||
export default class Login extends BaseCommand { | ||
static summary = 'Login to Apollo'; | ||
static description = wrapLines('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"'); | ||
static description = '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"'; | ||
static examples = [ | ||
{ | ||
description: wrapLines('The most basic and probably most typical usage is to login using the default profile in configuration file:'), | ||
description: 'The most basic and probably most typical usage is to login using the default profile in configuration file:', | ||
command: '<%= config.bin %> <%= command.id %>', | ||
}, | ||
{ | ||
description: wrapLines('Login with a different profile:'), | ||
description: 'Login with a different profile:', | ||
command: '<%= config.bin %> <%= command.id %> --profile my-profile', | ||
@@ -75,3 +75,3 @@ }, | ||
if (!flags.force) { | ||
await this.checkUserAlreadyLoggedIn(); | ||
await this.checkUserAlreadyLoggedIn(config, profileName); | ||
} | ||
@@ -109,11 +109,7 @@ if (accessType === 'root' || flags.username !== undefined) { | ||
} | ||
async checkUserAlreadyLoggedIn() { | ||
const userCredentials = getUserCredentials(); | ||
if (!userCredentials) { | ||
async checkUserAlreadyLoggedIn(userCredentials, profileName) { | ||
const accessToken = userCredentials.get(`${profileName}.${KEYS.accessToken}`); | ||
if (!accessToken) { | ||
return; | ||
} | ||
const alreadyLoggedIn = Object.keys(userCredentials).every((key) => Boolean(userCredentials[key])); | ||
if (!alreadyLoggedIn) { | ||
return; | ||
} | ||
const reAuthenticate = await ux.confirm("You're already logged. Do you want to re-authenticate? (y/n)"); | ||
@@ -120,0 +116,0 @@ if (!reAuthenticate) { |
import path from 'node:path'; | ||
import { ApolloConf, KEYS } from '../ApolloConf.js'; | ||
import { BaseCommand } from '../baseCommand.js'; | ||
import { basicCheckConfig, wrapLines } from '../utils.js'; | ||
import { basicCheckConfig } from '../utils.js'; | ||
export default class Logout extends BaseCommand { | ||
static summary = 'Logout of Apollo'; | ||
static description = wrapLines('Logout by removing the access token from the selected profile'); | ||
static description = 'Logout by removing the access token from the selected profile'; | ||
static examples = [ | ||
@@ -9,0 +9,0 @@ { |
@@ -5,7 +5,7 @@ import * as fs from 'node:fs'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { createFetchErrorMessage, localhostToAddress, queryApollo, wrapLines, } from '../../utils.js'; | ||
import { createFetchErrorMessage, localhostToAddress, queryApollo, } from '../../utils.js'; | ||
import { ConfigError } from '../../ApolloConf.js'; | ||
export default class AddRefNameAlias extends BaseCommand { | ||
static summary = 'Add reference name aliases from a file'; | ||
static description = wrapLines('Reference name aliasing is a process to make chromosomes that are named slightly differently but which refer to the same thing render properly. This command reads a file with reference name aliases and adds them to the database.'); | ||
static description = 'Reference name aliasing is a process to make chromosomes that are named slightly differently but which refer to the same thing render properly. This command reads a file with reference name aliases and adds them to the database.'; | ||
static examples = [ | ||
@@ -34,3 +34,3 @@ { | ||
} | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const filehandle = await fs.promises.open(flags['input-file']); | ||
@@ -37,0 +37,0 @@ const fileContent = await filehandle.readFile({ encoding: 'utf8' }); |
import { Flags } from '@oclif/core'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { convertAssemblyNameToId, idReader, queryApollo, wrapLines, } from '../../utils.js'; | ||
import { convertAssemblyNameToId, idReader, queryApollo } from '../../utils.js'; | ||
export default class Get extends BaseCommand { | ||
static summary = 'Get reference sequences'; | ||
static description = wrapLines('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.'); | ||
static description = '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.'; | ||
static examples = [ | ||
{ | ||
description: wrapLines('All sequences in the database:'), | ||
description: 'All sequences in the database:', | ||
command: '<%= config.bin %> <%= command.id %>', | ||
}, | ||
{ | ||
description: wrapLines('Only sequences for these assemblies:'), | ||
description: 'Only sequences for these assemblies:', | ||
command: '<%= config.bin %> <%= command.id %> -a mm9 mm10', | ||
@@ -28,3 +28,3 @@ }, | ||
const { flags } = await this.parse(Get); | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const refSeqs = await queryApollo(access.address, access.accessToken, 'refSeqs'); | ||
@@ -35,3 +35,3 @@ const json = (await refSeqs.json()); | ||
keep = []; | ||
const assembly = idReader(flags.assembly); | ||
const assembly = await idReader(flags.assembly); | ||
const assemblyIds = await convertAssemblyNameToId(access.address, access.accessToken, assembly); | ||
@@ -38,0 +38,0 @@ for (const x of json) { |
@@ -5,7 +5,8 @@ /* eslint-disable @typescript-eslint/no-unnecessary-condition */ | ||
import { BaseCommand } from '../baseCommand.js'; | ||
import { basicCheckConfig, wrapLines } from '../utils.js'; | ||
import { basicCheckConfig } from '../utils.js'; | ||
export default class Status extends BaseCommand { | ||
static summary = 'View authentication status'; | ||
static description = wrapLines('This command returns "<profile>: Logged in" if the selected profile has an access token and "<profile>: Logged out" otherwise.\ | ||
Note that this command does not check the validity of the access token.'); | ||
static description = 'This command returns "<profile>: Logged in" if the selected profile \ | ||
has an access token and "<profile>: Logged out" otherwise.\ | ||
Note that this command does not check the validity of the access token.'; | ||
async run() { | ||
@@ -12,0 +13,0 @@ const { flags } = await this.parse(Status); |
import { Flags } from '@oclif/core'; | ||
import { BaseCommand } from '../../baseCommand.js'; | ||
import { queryApollo, wrapLines } from '../../utils.js'; | ||
import { queryApollo } from '../../utils.js'; | ||
export default class Get extends BaseCommand { | ||
static summary = 'Get list of users'; | ||
static description = wrapLines('If set, filters username and role must be both satisfied to return an entry'); | ||
static description = 'If set, filters username and role must be both satisfied to return an entry'; | ||
static examples = [ | ||
@@ -33,3 +33,3 @@ { | ||
const { flags } = await this.parse(Get); | ||
const access = await this.getAccess(flags['config-file'], flags.profile); | ||
const access = await this.getAccess(); | ||
const users = await queryApollo(access.address, access.accessToken, 'users'); | ||
@@ -36,0 +36,0 @@ const json = (await users.json()); |
import EventEmitter from 'node:events'; | ||
import { Response } from 'undici'; | ||
import { ApolloConf } from './ApolloConf.js'; | ||
import { ApolloAssemblySnapshot } from '@apollo-annotation/mst'; | ||
export declare const CLI_SERVER_ADDRESS = "http://127.0.0.1:5657"; | ||
@@ -20,6 +21,6 @@ export declare const CLI_SERVER_ADDRESS_CALLBACK = "http://127.0.0.1:5657/auth/callback"; | ||
export declare function deleteAssembly(address: string, accessToken: string, assemblyId: string): Promise<void>; | ||
export declare function getAssembly(address: string, accessToken: string, assemblyNameOrId: string): Promise<object>; | ||
export declare function getAssembly(address: string, accessToken: string, assemblyNameOrId: string): Promise<ApolloAssemblySnapshot>; | ||
export declare function getRefseqId(address: string, accessToken: string, refseqNameOrId?: string, inAssemblyNameOrId?: string): Promise<string[]>; | ||
export declare function convertCheckNameToId(address: string, accessToken: string, namesOrIds: string[]): Promise<string[]>; | ||
export declare function assemblyNameToIdDict(address: string, accessToken: string): Promise<Record<string, string>>; | ||
export declare function assemblyNameToIdDict(address: string, accessToken: string): Promise<Record<string, string | undefined>>; | ||
/** In input array namesOrIds, substitute common names with internal IDs */ | ||
@@ -31,3 +32,2 @@ export declare function convertAssemblyNameToId(address: string, accessToken: string, namesOrIds: string[], verbose?: boolean, removeDuplicates?: boolean): Promise<string[]>; | ||
export declare function filterJsonList(json: object[], keep: string[], key: string): object[]; | ||
export declare const getUserCredentials: () => UserCredentials | null; | ||
export declare const generatePkceChallenge: () => { | ||
@@ -39,7 +39,19 @@ state: string; | ||
export declare const waitFor: <T>(eventName: string, emitter: EventEmitter) => Promise<T>; | ||
interface bodyLocalFile { | ||
interface bodyFastaFile { | ||
assemblyName: string; | ||
typeName: string; | ||
fileId: string; | ||
fileIds: { | ||
fa: string; | ||
}; | ||
assembly: string; | ||
} | ||
interface bodyIndexedFiles { | ||
assemblyName: string; | ||
typeName: string; | ||
fileIds: { | ||
fa: string; | ||
fai: string; | ||
gzi: string; | ||
}; | ||
} | ||
interface bodyExternalFile { | ||
@@ -53,6 +65,5 @@ assemblyName: string; | ||
} | ||
export declare function submitAssembly(address: string, accessToken: string, body: bodyLocalFile | bodyExternalFile, force: boolean): Promise<Response>; | ||
export declare function uploadFile(address: string, accessToken: string, file: string, type: string): Promise<never>; | ||
export declare function wrapLines(s: string, length?: number): string; | ||
export declare function idReader(input: string[], removeDuplicates?: boolean): string[]; | ||
export declare function submitAssembly(address: string, accessToken: string, body: bodyFastaFile | bodyExternalFile | bodyIndexedFiles, force: boolean): Promise<object>; | ||
export declare function readStdin(): Promise<string>; | ||
export declare function idReader(input: string[], removeDuplicates?: boolean): Promise<string[]>; | ||
export {}; |
@@ -1,15 +0,6 @@ | ||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */ | ||
/* eslint-disable @typescript-eslint/no-unsafe-call */ | ||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ | ||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */ | ||
/* eslint-disable @typescript-eslint/no-unsafe-return */ | ||
import * as crypto from 'node:crypto'; | ||
import * as fs from 'node:fs'; | ||
import * as os from 'node:os'; | ||
import * as path from 'node:path'; | ||
import { Transform, pipeline, } from 'node:stream'; | ||
import { SingleBar } from 'cli-progress'; | ||
import { stdin, stderr } from 'node:process'; | ||
import { Agent, fetch } from 'undici'; | ||
import { ApolloConf, ConfigError } from './ApolloConf.js'; | ||
const CONFIG_PATH = path.resolve(os.homedir(), '.clirc'); | ||
export const CLI_SERVER_ADDRESS = 'http://127.0.0.1:5657'; | ||
@@ -78,14 +69,12 @@ export const CLI_SERVER_ADDRESS_CALLBACK = `${CLI_SERVER_ADDRESS}/auth/callback`; | ||
if (assemblyId.length === 0) { | ||
return {}; | ||
throw new Error(`Assembly "${assemblyNameOrId}" not found`); | ||
} | ||
const res = await queryApollo(address, accessToken, 'assemblies'); | ||
const assemblies = (await res.json()); | ||
let assemblyObj = {}; | ||
for (const x of assemblies) { | ||
if (x._id === assemblyId[0]) { | ||
assemblyObj = JSON.parse(JSON.stringify(x)); | ||
break; | ||
return JSON.parse(JSON.stringify(x)); | ||
} | ||
} | ||
return assemblyObj; | ||
throw new Error(`Assembly "${assemblyNameOrId}" not found`); | ||
} | ||
@@ -180,3 +169,3 @@ export async function getRefseqId(address, accessToken, refseqNameOrId, inAssemblyNameOrId) { | ||
else if (verbose) { | ||
process.stderr.write(`Warning: Omitting unknown assembly: "${x}"\n`); | ||
stderr.write(`Warning: Omitting unknown assembly: "${x}"\n`); | ||
} | ||
@@ -229,11 +218,2 @@ } | ||
} | ||
export const getUserCredentials = () => { | ||
try { | ||
const content = fs.readFileSync(CONFIG_PATH, { encoding: 'utf8' }); | ||
return JSON.parse(content); | ||
} | ||
catch { | ||
return null; | ||
} | ||
}; | ||
export const generatePkceChallenge = () => { | ||
@@ -265,3 +245,3 @@ const codeVerifier = crypto.randomBytes(64).toString('hex'); | ||
export async function submitAssembly(address, accessToken, body, force) { | ||
const assemblies = await queryApollo(address, accessToken, 'assemblies'); | ||
let assemblies = await queryApollo(address, accessToken, 'assemblies'); | ||
for (const x of (await assemblies.json())) { | ||
@@ -290,77 +270,20 @@ if (x['name'] === body.assemblyName) { | ||
const errorMessage = await createFetchErrorMessage(response, 'submitAssembly failed'); | ||
throw new ConfigError(errorMessage); | ||
throw new Error(errorMessage); | ||
} | ||
return response; | ||
} | ||
class ProgressTransform extends Transform { | ||
size = 0; | ||
progressBar; | ||
constructor(opts) { | ||
super(opts); | ||
this.progressBar = opts.progressBar; | ||
} | ||
_transform(chunk, _encoding, callback) { | ||
this.size += chunk.length; | ||
this.progressBar.update(this.size); | ||
callback(null, chunk); | ||
} | ||
} | ||
export async function uploadFile(address, accessToken, file, type) { | ||
const filehandle = await fs.promises.open(file); | ||
const { size } = await filehandle.stat(); | ||
const stream = filehandle.createReadStream(); | ||
const progressBar = new SingleBar({ etaBuffer: 100_000_000 }); | ||
const progressTransform = new ProgressTransform({ progressBar }); | ||
const body = pipeline(stream, progressTransform, (error) => { | ||
if (error) { | ||
progressBar.stop(); | ||
console.error('Error processing file.', error); | ||
throw error; | ||
assemblies = await queryApollo(address, accessToken, 'assemblies'); | ||
for (const x of (await assemblies.json())) { | ||
if (x['name'] === body.assemblyName) { | ||
return x; | ||
} | ||
}); | ||
const init = { | ||
method: 'POST', | ||
body, | ||
duplex: 'half', | ||
headers: { | ||
Authorization: `Bearer ${accessToken}`, | ||
'Content-Type': type, | ||
'Content-Length': String(size), | ||
}, | ||
dispatcher: new Agent({ headersTimeout: 60 * 60 * 1000 }), | ||
}; | ||
const fileName = path.basename(file); | ||
const url = new URL(localhostToAddress(`${address}/files`)); | ||
url.searchParams.set('name', fileName); | ||
url.searchParams.set('type', type); | ||
progressBar.start(size, 0); | ||
try { | ||
const response = await fetch(url, init); | ||
if (!response.ok) { | ||
const errorMessage = await createFetchErrorMessage(response, 'uploadFile failed'); | ||
throw new ConfigError(errorMessage); | ||
} | ||
const json = (await response.json()); | ||
return json['_id']; | ||
} | ||
catch (error) { | ||
console.error(error); | ||
throw error; | ||
} | ||
finally { | ||
progressBar.stop(); | ||
} | ||
throw new Error(`Failed to retrieve assembly ${body.assemblyName}`); | ||
} | ||
/* Wrap text to max `length` per line */ | ||
export function wrapLines(s, length) { | ||
if (length === undefined) { | ||
length = 80; | ||
export async function readStdin() { | ||
const chunks = []; | ||
for await (const chunk of stdin) { | ||
chunks.push(Buffer.from(chunk)); | ||
} | ||
// Credit: https://stackoverflow.com/questions/14484787/wrap-text-in-javascript | ||
const re = new RegExp(`(?![^\\n]{1,${length}}$)([^\\n]{1,${length}})\\s`, 'g'); | ||
s = s.replaceAll(/ +/g, ' '); | ||
const wr = s.replace(re, '$1\n'); | ||
return wr; | ||
return Buffer.concat(chunks).toString('utf8'); | ||
} | ||
export function idReader(input, removeDuplicates = true) { | ||
export async function idReader(input, removeDuplicates = true) { | ||
let ids = []; | ||
@@ -370,3 +293,3 @@ for (const xin of input) { | ||
if (xin == '-') { | ||
data = fs.readFileSync('/dev/stdin').toString(); | ||
data = await readStdin(); | ||
} | ||
@@ -380,10 +303,9 @@ else if (fs.existsSync(xin)) { | ||
try { | ||
data = JSON.parse(data); | ||
if (data.length === undefined) { | ||
data = [data]; | ||
let parsedData = JSON.parse(data); | ||
if (!Array.isArray(parsedData)) { | ||
parsedData = [parsedData]; | ||
} | ||
for (const x of data) { | ||
const id = x['_id']; | ||
if (id !== undefined) { | ||
ids.push(id); | ||
for (const x of parsedData) { | ||
if ('_id' in x && typeof x._id === 'string') { | ||
ids.push(x._id); | ||
} | ||
@@ -390,0 +312,0 @@ } |
{ | ||
"name": "@apollo-annotation/cli", | ||
"version": "0.1.20", | ||
"description": "Command line interface for the Apollo annotation server", | ||
"version": "0.1.19", | ||
"author": "Apollo Team", | ||
"repository": { | ||
@@ -11,11 +10,9 @@ "type": "git", | ||
}, | ||
"bin": { | ||
"apollo": "./bin/run.js" | ||
}, | ||
"author": "Apollo Team", | ||
"type": "module", | ||
"exports": "./dist/index.js", | ||
"main": "", | ||
"types": "dist/index.d.ts", | ||
"exports": "./dist/index.js", | ||
"engines": { | ||
"node": ">=18.0.0" | ||
"bin": { | ||
"apollo": "./bin/run.js" | ||
}, | ||
@@ -30,10 +27,47 @@ "files": [ | ||
"dev": "tsx bin/dev.js", | ||
"prepack": "yarn build && oclif manifest && oclif readme && prettier --write README.md", | ||
"postpack": "shx rm -f oclif.manifest.json", | ||
"posttest": "yarn lint", | ||
"prepack": "yarn build && oclif manifest && oclif readme && prettier --write README.md", | ||
"prepare": "yarn build", | ||
"test": "mocha --require src/test/fixtures.ts 'src/**/*.test.ts'", | ||
"posttest": "yarn lint", | ||
"test:ci": "nyc mocha 'src/**/*.test.ts'", | ||
"version": "oclif readme && git add README.md" | ||
"version": "oclif readme --multi --dir ../website/docs/cli/ && oclif readme && git add README.md" | ||
}, | ||
"oclif": { | ||
"bin": "apollo", | ||
"commands": "./dist/commands", | ||
"dirname": "apollo-cli", | ||
"helpOptions": { | ||
"flagSortOrder": "none", | ||
"maxWidth": 80 | ||
}, | ||
"plugins": [ | ||
"@oclif/plugin-help" | ||
], | ||
"repositoryPrefix": "<%- repo %>/blob/v<%- version %>/packages/apollo-cli/<%- commandPath %>", | ||
"topicSeparator": " ", | ||
"topics": { | ||
"assembly": { | ||
"description": "Commands to manage assemblies" | ||
}, | ||
"change": { | ||
"description": "Commands to manage the change log" | ||
}, | ||
"feature": { | ||
"description": "Commands to manage features" | ||
}, | ||
"file": { | ||
"description": "Commands to manage files" | ||
}, | ||
"jbrowse": { | ||
"description": "Commands to manage the JBrowse configuration" | ||
}, | ||
"refseq": { | ||
"description": "Commands to manage reference sequences" | ||
}, | ||
"user": { | ||
"description": "Commands to manage users" | ||
} | ||
} | ||
}, | ||
"dependencies": { | ||
@@ -55,8 +89,8 @@ "@inquirer/input": "^1.2.14", | ||
"devDependencies": { | ||
"@apollo-annotation/mst": "^0.1.19", | ||
"@apollo-annotation/shared": "^0.1.19", | ||
"@apollo-annotation/mst": "^0.1.20", | ||
"@apollo-annotation/shared": "^0.1.20", | ||
"@istanbuljs/esm-loader-hook": "^0.2.0", | ||
"@istanbuljs/nyc-config-typescript": "^1.0.2", | ||
"@oclif/test": "^3.1.3", | ||
"@types/chai": "^4", | ||
"@types/chai": "^4.3.19", | ||
"@types/cli-progress": "^3", | ||
@@ -78,31 +112,4 @@ "@types/inquirer": "^9.0.7", | ||
}, | ||
"oclif": { | ||
"helpOptions": { | ||
"flagSortOrder": "none" | ||
}, | ||
"bin": "apollo", | ||
"dirname": "apollo-cli", | ||
"commands": "./dist/commands", | ||
"plugins": [ | ||
"@oclif/plugin-help" | ||
], | ||
"repositoryPrefix": "<%- repo %>/blob/v<%- version %>/packages/apollo-cli/<%- commandPath %>", | ||
"topicSeparator": " ", | ||
"topics": { | ||
"assembly": { | ||
"description": "Commands to handle assemblies" | ||
}, | ||
"change": { | ||
"description": "Commands to handle the log of changes made to the database" | ||
}, | ||
"feature": { | ||
"description": "Commands to handle features" | ||
}, | ||
"refseq": { | ||
"description": "Commands to handle reference sequences" | ||
}, | ||
"user": { | ||
"description": "Commands to handle users" | ||
} | ||
} | ||
"engines": { | ||
"node": ">=18.0.0" | ||
}, | ||
@@ -109,0 +116,0 @@ "publishConfig": { |
389
README.md
@@ -19,3 +19,3 @@ # Table of contents | ||
$ apollo (--version) | ||
@apollo-annotation/cli/0.1.19 linux-x64 node-v20.14.0 | ||
@apollo-annotation/cli/0.1.20 linux-x64 node-v18.20.4 | ||
$ apollo --help [COMMAND] | ||
@@ -33,4 +33,4 @@ 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) | ||
@@ -54,3 +54,9 @@ - [`apollo assembly delete`](#apollo-assembly-delete) | ||
- [`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) | ||
- [`apollo login`](#apollo-login) | ||
@@ -63,36 +69,51 @@ - [`apollo logout`](#apollo-logout) | ||
## `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 <value> [--profile <value>] [--config-file <value>] [-a <value>] [-x <value>] [-f] | ||
$ apollo assembly add-from-fasta INPUT [--profile <value>] [--config-file <value>] [-a <value>] [-x <value>] [-f] [-n] | ||
[--fai <value>] [--gzi <value>] [-z | -d] | ||
ARGUMENTS | ||
INPUT Input fasta file, local or remote, or id of a previously uploaded file | ||
FLAGS | ||
-a, --assembly=<value> 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=<value> (required) Input fasta file | ||
-x, --index=<value> 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 <my.fasta.gz>.gzi and | ||
<my.fasta.gz>.fai unless options --fai and --gzi are set | ||
-x, --index=<value> 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=<value> Use this config file (mostly for testing) | ||
--fai=<value> Fasta index of the (not-editable) fasta file | ||
--gzi=<value> Gzi index of the (not-editable) fasta file | ||
--profile=<value> 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.20/packages/apollo-cli/src/commands/assembly/add-from-fasta.ts)_ | ||
## `apollo assembly add-gff` | ||
## `apollo assembly add-from-gff INPUT-FILE` | ||
@@ -103,8 +124,10 @@ Add new assembly from gff or gft file | ||
USAGE | ||
$ apollo assembly add-gff -i <value> [--profile <value>] [--config-file <value>] [-a <value>] [-o] [-f] | ||
$ apollo assembly add-from-gff INPUT-FILE [--profile <value>] [--config-file <value>] [-a <value>] [-o] [-f] | ||
ARGUMENTS | ||
INPUT-FILE Input gff file | ||
FLAGS | ||
-a, --assembly=<value> Name for this assembly. Use the file name if omitted | ||
-f, --force Delete existing assembly, if it exists | ||
-i, --input-file=<value> (required) Input gff or gtf file | ||
-o, --omit-features Do not import features, only upload the sequences | ||
@@ -117,4 +140,3 @@ --config-file=<value> Use this config file (mostly for testing) | ||
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. | ||
@@ -124,11 +146,11 @@ EXAMPLES | ||
$ 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.20/packages/apollo-cli/src/commands/assembly/add-from-gff.ts)_ | ||
@@ -153,5 +175,4 @@ ## `apollo assembly 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`. | ||
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`. | ||
@@ -177,3 +198,3 @@ EXAMPLES | ||
_See code: | ||
[src/commands/assembly/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/check.ts)_ | ||
[src/commands/assembly/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/assembly/check.ts)_ | ||
@@ -206,3 +227,3 @@ ## `apollo assembly delete` | ||
_See code: | ||
[src/commands/assembly/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/delete.ts)_ | ||
[src/commands/assembly/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/assembly/delete.ts)_ | ||
@@ -229,3 +250,3 @@ ## `apollo assembly get` | ||
_See code: | ||
[src/commands/assembly/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/get.ts)_ | ||
[src/commands/assembly/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/assembly/get.ts)_ | ||
@@ -265,3 +286,3 @@ ## `apollo assembly sequence` | ||
_See code: | ||
[src/commands/assembly/sequence.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/sequence.ts)_ | ||
[src/commands/assembly/sequence.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/assembly/sequence.ts)_ | ||
@@ -284,10 +305,9 @@ ## `apollo change get` | ||
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: | ||
[src/commands/change/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/change/get.ts)_ | ||
[src/commands/change/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/change/get.ts)_ | ||
@@ -314,4 +334,3 @@ ## `apollo config [KEY] [VALUE]` | ||
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: | ||
@@ -322,4 +341,4 @@ - address: | ||
- 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 | ||
@@ -350,3 +369,3 @@ - accessToken: | ||
_See code: | ||
[src/commands/config.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/config.ts)_ | ||
[src/commands/config.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/config.ts)_ | ||
@@ -372,4 +391,4 @@ ## `apollo feature add-child` | ||
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. | ||
@@ -379,7 +398,7 @@ EXAMPLES | ||
$ 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: | ||
[src/commands/feature/add-child.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/add-child.ts)_ | ||
[src/commands/feature/add-child.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/add-child.ts)_ | ||
@@ -403,5 +422,4 @@ ## `apollo feature check` | ||
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 | ||
@@ -419,3 +437,3 @@ EXAMPLES | ||
_See code: | ||
[src/commands/feature/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/check.ts)_ | ||
[src/commands/feature/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/check.ts)_ | ||
@@ -441,5 +459,4 @@ ## `apollo feature copy` | ||
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. | ||
@@ -453,3 +470,3 @@ EXAMPLES | ||
_See code: | ||
[src/commands/feature/copy.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/copy.ts)_ | ||
[src/commands/feature/copy.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/copy.ts)_ | ||
@@ -474,8 +491,7 @@ ## `apollo feature delete` | ||
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: | ||
[src/commands/feature/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/delete.ts)_ | ||
[src/commands/feature/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/delete.ts)_ | ||
@@ -498,8 +514,7 @@ ## `apollo feature edit` | ||
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: | ||
@@ -524,3 +539,3 @@ { | ||
_See code: | ||
[src/commands/feature/edit.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit.ts)_ | ||
[src/commands/feature/edit.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/edit.ts)_ | ||
@@ -547,5 +562,4 @@ ## `apollo feature edit-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 | ||
@@ -567,3 +581,3 @@ EXAMPLES | ||
_See code: | ||
[src/commands/feature/edit-attribute.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit-attribute.ts)_ | ||
[src/commands/feature/edit-attribute.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/edit-attribute.ts)_ | ||
@@ -588,5 +602,4 @@ ## `apollo feature edit-coords` | ||
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` | ||
@@ -604,3 +617,3 @@ EXAMPLES | ||
_See code: | ||
[src/commands/feature/edit-coords.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit-coords.ts)_ | ||
[src/commands/feature/edit-coords.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/edit-coords.ts)_ | ||
@@ -624,8 +637,8 @@ ## `apollo feature edit-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: | ||
[src/commands/feature/edit-type.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit-type.ts)_ | ||
[src/commands/feature/edit-type.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/edit-type.ts)_ | ||
@@ -657,4 +670,4 @@ ## `apollo feature get` | ||
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: | ||
@@ -665,3 +678,3 @@ $ 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.19/packages/apollo-cli/src/commands/feature/get.ts)_ | ||
[src/commands/feature/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/get.ts)_ | ||
@@ -677,4 +690,3 @@ ## `apollo feature get-id` | ||
FLAGS | ||
-i, --feature-id=<value>... [default: -] Retrieves feature with these IDs. Use | ||
"-" to read IDs from stdin (one per | ||
-i, --feature-id=<value>... [default: -] Retrieves feature with these IDs. Use "-" to read IDs from stdin (one per | ||
line) | ||
@@ -687,4 +699,3 @@ --config-file=<value> Use this config file (mostly for testing) | ||
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 | ||
@@ -698,3 +709,3 @@ EXAMPLES | ||
_See code: | ||
[src/commands/feature/get-id.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/get-id.ts)_ | ||
[src/commands/feature/get-id.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/get-id.ts)_ | ||
@@ -712,3 +723,3 @@ ## `apollo feature import` | ||
-d, --delete-existing Delete existing features before importing | ||
-i, --input-file=<value> (required) Input gff or gtf file | ||
-i, --input-file=<value> (required) Input gff file | ||
--config-file=<value> Use this config file (mostly for testing) | ||
@@ -729,3 +740,3 @@ --profile=<value> Use credentials from this profile | ||
_See code: | ||
[src/commands/feature/import.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/import.ts)_ | ||
[src/commands/feature/import.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/import.ts)_ | ||
@@ -741,4 +752,4 @@ ## `apollo feature search` | ||
FLAGS | ||
-a, --assembly=<value>... Assembly names or IDs to search; use "-" to read it from stdin. If omitted | ||
search all assemblies | ||
-a, --assembly=<value>... Assembly names or IDs to search; use "-" to read it from stdin. If omitted search all | ||
assemblies | ||
-t, --text=<value> (required) Search for this text query | ||
@@ -767,4 +778,3 @@ --config-file=<value> Use this config file (mostly for testing) | ||
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: | ||
@@ -784,4 +794,121 @@ - "someKey" | ||
_See code: | ||
[src/commands/feature/search.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/search.ts)_ | ||
[src/commands/feature/search.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/feature/search.ts)_ | ||
## `apollo file delete` | ||
Delete files from the Apollo server | ||
``` | ||
USAGE | ||
$ apollo file delete [--profile <value>] [--config-file <value>] [-i <value>] | ||
FLAGS | ||
-i, --file-id=<value>... [default: -] IDs of the files to delete | ||
--config-file=<value> Use this config file (mostly for testing) | ||
--profile=<value> 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.20/packages/apollo-cli/src/commands/file/delete.ts)_ | ||
## `apollo file download` | ||
Download a file from the Apollo server | ||
``` | ||
USAGE | ||
$ apollo file download [--profile <value>] [--config-file <value>] [-i <value>] [-o <value>] | ||
FLAGS | ||
-i, --file-id=<value> [default: -] ID of the file to download | ||
-o, --output=<value> Write output to this file or "-" for stdout. Default to the name of the uploaded file. | ||
--config-file=<value> Use this config file (mostly for testing) | ||
--profile=<value> 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.20/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 <value>] [--config-file <value>] [-i <value>] | ||
FLAGS | ||
-i, --file-id=<value>... Get files matching this IDs | ||
--config-file=<value> Use this config file (mostly for testing) | ||
--profile=<value> 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.20/packages/apollo-cli/src/commands/file/get.ts)_ | ||
## `apollo file upload` | ||
Upload a local file to the Apollo server | ||
``` | ||
USAGE | ||
$ apollo file upload -i <value> [--profile <value>] [--config-file <value>] [-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=<value> (required) Local file to upload | ||
-t, --type=<option> Set file type or autodetected it if not set. | ||
NB: There is no check for whether the file complies to this type | ||
<options: text/x-fasta|text/x-gff3|application/x-bgzip-fasta|text/x-fai|application/x-gzi> | ||
-z, --gzip Override autodetection and instruct that input is gzip compressed | ||
--config-file=<value> Use this config file (mostly for testing) | ||
--profile=<value> Use credentials from this profile | ||
DESCRIPTION | ||
Upload a local file to the Apollo server | ||
This command only uploads a file and returns the corresponding file id. | ||
To add an assembly based on this file or to upload & add an assembly in a single pass see `apollo assembly | ||
add-from-fasta` and `add-from-gff` | ||
EXAMPLES | ||
Upload local file, type auto-detected: | ||
$ apollo file upload -i genome.fa > file.json | ||
``` | ||
_See code: | ||
[src/commands/file/upload.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/file/upload.ts)_ | ||
## `apollo help [COMMANDS]` | ||
@@ -808,2 +935,57 @@ | ||
## `apollo jbrowse get-config` | ||
Get JBrowse configuration from Apollo | ||
``` | ||
USAGE | ||
$ apollo jbrowse get-config [--profile <value>] [--config-file <value>] | ||
FLAGS | ||
--config-file=<value> Use this config file (mostly for testing) | ||
--profile=<value> Use credentials from this profile | ||
DESCRIPTION | ||
Get JBrowse configuration from Apollo | ||
Print to stdout the JBrowse configuration from Apollo in JSON format | ||
EXAMPLES | ||
Get JBrowse configuration: | ||
$ apollo jbrowse get-config > config.json | ||
``` | ||
_See code: | ||
[src/commands/jbrowse/get-config.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/jbrowse/get-config.ts)_ | ||
## `apollo jbrowse set-config INPUTFILE` | ||
Set JBrowse configuration | ||
``` | ||
USAGE | ||
$ apollo jbrowse set-config INPUTFILE [--profile <value>] [--config-file <value>] | ||
ARGUMENTS | ||
INPUTFILE JBrowse configuration file | ||
FLAGS | ||
--config-file=<value> Use this config file (mostly for testing) | ||
--profile=<value> Use credentials from this profile | ||
DESCRIPTION | ||
Set JBrowse configuration | ||
Set JBrowse configuration in Apollo collaboration server | ||
EXAMPLES | ||
Add JBrowse configuration: | ||
$ apollo jbrowse set-config config.json | ||
``` | ||
_See code: | ||
[src/commands/jbrowse/set-config.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/jbrowse/set-config.ts)_ | ||
## `apollo login` | ||
@@ -831,10 +1013,8 @@ | ||
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" | ||
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: | ||
The most basic and probably most typical usage is to login using the default profile in configuration file: | ||
@@ -849,3 +1029,3 @@ $ apollo login | ||
_See code: | ||
[src/commands/login.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/login.ts)_ | ||
[src/commands/login.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/login.ts)_ | ||
@@ -880,3 +1060,3 @@ ## `apollo logout` | ||
_See code: | ||
[src/commands/logout.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/logout.ts)_ | ||
[src/commands/logout.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/logout.ts)_ | ||
@@ -900,5 +1080,4 @@ ## `apollo refseq add-alias` | ||
Reference name aliasing is a process to make chromosomes that are named slightly | ||
differently but which refer to the same thing render properly. This command | ||
reads a file with reference name aliases and adds them to the database. | ||
Reference name aliasing is a process to make chromosomes that are named slightly differently but which refer to the | ||
same thing render properly. This command reads a file with reference name aliases and adds them to the database. | ||
@@ -912,3 +1091,3 @@ EXAMPLES | ||
_See code: | ||
[src/commands/refseq/add-alias.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/refseq/add-alias.ts)_ | ||
[src/commands/refseq/add-alias.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/refseq/add-alias.ts)_ | ||
@@ -931,5 +1110,4 @@ ## `apollo refseq get` | ||
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. | ||
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. | ||
@@ -947,3 +1125,3 @@ EXAMPLES | ||
_See code: | ||
[src/commands/refseq/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/refseq/get.ts)_ | ||
[src/commands/refseq/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/refseq/get.ts)_ | ||
@@ -965,9 +1143,8 @@ ## `apollo status` | ||
This command returns "<profile>: Logged in" if the selected profile has an | ||
access token and "<profile>: Logged out" otherwise. Note that this command does | ||
not check the validity of the access token. | ||
This command returns "<profile>: Logged in" if the selected profile has an access token and "<profile>: 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.19/packages/apollo-cli/src/commands/status.ts)_ | ||
[src/commands/status.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/status.ts)_ | ||
@@ -1008,4 +1185,4 @@ ## `apollo user get` | ||
_See code: | ||
[src/commands/user/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/user/get.ts)_ | ||
[src/commands/user/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.20/packages/apollo-cli/src/commands/user/get.ts)_ | ||
<!-- commandsstop --> |
Sorry, the diff of this file is too big to display
258798
89
5904
1139
26