@apollo-annotation/cli 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -56
- package/bin/dev.js +2 -2
- package/bin/run.js +2 -2
- package/dist/ApolloConf.js +1 -0
- package/dist/baseCommand.js +4 -3
- package/dist/commands/assembly/add-fasta.js +0 -1
- package/dist/commands/assembly/add-gff.js +0 -1
- package/dist/commands/assembly/get.test.js +3 -3
- package/dist/commands/assembly/sequence.js +4 -10
- package/dist/commands/change/get.test.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/feature/add-child.js +12 -14
- package/dist/commands/feature/check.js +5 -5
- package/dist/commands/feature/copy.js +7 -10
- package/dist/commands/feature/delete.js +9 -15
- package/dist/commands/feature/edit-attribute.js +12 -6
- package/dist/commands/feature/edit-coords.js +31 -16
- package/dist/commands/feature/edit-type.js +2 -6
- package/dist/commands/feature/edit.js +0 -1
- package/dist/commands/feature/get-id.js +0 -1
- package/dist/commands/feature/get.js +0 -1
- package/dist/commands/feature/import.js +20 -33
- package/dist/commands/feature/search.js +1 -1
- package/dist/commands/login.js +1 -1
- package/dist/commands/logout.js +1 -1
- package/dist/commands/refseq/add-alias.d.ts +14 -0
- package/dist/commands/refseq/add-alias.js +72 -0
- package/dist/commands/status.js +1 -1
- package/dist/commands/user/get.test.js +1 -1
- package/dist/test/fixtures.js +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +59 -28
- package/oclif.manifest.json +107 -46
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -1,56 +1,61 @@
|
|
|
1
1
|
# Table of contents
|
|
2
2
|
|
|
3
3
|
<!-- toc -->
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
- [Table of contents](#table-of-contents)
|
|
6
|
+
- [Usage](#usage)
|
|
7
|
+
- [Commands](#commands)
|
|
7
8
|
<!-- tocstop -->
|
|
8
9
|
|
|
9
10
|
# Usage
|
|
10
11
|
|
|
11
12
|
<!-- usage -->
|
|
13
|
+
|
|
12
14
|
```sh-session
|
|
13
15
|
$ npm install -g @apollo-annotation/cli
|
|
14
16
|
$ apollo COMMAND
|
|
15
17
|
running command...
|
|
16
18
|
$ apollo (--version)
|
|
17
|
-
@apollo-annotation/cli/0.1.
|
|
19
|
+
@apollo-annotation/cli/0.1.19 linux-x64 node-v20.14.0
|
|
18
20
|
$ apollo --help [COMMAND]
|
|
19
21
|
USAGE
|
|
20
22
|
$ apollo COMMAND
|
|
21
23
|
...
|
|
22
24
|
```
|
|
25
|
+
|
|
23
26
|
<!-- usagestop -->
|
|
24
27
|
|
|
25
28
|
# Commands
|
|
26
29
|
|
|
27
30
|
<!-- commands -->
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
31
|
+
|
|
32
|
+
- [`apollo assembly add-fasta`](#apollo-assembly-add-fasta)
|
|
33
|
+
- [`apollo assembly add-gff`](#apollo-assembly-add-gff)
|
|
34
|
+
- [`apollo assembly check`](#apollo-assembly-check)
|
|
35
|
+
- [`apollo assembly delete`](#apollo-assembly-delete)
|
|
36
|
+
- [`apollo assembly get`](#apollo-assembly-get)
|
|
37
|
+
- [`apollo assembly sequence`](#apollo-assembly-sequence)
|
|
38
|
+
- [`apollo change get`](#apollo-change-get)
|
|
39
|
+
- [`apollo config [KEY] [VALUE]`](#apollo-config-key-value)
|
|
40
|
+
- [`apollo feature add-child`](#apollo-feature-add-child)
|
|
41
|
+
- [`apollo feature check`](#apollo-feature-check)
|
|
42
|
+
- [`apollo feature copy`](#apollo-feature-copy)
|
|
43
|
+
- [`apollo feature delete`](#apollo-feature-delete)
|
|
44
|
+
- [`apollo feature edit`](#apollo-feature-edit)
|
|
45
|
+
- [`apollo feature edit-attribute`](#apollo-feature-edit-attribute)
|
|
46
|
+
- [`apollo feature edit-coords`](#apollo-feature-edit-coords)
|
|
47
|
+
- [`apollo feature edit-type`](#apollo-feature-edit-type)
|
|
48
|
+
- [`apollo feature get`](#apollo-feature-get)
|
|
49
|
+
- [`apollo feature get-id`](#apollo-feature-get-id)
|
|
50
|
+
- [`apollo feature import`](#apollo-feature-import)
|
|
51
|
+
- [`apollo feature search`](#apollo-feature-search)
|
|
52
|
+
- [`apollo help [COMMANDS]`](#apollo-help-commands)
|
|
53
|
+
- [`apollo login`](#apollo-login)
|
|
54
|
+
- [`apollo logout`](#apollo-logout)
|
|
55
|
+
- [`apollo refseq add-alias`](#apollo-refseq-add-alias)
|
|
56
|
+
- [`apollo refseq get`](#apollo-refseq-get)
|
|
57
|
+
- [`apollo status`](#apollo-status)
|
|
58
|
+
- [`apollo user get`](#apollo-user-get)
|
|
54
59
|
|
|
55
60
|
## `apollo assembly add-fasta`
|
|
56
61
|
|
|
@@ -82,7 +87,8 @@ EXAMPLES
|
|
|
82
87
|
$ apollo assembly add-fasta -i https://.../genome.fa -x https://.../genome.fa.fai -a myAssembly
|
|
83
88
|
```
|
|
84
89
|
|
|
85
|
-
_See code:
|
|
90
|
+
_See code:
|
|
91
|
+
[src/commands/assembly/add-fasta.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/add-fasta.ts)_
|
|
86
92
|
|
|
87
93
|
## `apollo assembly add-gff`
|
|
88
94
|
|
|
@@ -116,7 +122,8 @@ EXAMPLES
|
|
|
116
122
|
$ apollo assembly add-gff -i genome.gff -a myAssembly -o
|
|
117
123
|
```
|
|
118
124
|
|
|
119
|
-
_See code:
|
|
125
|
+
_See code:
|
|
126
|
+
[src/commands/assembly/add-gff.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/add-gff.ts)_
|
|
120
127
|
|
|
121
128
|
## `apollo assembly check`
|
|
122
129
|
|
|
@@ -158,7 +165,8 @@ EXAMPLES
|
|
|
158
165
|
$ apollo assembly check -a hg19 -c CDSCheck --delete
|
|
159
166
|
```
|
|
160
167
|
|
|
161
|
-
_See code:
|
|
168
|
+
_See code:
|
|
169
|
+
[src/commands/assembly/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/check.ts)_
|
|
162
170
|
|
|
163
171
|
## `apollo assembly delete`
|
|
164
172
|
|
|
@@ -185,7 +193,8 @@ EXAMPLES
|
|
|
185
193
|
$ apollo assembly delete -a mouse 6605826fbd0eee691f83e73f
|
|
186
194
|
```
|
|
187
195
|
|
|
188
|
-
_See code:
|
|
196
|
+
_See code:
|
|
197
|
+
[src/commands/assembly/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/delete.ts)_
|
|
189
198
|
|
|
190
199
|
## `apollo assembly get`
|
|
191
200
|
|
|
@@ -206,7 +215,8 @@ DESCRIPTION
|
|
|
206
215
|
Print to stdout the list of assemblies in json format
|
|
207
216
|
```
|
|
208
217
|
|
|
209
|
-
_See code:
|
|
218
|
+
_See code:
|
|
219
|
+
[src/commands/assembly/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/get.ts)_
|
|
210
220
|
|
|
211
221
|
## `apollo assembly sequence`
|
|
212
222
|
|
|
@@ -240,7 +250,8 @@ EXAMPLES
|
|
|
240
250
|
$ apollo assembly sequence -a myAssembly -r chr1 -s 1 -e 1000
|
|
241
251
|
```
|
|
242
252
|
|
|
243
|
-
_See code:
|
|
253
|
+
_See code:
|
|
254
|
+
[src/commands/assembly/sequence.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/sequence.ts)_
|
|
244
255
|
|
|
245
256
|
## `apollo change get`
|
|
246
257
|
|
|
@@ -264,7 +275,8 @@ DESCRIPTION
|
|
|
264
275
|
need to use the assembly ID.
|
|
265
276
|
```
|
|
266
277
|
|
|
267
|
-
_See code:
|
|
278
|
+
_See code:
|
|
279
|
+
[src/commands/change/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/change/get.ts)_
|
|
268
280
|
|
|
269
281
|
## `apollo config [KEY] [VALUE]`
|
|
270
282
|
|
|
@@ -319,7 +331,8 @@ EXAMPLES
|
|
|
319
331
|
$ apollo config address
|
|
320
332
|
```
|
|
321
333
|
|
|
322
|
-
_See code:
|
|
334
|
+
_See code:
|
|
335
|
+
[src/commands/config.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/config.ts)_
|
|
323
336
|
|
|
324
337
|
## `apollo feature add-child`
|
|
325
338
|
|
|
@@ -349,7 +362,8 @@ EXAMPLES
|
|
|
349
362
|
$ apollo feature add-child -i 6605826fbd0eee691f83e73f -t exon -s 10 -e 20
|
|
350
363
|
```
|
|
351
364
|
|
|
352
|
-
_See code:
|
|
365
|
+
_See code:
|
|
366
|
+
[src/commands/feature/add-child.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/add-child.ts)_
|
|
353
367
|
|
|
354
368
|
## `apollo feature check`
|
|
355
369
|
|
|
@@ -382,7 +396,8 @@ EXAMPLES
|
|
|
382
396
|
$ apollo feature check -a hg19
|
|
383
397
|
```
|
|
384
398
|
|
|
385
|
-
_See code:
|
|
399
|
+
_See code:
|
|
400
|
+
[src/commands/feature/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/check.ts)_
|
|
386
401
|
|
|
387
402
|
## `apollo feature copy`
|
|
388
403
|
|
|
@@ -413,7 +428,8 @@ EXAMPLES
|
|
|
413
428
|
$ apollo feature copy -i 6605826fbd0eee691f83e73f -r chr1 -s 100 -a hg38
|
|
414
429
|
```
|
|
415
430
|
|
|
416
|
-
_See code:
|
|
431
|
+
_See code:
|
|
432
|
+
[src/commands/feature/copy.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/copy.ts)_
|
|
417
433
|
|
|
418
434
|
## `apollo feature delete`
|
|
419
435
|
|
|
@@ -437,7 +453,8 @@ DESCRIPTION
|
|
|
437
453
|
error unless you set -f/--force.
|
|
438
454
|
```
|
|
439
455
|
|
|
440
|
-
_See code:
|
|
456
|
+
_See code:
|
|
457
|
+
[src/commands/feature/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/delete.ts)_
|
|
441
458
|
|
|
442
459
|
## `apollo feature edit`
|
|
443
460
|
|
|
@@ -479,7 +496,8 @@ EXAMPLES
|
|
|
479
496
|
echo '{"typeName": ... "newType": "G_quartet"}' | apollo feature edit -j -
|
|
480
497
|
```
|
|
481
498
|
|
|
482
|
-
_See code:
|
|
499
|
+
_See code:
|
|
500
|
+
[src/commands/feature/edit.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit.ts)_
|
|
483
501
|
|
|
484
502
|
## `apollo feature edit-attribute`
|
|
485
503
|
|
|
@@ -519,7 +537,8 @@ EXAMPLES
|
|
|
519
537
|
$ apollo feature edit-attribute -i 66...3f -a domains -d
|
|
520
538
|
```
|
|
521
539
|
|
|
522
|
-
_See code:
|
|
540
|
+
_See code:
|
|
541
|
+
[src/commands/feature/edit-attribute.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit-attribute.ts)_
|
|
523
542
|
|
|
524
543
|
## `apollo feature edit-coords`
|
|
525
544
|
|
|
@@ -553,7 +572,8 @@ EXAMPLES
|
|
|
553
572
|
$ apollo feature edit-coords -i abc...xyz -e 2000
|
|
554
573
|
```
|
|
555
574
|
|
|
556
|
-
_See code:
|
|
575
|
+
_See code:
|
|
576
|
+
[src/commands/feature/edit-coords.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit-coords.ts)_
|
|
557
577
|
|
|
558
578
|
## `apollo feature edit-type`
|
|
559
579
|
|
|
@@ -576,7 +596,8 @@ DESCRIPTION
|
|
|
576
596
|
term although but the valifdity of the new term is not checked.
|
|
577
597
|
```
|
|
578
598
|
|
|
579
|
-
_See code:
|
|
599
|
+
_See code:
|
|
600
|
+
[src/commands/feature/edit-type.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit-type.ts)_
|
|
580
601
|
|
|
581
602
|
## `apollo feature get`
|
|
582
603
|
|
|
@@ -609,7 +630,8 @@ EXAMPLES
|
|
|
609
630
|
$ apollo feature get -a myAssembly -r chr1 -s 1 -e 1000
|
|
610
631
|
```
|
|
611
632
|
|
|
612
|
-
_See code:
|
|
633
|
+
_See code:
|
|
634
|
+
[src/commands/feature/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/get.ts)_
|
|
613
635
|
|
|
614
636
|
## `apollo feature get-id`
|
|
615
637
|
|
|
@@ -638,7 +660,8 @@ EXAMPLES
|
|
|
638
660
|
$ apollo feature get-id -i abc...zyz def...foo
|
|
639
661
|
```
|
|
640
662
|
|
|
641
|
-
_See code:
|
|
663
|
+
_See code:
|
|
664
|
+
[src/commands/feature/get-id.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/get-id.ts)_
|
|
642
665
|
|
|
643
666
|
## `apollo feature import`
|
|
644
667
|
|
|
@@ -666,7 +689,8 @@ EXAMPLES
|
|
|
666
689
|
$ apollo feature import -d -i features.gff3 -a myAssembly
|
|
667
690
|
```
|
|
668
691
|
|
|
669
|
-
_See code:
|
|
692
|
+
_See code:
|
|
693
|
+
[src/commands/feature/import.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/import.ts)_
|
|
670
694
|
|
|
671
695
|
## `apollo feature search`
|
|
672
696
|
|
|
@@ -717,7 +741,8 @@ EXAMPLES
|
|
|
717
741
|
$ apollo feature search -a mm9 mm10 -t bac
|
|
718
742
|
```
|
|
719
743
|
|
|
720
|
-
_See code:
|
|
744
|
+
_See code:
|
|
745
|
+
[src/commands/feature/search.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/search.ts)_
|
|
721
746
|
|
|
722
747
|
## `apollo help [COMMANDS]`
|
|
723
748
|
|
|
@@ -737,7 +762,8 @@ DESCRIPTION
|
|
|
737
762
|
Display help for apollo.
|
|
738
763
|
```
|
|
739
764
|
|
|
740
|
-
_See code:
|
|
765
|
+
_See code:
|
|
766
|
+
[@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.8/src/commands/help.ts)_
|
|
741
767
|
|
|
742
768
|
## `apollo login`
|
|
743
769
|
|
|
@@ -777,7 +803,8 @@ EXAMPLES
|
|
|
777
803
|
$ apollo login --profile my-profile
|
|
778
804
|
```
|
|
779
805
|
|
|
780
|
-
_See code:
|
|
806
|
+
_See code:
|
|
807
|
+
[src/commands/login.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/login.ts)_
|
|
781
808
|
|
|
782
809
|
## `apollo logout`
|
|
783
810
|
|
|
@@ -806,7 +833,38 @@ EXAMPLES
|
|
|
806
833
|
$ apollo logout --profile my-profile
|
|
807
834
|
```
|
|
808
835
|
|
|
809
|
-
_See code:
|
|
836
|
+
_See code:
|
|
837
|
+
[src/commands/logout.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/logout.ts)_
|
|
838
|
+
|
|
839
|
+
## `apollo refseq add-alias`
|
|
840
|
+
|
|
841
|
+
Add reference name aliases from a file
|
|
842
|
+
|
|
843
|
+
```
|
|
844
|
+
USAGE
|
|
845
|
+
$ apollo refseq add-alias -i <value> -a <value> [--profile <value>] [--config-file <value>]
|
|
846
|
+
|
|
847
|
+
FLAGS
|
|
848
|
+
-a, --assembly=<value> (required) Name for this assembly.
|
|
849
|
+
-i, --input-file=<value> (required) Input refname alias file
|
|
850
|
+
--config-file=<value> Use this config file (mostly for testing)
|
|
851
|
+
--profile=<value> Use credentials from this profile
|
|
852
|
+
|
|
853
|
+
DESCRIPTION
|
|
854
|
+
Add reference name aliases from a file
|
|
855
|
+
|
|
856
|
+
Reference name aliasing is a process to make chromosomes that are named slightly
|
|
857
|
+
differently but which refer to the same thing render properly. This command
|
|
858
|
+
reads a file with reference name aliases and adds them to the database.
|
|
859
|
+
|
|
860
|
+
EXAMPLES
|
|
861
|
+
Add reference name aliases:
|
|
862
|
+
|
|
863
|
+
$ apollo refseq add-alias -i alias.txt -a myAssembly
|
|
864
|
+
```
|
|
865
|
+
|
|
866
|
+
_See code:
|
|
867
|
+
[src/commands/refseq/add-alias.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/refseq/add-alias.ts)_
|
|
810
868
|
|
|
811
869
|
## `apollo refseq get`
|
|
812
870
|
|
|
@@ -838,7 +896,8 @@ EXAMPLES
|
|
|
838
896
|
$ apollo refseq get -a mm9 mm10
|
|
839
897
|
```
|
|
840
898
|
|
|
841
|
-
_See code:
|
|
899
|
+
_See code:
|
|
900
|
+
[src/commands/refseq/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/refseq/get.ts)_
|
|
842
901
|
|
|
843
902
|
## `apollo status`
|
|
844
903
|
|
|
@@ -860,7 +919,8 @@ DESCRIPTION
|
|
|
860
919
|
not check the validity of the access token.
|
|
861
920
|
```
|
|
862
921
|
|
|
863
|
-
_See code:
|
|
922
|
+
_See code:
|
|
923
|
+
[src/commands/status.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/status.ts)_
|
|
864
924
|
|
|
865
925
|
## `apollo user get`
|
|
866
926
|
|
|
@@ -895,5 +955,7 @@ EXAMPLES
|
|
|
895
955
|
$ apollo user get | jq '.[] | select(.createdAt > "2024-03-18")'
|
|
896
956
|
```
|
|
897
957
|
|
|
898
|
-
_See code:
|
|
958
|
+
_See code:
|
|
959
|
+
[src/commands/user/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/user/get.ts)_
|
|
960
|
+
|
|
899
961
|
<!-- commandsstop -->
|
package/bin/dev.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line node/shebang
|
|
4
4
|
async function main() {
|
|
5
|
-
const {execute} = await import('@oclif/core')
|
|
6
|
-
await execute({development: true, dir: import.meta.url})
|
|
5
|
+
const { execute } = await import('@oclif/core')
|
|
6
|
+
await execute({ development: true, dir: import.meta.url })
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
await main()
|
package/bin/run.js
CHANGED
package/dist/ApolloConf.js
CHANGED
package/dist/baseCommand.js
CHANGED
|
@@ -26,7 +26,7 @@ export class BaseCommand extends Command {
|
|
|
26
26
|
}
|
|
27
27
|
getConfig(configFile) {
|
|
28
28
|
if (configFile === undefined) {
|
|
29
|
-
configFile = path.join(this.config.configDir, 'config.
|
|
29
|
+
configFile = path.join(this.config.configDir, 'config.yml');
|
|
30
30
|
}
|
|
31
31
|
checkConfigfileExists(configFile);
|
|
32
32
|
const config = new ApolloConf(configFile);
|
|
@@ -40,8 +40,9 @@ export class BaseCommand extends Command {
|
|
|
40
40
|
return config.getAccess(profileName);
|
|
41
41
|
}
|
|
42
42
|
async catch(err) {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
if (err.cause instanceof Error) {
|
|
44
|
+
console.error(err.cause);
|
|
45
|
+
}
|
|
45
46
|
return super.catch(err);
|
|
46
47
|
}
|
|
47
48
|
async finally(_) {
|
|
@@ -7,7 +7,7 @@ import { CONFIG_FILE, TEST_DATA_DIR, VERBOSE, copyFile, } from '../../test/fixtu
|
|
|
7
7
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
8
8
|
describe.skip('apollo assembly get: Fail without token', () => {
|
|
9
9
|
before(() => {
|
|
10
|
-
copyFile(`${TEST_DATA_DIR}/guest.
|
|
10
|
+
copyFile(`${TEST_DATA_DIR}/guest.yml`, CONFIG_FILE, VERBOSE);
|
|
11
11
|
});
|
|
12
12
|
after(() => {
|
|
13
13
|
fs.rmSync(CONFIG_FILE);
|
|
@@ -24,7 +24,7 @@ describe.skip('apollo assembly get: Fail without token', () => {
|
|
|
24
24
|
// TODO: Need valid token
|
|
25
25
|
describe.skip('apollo assembly get: Get assemblies as YAML string', () => {
|
|
26
26
|
before(() => {
|
|
27
|
-
copyFile(`${TEST_DATA_DIR}/complete_config.
|
|
27
|
+
copyFile(`${TEST_DATA_DIR}/complete_config.yml`, CONFIG_FILE, VERBOSE);
|
|
28
28
|
});
|
|
29
29
|
after(() => {
|
|
30
30
|
fs.rmSync(CONFIG_FILE);
|
|
@@ -38,7 +38,7 @@ describe.skip('apollo assembly get: Get assemblies as YAML string', () => {
|
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
describe.skip('apollo assembly get: Test nock', () => {
|
|
41
|
-
const cmd = ['assembly:get', '--config-file', 'tmp.
|
|
41
|
+
const cmd = ['assembly:get', '--config-file', 'tmp.yml'];
|
|
42
42
|
test
|
|
43
43
|
.stdout()
|
|
44
44
|
.nock('http://127.0.0.1:3999', (api) => api.persist().get('/assemblies').reply(200, { stuff: 'foo' }))
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
|
-
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
3
2
|
import { Flags } from '@oclif/core';
|
|
4
|
-
import { fetch } from 'undici';
|
|
3
|
+
import { Agent, fetch } from 'undici';
|
|
5
4
|
import { BaseCommand } from '../../baseCommand.js';
|
|
6
5
|
import { createFetchErrorMessage, getRefseqId, idReader, localhostToAddress, queryApollo, wrapLines, } from '../../utils.js';
|
|
7
6
|
async function getSequence(address, accessToken, refSeq, start, end) {
|
|
@@ -13,15 +12,11 @@ async function getSequence(address, accessToken, refSeq, start, end) {
|
|
|
13
12
|
});
|
|
14
13
|
url.search = searchParams.toString();
|
|
15
14
|
const uri = url.toString();
|
|
16
|
-
const controller = new AbortController();
|
|
17
|
-
setTimeout(() => {
|
|
18
|
-
controller.abort();
|
|
19
|
-
}, 24 * 60 * 60 * 1000);
|
|
20
15
|
const auth = {
|
|
21
16
|
headers: {
|
|
22
17
|
authorization: `Bearer ${accessToken}`,
|
|
23
18
|
},
|
|
24
|
-
|
|
19
|
+
dispatcher: new Agent({ headersTimeout: 60 * 60 * 1000 }),
|
|
25
20
|
};
|
|
26
21
|
const response = await fetch(uri, auth);
|
|
27
22
|
if (!response.ok) {
|
|
@@ -87,8 +82,8 @@ export default class ApolloCmd extends BaseCommand {
|
|
|
87
82
|
const seq = new TextDecoder().decode(seqObj?.value);
|
|
88
83
|
let header = '';
|
|
89
84
|
for (const x of refSeqs) {
|
|
90
|
-
if (x
|
|
91
|
-
const rname = x
|
|
85
|
+
if (x._id === rid) {
|
|
86
|
+
const rname = x.name;
|
|
92
87
|
header = `>${rname}:${flags.start}..${flags.start + seq.length - 1}`;
|
|
93
88
|
break;
|
|
94
89
|
}
|
|
@@ -96,7 +91,6 @@ export default class ApolloCmd extends BaseCommand {
|
|
|
96
91
|
this.log(header);
|
|
97
92
|
this.log(splitStringIntoChunks(seq, 80).join('\n'));
|
|
98
93
|
}
|
|
99
|
-
this.exit(0);
|
|
100
94
|
}
|
|
101
95
|
}
|
|
102
96
|
function splitStringIntoChunks(input, chunkSize) {
|
|
@@ -7,7 +7,7 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
|
7
7
|
// TODO: Need valid token
|
|
8
8
|
describe.skip('apollo change get: Get changes as YAML string', () => {
|
|
9
9
|
before(() => {
|
|
10
|
-
copyFile(`${TEST_DATA_DIR}/complete_config.
|
|
10
|
+
copyFile(`${TEST_DATA_DIR}/complete_config.yml`, CONFIG_FILE, VERBOSE);
|
|
11
11
|
});
|
|
12
12
|
after(() => {
|
|
13
13
|
fs.rmSync(CONFIG_FILE);
|
package/dist/commands/config.js
CHANGED
|
@@ -53,7 +53,7 @@ export default class ApolloConfig extends BaseCommand {
|
|
|
53
53
|
let configFile = flags['config-file'];
|
|
54
54
|
configFile =
|
|
55
55
|
configFile === undefined
|
|
56
|
-
? path.join(this.config.configDir, 'config.
|
|
56
|
+
? path.join(this.config.configDir, 'config.yml')
|
|
57
57
|
: path.resolve(configFile);
|
|
58
58
|
if (flags['get-config-file']) {
|
|
59
59
|
this.log(configFile);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
2
|
-
/* eslint-disable @typescript-eslint/restrict-plus-operands */
|
|
3
1
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
4
2
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
5
3
|
import { Flags } from '@oclif/core';
|
|
@@ -63,17 +61,16 @@ export default class Get extends BaseCommand {
|
|
|
63
61
|
const errorMessage = await createFetchErrorMessage(childRes, 'Add child failed');
|
|
64
62
|
throw new Error(errorMessage);
|
|
65
63
|
}
|
|
66
|
-
this.exit(0);
|
|
67
64
|
}
|
|
68
|
-
async addChild(address, accessToken, parentFeature,
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
this.error(`Error: Child feature coordinates (${
|
|
65
|
+
async addChild(address, accessToken, parentFeature, min, max, type) {
|
|
66
|
+
const pMin = parentFeature.min;
|
|
67
|
+
const pMax = parentFeature.max;
|
|
68
|
+
if (min < pMin || max > pMax) {
|
|
69
|
+
this.error(`Error: Child feature coordinates (${min + 1}-${max}) cannot extend beyond parent coordinates (${pMin + 1}-${pMax})`);
|
|
73
70
|
}
|
|
74
71
|
const res = await queryApollo(address, accessToken, 'refSeqs');
|
|
75
72
|
const refSeqs = (await res.json());
|
|
76
|
-
const refSeq = parentFeature
|
|
73
|
+
const { refSeq } = parentFeature;
|
|
77
74
|
let assembly = '';
|
|
78
75
|
for (const x of refSeqs) {
|
|
79
76
|
if (x['_id'] === refSeq) {
|
|
@@ -83,17 +80,18 @@ export default class Get extends BaseCommand {
|
|
|
83
80
|
}
|
|
84
81
|
const change = {
|
|
85
82
|
typeName: 'AddFeatureChange',
|
|
86
|
-
|
|
83
|
+
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
84
|
+
changedIds: [parentFeature._id],
|
|
87
85
|
assembly,
|
|
88
86
|
addedFeature: {
|
|
89
87
|
_id: new ObjectId().toHexString(),
|
|
90
|
-
gffId: '',
|
|
91
88
|
refSeq,
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
min,
|
|
90
|
+
max,
|
|
94
91
|
type,
|
|
95
92
|
},
|
|
96
|
-
|
|
93
|
+
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
94
|
+
parentFeatureId: parentFeature._id,
|
|
97
95
|
};
|
|
98
96
|
const url = new URL(localhostToAddress(`${address}/changes`));
|
|
99
97
|
const auth = {
|
|
@@ -50,15 +50,15 @@ export default class Check extends BaseCommand {
|
|
|
50
50
|
if (flags['feature-id'] === undefined) {
|
|
51
51
|
keep = true;
|
|
52
52
|
}
|
|
53
|
-
else {
|
|
54
|
-
for (const x of chk
|
|
55
|
-
if (keepFeatures.has(x)) {
|
|
53
|
+
else if (chk.ids !== undefined) {
|
|
54
|
+
for (const x of chk.ids) {
|
|
55
|
+
if (x !== undefined && keepFeatures.has(x.toString())) {
|
|
56
56
|
keep = true;
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
if (keep && refseqId.has(chk
|
|
61
|
+
if (keep && refseqId.has(chk.refSeq)) {
|
|
62
62
|
results.push(chk);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -71,7 +71,7 @@ async function keepAssemblies(address, accessToken, assembly) {
|
|
|
71
71
|
const res = await queryApollo(address, accessToken, 'assemblies');
|
|
72
72
|
const asm = (await res.json());
|
|
73
73
|
for (const x of asm) {
|
|
74
|
-
keepAssembly.push(x
|
|
74
|
+
keepAssembly.push(x._id);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
else {
|
|
@@ -60,11 +60,9 @@ export default class Copy extends BaseCommand {
|
|
|
60
60
|
const errorMessage = await createFetchErrorMessage(rescopy, 'Copy feature failed');
|
|
61
61
|
throw new Error(errorMessage);
|
|
62
62
|
}
|
|
63
|
-
this.exit(0);
|
|
64
63
|
}
|
|
65
|
-
async copyFeature(address, accessToken, feature, refseq,
|
|
66
|
-
const featureLen = feature
|
|
67
|
-
feature['start'];
|
|
64
|
+
async copyFeature(address, accessToken, feature, refseq, min, assembly, newId) {
|
|
65
|
+
const featureLen = feature.max - feature.min;
|
|
68
66
|
const change = {
|
|
69
67
|
typeName: 'AddFeatureChange',
|
|
70
68
|
changedIds: [newId],
|
|
@@ -72,12 +70,11 @@ export default class Copy extends BaseCommand {
|
|
|
72
70
|
addedFeature: {
|
|
73
71
|
_id: newId,
|
|
74
72
|
refSeq: refseq,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
type: feature
|
|
78
|
-
attributes: feature
|
|
79
|
-
|
|
80
|
-
strand: feature['strand'],
|
|
73
|
+
min: min - 1,
|
|
74
|
+
max: min + featureLen - 1,
|
|
75
|
+
type: feature.type,
|
|
76
|
+
attributes: feature.attributes,
|
|
77
|
+
strand: feature.strand,
|
|
81
78
|
},
|
|
82
79
|
copyFeature: true,
|
|
83
80
|
allIds: [newId],
|