Skip to content

Commit

Permalink
Prepare phylogenetic workflow for Nextclade workflow #57
Browse files Browse the repository at this point in the history
  • Loading branch information
j23414 authored May 24, 2024
2 parents 57b57d1 + 5af15a1 commit 75d9c5f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions phylogenetic/config/config_dengue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ display_strain_field: "strain"

filter:
exclude: "config/exclude.txt"
include: "config/include_{serotype}.txt"
group_by: "year region"
min_length:
genome: 5000
Expand Down
1 change: 1 addition & 0 deletions phylogenetic/config/include_all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Format: <GenBank accession> [# <documentation on reason for inclusion>]
1 change: 1 addition & 0 deletions phylogenetic/config/include_denv1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Format: <GenBank accession> [# <documentation on reason for inclusion>]
1 change: 1 addition & 0 deletions phylogenetic/config/include_denv2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Format: <GenBank accession> [# <documentation on reason for inclusion>]
1 change: 1 addition & 0 deletions phylogenetic/config/include_denv3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Format: <GenBank accession> [# <documentation on reason for inclusion>]
1 change: 1 addition & 0 deletions phylogenetic/config/include_denv4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Format: <GenBank accession> [# <documentation on reason for inclusion>]
4 changes: 3 additions & 1 deletion phylogenetic/rules/annotate_phylogeny.smk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ rule ancestral:
"""Reconstructing ancestral sequences and mutations"""
input:
tree = "results/{gene}/tree_{serotype}.nwk",
alignment = "results/{gene}/aligned_{serotype}.fasta"
alignment = "results/{gene}/aligned_{serotype}.fasta",
root_sequence = lambda wildcard: "config/reference_{serotype}_genome.gb" if wildcard.gene in ['genome'] else "results/config/reference_{serotype}_{gene}.gb",
output:
node_data = "results/{gene}/nt-muts_{serotype}.json"
params:
Expand All @@ -36,6 +37,7 @@ rule ancestral:
--tree {input.tree} \
--alignment {input.alignment} \
--output-node-data {output.node_data} \
--root-sequence {input.root_sequence} \
--inference {params.inference}
"""

Expand Down
2 changes: 2 additions & 0 deletions phylogenetic/rules/prepare_sequences.smk
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ rule filter:
sequences = lambda wildcard: "data/sequences_{serotype}.fasta" if wildcard.gene in ['genome'] else "results/{gene}/sequences_{serotype}.fasta",
metadata = "data/metadata_{serotype}.tsv",
exclude = config["filter"]["exclude"],
include = config["filter"]["include"],
output:
sequences = "results/{gene}/filtered_{serotype}.fasta"
params:
Expand All @@ -69,6 +70,7 @@ rule filter:
--metadata {input.metadata} \
--metadata-id-columns {params.strain_id} \
--exclude {input.exclude} \
--include {input.include} \
--output {output.sequences} \
--group-by {params.group_by} \
--sequences-per-group {params.sequences_per_group} \
Expand Down

0 comments on commit 75d9c5f

Please sign in to comment.