Convert sylph profiles to Krona-compatible format using GTDB taxonomy.
- Python 3.9+
- pandas
- GTDB taxonomy files (the latest are downloaded automatically if not present)
- KronaTools for visualization
- A sylph profile generated with a GTDB sylph database (e.g., gtdb-r226-c200-dbv1.syldb)
The easiest way to use sylph2krona is via uv, e.g. for quick one-offs:
$ alias sylph2krona='uvx git+https://github.com/jonasoh/sylph2krona'
$ sylph2krona -h
<…>
usage: sylph2krona [-h] [--version] --input INPUT [--bac BAC] [--ar AR] [--abundance {tax,seq}] [--outdir OUTDIR]
sylph2krona v0.1.0: join sylph profile to GTDB taxonomy and emit krona-ready text files
options:
-h, --help show this help message and exit
--version, -v show version information and exit
--input INPUT, -i INPUT
sylph profile tsv (use '-' for stdin)
--bac BAC GTDB bac taxonomy tsv file (can be gzipped)
--ar AR GTDB ar taxonomy tsv file (can be gzipped)
--abundance {tax,seq}
which abundance column to use: tax (Taxonomic) or seq (Sequence) abundance
--outdir OUTDIR, -o OUTDIR
output directory for *_krona.txtOr to install it permanently in your Python environment:
uv pip install git+https://github.com/jonasoh/sylph2kronasylph2krona generates individual Krona-compatible text files for each sample in the input profile, and prints a suggested ktImportText command to generate a combined Krona HTML visualization.
After running the tool, use the suggested KronaTools command to generate the interactive HTML visualization.
# Basic usage
sylph2krona --input profile.tsv
# Custom output directory
sylph2krona --input profile.tsv --outdir my_results
# Using stdin to clean sample names
sed 's/.fastq.gz//g' profile.tsv | sylph2krona --input -
# Specifying GTDB taxonomy files
sylph2krona --input profile.tsv --bac path/to/bac120_taxonomy.tsv.gz --ar path/to/ar53_taxonomy.tsv.gz
# Using sequence abundance instead of taxonomic abundance
sylph2krona --input profile.tsv --abundance seq