Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bcd9a87
refactor
xonq Jul 17, 2026
279fa52
remove usearch
xonq Jul 18, 2026
db3bf4a
init testing
xonq Jul 18, 2026
73f0a57
update login to provide non-credentialed login info
xonq Jul 19, 2026
4a43acf
init
xonq Jul 19, 2026
4406cae
update JGI xml
xonq Jul 19, 2026
d9d2f51
minor release?
xonq Jul 19, 2026
d3c4c23
handle potentially erroneous error
xonq Jul 19, 2026
7f00c4a
not in scope
xonq Jul 20, 2026
d1b9893
offload acc2 scripts
xonq Jul 20, 2026
137cb0c
stage next release, rm from root usage
xonq Jul 20, 2026
0f2e655
stage 2.0.0 release
xonq Jul 20, 2026
5b1983b
rename for import
xonq Jul 20, 2026
87bf511
init cli entrypoints
xonq Jul 20, 2026
7f7e21d
engender mycotools subcommand
xonq Jul 20, 2026
df7f5c7
black formatting
xonq Jul 20, 2026
88720b5
pep8 reformatting
xonq Jul 20, 2026
3531db8
change from predb2mtdb
xonq Jul 20, 2026
f5c3e4b
change from predb2mtdb
xonq Jul 20, 2026
bbe48c6
convert to datasets
xonq Jul 21, 2026
9cd7304
fix
xonq Jul 21, 2026
c1f981d
convert to sqlite backend
xonq Jul 21, 2026
2f280a2
rework to datasets and circularize JGI tape downloads
xonq Jul 22, 2026
8f79a73
update rank / lineage test
xonq Jul 22, 2026
47ff9f5
update tests and exclude mitochondrial genomes
xonq Jul 22, 2026
ed33ac2
update mycocosm table download and error reporting; separately chunk …
xonq Jul 22, 2026
9139918
add configure and streamline repo
xonq Jul 24, 2026
3bf0dc9
reorganize, fix taxonomny
xonq Jul 24, 2026
62a99f3
update
xonq Jul 24, 2026
5680ffe
streamline
xonq Jul 24, 2026
d3c1a67
update formatting
xonq Jul 24, 2026
26714fc
refactor for features
xonq Jul 25, 2026
1369647
begin feature migration
xonq Jul 26, 2026
03bd63b
expand featurecol
xonq Jul 26, 2026
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
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ prepUpdate.py
*.pyc
include.txt
build.sh
update_mtdb
extract_mtdb
predb2mtdb
mtdb
manage_mtdb
# legacy root-level console-script copies (anchored so they do NOT clobber the
# mycotools/mtdb/ package or the test/update_mtdb/ suite of the same name)
/update_mtdb
/extract_mtdb
/predb2mtdb
/mtdb
/manage_mtdb
.gitignore
CLAUDE.md
18 changes: 12 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM mambaorg/micromamba:2.3.0-ubuntu22.04 AS app

ARG MYCOTOOLS_VER="1.0.0"
USER root
ARG MYCOTOOLS_VER="2.0.0"

# 'LABEL' instructions tag the image with metadata that might be important to the user
LABEL base.image="mambaorg/micromamba:2.3.0-ubuntu22.04"
Expand All @@ -12,21 +11,28 @@ LABEL description="Mycotools is a compilation of computational biology tools and
LABEL website="https://github.com/xonq/mycotools"
LABEL license="https://github.com/xonq/mycotools/blob/master/LICENSE"
LABEL maintainer="Zachary Konkel"
LABEL maintainer.email="konkelzach@protonmail.com"

# this is unfortunately necessary to install ete4
RUN micromamba install --name base -c conda-forge -c bioconda -c defaults legacy-cgi pip mycotools=${MYCOTOOLS_VER} && \
eval "$(micromamba shell hook --shell bash)" && \
micromamba activate base && \
python3 -m pip install dna_features_viewer && \
micromamba clean -a -f -y && \
mkdir /data
micromamba clean -a -f -y

USER root

RUN mkdir /data

RUN chown $MAMBA_USER:$MAMBA_USER /data

USER MAMBA_USER

ENV PATH="/opt/conda/bin/:${PATH}" \
LC_ALL=C.UTF-8

# 'CMD' instructions set a default command when the container is run. This is typically 'tool --help.'
CMD [ "mtdb", "--help" ]
CMD [ "mycotools", "--help" ]

# 'WORKDIR' sets working directory
WORKDIR /data
WORKDIR /data
220 changes: 0 additions & 220 deletions mycotools/acc2fq.py

This file was deleted.

62 changes: 62 additions & 0 deletions mycotools/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#! /usr/bin/env python3
"""Top-level dispatcher for the `mycotools` command.

`mycotools` is the downstream-analysis entrypoint; the database lifecycle
(update/extract/predb/manage/accession/files) lives under the separate `mtdb`
command. Routes `mycotools <GROUP> ...` to a group dispatcher, or, for a leaf
tool like `rename`, directly to that tool's module."""
from mycotools.lib.subcmd import Dispatcher

# group name/alias -> submodule within the mycotools package. Groups (download,
# homology, cluster, phylo, stats, seq, gff) are subpackage dispatchers;
# `rename` is a single leaf module.
SUBCOMMANDS = {
"download": "download",
"d": "download",
"homology": "homology",
"h": "homology",
"cluster": "cluster",
"c": "cluster",
"phylo": "phylo",
"p": "phylo",
"rename": "rename",
"r": "rename",
"stats": "stats",
"seq": "seq",
"gff": "gff",
}

DESCRIPTION = """Mycotools downstream-analysis toolkit

Groups (all following arguments are forwarded to the group/tool):
download (d) download genomes/annotations from JGI or NCBI
homology (h) search query sequence(s) against the database or a fasta
cluster (c) cluster sequences / circumscribe homology groups
phylo (p) phylogenies and phylogenetic pipelines (crap/tree/synteny)
rename (r) substitute MTDB ome codes with taxonomic names in a file
stats annotation / assembly statistics
seq sequence & coordinate transforms
gff manipulate / render gff3 files

Database operations (build/manage/query the MTDB) live under the `mtdb` command;
run `mtdb -h`.

Examples:
mycotools download jgi -h
mycotools phylo crap -h
mycotools homology -h"""

_dispatcher = Dispatcher(
"mycotools",
"mycotools",
SUBCOMMANDS,
DESCRIPTION,
metavar="GROUP",
arg_help="analysis group or tool (see below)",
)
main = _dispatcher.main
cli = _dispatcher.cli


if __name__ == "__main__":
cli()
39 changes: 39 additions & 0 deletions mycotools/cluster/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#! /usr/bin/env python3
"""Dispatcher for the `mycotools cluster` subcommand.

Routes `mycotools cluster <METHOD> ...` to a clustering module: `db`
circumscribes database sequences into homology groups, `fasta` runs iterative
sequence-similarity clustering of a fasta."""
from mycotools.lib.subcmd import Dispatcher

# subcommand name/alias -> submodule within this package (mycotools.cluster.<module>)
SUBCOMMANDS = {
"db": "db",
"fasta": "fasta",
"fa": "fasta",
}

DESCRIPTION = """Group sequences into clusters / homology groups

Methods (all following arguments are forwarded to the method):
db circumscribe database sequences into homology groups
fasta (fa) iterative sequence-similarity clustering of a fasta

Examples:
mycotools cluster db -h
mycotools cluster fasta -h"""

_dispatcher = Dispatcher(
"mycotools cluster",
"mycotools.cluster",
SUBCOMMANDS,
DESCRIPTION,
metavar="METHOD",
arg_help="clustering method (see below)",
)
main = _dispatcher.main
cli = _dispatcher.cli


if __name__ == "__main__":
cli()
6 changes: 6 additions & 0 deletions mycotools/cluster/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /usr/bin/env python3
"""Enable ``python -m mycotools.cluster`` to run the cluster dispatcher."""
from mycotools.cluster import cli

if __name__ == "__main__":
cli()
Loading