Skip to content

Commit

Permalink
Refactor __main__.py
Browse files Browse the repository at this point in the history
Most of the changes are internal, i.e. show no changed behaviour. Instead, the
code should be  more robust and maintainable. This is achieved by:

* Choosing composition over inheiritance
* Leaning even further into static typing, with the different combinations of
  options being encoded in a sum type-like manner, by combining wrapper classes
  with `Union`.
* More consistent typeassert of fields loaded from argparse.NameSpace at the
  point where they are accessed
* The requirements for each command is encapsulated more directly in classes,
  with their invariants clearer, and more enforced

Further, some user-facing stuff have been changed:
* Refactoring of the command-line flags exposed to the user, such that only the
  flags actually used by each command is exposed.
* Changed the grouping of command-line flags to be more sensible
* Added the `--version` flag to all subcommands
  • Loading branch information
jakobnissen committed Jul 19, 2024
1 parent 7612296 commit 06b2136
Show file tree
Hide file tree
Showing 3 changed files with 1,006 additions and 943 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cli_vamb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
cat outdir_vamb/log.txt
- name: Run TaxVAMB
run: |
vamb bin taxvamb --outdir outdir_taxvamb --fasta catalogue_mock.fna.gz --abundance abundance_mock.npz --taxonomy taxonomy_mock.tsv -pe 10 -pt 10 -e 10 -q -t 10 -o C --minfasta 200000
vamb bin taxvamb --outdir outdir_taxvamb --fasta catalogue_mock.fna.gz --abundance abundance_mock.npz --taxonomy taxonomy_mock.tsv -pe 10 -pt 10 -e 10 -q -pq -t 10 -o C --minfasta 200000
ls -la outdir_taxvamb
cat outdir_taxvamb/log.txt
vamb bin taxvamb --outdir outdir_taxvamb_no_predict --no_predictor --fasta catalogue_mock.fna.gz --abundance abundance_mock.npz --taxonomy taxonomy_mock.tsv -e 10 -q -t 10 -o C --minfasta 200000
Expand All @@ -53,10 +53,10 @@ jobs:
cat outdir_taxvamb_preds/log.txt
- name: Run Taxometer
run: |
vamb taxometer --outdir outdir_taxometer --fasta catalogue_mock.fna.gz --abundance abundance_mock.npz --taxonomy taxonomy_mock.tsv -pe 10 -pt 10
vamb taxometer --outdir outdir_taxometer --fasta catalogue_mock.fna.gz --abundance abundance_mock.npz --taxonomy taxonomy_mock.tsv -pe 10 -pq -pt 10
ls -la outdir_taxometer
cat outdir_taxometer/log.txt
vamb taxometer --outdir outdir_taxometer_pred --fasta catalogue_mock.fna.gz --abundance abundance_mock.npz --taxonomy outdir_taxometer/results_taxometer.tsv -pe 10 -pt 10
vamb taxometer --outdir outdir_taxometer_pred --fasta catalogue_mock.fna.gz --abundance abundance_mock.npz --taxonomy outdir_taxometer/results_taxometer.tsv -pe 10 -pq -pt 10
ls -la outdir_taxometer_pred
cat outdir_taxometer/log.txt
- name: Run k-means reclustering
Expand Down
Loading

0 comments on commit 06b2136

Please sign in to comment.