Skip to content

Commit

Permalink
Adding option to add branch supports via bootstrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
skchronicles committed Apr 8, 2024
1 parent edb78ac commit 82d5231
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
21 changes: 20 additions & 1 deletion mpox-seek
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ def parsed_arguments(name, description):
[--conda-env-name CONDA_ENV_NAME] \\
[--additional-strains ADDITIONAL_STRAINS] \\
[--batch-id BATCH_ID] \\
[--bootstrap-trees] \\
--input INPUT [INPUT ...] \\
--output OUTPUT
Expand Down Expand Up @@ -444,7 +445,6 @@ def parsed_arguments(name, description):
the option listed below.
Example:
--additional-strains resources/mpox_additional_strains.fa.gz
--batch-id BATCH_ID
Unique identifer to associate with a batch of samples.
This option can be provided to ensure that project-level
Expand All @@ -462,6 +462,13 @@ def parsed_arguments(name, description):
Here is a list of valid or acceptable characters: "aA-Zz",
"0-9", "-", "_".
Example: --batch-id "2024-04-01"
--bootstrap-trees
Computes branch support by bootstraping data. If this flag
is provided, raxml-ng is run in an all-in-one (ML search +
bootstrapping) mode via its '--all' option. Branch supports,
calculated by bootstrapping, will be added to the best
scoring tree.
Example: --bootstrap-trees
{3}{4}Orchestration options:{5}
--mode {{local,slurm}}
Expand Down Expand Up @@ -593,6 +600,7 @@ def parsed_arguments(name, description):
--output mpox-seek_output \\
--additional-strains resources/mpox_additional_strains.fa.gz \\
--batch-id "$(date '+%Y-%m-%d-%H-%M')" \\
--bootstrap-trees \\
--mode local \\
--use-conda \\
--conda-env-name mpox-seek \\
Expand All @@ -609,6 +617,7 @@ def parsed_arguments(name, description):
--output mpox-seek_output \\
--additional-strains resources/mpox_additional_strains.fa.gz \\
--batch-id "$(date '+%Y-%m-%d-%H-%M')" \\
--bootstrap-trees \\
--use-conda \\
--conda-env-name mpox-seek \\
--mode local
Expand Down Expand Up @@ -666,6 +675,16 @@ def parsed_arguments(name, description):
help = argparse.SUPPRESS
)

# Add branch support/confidence values
# to best tree via bootstrapping
subparser_run.add_argument(
'--bootstrap-trees',
action = 'store_true',
required = False,
default = False,
help = argparse.SUPPRESS
)

# Optional Arguments
# Add custom help message
subparser_run.add_argument(
Expand Down
4 changes: 4 additions & 0 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ decompress_strains_fasta = False
if strains_fasta.endswith('.gz') or strains_fasta.endswith('.gzip'):
decompress_strains_fasta = True

# Maps branch support/confidence values
# to the best tree via bootstrapping data
bootstrap_trees = str_bool(config['options']['bootstrap_trees'])

# Find list of sample which
# have mulitple barcodes, this
# means they need to be merged
Expand Down
3 changes: 2 additions & 1 deletion workflow/rules/tree.smk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ rule tree:
params:
rname = 'tree',
prefix = join(workpath, "project", batch_id, "mpox_phylogeny"),
bootrapping_options = lambda _: "--all --bs-metric fbp,tbe" if bootstrap_trees else ""
conda: depending(conda_yaml_or_named_env, use_conda)
container: depending(config['images']['mpox-seek'], use_singularity)
shell:
Expand All @@ -31,5 +32,5 @@ rule tree:
--model GTR+G \\
--msa-format FASTA \\
--prefix {params.prefix} \\
--seed 42
--seed 42 {params.bootrapping_options}
"""

0 comments on commit 82d5231

Please sign in to comment.