Skip to content

e. Tree2 (RepGenR ‐ FlexTaxD annotation pipe)

jaclew edited this page Mar 31, 2025 · 1 revision

Example files

Download example files for "tree2". Example files are from RepGenR run on Francisella, specified with --include_dereplicated during repgenr tree2tax

Parameter description

Argument and example value Description
--help See possible arguments and desriptions
--metadata_file example_metadata.tsv path to metadata
--input genomes_derep_representants.dnd path to treefile (e.g. RepGenR)
--plot plot.pdf path to output plot, can be used to view the tree when determining which metadata to incorporate at branches/leafs
--columns SNP_final metadata column(s) to use for leafs (datasets)
--branch_columns subspecies,SNP_path metadata column(s) to use for branches
--cansnper_column SNP_path specifies that column "SNP_path" is a CanSNPer output and the script will parse the cell
--cansnps B.12,B.6,B.4,B.96,B.34,B.27,A.1,M.1 specify which CanSNPs should be used from "SNP_path"
--outgroup Rhizobiaceae_Ochrobactrum_intermedium_GCF_900454225.1 specify outgroup to orient tree (see "outgroup" directory in RepGenR workdir)
--remove_outgroup remove the outgroup, it is only used to orient the tree (we also do not want it in the flextaxd files)
--branch_node_basename ftul specify basename for branchnodes without metadata annotation
--branchify_leafs add a branch-node upstream of leaf-nodes to incorporate singleton metadata
--flextaxd_additional_genomes derep_genomes_map.tsv load additional leaf-genomes that are not present in the tree. In this case, load the dereplicated (removed) genomes and put them at their representant
--flextaxd_outfiles_path FTD_files output directory for flextaxd tree+genomemap files

Example commands

# plot only, to determine which metadata to apply at branches and/or leafs
flexmetr_alpha tree2 \
--metadata_file example_metadata.tsv \
--input genomes_derep_representants.dnd \
--plot plot.pdf \
--columns SNP_final \
--branch_columns subspecies,SNP_path \
--cansnper_column SNP_path \
--cansnps B.12,B.6,B.4,B.96,B.34,B.27,A.1,M.1 \
--outgroup Rhizobiaceae_Ochrobactrum_intermedium_GCF_900454225.1 \
--remove_outgroup
# produce flextaxd files, nodes renamed by metadata
flexmetr_alpha tree2 \
--metadata_file example_metadata.tsv \
--input genomes_derep_representants.dnd \
--columns SNP_final \
--branch_columns subspecies,SNP_path \
--cansnper_column SNP_path \
--cansnps B.12,B.6,B.4,B.96,B.34,B.27,A.1,M.1 \
--outgroup Rhizobiaceae_Ochrobactrum_intermedium_GCF_900454225.1 \
--remove_outgroup \
--branch_node_basename ftul \
--flextaxd_additional_genomes derep_genomes_map.tsv \
--flextaxd_outfiles_path FTD_files

Building and visualising the FlexTaxD database

# build db
flextaxd --db db.ftd --taxonomy_file FTD_files/tree_parent_child_relations.tsv --genomeid2taxid FTD_files/genome_id_map.tsv
# visualise db
flextaxd --db db.ftd --vis_type tree --vis_node "Francisella tularensis" --vis_depth 0 --vis_label_size 7
Clone this wiki locally