diff --git a/phylogenetic/rules/annotate_phylogeny.smk b/phylogenetic/rules/annotate_phylogeny.smk index 564f8c2..9f45b29 100644 --- a/phylogenetic/rules/annotate_phylogeny.smk +++ b/phylogenetic/rules/annotate_phylogeny.smk @@ -25,7 +25,7 @@ rule ancestral: Reconstructing ancestral sequences and mutations """ input: - tree=rules.refine.output.tree, + tree=build_dir + "/{build_name}/tree.nwk", alignment=build_dir + "/{build_name}/masked.fasta", output: node_data=build_dir + "/{build_name}/nt_muts.json", @@ -46,8 +46,8 @@ rule translate: Translating amino acid sequences """ input: - tree=rules.refine.output.tree, - node_data=rules.ancestral.output.node_data, + tree=build_dir + "/{build_name}/tree.nwk", + node_data=build_dir + "/{build_name}/nt_muts.json", genemap=config["genemap"], output: node_data=build_dir + "/{build_name}/aa_muts.json", @@ -67,7 +67,7 @@ rule traits: - increase uncertainty of reconstruction by {params.sampling_bias_correction} to partially account for sampling bias """ input: - tree=rules.refine.output.tree, + tree=build_dir + "/{build_name}/tree.nwk", metadata=build_dir + "/{build_name}/metadata.tsv", output: node_data=build_dir + "/{build_name}/traits.json", @@ -93,9 +93,9 @@ rule clades: Adding internal clade labels """ input: - tree=rules.refine.output.tree, - aa_muts=rules.translate.output.node_data, - nuc_muts=rules.ancestral.output.node_data, + tree=build_dir + "/{build_name}/tree.nwk", + aa_muts=build_dir + "/{build_name}/aa_muts.json", + nuc_muts=build_dir + "/{build_name}/nt_muts.json", clades=config["clades"], output: node_data=build_dir + "/{build_name}/clades_raw.json", @@ -113,7 +113,7 @@ rule clades: rule rename_clades: input: - rules.clades.output.node_data, + build_dir + "/{build_name}/clades_raw.json", output: node_data=build_dir + "/{build_name}/clades.json", shell: @@ -126,7 +126,7 @@ rule rename_clades: rule mutation_context: input: - tree=rules.refine.output.tree, + tree=build_dir + "/{build_name}/tree.nwk", node_data=build_dir + "/{build_name}/nt_muts.json", output: node_data=build_dir + "/{build_name}/mutation_context.json", diff --git a/phylogenetic/rules/construct_phylogeny.smk b/phylogenetic/rules/construct_phylogeny.smk index 215c6a9..fe0a7de 100644 --- a/phylogenetic/rules/construct_phylogeny.smk +++ b/phylogenetic/rules/construct_phylogeny.smk @@ -41,7 +41,7 @@ rule fix_tree: Fixing tree """ input: - tree=rules.tree.output.tree, + tree=build_dir + "/{build_name}/tree_raw.nwk", alignment=build_dir + "/{build_name}/masked.fasta", output: tree=build_dir + "/{build_name}/tree_fixed.nwk", @@ -66,9 +66,9 @@ rule refine: - filter tips more than {params.clock_filter_iqd} IQDs from clock expectation """ input: - tree=rules.fix_tree.output.tree + tree=build_dir + "/{build_name}/tree_fixed.nwk" if config["fix_tree"] - else rules.tree.output.tree, + else build_dir + "/{build_name}/tree_raw.nwk", alignment=build_dir + "/{build_name}/masked.fasta", metadata=build_dir + "/{build_name}/metadata.tsv", output: diff --git a/phylogenetic/rules/export.smk b/phylogenetic/rules/export.smk index f4e7ee6..89499ed 100644 --- a/phylogenetic/rules/export.smk +++ b/phylogenetic/rules/export.smk @@ -63,18 +63,18 @@ rule export: Exporting data files for auspice """ input: - tree=rules.refine.output.tree, + tree=build_dir + "/{build_name}/tree.nwk", metadata=build_dir + "/{build_name}/metadata.tsv", branch_lengths="results/{build_name}/branch_lengths.json" if config.get("timetree", False) else "results/{build_name}/branch_lengths_no_time.json", - traits=rules.traits.output.node_data, - nt_muts=rules.ancestral.output.node_data, - aa_muts=rules.translate.output.node_data, + traits=build_dir + "/{build_name}/traits.json", + nt_muts=build_dir + "/{build_name}/nt_muts.json", + aa_muts=build_dir + "/{build_name}/aa_muts.json", clades=build_dir + "/{build_name}/clades.json", - mutation_context=rules.mutation_context.output.node_data, - recency=rules.recency.output.node_data if config.get("recency", False) else [], - colors=rules.colors.output.colors, + mutation_context=build_dir + "/{build_name}/mutation_context.json", + recency=build_dir + "/{build_name}/recency.json" if config.get("recency", False) else [], + colors=build_dir + "/{build_name}/colors.tsv", lat_longs=config["lat_longs"], description=config["description"], auspice_config=config["auspice_config"], diff --git a/phylogenetic/rules/prepare_sequences.smk b/phylogenetic/rules/prepare_sequences.smk index b87820c..da4b501 100644 --- a/phylogenetic/rules/prepare_sequences.smk +++ b/phylogenetic/rules/prepare_sequences.smk @@ -83,7 +83,7 @@ rule filter: rule subsample: input: - metadata=rules.filter.output.metadata, + metadata=build_dir + "/{build_name}/good_metadata.tsv", output: strains=build_dir + "/{build_name}/{sample}_strains.txt", log=build_dir + "/{build_name}/{sample}_filter.log", @@ -117,8 +117,8 @@ rule combine_samples: f"{build_dir}/{w.build_name}/{sample}_strains.txt" for sample in config["subsample"] ], - sequences=rules.filter.output.sequences, - metadata=rules.filter.output.metadata, + sequences=build_dir + "/{build_name}/good_sequences.fasta", + metadata=build_dir + "/{build_name}/good_metadata.tsv", include=config["include"], output: sequences=build_dir + "/{build_name}/filtered.fasta", @@ -159,7 +159,7 @@ rule align: - filling gaps with N """ input: - sequences=rules.reverse_reverse_complements.output, + sequences=build_dir + "/{build_name}/reversed.fasta", reference=config["reference"], genemap=config["genemap"], output: