Skip to content

Commit 2e226a4

Browse files
author
Emrah Akkoyun
committed
workflow is updated
1 parent 58e669f commit 2e226a4

File tree

12 files changed

+234
-411
lines changed

12 files changed

+234
-411
lines changed

config/config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
cnfigfile: "config.yml"
22

33
#outputs
4-
workdir: "/cta/users/eakkoyun/WORKFOLDER/TEST/120421_test/phylogeny-snakemake"
5-
query_ids: ["P35520", "P63000"]
6-
#query_ids: ["P16157", "P22105"]
4+
workdir: "/cta/users/eakkoyun/WORKFOLDER/TEST/020621_test/phylogeny-snakemake"
5+
query_ids: ["P13942", "P16157"]
76

87

98
#blast

images/rulegraph.svg

Lines changed: 200 additions & 382 deletions
Loading

workflow/Snakefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
12
configfile: "../config/config.yml"
23

34
rule all:
45
input:
5-
expand("{workdir}/results/{query_id}/8_pruned_raxmlng_ancestral_scores/pruned_{query_id}_wol_param_{pattern}.csv",workdir=config["workdir"], query_id=config["query_ids"],pattern=config["pattern"]),
66
expand("{workdir}/results/{query_id}/5_raxmlng_ancestral_scores/{query_id}_wl_param_{pattern}.csv",workdir=config["workdir"], query_id=config["query_ids"],pattern=config["pattern"]),
77

88
include : "rules/query_fasta.smk"
@@ -12,11 +12,7 @@ include : "rules/msa.smk"
1212
include : "rules/trim_msa.smk"
1313
include : "rules/ml_tree.smk"
1414
include : "rules/remove_gaps.smk"
15-
include : "rules/remove_outliers.smk"
16-
include : "rules/prune.smk"
1715
include : "rules/unroot_tree.smk"
1816
include : "rules/raxmlng_ancestral.smk"
1917
include : "rules/compute_raxml_anc_score.smk"
20-
include : "rules/unroot_pruned_tree.smk"
21-
include : "rules/pruned_raxmlng_ancestral.smk"
22-
include : "rules/pruned_raxmlng_ancestral_score.smk"
18+

workflow/envs/raxml-ng.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: raxml-ng
22
channels:
33
- bioconda
4+
- conda-forge
45
dependencies:
56
- raxml-ng = 1.0.2
7+
- openmpi = 4.0.5

workflow/rules/prune.smk

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
rule prune:
22
input:
33
blastp_out_file = "{workdir}/results/{query_id}/1_psiblast/{query_id}_blasthits.out",
4-
ml_tree = "{workdir}/results/{query_id}/3_mltree/{query_id}.no_outlier.nwk",
5-
msa_file = "{workdir}/results/{query_id}/2_msa/{query_id}_no_outlier_no_gap.fasta",
4+
ml_tree = "{workdir}/results/{query_id}/3_mltree/{query_id}.raxml.bestTree"
5+
msa_file = "{workdir}/results/{query_id}/2_msa/{query_id}_nogap_msa.fasta",
66
query_fasta = "{workdir}/results/{query_id}/1_psiblast/{query_id}.fasta",
77
output:
8-
pruned_tree = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}.pruned.no_outlier",
9-
pruned_msa = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}_pruned_nogap_nooutlier_msa.fasta",
8+
pruned_tree = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}.pruned",
9+
pruned_msa = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}_pruned_nogap_msa.fasta",
1010
log:
1111
"{workdir}/workflow/logs/rules/{query_id}_pruned.err"
1212
benchmark:
@@ -17,3 +17,6 @@ rule prune:
1717
shell:
1818
"python3 scripts/prune_msa_tree.py {input.blastp_out_file} {config[blast_hit_number]} {config[max_e_value]} {config[min_identity]} {config[max_identity]} {input.ml_tree} {output.pruned_tree} {input.msa_file} {output.pruned_msa} {input.query_fasta}"
1919

20+
21+
22+

workflow/rules/pruned_raxmlng_ancestral.smk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
21
rule pruned_raxmlng_ancestral:
32
input:
4-
pruned_nogap_msa = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}_pruned_nogap_nooutlier_msa.fasta",
5-
pruned_unrooted_tree = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}.pruned.no_outlier_unrooted",
3+
pruned_nogap_msa = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}_pruned_nogap_msa.fasta",
4+
pruned_unrooted_tree = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}.pruned_unrooted",
65
output:
76
pruned_ancestral_probabilities = "{workdir}/results/{query_id}/7_pruned_raxmlng_ancestral/pruned_{query_id}.raxml.ancestralProbs",
87
pruned_ancestral_states = "{workdir}/results/{query_id}/7_pruned_raxmlng_ancestral/pruned_{query_id}.raxml.ancestralStates",
@@ -19,3 +18,5 @@ rule pruned_raxmlng_ancestral:
1918
"{workdir}/workflow/logs/benchmarks/{query_id}_pruned_raxmlng_ancestral.out"
2019
shell:
2120
"raxml-ng --ancestral --msa {input.pruned_nogap_msa} --tree {input.pruned_unrooted_tree} --model {config[raxmlng_ancestral_model]} --prefix {params.pruned_raxml_ancestral_out_name} --threads {config[raxml_ancestral_threads]}"
21+
22+

workflow/rules/pruned_raxmlng_ancestral_score.smk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rule pruned_raxml_anc_score:
77
"{workdir}/results/{query_id}/8_pruned_raxmlng_ancestral_scores/pruned_{query_id}_wl_param_{pattern}.csv",
88
params:
99
out = "{workdir}/results/{query_id}/8_pruned_raxmlng_ancestral_scores/pruned_{query_id}",
10-
fasta = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}_pruned_nogap_nooutlier_msa.fasta",
10+
fasta = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}_pruned_nogap_msa.fasta",
1111
query_fasta = "{workdir}/results/{query_id}/1_psiblast/{query_id}.fasta",
1212
log:
1313
"{workdir}/workflow/logs/rules/{query_id}_pruned_raxmlanc_{pattern}_compute_score.err"
@@ -19,3 +19,4 @@ rule pruned_raxml_anc_score:
1919
shell:
2020
"query=`python scripts/get_query.py {params.query_fasta}` && Rscript scripts/compute_score_RaxmlNg_Final.R {input.tree_file} {input.probabilities} {params.fasta} {params.out} $query {config[weights]} 2>{log}"
2121

22+

workflow/rules/raxmlng_ancestral.smk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
rule raxmlng_ancestral:
22
input:
3-
no_outlier_msa = "{workdir}/results/{query_id}/2_msa/{query_id}_no_outlier_no_gap.fasta",
4-
unrooted_tree = "{workdir}/results/{query_id}/3_mltree/{query_id}.no_outlier.nwk_unrooted",
3+
no_gap_msa = "{workdir}/results/{query_id}/2_msa/{query_id}_nogap_msa.fasta",
4+
unrooted_tree = "{workdir}/results/{query_id}/3_mltree/{query_id}.raxml.bestTree_unrooted",
55
output:
66
ancestral_probabilities = "{workdir}/results/{query_id}/4_raxmlng_ancestral/{query_id}.raxml.ancestralProbs",
77
ancestral_states = "{workdir}/results/{query_id}/4_raxmlng_ancestral/{query_id}.raxml.ancestralStates",
@@ -18,5 +18,4 @@ rule raxmlng_ancestral:
1818
resources:
1919
time_min=7200,cpus=4
2020
shell:
21-
"raxml-ng --ancestral --msa {input.no_outlier_msa} --tree {input.unrooted_tree} --model {config[raxmlng_ancestral_model]} --prefix {params.raxml_ancestral_out_name} --threads {resources.cpus}"
22-
21+
"raxml-ng --ancestral --msa {input.no_gap_msa} --tree {input.unrooted_tree} --model {config[raxmlng_ancestral_model]} --prefix {params.raxml_ancestral_out_name} --threads {resources.cpus}"

workflow/rules/unroot_pruned_tree.smk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
rule unroot_pruned_tree:
22
input:
3-
input_tree = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}.pruned.no_outlier",
3+
input_tree = "{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}.pruned",
44
output:
5-
"{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}.pruned.no_outlier_unrooted",
5+
"{workdir}/results/{query_id}/6_pruned_msa_tree/{query_id}.pruned_unrooted",
66
log:
77
"{workdir}/workflow/logs/rules/{query_id}_pruned_unroot_tree.err"
88
benchmark:

workflow/rules/unroot_tree.smk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
rule unroot_tree:
22
input:
3-
input_tree = "{workdir}/results/{query_id}/3_mltree/{query_id}.no_outlier.nwk",
3+
input_tree = "{workdir}/results/{query_id}/3_mltree/{query_id}.raxml.bestTree"
44
output:
5-
"{workdir}/results/{query_id}/3_mltree/{query_id}.no_outlier.nwk_unrooted",
5+
"{workdir}/results/{query_id}/3_mltree/{query_id}.raxml.bestTree_unrooted",
66
log:
77
"{workdir}/workflow/logs/rules/{query_id}_unroot_tree.err"
88
benchmark:

0 commit comments

Comments
 (0)