Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement the CLI in TypeScript #172

Merged
merged 86 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
a0a7c6a
remove unneeded files
bmesuere Jun 17, 2024
52f0494
require node 22 to use fetch
bmesuere Jun 17, 2024
02c2af5
yarn init
bmesuere Jun 17, 2024
49b5681
get basic version working
bmesuere Jun 17, 2024
f122274
move to bin folder
bmesuere Jun 17, 2024
691bda3
move to typescript
bmesuere Jun 17, 2024
bff18e9
cleanup
bmesuere Jun 17, 2024
dcaee59
add uniprot run command
bmesuere Jun 17, 2024
4fc9216
Merge pull request #173 from unipept/next-uniprot
bmesuere Jun 18, 2024
71823bf
refactor
bmesuere Jun 18, 2024
dc6c822
add eslint
bmesuere Jun 18, 2024
5ba8ae2
add github action
bmesuere Jun 18, 2024
5077b02
refactor
bmesuere Jun 18, 2024
d6ed622
add tests
bmesuere Jun 18, 2024
e09cc6d
add CI
bmesuere Jun 18, 2024
e8b6773
add a bit more comments
bmesuere Jun 18, 2024
b0c9868
Merge pull request #174 from unipept/next-testing
bmesuere Jun 20, 2024
72f970a
implement peptfilter
bmesuere Jun 19, 2024
f70a95c
write tests
bmesuere Jun 19, 2024
a62ff53
optimize performance
bmesuere Jun 20, 2024
72448de
fix tests
bmesuere Jun 20, 2024
f5b879f
lint
bmesuere Jun 20, 2024
eb8fb5d
add comments
bmesuere Jun 20, 2024
aa5d358
implement prot2pept
bmesuere Jun 21, 2024
c24382a
add tests
bmesuere Jun 21, 2024
b071301
Merge pull request #175 from unipept/next-peptfilter
bmesuere Jun 21, 2024
f0346d3
Update lib/commands/prot2pept.ts
bmesuere Jun 21, 2024
ad82132
Merge pull request #176 from unipept/next-prot2pept
bmesuere Jun 21, 2024
9fef29a
implement basic version of the pept2lca command
bmesuere Jul 2, 2024
bd3d031
use post and set headers
bmesuere Jul 2, 2024
33353b1
move processing loop to the super class
bmesuere Jul 2, 2024
c62a0b2
implement input batches
bmesuere Jul 2, 2024
1b30a66
use different input options if available
bmesuere Jul 2, 2024
d135611
parse more parameters
bmesuere Jul 2, 2024
5da999c
add a few utility methods
bmesuere Jul 2, 2024
bcd9535
add basic csv formatter
bmesuere Jul 8, 2024
0ad8004
write to file if needed
bmesuere Jul 8, 2024
8f9334a
support no-header
bmesuere Jul 8, 2024
beb414c
fix lint
bmesuere Jul 8, 2024
5c9e17f
add test for unipept
bmesuere Jul 30, 2024
e0b691a
add formatter tests
bmesuere Jul 30, 2024
e1589da
linter
bmesuere Jul 30, 2024
819f1a6
refactor passing arguments programatically
bmesuere Jul 30, 2024
f7dcf0e
add basic command runner tests
bmesuere Jul 31, 2024
0e377b2
Merge pull request #177 from unipept/next-unipept-1
bmesuere Aug 1, 2024
7da1e02
implement json formatter
bmesuere Aug 1, 2024
ec28bfe
add tests for json formatter
bmesuere Aug 1, 2024
0f915f5
add xml formatter
bmesuere Aug 1, 2024
8044011
add tests for xml formatter
bmesuere Aug 1, 2024
ed97bab
fix linter
bmesuere Aug 1, 2024
c9aa3aa
Merge pull request #178 from unipept/next-unipept-2
bmesuere Aug 1, 2024
3b575a9
refactor existing code
bmesuere Aug 5, 2024
2435f1f
add fasta support
bmesuere Aug 5, 2024
b21872d
add tests
bmesuere Aug 5, 2024
eac4282
Merge pull request #179 from unipept/next-unipept-fasta
bmesuere Aug 5, 2024
c3126fd
implement pept2ec
bmesuere Aug 6, 2024
931f810
add pept2lca test
bmesuere Aug 6, 2024
d544627
add pept2ec test
bmesuere Aug 6, 2024
d7ed283
fix linter
bmesuere Aug 6, 2024
42fe0bf
add pept2funct
bmesuere Aug 6, 2024
d7fffcd
add pept2go
bmesuere Aug 6, 2024
07d1368
add pept2interpro
bmesuere Aug 6, 2024
bb4ed75
add pept2prot
bmesuere Aug 6, 2024
362789f
add pept2taxa
bmesuere Aug 6, 2024
49d2828
add peptinfo
bmesuere Aug 6, 2024
ce55c09
add protinfo
bmesuere Aug 6, 2024
a58a0d3
add taxa2lca
bmesuere Aug 6, 2024
2d98583
add taxonomy command
bmesuere Aug 6, 2024
e7c2365
fix strings
bmesuere Aug 6, 2024
cc21dad
Merge pull request #180 from unipept/next-unipept-subcommands
bmesuere Aug 6, 2024
83a281b
filter results
bmesuere Aug 7, 2024
5906ef0
always flatten the results for csv so select fields works
bmesuere Aug 7, 2024
3c54ee1
don't crash on empty response
bmesuere Aug 7, 2024
193284c
don't crash if the server doesn't return valid json
bmesuere Aug 7, 2024
495d461
retry requests and log errors
bmesuere Aug 7, 2024
37a23a2
linter
bmesuere Aug 7, 2024
0579bec
add comments
bmesuere Aug 7, 2024
0dd1b12
Merge pull request #181 from unipept/next-rest
bmesuere Aug 7, 2024
e66da23
prepare to publish on npm
bmesuere Aug 7, 2024
2472da2
fix relative file paths
bmesuere Aug 7, 2024
5e85164
typo
bmesuere Nov 27, 2024
8aa8ab8
minor tweaks
bmesuere Nov 27, 2024
b77a7c5
Merge branch 'next' of github.com:unipept/unipept-cli into next
bmesuere Nov 27, 2024
7c8d1a3
more flexible test matching
bmesuere Nov 28, 2024
5f14a81
use integevers as input for taxa2lca and taxonomy
bmesuere Nov 28, 2024
1096d2e
bump version
bmesuere Nov 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .devcontainer/devcontainer.json

This file was deleted.

5 changes: 0 additions & 5 deletions .document

This file was deleted.

46 changes: 26 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,38 @@ name: CI
on: [push]

jobs:
test:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2"]
fail-fast: false
name: Test Ruby ${{ matrix.ruby }}
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: ruby/setup-ruby@v1
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Test
node-version: 22.x
cache: yarn
- name: Install dependencies
run: |
bundle exec rake test
lint:
name: Lint
yarn install
- name: Lint
run: |
yarn lint
- name: Type check
run: |
yarn typecheck
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: ruby/setup-ruby@v1
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
bundler-cache: true
node-version: 22.x
cache: yarn
- name: Install dependencies
run: |
yarn install
- name: Test
run: |
bundle exec rake test_style
yarn test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ pkg

# For rubinius:
#*.rbc

node_modules/**
dist/**
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
7 changes: 0 additions & 7 deletions .rakeTasks

This file was deleted.

43 changes: 0 additions & 43 deletions .rubocop.yml

This file was deleted.

1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

34 changes: 0 additions & 34 deletions .vscode/tasks.json

This file was deleted.

18 changes: 0 additions & 18 deletions Gemfile

This file was deleted.

109 changes: 0 additions & 109 deletions Gemfile.lock

This file was deleted.

23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
# unipept-cli

[![Gem Version](https://badge.fury.io/rb/unipept.svg)](http://badge.fury.io/rb/unipept)
![NPM Version](https://img.shields.io/npm/v/unipept-cli)

Unipept-cli offers a command line interface to the [Unipept](http://unipept.ugent.be) web service.
Documentation about the web service can be found at [http://unipept.ugent.be/apidocs](http://unipept.ugent.be/apidocs), documentation about the command line tools at [http://unipept.ugent.be/clidocs](http://unipept.ugent.be/clidocs).

## Installation

To use the Unipept CLI, Ruby version 2.7 or higher needs to be installed. You can check this by running `ruby -v` on the commandline:
To use the Unipept CLI, node 22 or higher needs to be installed. You can check this by running `node -v` on the commandline:

```
$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin21]
$ node -v
v22.3.0
```

More information on installing Ruby can be found at https://www.ruby-lang.org/en/installation/
More information on installing Node can be found at https://nodejs.org/en/download/package-manager

The Unipept CLI is available as a _gem_. This means it can easily be installed with the following command:
The Unipept CLI is available as an npm package. This means it can easily be installed with the following command:

```bash
$ gem install unipept
Successfully installed unipept-1.0.1
Parsing documentation for unipept-1.0.1
Done installing documentation for unipept after 0 seconds
1 gem installed
$ npm install -g unipept-cli
added 3 packages in 986ms
```

After successful installation, the unipept command should be available:

```bash
$ unipept -v
1.0.1
$ unipept --version
4.0.0
```

The help can be accessed by running `unipept -h`.
Loading